main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

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

View File

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

View File

@@ -0,0 +1,139 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "أقل من ثانية",
two: "أقل من ثانيتين",
threeToTen: "أقل من {{count}} ثواني",
other: "أقل من {{count}} ثانية",
},
xSeconds: {
one: "ثانية",
two: "ثانيتين",
threeToTen: "{{count}} ثواني",
other: "{{count}} ثانية",
},
halfAMinute: "نص دقيقة",
lessThanXMinutes: {
one: "أقل من دقيقة",
two: "أقل من دقيقتين",
threeToTen: "أقل من {{count}} دقايق",
other: "أقل من {{count}} دقيقة",
},
xMinutes: {
one: "دقيقة",
two: "دقيقتين",
threeToTen: "{{count}} دقايق",
other: "{{count}} دقيقة",
},
aboutXHours: {
one: "حوالي ساعة",
two: "حوالي ساعتين",
threeToTen: "حوالي {{count}} ساعات",
other: "حوالي {{count}} ساعة",
},
xHours: {
one: "ساعة",
two: "ساعتين",
threeToTen: "{{count}} ساعات",
other: "{{count}} ساعة",
},
xDays: {
one: "يوم",
two: "يومين",
threeToTen: "{{count}} أيام",
other: "{{count}} يوم",
},
aboutXWeeks: {
one: "حوالي أسبوع",
two: "حوالي أسبوعين",
threeToTen: "حوالي {{count}} أسابيع",
other: "حوالي {{count}} أسبوع",
},
xWeeks: {
one: "أسبوع",
two: "أسبوعين",
threeToTen: "{{count}} أسابيع",
other: "{{count}} أسبوع",
},
aboutXMonths: {
one: "حوالي شهر",
two: "حوالي شهرين",
threeToTen: "حوالي {{count}} أشهر",
other: "حوالي {{count}} شهر",
},
xMonths: {
one: "شهر",
two: "شهرين",
threeToTen: "{{count}} أشهر",
other: "{{count}} شهر",
},
aboutXYears: {
one: "حوالي سنة",
two: "حوالي سنتين",
threeToTen: "حوالي {{count}} سنين",
other: "حوالي {{count}} سنة",
},
xYears: {
one: "عام",
two: "عامين",
threeToTen: "{{count}} أعوام",
other: "{{count}} عام",
},
overXYears: {
one: "أكثر من سنة",
two: "أكثر من سنتين",
threeToTen: "أكثر من {{count}} سنين",
other: "أكثر من {{count}} سنة",
},
almostXYears: {
one: "عام تقريبًا",
two: "عامين تقريبًا",
threeToTen: "{{count}} أعوام تقريبًا",
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 if (count === 2) {
result = tokenValue.two;
} else if (count <= 10) {
result = tokenValue.threeToTen.replace("{{count}}", String(count));
} 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

@@ -0,0 +1,135 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "أقل من ثانية",
two: "أقل من ثانيتين",
threeToTen: "أقل من {{count}} ثواني",
other: "أقل من {{count}} ثانية",
},
xSeconds: {
one: "ثانية",
two: "ثانيتين",
threeToTen: "{{count}} ثواني",
other: "{{count}} ثانية",
},
halfAMinute: "نص دقيقة",
lessThanXMinutes: {
one: "أقل من دقيقة",
two: "أقل من دقيقتين",
threeToTen: "أقل من {{count}} دقايق",
other: "أقل من {{count}} دقيقة",
},
xMinutes: {
one: "دقيقة",
two: "دقيقتين",
threeToTen: "{{count}} دقايق",
other: "{{count}} دقيقة",
},
aboutXHours: {
one: "حوالي ساعة",
two: "حوالي ساعتين",
threeToTen: "حوالي {{count}} ساعات",
other: "حوالي {{count}} ساعة",
},
xHours: {
one: "ساعة",
two: "ساعتين",
threeToTen: "{{count}} ساعات",
other: "{{count}} ساعة",
},
xDays: {
one: "يوم",
two: "يومين",
threeToTen: "{{count}} أيام",
other: "{{count}} يوم",
},
aboutXWeeks: {
one: "حوالي أسبوع",
two: "حوالي أسبوعين",
threeToTen: "حوالي {{count}} أسابيع",
other: "حوالي {{count}} أسبوع",
},
xWeeks: {
one: "أسبوع",
two: "أسبوعين",
threeToTen: "{{count}} أسابيع",
other: "{{count}} أسبوع",
},
aboutXMonths: {
one: "حوالي شهر",
two: "حوالي شهرين",
threeToTen: "حوالي {{count}} أشهر",
other: "حوالي {{count}} شهر",
},
xMonths: {
one: "شهر",
two: "شهرين",
threeToTen: "{{count}} أشهر",
other: "{{count}} شهر",
},
aboutXYears: {
one: "حوالي سنة",
two: "حوالي سنتين",
threeToTen: "حوالي {{count}} سنين",
other: "حوالي {{count}} سنة",
},
xYears: {
one: "عام",
two: "عامين",
threeToTen: "{{count}} أعوام",
other: "{{count}} عام",
},
overXYears: {
one: "أكثر من سنة",
two: "أكثر من سنتين",
threeToTen: "أكثر من {{count}} سنين",
other: "أكثر من {{count}} سنة",
},
almostXYears: {
one: "عام تقريبًا",
two: "عامين تقريبًا",
threeToTen: "{{count}} أعوام تقريبًا",
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 if (count === 2) {
result = tokenValue.two;
} else if (count <= 10) {
result = tokenValue.threeToTen.replace("{{count}}", String(count));
} 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

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

View File

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

41
node_modules/date-fns/locale/ar-EG/_lib/formatLong.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE، do MMMM y",
long: "do MMMM y",
medium: "dd/MMM/y",
short: "d/MM/y",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
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",
}),
});

39
node_modules/date-fns/locale/ar-EG/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE، do MMMM y",
long: "do MMMM y",
medium: "dd/MMM/y",
short: "d/MM/y",
};
const timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a",
};
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

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

View File

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

View File

@@ -0,0 +1,15 @@
"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

@@ -0,0 +1,11 @@
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

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

View File

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

166
node_modules/date-fns/locale/ar-EG/_lib/localize.js generated vendored Normal file
View File

@@ -0,0 +1,166 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م", "ب.م"],
wide: ["قبل الميلاد", "بعد الميلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["ر1", "ر2", "ر3", "ر4"],
wide: ["الربع الأول", "الربع الثاني", "الربع الثالث", "الربع الرابع"],
};
const monthValues = {
narrow: ["ي", "ف", "م", "أ", "م", "ي", "ي", "أ", "س", "أ", "ن", "د"],
abbreviated: [
"ينا",
"فبر",
"مارس",
"أبريل",
"مايو",
"يونـ",
"يولـ",
"أغسـ",
"سبتـ",
"أكتـ",
"نوفـ",
"ديسـ",
],
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: "نصف الليل",
morning: "في الصباح",
noon: "ظهراً",
afternoon: "بعد الظهر",
evening: "في المساء",
night: "في الليل",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
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",
}),
});

164
node_modules/date-fns/locale/ar-EG/_lib/localize.mjs generated vendored Normal file
View File

@@ -0,0 +1,164 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["ق", "ب"],
abbreviated: ["ق.م", "ب.م"],
wide: ["قبل الميلاد", "بعد الميلاد"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["ر1", "ر2", "ر3", "ر4"],
wide: ["الربع الأول", "الربع الثاني", "الربع الثالث", "الربع الرابع"],
};
const monthValues = {
narrow: ["ي", "ف", "م", "أ", "م", "ي", "ي", "أ", "س", "أ", "ن", "د"],
abbreviated: [
"ينا",
"فبر",
"مارس",
"أبريل",
"مايو",
"يونـ",
"يولـ",
"أغسـ",
"سبتـ",
"أكتـ",
"نوفـ",
"ديسـ",
],
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: "نصف الليل",
morning: "في الصباح",
noon: "ظهراً",
afternoon: "بعد الظهر",
evening: "في المساء",
night: "في الليل",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
return String(dirtyNumber);
};
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",
}),
};

2
node_modules/date-fns/locale/ar-EG/_lib/match.d.mts generated vendored Normal file
View File

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

2
node_modules/date-fns/locale/ar-EG/_lib/match.d.ts generated vendored Normal file
View File

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

140
node_modules/date-fns/locale/ar-EG/_lib/match.js generated vendored Normal file
View File

@@ -0,0 +1,140 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)/;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/g,
abbreviated: /^(ق.م|ب.م)/g,
wide: /^(قبل الميلاد|بعد الميلاد)/g,
};
const parseEraPatterns = {
any: [/^ق/g, /^ب/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/,
abbreviated: /^ر[1234]/,
wide: /^الربع (الأول|الثاني|الثالث|الرابع)/,
};
const parseQuarterPatterns = {
wide: [/الربع الأول/, /الربع الثاني/, /الربع الثالث/, /الربع الرابع/],
any: [/1/, /2/, /3/, /4/],
};
const matchMonthPatterns = {
narrow: /^(ي|ف|م|أ|س|ن|د)/,
abbreviated: /^(ينا|فبر|مارس|أبريل|مايو|يونـ|يولـ|أغسـ|سبتـ|أكتـ|نوفـ|ديسـ)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
};
const parseMonthPatterns = {
narrow: [
/^ي/,
/^ف/,
/^م/,
/^أ/,
/^م/,
/^ي/,
/^ي/,
/^أ/,
/^س/,
/^أ/,
/^ن/,
/^د/,
],
any: [
/^ينا/,
/^فبر/,
/^مارس/,
/^أبريل/,
/^مايو/,
/^يون/,
/^يول/,
/^أغس/,
/^سبت/,
/^أكت/,
/^نوف/,
/^ديس/,
],
};
const matchDayPatterns = {
narrow: /^(ح|ن|ث|ر|خ|ج|س)/,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/,
};
const parseDayPatterns = {
narrow: [/^ح/, /^ن/, /^ث/, /^ر/, /^خ/, /^ج/, /^س/],
any: [/أحد/, /اثنين/, /ثلاثاء/, /أربعاء/, /خميس/, /جمعة/, /سبت/],
};
const matchDayPeriodPatterns = {
narrow: /^(ص|م|ن|ظ|في الصباح|بعد الظهر|في المساء|في الليل)/,
abbreviated: /^(ص|م|نصف الليل|ظهراً|في الصباح|بعد الظهر|في المساء|في الليل)/,
wide: /^(ص|م|نصف الليل|في الصباح|ظهراً|بعد الظهر|في المساء|في الليل)/,
any: /^(ص|م|صباح|ظهر|مساء|ليل)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /^ن/,
noon: /^ظ/,
morning: /^ص/,
afternoon: /^بعد/,
evening: /^م/,
night: /^ل/,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
return 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",
}),
});

137
node_modules/date-fns/locale/ar-EG/_lib/match.mjs generated vendored Normal file
View File

@@ -0,0 +1,137 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)/;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/g,
abbreviated: /^(ق.م|ب.م)/g,
wide: /^(قبل الميلاد|بعد الميلاد)/g,
};
const parseEraPatterns = {
any: [/^ق/g, /^ب/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/,
abbreviated: /^ر[1234]/,
wide: /^الربع (الأول|الثاني|الثالث|الرابع)/,
};
const parseQuarterPatterns = {
wide: [/الربع الأول/, /الربع الثاني/, /الربع الثالث/, /الربع الرابع/],
any: [/1/, /2/, /3/, /4/],
};
const matchMonthPatterns = {
narrow: /^(ي|ف|م|أ|س|ن|د)/,
abbreviated: /^(ينا|فبر|مارس|أبريل|مايو|يونـ|يولـ|أغسـ|سبتـ|أكتـ|نوفـ|ديسـ)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
};
const parseMonthPatterns = {
narrow: [
/^ي/,
/^ف/,
/^م/,
/^أ/,
/^م/,
/^ي/,
/^ي/,
/^أ/,
/^س/,
/^أ/,
/^ن/,
/^د/,
],
any: [
/^ينا/,
/^فبر/,
/^مارس/,
/^أبريل/,
/^مايو/,
/^يون/,
/^يول/,
/^أغس/,
/^سبت/,
/^أكت/,
/^نوف/,
/^ديس/,
],
};
const matchDayPatterns = {
narrow: /^(ح|ن|ث|ر|خ|ج|س)/,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/,
};
const parseDayPatterns = {
narrow: [/^ح/, /^ن/, /^ث/, /^ر/, /^خ/, /^ج/, /^س/],
any: [/أحد/, /اثنين/, /ثلاثاء/, /أربعاء/, /خميس/, /جمعة/, /سبت/],
};
const matchDayPeriodPatterns = {
narrow: /^(ص|م|ن|ظ|في الصباح|بعد الظهر|في المساء|في الليل)/,
abbreviated: /^(ص|م|نصف الليل|ظهراً|في الصباح|بعد الظهر|في المساء|في الليل)/,
wide: /^(ص|م|نصف الليل|في الصباح|ظهراً|بعد الظهر|في المساء|في الليل)/,
any: /^(ص|م|صباح|ظهر|مساء|ليل)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /^ن/,
noon: /^ظ/,
morning: /^ص/,
afternoon: /^بعد/,
evening: /^م/,
night: /^ل/,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (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: (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",
}),
};