It appears that the repository has undergone several changes and renamings:

This commit is contained in:
2025-06-10 13:23:37 +02:00
parent a4a293a744
commit 7e4bfbd4d7
11470 changed files with 704 additions and 1206091 deletions

View File

@ -1,105 +0,0 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "少於 1 秒",
other: "少於 {{count}} 秒",
},
xSeconds: {
one: "1 秒",
other: "{{count}} 秒",
},
halfAMinute: "半分鐘",
lessThanXMinutes: {
one: "少於 1 分鐘",
other: "少於 {{count}} 分鐘",
},
xMinutes: {
one: "1 分鐘",
other: "{{count}} 分鐘",
},
xHours: {
one: "1 小時",
other: "{{count}} 小時",
},
aboutXHours: {
one: "大約 1 小時",
other: "大約 {{count}} 小時",
},
xDays: {
one: "1 天",
other: "{{count}} 天",
},
aboutXWeeks: {
one: "大約 1 個星期",
other: "大約 {{count}} 個星期",
},
xWeeks: {
one: "1 個星期",
other: "{{count}} 個星期",
},
aboutXMonths: {
one: "大約 1 個月",
other: "大約 {{count}} 個月",
},
xMonths: {
one: "1 個月",
other: "{{count}} 個月",
},
aboutXYears: {
one: "大約 1 年",
other: "大約 {{count}} 年",
},
xYears: {
one: "1 年",
other: "{{count}} 年",
},
overXYears: {
one: "超過 1 年",
other: "超過 {{count}} 年",
},
almostXYears: {
one: "將近 1 年",
other: "將近 {{count}} 年",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "內";
} else {
return result + "前";
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@ -1,2 +0,0 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@ -1,2 +0,0 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@ -1,101 +0,0 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "少於 1 秒",
other: "少於 {{count}} 秒",
},
xSeconds: {
one: "1 秒",
other: "{{count}} 秒",
},
halfAMinute: "半分鐘",
lessThanXMinutes: {
one: "少於 1 分鐘",
other: "少於 {{count}} 分鐘",
},
xMinutes: {
one: "1 分鐘",
other: "{{count}} 分鐘",
},
xHours: {
one: "1 小時",
other: "{{count}} 小時",
},
aboutXHours: {
one: "大約 1 小時",
other: "大約 {{count}} 小時",
},
xDays: {
one: "1 天",
other: "{{count}} 天",
},
aboutXWeeks: {
one: "大約 1 個星期",
other: "大約 {{count}} 個星期",
},
xWeeks: {
one: "1 個星期",
other: "{{count}} 個星期",
},
aboutXMonths: {
one: "大約 1 個月",
other: "大約 {{count}} 個月",
},
xMonths: {
one: "1 個月",
other: "{{count}} 個月",
},
aboutXYears: {
one: "大約 1 年",
other: "大約 {{count}} 年",
},
xYears: {
one: "1 年",
other: "{{count}} 年",
},
overXYears: {
one: "超過 1 年",
other: "超過 {{count}} 年",
},
almostXYears: {
one: "將近 1 年",
other: "將近 {{count}} 年",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "內";
} else {
return result + "前";
}
}
return result;
};

View File

@ -1,41 +0,0 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.cjs");
const dateFormats = {
full: "y'年'M'月'd'日' EEEE",
long: "y'年'M'月'd'日'",
medium: "yyyy-MM-dd",
short: "yy-MM-dd",
};
const timeFormats = {
full: "zzzz a h:mm:ss",
long: "z a h:mm:ss",
medium: "a h:mm:ss",
short: "a h:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

View File

@ -1,2 +0,0 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

View File

@ -1,2 +0,0 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

View File

@ -1,39 +0,0 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "y'年'M'月'd'日' EEEE",
long: "y'年'M'月'd'日'",
medium: "yyyy-MM-dd",
short: "yy-MM-dd",
};
const timeFormats = {
full: "zzzz a h:mm:ss",
long: "z a h:mm:ss",
medium: "a h:mm:ss",
short: "a h:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@ -1,15 +0,0 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'上個'eeee p",
yesterday: "'昨天' p",
today: "'今天' p",
tomorrow: "'明天' p",
nextWeek: "'下個'eeee p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@ -1,2 +0,0 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@ -1,2 +0,0 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@ -1,11 +0,0 @@
const formatRelativeLocale = {
lastWeek: "'上個'eeee p",
yesterday: "'昨天' p",
today: "'今天' p",
tomorrow: "'明天' p",
nextWeek: "'下個'eeee p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

View File

@ -1,185 +0,0 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.cjs");
const eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一刻", "第二刻", "第三刻", "第四刻"],
wide: ["第一刻鐘", "第二刻鐘", "第三刻鐘", "第四刻鐘"],
};
const monthValues = {
narrow: [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
],
abbreviated: [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
],
wide: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
};
const dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
};
const dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
switch (options?.unit) {
case "date":
return number + "日";
case "hour":
return number + "時";
case "minute":
return number + "分";
case "second":
return number + "秒";
default:
return "第 " + number;
}
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@ -1,2 +0,0 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

View File

@ -1,2 +0,0 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

View File

@ -1,183 +0,0 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一刻", "第二刻", "第三刻", "第四刻"],
wide: ["第一刻鐘", "第二刻鐘", "第三刻鐘", "第四刻鐘"],
};
const monthValues = {
narrow: [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
],
abbreviated: [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
],
wide: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
};
const dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
};
const dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
switch (options?.unit) {
case "date":
return number + "日";
case "hour":
return number + "時";
case "minute":
return number + "分";
case "second":
return number + "秒";
default:
return "第 " + number;
}
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@ -1,133 +0,0 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(前)/i,
abbreviated: /^(前)/i,
wide: /^(公元前|公元)/i,
};
const parseEraPatterns = {
any: [/^(前)/i, /^(公元)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^第[一二三四]刻/i,
wide: /^第[一二三四]刻鐘/i,
};
const parseQuarterPatterns = {
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i],
};
const matchMonthPatterns = {
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,
};
const parseMonthPatterns = {
narrow: [
/^一/i,
/^二/i,
/^三/i,
/^四/i,
/^五/i,
/^六/i,
/^七/i,
/^八/i,
/^九/i,
/^十(?!(一|二))/i,
/^十一/i,
/^十二/i,
],
any: [
/^一|1/i,
/^二|2/i,
/^三|3/i,
/^四|4/i,
/^五|5/i,
/^六|6/i,
/^七|7/i,
/^八|8/i,
/^九|9/i,
/^十(?!(一|二))|10/i,
/^十一|11/i,
/^十二|12/i,
],
};
const matchDayPatterns = {
narrow: /^[一二三四五六日]/i,
short: /^[一二三四五六日]/i,
abbreviated: /^週[一二三四五六日]/i,
wide: /^星期[一二三四五六日]/i,
};
const parseDayPatterns = {
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i],
};
const matchDayPeriodPatterns = {
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^上午?/i,
pm: /^下午?/i,
midnight: /^午夜/i,
noon: /^[中正]午/i,
morning: /^早上/i,
afternoon: /^下午/i,
evening: /^晚上?/i,
night: /^凌晨/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@ -1,2 +0,0 @@
import type { Match } from "../../types.js";
export declare const match: Match;

View File

@ -1,2 +0,0 @@
import type { Match } from "../../types.js";
export declare const match: Match;

View File

@ -1,130 +0,0 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(前)/i,
abbreviated: /^(前)/i,
wide: /^(公元前|公元)/i,
};
const parseEraPatterns = {
any: [/^(前)/i, /^(公元)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^第[一二三四]刻/i,
wide: /^第[一二三四]刻鐘/i,
};
const parseQuarterPatterns = {
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i],
};
const matchMonthPatterns = {
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i,
};
const parseMonthPatterns = {
narrow: [
/^一/i,
/^二/i,
/^三/i,
/^四/i,
/^五/i,
/^六/i,
/^七/i,
/^八/i,
/^九/i,
/^十(?!(一|二))/i,
/^十一/i,
/^十二/i,
],
any: [
/^一|1/i,
/^二|2/i,
/^三|3/i,
/^四|4/i,
/^五|5/i,
/^六|6/i,
/^七|7/i,
/^八|8/i,
/^九|9/i,
/^十(?!(一|二))|10/i,
/^十一|11/i,
/^十二|12/i,
],
};
const matchDayPatterns = {
narrow: /^[一二三四五六日]/i,
short: /^[一二三四五六日]/i,
abbreviated: /^週[一二三四五六日]/i,
wide: /^星期[一二三四五六日]/i,
};
const parseDayPatterns = {
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i],
};
const matchDayPeriodPatterns = {
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^上午?/i,
pm: /^下午?/i,
midnight: /^午夜/i,
noon: /^[中正]午/i,
morning: /^早上/i,
afternoon: /^下午/i,
evening: /^晚上?/i,
night: /^凌晨/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@ -1,533 +0,0 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/zh-TW/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "\u5C11\u65BC 1 \u79D2",
other: "\u5C11\u65BC {{count}} \u79D2"
},
xSeconds: {
one: "1 \u79D2",
other: "{{count}} \u79D2"
},
halfAMinute: "\u534A\u5206\u9418",
lessThanXMinutes: {
one: "\u5C11\u65BC 1 \u5206\u9418",
other: "\u5C11\u65BC {{count}} \u5206\u9418"
},
xMinutes: {
one: "1 \u5206\u9418",
other: "{{count}} \u5206\u9418"
},
xHours: {
one: "1 \u5C0F\u6642",
other: "{{count}} \u5C0F\u6642"
},
aboutXHours: {
one: "\u5927\u7D04 1 \u5C0F\u6642",
other: "\u5927\u7D04 {{count}} \u5C0F\u6642"
},
xDays: {
one: "1 \u5929",
other: "{{count}} \u5929"
},
aboutXWeeks: {
one: "\u5927\u7D04 1 \u500B\u661F\u671F",
other: "\u5927\u7D04 {{count}} \u500B\u661F\u671F"
},
xWeeks: {
one: "1 \u500B\u661F\u671F",
other: "{{count}} \u500B\u661F\u671F"
},
aboutXMonths: {
one: "\u5927\u7D04 1 \u500B\u6708",
other: "\u5927\u7D04 {{count}} \u500B\u6708"
},
xMonths: {
one: "1 \u500B\u6708",
other: "{{count}} \u500B\u6708"
},
aboutXYears: {
one: "\u5927\u7D04 1 \u5E74",
other: "\u5927\u7D04 {{count}} \u5E74"
},
xYears: {
one: "1 \u5E74",
other: "{{count}} \u5E74"
},
overXYears: {
one: "\u8D85\u904E 1 \u5E74",
other: "\u8D85\u904E {{count}} \u5E74"
},
almostXYears: {
one: "\u5C07\u8FD1 1 \u5E74",
other: "\u5C07\u8FD1 {{count}} \u5E74"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "\u5167";
} else {
return result + "\u524D";
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/zh-TW/_lib/formatLong.js
var dateFormats = {
full: "y'\u5E74'M'\u6708'd'\u65E5' EEEE",
long: "y'\u5E74'M'\u6708'd'\u65E5'",
medium: "yyyy-MM-dd",
short: "yy-MM-dd"
};
var timeFormats = {
full: "zzzz a h:mm:ss",
long: "z a h:mm:ss",
medium: "a h:mm:ss",
short: "a h:mm"
};
var dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/zh-TW/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "'\u4E0A\u500B'eeee p",
yesterday: "'\u6628\u5929' p",
today: "'\u4ECA\u5929' p",
tomorrow: "'\u660E\u5929' p",
nextWeek: "'\u4E0B\u500B'eeee p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/zh-TW/_lib/localize.js
var eraValues = {
narrow: ["\u524D", "\u516C\u5143"],
abbreviated: ["\u524D", "\u516C\u5143"],
wide: ["\u516C\u5143\u524D", "\u516C\u5143"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["\u7B2C\u4E00\u523B", "\u7B2C\u4E8C\u523B", "\u7B2C\u4E09\u523B", "\u7B2C\u56DB\u523B"],
wide: ["\u7B2C\u4E00\u523B\u9418", "\u7B2C\u4E8C\u523B\u9418", "\u7B2C\u4E09\u523B\u9418", "\u7B2C\u56DB\u523B\u9418"]
};
var monthValues = {
narrow: [
"\u4E00",
"\u4E8C",
"\u4E09",
"\u56DB",
"\u4E94",
"\u516D",
"\u4E03",
"\u516B",
"\u4E5D",
"\u5341",
"\u5341\u4E00",
"\u5341\u4E8C"],
abbreviated: [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"],
wide: [
"\u4E00\u6708",
"\u4E8C\u6708",
"\u4E09\u6708",
"\u56DB\u6708",
"\u4E94\u6708",
"\u516D\u6708",
"\u4E03\u6708",
"\u516B\u6708",
"\u4E5D\u6708",
"\u5341\u6708",
"\u5341\u4E00\u6708",
"\u5341\u4E8C\u6708"]
};
var dayValues = {
narrow: ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"],
short: ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"],
abbreviated: ["\u9031\u65E5", "\u9031\u4E00", "\u9031\u4E8C", "\u9031\u4E09", "\u9031\u56DB", "\u9031\u4E94", "\u9031\u516D"],
wide: ["\u661F\u671F\u65E5", "\u661F\u671F\u4E00", "\u661F\u671F\u4E8C", "\u661F\u671F\u4E09", "\u661F\u671F\u56DB", "\u661F\u671F\u4E94", "\u661F\u671F\u516D"]
};
var dayPeriodValues = {
narrow: {
am: "\u4E0A",
pm: "\u4E0B",
midnight: "\u51CC\u6668",
noon: "\u5348",
morning: "\u65E9",
afternoon: "\u4E0B\u5348",
evening: "\u665A",
night: "\u591C"
},
abbreviated: {
am: "\u4E0A\u5348",
pm: "\u4E0B\u5348",
midnight: "\u51CC\u6668",
noon: "\u4E2D\u5348",
morning: "\u65E9\u6668",
afternoon: "\u4E2D\u5348",
evening: "\u665A\u4E0A",
night: "\u591C\u9593"
},
wide: {
am: "\u4E0A\u5348",
pm: "\u4E0B\u5348",
midnight: "\u51CC\u6668",
noon: "\u4E2D\u5348",
morning: "\u65E9\u6668",
afternoon: "\u4E2D\u5348",
evening: "\u665A\u4E0A",
night: "\u591C\u9593"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "\u4E0A",
pm: "\u4E0B",
midnight: "\u51CC\u6668",
noon: "\u5348",
morning: "\u65E9",
afternoon: "\u4E0B\u5348",
evening: "\u665A",
night: "\u591C"
},
abbreviated: {
am: "\u4E0A\u5348",
pm: "\u4E0B\u5348",
midnight: "\u51CC\u6668",
noon: "\u4E2D\u5348",
morning: "\u65E9\u6668",
afternoon: "\u4E2D\u5348",
evening: "\u665A\u4E0A",
night: "\u591C\u9593"
},
wide: {
am: "\u4E0A\u5348",
pm: "\u4E0B\u5348",
midnight: "\u51CC\u6668",
noon: "\u4E2D\u5348",
morning: "\u65E9\u6668",
afternoon: "\u4E2D\u5348",
evening: "\u665A\u4E0A",
night: "\u591C\u9593"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
var number = Number(dirtyNumber);
switch (options === null || options === void 0 ? void 0 : options.unit) {
case "date":
return number + "\u65E5";
case "hour":
return number + "\u6642";
case "minute":
return number + "\u5206";
case "second":
return number + "\u79D2";
default:
return "\u7B2C " + number;
}
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/zh-TW/_lib/match.js
var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(前)/i,
abbreviated: /^(前)/i,
wide: /^(公元前|公元)/i
};
var parseEraPatterns = {
any: [/^(前)/i, /^(公元)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^第[一二三四]刻/i,
wide: /^第[一二三四]刻鐘/i
};
var parseQuarterPatterns = {
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i]
};
var matchMonthPatterns = {
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
};
var parseMonthPatterns = {
narrow: [
/^一/i,
/^二/i,
/^三/i,
/^四/i,
/^五/i,
/^六/i,
/^七/i,
/^八/i,
/^九/i,
/^十(?!(一|二))/i,
/^十一/i,
/^十二/i],
any: [
/^一|1/i,
/^二|2/i,
/^三|3/i,
/^四|4/i,
/^五|5/i,
/^六|6/i,
/^七|7/i,
/^八|8/i,
/^九|9/i,
/^十(?!(一|二))|10/i,
/^十一|11/i,
/^十二|12/i]
};
var matchDayPatterns = {
narrow: /^[一二三四五六日]/i,
short: /^[一二三四五六日]/i,
abbreviated: /^週[一二三四五六日]/i,
wide: /^星期[一二三四五六日]/i
};
var parseDayPatterns = {
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
};
var matchDayPeriodPatterns = {
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^上午?/i,
pm: /^下午?/i,
midnight: /^午夜/i,
noon: /^[中正]午/i,
morning: /^早上/i,
afternoon: /^下午/i,
evening: /^晚上?/i,
night: /^凌晨/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/zh-TW.js
var zhTW = {
code: "zh-TW",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/zh-TW/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
zhTW: zhTW }) });
//# debugId=CD03D70ACF44E1C864756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long