@esic-lab/data-core-ui 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -305,28 +305,6 @@ var require_dayjs_min = __commonJS({
305
305
  }
306
306
  });
307
307
 
308
- // node_modules/dayjs/plugin/buddhistEra.js
309
- var require_buddhistEra = __commonJS({
310
- "node_modules/dayjs/plugin/buddhistEra.js"(exports, module) {
311
- "use strict";
312
- !(function(t, e) {
313
- "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_buddhistEra = e();
314
- })(exports, (function() {
315
- "use strict";
316
- return function(t, e) {
317
- var n = e.prototype, i = n.format;
318
- n.format = function(t2) {
319
- var e2 = this, n2 = (t2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g, (function(t3, n3) {
320
- var i2, o = String(e2.$y + 543), f = "BB" === t3 ? [o.slice(-2), 2] : [o, 4];
321
- return n3 || (i2 = e2.$utils()).s.apply(i2, f.concat(["0"]));
322
- }));
323
- return i.bind(this)(n2);
324
- };
325
- };
326
- }));
327
- }
328
- });
329
-
330
308
  // node_modules/dayjs/locale/th.js
331
309
  var require_th = __commonJS({
332
310
  "node_modules/dayjs/locale/th.js"(exports, module) {
@@ -346,6 +324,134 @@ var require_th = __commonJS({
346
324
  }
347
325
  });
348
326
 
327
+ // node_modules/dayjs/plugin/customParseFormat.js
328
+ var require_customParseFormat = __commonJS({
329
+ "node_modules/dayjs/plugin/customParseFormat.js"(exports, module) {
330
+ "use strict";
331
+ !(function(e, t) {
332
+ "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
333
+ })(exports, (function() {
334
+ "use strict";
335
+ var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
336
+ return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
337
+ };
338
+ var f = function(e2) {
339
+ return function(t2) {
340
+ this[e2] = +t2;
341
+ };
342
+ }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
343
+ (this.zone || (this.zone = {})).offset = (function(e3) {
344
+ if (!e3) return 0;
345
+ if ("Z" === e3) return 0;
346
+ var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
347
+ return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
348
+ })(e2);
349
+ }], u = function(e2) {
350
+ var t2 = s[e2];
351
+ return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
352
+ }, d = function(e2, t2) {
353
+ var n2, r2 = s.meridiem;
354
+ if (r2) {
355
+ for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
356
+ n2 = i2 > 12;
357
+ break;
358
+ }
359
+ } else n2 = e2 === (t2 ? "pm" : "PM");
360
+ return n2;
361
+ }, c = { A: [o, function(e2) {
362
+ this.afternoon = d(e2, false);
363
+ }], a: [o, function(e2) {
364
+ this.afternoon = d(e2, true);
365
+ }], Q: [n, function(e2) {
366
+ this.month = 3 * (e2 - 1) + 1;
367
+ }], S: [n, function(e2) {
368
+ this.milliseconds = 100 * +e2;
369
+ }], SS: [r, function(e2) {
370
+ this.milliseconds = 10 * +e2;
371
+ }], SSS: [/\d{3}/, function(e2) {
372
+ this.milliseconds = +e2;
373
+ }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
374
+ var t2 = s.ordinal, n2 = e2.match(/\d+/);
375
+ if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
376
+ }], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
377
+ var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
378
+ return e3.slice(0, 3);
379
+ }))).indexOf(e2) + 1;
380
+ if (n2 < 1) throw new Error();
381
+ this.month = n2 % 12 || n2;
382
+ }], MMMM: [o, function(e2) {
383
+ var t2 = u("months").indexOf(e2) + 1;
384
+ if (t2 < 1) throw new Error();
385
+ this.month = t2 % 12 || t2;
386
+ }], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
387
+ this.year = a(e2);
388
+ }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
389
+ function l(n2) {
390
+ var r2, i2;
391
+ r2 = n2, i2 = s && s.formats;
392
+ for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
393
+ var o3 = r3 && r3.toUpperCase();
394
+ return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
395
+ return t3 || n4.slice(1);
396
+ }));
397
+ }))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
398
+ var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
399
+ o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
400
+ }
401
+ return function(e2) {
402
+ for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
403
+ var i3 = o2[n3];
404
+ if ("string" == typeof i3) r3 += i3.length;
405
+ else {
406
+ var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
407
+ f3.call(t2, u3), e2 = e2.replace(u3, "");
408
+ }
409
+ }
410
+ return (function(e3) {
411
+ var t3 = e3.afternoon;
412
+ if (void 0 !== t3) {
413
+ var n4 = e3.hours;
414
+ t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
415
+ }
416
+ })(t2), t2;
417
+ };
418
+ }
419
+ return function(e2, t2, n2) {
420
+ n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
421
+ var r2 = t2.prototype, i2 = r2.parse;
422
+ r2.parse = function(e3) {
423
+ var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
424
+ this.$u = r3;
425
+ var a2 = o2[1];
426
+ if ("string" == typeof a2) {
427
+ var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
428
+ h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
429
+ try {
430
+ if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
431
+ var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
432
+ o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
433
+ var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
434
+ return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
435
+ } catch (e5) {
436
+ return /* @__PURE__ */ new Date("");
437
+ }
438
+ })(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
439
+ } else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
440
+ o2[1] = a2[m - 1];
441
+ var M = n2.apply(this, o2);
442
+ if (M.isValid()) {
443
+ this.$d = M.$d, this.$L = M.$L, this.init();
444
+ break;
445
+ }
446
+ m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
447
+ }
448
+ else i2.call(this, e3);
449
+ };
450
+ };
451
+ }));
452
+ }
453
+ });
454
+
349
455
  // src/Button/PrimaryButton/PrimaryButton.tsx
350
456
  import { jsx, jsxs } from "react/jsx-runtime";
351
457
  function PrimaryButton({
@@ -1004,11 +1110,10 @@ function InputField({
1004
1110
  onChange,
1005
1111
  placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
1006
1112
  title,
1007
- require: require2,
1113
+ required,
1008
1114
  bottomText,
1009
1115
  disabled,
1010
- showError,
1011
- errorMessage,
1116
+ error,
1012
1117
  addonBefore,
1013
1118
  addonAfter,
1014
1119
  defaultValue,
@@ -1027,7 +1132,7 @@ function InputField({
1027
1132
  /* @__PURE__ */ jsxs14("div", { children: [
1028
1133
  /* @__PURE__ */ jsx18("span", { className: "body-1", children: title }),
1029
1134
  " ",
1030
- require2 && /* @__PURE__ */ jsx18("span", { className: "text-red-500", children: "*" })
1135
+ required && /* @__PURE__ */ jsx18("span", { className: "text-red-500", children: "*" })
1031
1136
  ] }),
1032
1137
  /* @__PURE__ */ jsx18(
1033
1138
  Input,
@@ -1047,7 +1152,7 @@ function InputField({
1047
1152
  /* @__PURE__ */ jsxs14("div", { children: [
1048
1153
  /* @__PURE__ */ jsx18("p", { className: "caption-1 text-gray-500", children: bottomText }),
1049
1154
  " ",
1050
- showError && /* @__PURE__ */ jsx18("p", { className: "caption-1 text-red-500 ", children: errorMessage })
1155
+ error && /* @__PURE__ */ jsx18("p", { className: "caption-1 text-red-500 ", children: error })
1051
1156
  ] })
1052
1157
  ] })
1053
1158
  }
@@ -1115,11 +1220,10 @@ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
1115
1220
  function ColorPickerBasic({
1116
1221
  value,
1117
1222
  onChange,
1118
- require: require2,
1223
+ required,
1119
1224
  title,
1120
1225
  bottomText,
1121
- showError,
1122
- errorMessage,
1226
+ error,
1123
1227
  disabled,
1124
1228
  allowClear,
1125
1229
  defaultFormat,
@@ -1139,7 +1243,7 @@ function ColorPickerBasic({
1139
1243
  /* @__PURE__ */ jsxs16("div", { children: [
1140
1244
  /* @__PURE__ */ jsx20("span", { className: "body-1", children: title }),
1141
1245
  " ",
1142
- require2 && /* @__PURE__ */ jsx20("span", { className: "text-red-500", children: "*" })
1246
+ required && /* @__PURE__ */ jsx20("span", { className: "text-red-500", children: "*" })
1143
1247
  ] }),
1144
1248
  /* @__PURE__ */ jsx20(
1145
1249
  ColorPicker,
@@ -1167,7 +1271,7 @@ function ColorPickerBasic({
1167
1271
  /* @__PURE__ */ jsxs16("div", { children: [
1168
1272
  /* @__PURE__ */ jsx20("p", { className: "caption-1 text-gray-500", children: bottomText }),
1169
1273
  " ",
1170
- showError && /* @__PURE__ */ jsx20("p", { className: "caption-1 text-red-500 ", children: errorMessage })
1274
+ error && /* @__PURE__ */ jsx20("p", { className: "caption-1 text-red-500 ", children: error })
1171
1275
  ] })
1172
1276
  ] })
1173
1277
  }
@@ -1176,2022 +1280,16 @@ function ColorPickerBasic({
1176
1280
 
1177
1281
  // src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
1178
1282
  var import_dayjs = __toESM(require_dayjs_min());
1283
+ var import_th2 = __toESM(require_th());
1179
1284
  import { ConfigProvider as ConfigProvider5, DatePicker } from "antd";
1180
1285
  import thTH from "antd/locale/th_TH";
1181
-
1182
- // node_modules/date-fns/constants.js
1183
- var daysInYear = 365.2425;
1184
- var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
1185
- var minTime = -maxTime;
1186
- var millisecondsInWeek = 6048e5;
1187
- var millisecondsInDay = 864e5;
1188
- var secondsInHour = 3600;
1189
- var secondsInDay = secondsInHour * 24;
1190
- var secondsInWeek = secondsInDay * 7;
1191
- var secondsInYear = secondsInDay * daysInYear;
1192
- var secondsInMonth = secondsInYear / 12;
1193
- var secondsInQuarter = secondsInMonth * 3;
1194
- var constructFromSymbol = Symbol.for("constructDateFrom");
1195
-
1196
- // node_modules/date-fns/constructFrom.js
1197
- function constructFrom(date, value) {
1198
- if (typeof date === "function") return date(value);
1199
- if (date && typeof date === "object" && constructFromSymbol in date)
1200
- return date[constructFromSymbol](value);
1201
- if (date instanceof Date) return new date.constructor(value);
1202
- return new Date(value);
1203
- }
1204
-
1205
- // node_modules/date-fns/toDate.js
1206
- function toDate(argument, context) {
1207
- return constructFrom(context || argument, argument);
1208
- }
1209
-
1210
- // node_modules/date-fns/_lib/defaultOptions.js
1211
- var defaultOptions = {};
1212
- function getDefaultOptions() {
1213
- return defaultOptions;
1214
- }
1215
-
1216
- // node_modules/date-fns/startOfWeek.js
1217
- function startOfWeek(date, options) {
1218
- const defaultOptions2 = getDefaultOptions();
1219
- const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
1220
- const _date = toDate(date, options?.in);
1221
- const day = _date.getDay();
1222
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1223
- _date.setDate(_date.getDate() - diff);
1224
- _date.setHours(0, 0, 0, 0);
1225
- return _date;
1226
- }
1227
-
1228
- // node_modules/date-fns/startOfISOWeek.js
1229
- function startOfISOWeek(date, options) {
1230
- return startOfWeek(date, { ...options, weekStartsOn: 1 });
1231
- }
1232
-
1233
- // node_modules/date-fns/getISOWeekYear.js
1234
- function getISOWeekYear(date, options) {
1235
- const _date = toDate(date, options?.in);
1236
- const year = _date.getFullYear();
1237
- const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
1238
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
1239
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
1240
- const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
1241
- const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
1242
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
1243
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
1244
- const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
1245
- if (_date.getTime() >= startOfNextYear.getTime()) {
1246
- return year + 1;
1247
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
1248
- return year;
1249
- } else {
1250
- return year - 1;
1251
- }
1252
- }
1253
-
1254
- // node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
1255
- function getTimezoneOffsetInMilliseconds(date) {
1256
- const _date = toDate(date);
1257
- const utcDate = new Date(
1258
- Date.UTC(
1259
- _date.getFullYear(),
1260
- _date.getMonth(),
1261
- _date.getDate(),
1262
- _date.getHours(),
1263
- _date.getMinutes(),
1264
- _date.getSeconds(),
1265
- _date.getMilliseconds()
1266
- )
1267
- );
1268
- utcDate.setUTCFullYear(_date.getFullYear());
1269
- return +date - +utcDate;
1270
- }
1271
-
1272
- // node_modules/date-fns/_lib/normalizeDates.js
1273
- function normalizeDates(context, ...dates) {
1274
- const normalize = constructFrom.bind(
1275
- null,
1276
- context || dates.find((date) => typeof date === "object")
1277
- );
1278
- return dates.map(normalize);
1279
- }
1280
-
1281
- // node_modules/date-fns/startOfDay.js
1282
- function startOfDay(date, options) {
1283
- const _date = toDate(date, options?.in);
1284
- _date.setHours(0, 0, 0, 0);
1285
- return _date;
1286
- }
1287
-
1288
- // node_modules/date-fns/differenceInCalendarDays.js
1289
- function differenceInCalendarDays(laterDate, earlierDate, options) {
1290
- const [laterDate_, earlierDate_] = normalizeDates(
1291
- options?.in,
1292
- laterDate,
1293
- earlierDate
1294
- );
1295
- const laterStartOfDay = startOfDay(laterDate_);
1296
- const earlierStartOfDay = startOfDay(earlierDate_);
1297
- const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
1298
- const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
1299
- return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
1300
- }
1301
-
1302
- // node_modules/date-fns/startOfISOWeekYear.js
1303
- function startOfISOWeekYear(date, options) {
1304
- const year = getISOWeekYear(date, options);
1305
- const fourthOfJanuary = constructFrom(options?.in || date, 0);
1306
- fourthOfJanuary.setFullYear(year, 0, 4);
1307
- fourthOfJanuary.setHours(0, 0, 0, 0);
1308
- return startOfISOWeek(fourthOfJanuary);
1309
- }
1310
-
1311
- // node_modules/date-fns/isDate.js
1312
- function isDate(value) {
1313
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
1314
- }
1315
-
1316
- // node_modules/date-fns/isValid.js
1317
- function isValid(date) {
1318
- return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
1319
- }
1320
-
1321
- // node_modules/date-fns/startOfYear.js
1322
- function startOfYear(date, options) {
1323
- const date_ = toDate(date, options?.in);
1324
- date_.setFullYear(date_.getFullYear(), 0, 1);
1325
- date_.setHours(0, 0, 0, 0);
1326
- return date_;
1327
- }
1328
-
1329
- // node_modules/date-fns/locale/en-US/_lib/formatDistance.js
1330
- var formatDistanceLocale = {
1331
- lessThanXSeconds: {
1332
- one: "less than a second",
1333
- other: "less than {{count}} seconds"
1334
- },
1335
- xSeconds: {
1336
- one: "1 second",
1337
- other: "{{count}} seconds"
1338
- },
1339
- halfAMinute: "half a minute",
1340
- lessThanXMinutes: {
1341
- one: "less than a minute",
1342
- other: "less than {{count}} minutes"
1343
- },
1344
- xMinutes: {
1345
- one: "1 minute",
1346
- other: "{{count}} minutes"
1347
- },
1348
- aboutXHours: {
1349
- one: "about 1 hour",
1350
- other: "about {{count}} hours"
1351
- },
1352
- xHours: {
1353
- one: "1 hour",
1354
- other: "{{count}} hours"
1355
- },
1356
- xDays: {
1357
- one: "1 day",
1358
- other: "{{count}} days"
1359
- },
1360
- aboutXWeeks: {
1361
- one: "about 1 week",
1362
- other: "about {{count}} weeks"
1363
- },
1364
- xWeeks: {
1365
- one: "1 week",
1366
- other: "{{count}} weeks"
1367
- },
1368
- aboutXMonths: {
1369
- one: "about 1 month",
1370
- other: "about {{count}} months"
1371
- },
1372
- xMonths: {
1373
- one: "1 month",
1374
- other: "{{count}} months"
1375
- },
1376
- aboutXYears: {
1377
- one: "about 1 year",
1378
- other: "about {{count}} years"
1379
- },
1380
- xYears: {
1381
- one: "1 year",
1382
- other: "{{count}} years"
1383
- },
1384
- overXYears: {
1385
- one: "over 1 year",
1386
- other: "over {{count}} years"
1387
- },
1388
- almostXYears: {
1389
- one: "almost 1 year",
1390
- other: "almost {{count}} years"
1391
- }
1392
- };
1393
- var formatDistance = (token, count, options) => {
1394
- let result;
1395
- const tokenValue = formatDistanceLocale[token];
1396
- if (typeof tokenValue === "string") {
1397
- result = tokenValue;
1398
- } else if (count === 1) {
1399
- result = tokenValue.one;
1400
- } else {
1401
- result = tokenValue.other.replace("{{count}}", count.toString());
1402
- }
1403
- if (options?.addSuffix) {
1404
- if (options.comparison && options.comparison > 0) {
1405
- return "in " + result;
1406
- } else {
1407
- return result + " ago";
1408
- }
1409
- }
1410
- return result;
1411
- };
1412
-
1413
- // node_modules/date-fns/locale/_lib/buildFormatLongFn.js
1414
- function buildFormatLongFn(args) {
1415
- return (options = {}) => {
1416
- const width = options.width ? String(options.width) : args.defaultWidth;
1417
- const format2 = args.formats[width] || args.formats[args.defaultWidth];
1418
- return format2;
1419
- };
1420
- }
1421
-
1422
- // node_modules/date-fns/locale/en-US/_lib/formatLong.js
1423
- var dateFormats = {
1424
- full: "EEEE, MMMM do, y",
1425
- long: "MMMM do, y",
1426
- medium: "MMM d, y",
1427
- short: "MM/dd/yyyy"
1428
- };
1429
- var timeFormats = {
1430
- full: "h:mm:ss a zzzz",
1431
- long: "h:mm:ss a z",
1432
- medium: "h:mm:ss a",
1433
- short: "h:mm a"
1434
- };
1435
- var dateTimeFormats = {
1436
- full: "{{date}} 'at' {{time}}",
1437
- long: "{{date}} 'at' {{time}}",
1438
- medium: "{{date}}, {{time}}",
1439
- short: "{{date}}, {{time}}"
1440
- };
1441
- var formatLong = {
1442
- date: buildFormatLongFn({
1443
- formats: dateFormats,
1444
- defaultWidth: "full"
1445
- }),
1446
- time: buildFormatLongFn({
1447
- formats: timeFormats,
1448
- defaultWidth: "full"
1449
- }),
1450
- dateTime: buildFormatLongFn({
1451
- formats: dateTimeFormats,
1452
- defaultWidth: "full"
1453
- })
1454
- };
1455
-
1456
- // node_modules/date-fns/locale/en-US/_lib/formatRelative.js
1457
- var formatRelativeLocale = {
1458
- lastWeek: "'last' eeee 'at' p",
1459
- yesterday: "'yesterday at' p",
1460
- today: "'today at' p",
1461
- tomorrow: "'tomorrow at' p",
1462
- nextWeek: "eeee 'at' p",
1463
- other: "P"
1464
- };
1465
- var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
1466
-
1467
- // node_modules/date-fns/locale/_lib/buildLocalizeFn.js
1468
- function buildLocalizeFn(args) {
1469
- return (value, options) => {
1470
- const context = options?.context ? String(options.context) : "standalone";
1471
- let valuesArray;
1472
- if (context === "formatting" && args.formattingValues) {
1473
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1474
- const width = options?.width ? String(options.width) : defaultWidth;
1475
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1476
- } else {
1477
- const defaultWidth = args.defaultWidth;
1478
- const width = options?.width ? String(options.width) : args.defaultWidth;
1479
- valuesArray = args.values[width] || args.values[defaultWidth];
1480
- }
1481
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
1482
- return valuesArray[index];
1483
- };
1484
- }
1485
-
1486
- // node_modules/date-fns/locale/en-US/_lib/localize.js
1487
- var eraValues = {
1488
- narrow: ["B", "A"],
1489
- abbreviated: ["BC", "AD"],
1490
- wide: ["Before Christ", "Anno Domini"]
1491
- };
1492
- var quarterValues = {
1493
- narrow: ["1", "2", "3", "4"],
1494
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1495
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1496
- };
1497
- var monthValues = {
1498
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1499
- abbreviated: [
1500
- "Jan",
1501
- "Feb",
1502
- "Mar",
1503
- "Apr",
1504
- "May",
1505
- "Jun",
1506
- "Jul",
1507
- "Aug",
1508
- "Sep",
1509
- "Oct",
1510
- "Nov",
1511
- "Dec"
1512
- ],
1513
- wide: [
1514
- "January",
1515
- "February",
1516
- "March",
1517
- "April",
1518
- "May",
1519
- "June",
1520
- "July",
1521
- "August",
1522
- "September",
1523
- "October",
1524
- "November",
1525
- "December"
1526
- ]
1527
- };
1528
- var dayValues = {
1529
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1530
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1531
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1532
- wide: [
1533
- "Sunday",
1534
- "Monday",
1535
- "Tuesday",
1536
- "Wednesday",
1537
- "Thursday",
1538
- "Friday",
1539
- "Saturday"
1540
- ]
1541
- };
1542
- var dayPeriodValues = {
1543
- narrow: {
1544
- am: "a",
1545
- pm: "p",
1546
- midnight: "mi",
1547
- noon: "n",
1548
- morning: "morning",
1549
- afternoon: "afternoon",
1550
- evening: "evening",
1551
- night: "night"
1552
- },
1553
- abbreviated: {
1554
- am: "AM",
1555
- pm: "PM",
1556
- midnight: "midnight",
1557
- noon: "noon",
1558
- morning: "morning",
1559
- afternoon: "afternoon",
1560
- evening: "evening",
1561
- night: "night"
1562
- },
1563
- wide: {
1564
- am: "a.m.",
1565
- pm: "p.m.",
1566
- midnight: "midnight",
1567
- noon: "noon",
1568
- morning: "morning",
1569
- afternoon: "afternoon",
1570
- evening: "evening",
1571
- night: "night"
1572
- }
1573
- };
1574
- var formattingDayPeriodValues = {
1575
- narrow: {
1576
- am: "a",
1577
- pm: "p",
1578
- midnight: "mi",
1579
- noon: "n",
1580
- morning: "in the morning",
1581
- afternoon: "in the afternoon",
1582
- evening: "in the evening",
1583
- night: "at night"
1584
- },
1585
- abbreviated: {
1586
- am: "AM",
1587
- pm: "PM",
1588
- midnight: "midnight",
1589
- noon: "noon",
1590
- morning: "in the morning",
1591
- afternoon: "in the afternoon",
1592
- evening: "in the evening",
1593
- night: "at night"
1594
- },
1595
- wide: {
1596
- am: "a.m.",
1597
- pm: "p.m.",
1598
- midnight: "midnight",
1599
- noon: "noon",
1600
- morning: "in the morning",
1601
- afternoon: "in the afternoon",
1602
- evening: "in the evening",
1603
- night: "at night"
1604
- }
1605
- };
1606
- var ordinalNumber = (dirtyNumber, _options) => {
1607
- const number = Number(dirtyNumber);
1608
- const rem100 = number % 100;
1609
- if (rem100 > 20 || rem100 < 10) {
1610
- switch (rem100 % 10) {
1611
- case 1:
1612
- return number + "st";
1613
- case 2:
1614
- return number + "nd";
1615
- case 3:
1616
- return number + "rd";
1617
- }
1618
- }
1619
- return number + "th";
1620
- };
1621
- var localize = {
1622
- ordinalNumber,
1623
- era: buildLocalizeFn({
1624
- values: eraValues,
1625
- defaultWidth: "wide"
1626
- }),
1627
- quarter: buildLocalizeFn({
1628
- values: quarterValues,
1629
- defaultWidth: "wide",
1630
- argumentCallback: (quarter) => quarter - 1
1631
- }),
1632
- month: buildLocalizeFn({
1633
- values: monthValues,
1634
- defaultWidth: "wide"
1635
- }),
1636
- day: buildLocalizeFn({
1637
- values: dayValues,
1638
- defaultWidth: "wide"
1639
- }),
1640
- dayPeriod: buildLocalizeFn({
1641
- values: dayPeriodValues,
1642
- defaultWidth: "wide",
1643
- formattingValues: formattingDayPeriodValues,
1644
- defaultFormattingWidth: "wide"
1645
- })
1646
- };
1647
-
1648
- // node_modules/date-fns/locale/_lib/buildMatchFn.js
1649
- function buildMatchFn(args) {
1650
- return (string, options = {}) => {
1651
- const width = options.width;
1652
- const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1653
- const matchResult = string.match(matchPattern);
1654
- if (!matchResult) {
1655
- return null;
1656
- }
1657
- const matchedString = matchResult[0];
1658
- const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1659
- const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
1660
- // [TODO] -- I challenge you to fix the type
1661
- findKey(parsePatterns, (pattern) => pattern.test(matchedString))
1662
- );
1663
- let value;
1664
- value = args.valueCallback ? args.valueCallback(key) : key;
1665
- value = options.valueCallback ? (
1666
- // [TODO] -- I challenge you to fix the type
1667
- options.valueCallback(value)
1668
- ) : value;
1669
- const rest = string.slice(matchedString.length);
1670
- return { value, rest };
1671
- };
1672
- }
1673
- function findKey(object, predicate) {
1674
- for (const key in object) {
1675
- if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
1676
- return key;
1677
- }
1678
- }
1679
- return void 0;
1680
- }
1681
- function findIndex(array, predicate) {
1682
- for (let key = 0; key < array.length; key++) {
1683
- if (predicate(array[key])) {
1684
- return key;
1685
- }
1686
- }
1687
- return void 0;
1688
- }
1689
-
1690
- // node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
1691
- function buildMatchPatternFn(args) {
1692
- return (string, options = {}) => {
1693
- const matchResult = string.match(args.matchPattern);
1694
- if (!matchResult) return null;
1695
- const matchedString = matchResult[0];
1696
- const parseResult = string.match(args.parsePattern);
1697
- if (!parseResult) return null;
1698
- let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1699
- value = options.valueCallback ? options.valueCallback(value) : value;
1700
- const rest = string.slice(matchedString.length);
1701
- return { value, rest };
1702
- };
1703
- }
1704
-
1705
- // node_modules/date-fns/locale/en-US/_lib/match.js
1706
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1707
- var parseOrdinalNumberPattern = /\d+/i;
1708
- var matchEraPatterns = {
1709
- narrow: /^(b|a)/i,
1710
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1711
- wide: /^(before christ|before common era|anno domini|common era)/i
1712
- };
1713
- var parseEraPatterns = {
1714
- any: [/^b/i, /^(a|c)/i]
1715
- };
1716
- var matchQuarterPatterns = {
1717
- narrow: /^[1234]/i,
1718
- abbreviated: /^q[1234]/i,
1719
- wide: /^[1234](th|st|nd|rd)? quarter/i
1720
- };
1721
- var parseQuarterPatterns = {
1722
- any: [/1/i, /2/i, /3/i, /4/i]
1723
- };
1724
- var matchMonthPatterns = {
1725
- narrow: /^[jfmasond]/i,
1726
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1727
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1728
- };
1729
- var parseMonthPatterns = {
1730
- narrow: [
1731
- /^j/i,
1732
- /^f/i,
1733
- /^m/i,
1734
- /^a/i,
1735
- /^m/i,
1736
- /^j/i,
1737
- /^j/i,
1738
- /^a/i,
1739
- /^s/i,
1740
- /^o/i,
1741
- /^n/i,
1742
- /^d/i
1743
- ],
1744
- any: [
1745
- /^ja/i,
1746
- /^f/i,
1747
- /^mar/i,
1748
- /^ap/i,
1749
- /^may/i,
1750
- /^jun/i,
1751
- /^jul/i,
1752
- /^au/i,
1753
- /^s/i,
1754
- /^o/i,
1755
- /^n/i,
1756
- /^d/i
1757
- ]
1758
- };
1759
- var matchDayPatterns = {
1760
- narrow: /^[smtwf]/i,
1761
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1762
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1763
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1764
- };
1765
- var parseDayPatterns = {
1766
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1767
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1768
- };
1769
- var matchDayPeriodPatterns = {
1770
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1771
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1772
- };
1773
- var parseDayPeriodPatterns = {
1774
- any: {
1775
- am: /^a/i,
1776
- pm: /^p/i,
1777
- midnight: /^mi/i,
1778
- noon: /^no/i,
1779
- morning: /morning/i,
1780
- afternoon: /afternoon/i,
1781
- evening: /evening/i,
1782
- night: /night/i
1783
- }
1784
- };
1785
- var match = {
1786
- ordinalNumber: buildMatchPatternFn({
1787
- matchPattern: matchOrdinalNumberPattern,
1788
- parsePattern: parseOrdinalNumberPattern,
1789
- valueCallback: (value) => parseInt(value, 10)
1790
- }),
1791
- era: buildMatchFn({
1792
- matchPatterns: matchEraPatterns,
1793
- defaultMatchWidth: "wide",
1794
- parsePatterns: parseEraPatterns,
1795
- defaultParseWidth: "any"
1796
- }),
1797
- quarter: buildMatchFn({
1798
- matchPatterns: matchQuarterPatterns,
1799
- defaultMatchWidth: "wide",
1800
- parsePatterns: parseQuarterPatterns,
1801
- defaultParseWidth: "any",
1802
- valueCallback: (index) => index + 1
1803
- }),
1804
- month: buildMatchFn({
1805
- matchPatterns: matchMonthPatterns,
1806
- defaultMatchWidth: "wide",
1807
- parsePatterns: parseMonthPatterns,
1808
- defaultParseWidth: "any"
1809
- }),
1810
- day: buildMatchFn({
1811
- matchPatterns: matchDayPatterns,
1812
- defaultMatchWidth: "wide",
1813
- parsePatterns: parseDayPatterns,
1814
- defaultParseWidth: "any"
1815
- }),
1816
- dayPeriod: buildMatchFn({
1817
- matchPatterns: matchDayPeriodPatterns,
1818
- defaultMatchWidth: "any",
1819
- parsePatterns: parseDayPeriodPatterns,
1820
- defaultParseWidth: "any"
1821
- })
1822
- };
1823
-
1824
- // node_modules/date-fns/locale/en-US.js
1825
- var enUS = {
1826
- code: "en-US",
1827
- formatDistance,
1828
- formatLong,
1829
- formatRelative,
1830
- localize,
1831
- match,
1832
- options: {
1833
- weekStartsOn: 0,
1834
- firstWeekContainsDate: 1
1835
- }
1836
- };
1837
-
1838
- // node_modules/date-fns/getDayOfYear.js
1839
- function getDayOfYear(date, options) {
1840
- const _date = toDate(date, options?.in);
1841
- const diff = differenceInCalendarDays(_date, startOfYear(_date));
1842
- const dayOfYear = diff + 1;
1843
- return dayOfYear;
1844
- }
1845
-
1846
- // node_modules/date-fns/getISOWeek.js
1847
- function getISOWeek(date, options) {
1848
- const _date = toDate(date, options?.in);
1849
- const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1850
- return Math.round(diff / millisecondsInWeek) + 1;
1851
- }
1852
-
1853
- // node_modules/date-fns/getWeekYear.js
1854
- function getWeekYear(date, options) {
1855
- const _date = toDate(date, options?.in);
1856
- const year = _date.getFullYear();
1857
- const defaultOptions2 = getDefaultOptions();
1858
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
1859
- const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1860
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1861
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
1862
- const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1863
- const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1864
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1865
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
1866
- const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1867
- if (+_date >= +startOfNextYear) {
1868
- return year + 1;
1869
- } else if (+_date >= +startOfThisYear) {
1870
- return year;
1871
- } else {
1872
- return year - 1;
1873
- }
1874
- }
1875
-
1876
- // node_modules/date-fns/startOfWeekYear.js
1877
- function startOfWeekYear(date, options) {
1878
- const defaultOptions2 = getDefaultOptions();
1879
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
1880
- const year = getWeekYear(date, options);
1881
- const firstWeek = constructFrom(options?.in || date, 0);
1882
- firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1883
- firstWeek.setHours(0, 0, 0, 0);
1884
- const _date = startOfWeek(firstWeek, options);
1885
- return _date;
1886
- }
1887
-
1888
- // node_modules/date-fns/getWeek.js
1889
- function getWeek(date, options) {
1890
- const _date = toDate(date, options?.in);
1891
- const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1892
- return Math.round(diff / millisecondsInWeek) + 1;
1893
- }
1894
-
1895
- // node_modules/date-fns/_lib/addLeadingZeros.js
1896
- function addLeadingZeros(number, targetLength) {
1897
- const sign = number < 0 ? "-" : "";
1898
- const output = Math.abs(number).toString().padStart(targetLength, "0");
1899
- return sign + output;
1900
- }
1901
-
1902
- // node_modules/date-fns/_lib/format/lightFormatters.js
1903
- var lightFormatters = {
1904
- // Year
1905
- y(date, token) {
1906
- const signedYear = date.getFullYear();
1907
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
1908
- return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1909
- },
1910
- // Month
1911
- M(date, token) {
1912
- const month = date.getMonth();
1913
- return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1914
- },
1915
- // Day of the month
1916
- d(date, token) {
1917
- return addLeadingZeros(date.getDate(), token.length);
1918
- },
1919
- // AM or PM
1920
- a(date, token) {
1921
- const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1922
- switch (token) {
1923
- case "a":
1924
- case "aa":
1925
- return dayPeriodEnumValue.toUpperCase();
1926
- case "aaa":
1927
- return dayPeriodEnumValue;
1928
- case "aaaaa":
1929
- return dayPeriodEnumValue[0];
1930
- case "aaaa":
1931
- default:
1932
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1933
- }
1934
- },
1935
- // Hour [1-12]
1936
- h(date, token) {
1937
- return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1938
- },
1939
- // Hour [0-23]
1940
- H(date, token) {
1941
- return addLeadingZeros(date.getHours(), token.length);
1942
- },
1943
- // Minute
1944
- m(date, token) {
1945
- return addLeadingZeros(date.getMinutes(), token.length);
1946
- },
1947
- // Second
1948
- s(date, token) {
1949
- return addLeadingZeros(date.getSeconds(), token.length);
1950
- },
1951
- // Fraction of second
1952
- S(date, token) {
1953
- const numberOfDigits = token.length;
1954
- const milliseconds = date.getMilliseconds();
1955
- const fractionalSeconds = Math.trunc(
1956
- milliseconds * Math.pow(10, numberOfDigits - 3)
1957
- );
1958
- return addLeadingZeros(fractionalSeconds, token.length);
1959
- }
1960
- };
1961
-
1962
- // node_modules/date-fns/_lib/format/formatters.js
1963
- var dayPeriodEnum = {
1964
- am: "am",
1965
- pm: "pm",
1966
- midnight: "midnight",
1967
- noon: "noon",
1968
- morning: "morning",
1969
- afternoon: "afternoon",
1970
- evening: "evening",
1971
- night: "night"
1972
- };
1973
- var formatters = {
1974
- // Era
1975
- G: function(date, token, localize3) {
1976
- const era = date.getFullYear() > 0 ? 1 : 0;
1977
- switch (token) {
1978
- // AD, BC
1979
- case "G":
1980
- case "GG":
1981
- case "GGG":
1982
- return localize3.era(era, { width: "abbreviated" });
1983
- // A, B
1984
- case "GGGGG":
1985
- return localize3.era(era, { width: "narrow" });
1986
- // Anno Domini, Before Christ
1987
- case "GGGG":
1988
- default:
1989
- return localize3.era(era, { width: "wide" });
1990
- }
1991
- },
1992
- // Year
1993
- y: function(date, token, localize3) {
1994
- if (token === "yo") {
1995
- const signedYear = date.getFullYear();
1996
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
1997
- return localize3.ordinalNumber(year, { unit: "year" });
1998
- }
1999
- return lightFormatters.y(date, token);
2000
- },
2001
- // Local week-numbering year
2002
- Y: function(date, token, localize3, options) {
2003
- const signedWeekYear = getWeekYear(date, options);
2004
- const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
2005
- if (token === "YY") {
2006
- const twoDigitYear = weekYear % 100;
2007
- return addLeadingZeros(twoDigitYear, 2);
2008
- }
2009
- if (token === "Yo") {
2010
- return localize3.ordinalNumber(weekYear, { unit: "year" });
2011
- }
2012
- return addLeadingZeros(weekYear, token.length);
2013
- },
2014
- // ISO week-numbering year
2015
- R: function(date, token) {
2016
- const isoWeekYear = getISOWeekYear(date);
2017
- return addLeadingZeros(isoWeekYear, token.length);
2018
- },
2019
- // Extended year. This is a single number designating the year of this calendar system.
2020
- // The main difference between `y` and `u` localizers are B.C. years:
2021
- // | Year | `y` | `u` |
2022
- // |------|-----|-----|
2023
- // | AC 1 | 1 | 1 |
2024
- // | BC 1 | 1 | 0 |
2025
- // | BC 2 | 2 | -1 |
2026
- // Also `yy` always returns the last two digits of a year,
2027
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
2028
- u: function(date, token) {
2029
- const year = date.getFullYear();
2030
- return addLeadingZeros(year, token.length);
2031
- },
2032
- // Quarter
2033
- Q: function(date, token, localize3) {
2034
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
2035
- switch (token) {
2036
- // 1, 2, 3, 4
2037
- case "Q":
2038
- return String(quarter);
2039
- // 01, 02, 03, 04
2040
- case "QQ":
2041
- return addLeadingZeros(quarter, 2);
2042
- // 1st, 2nd, 3rd, 4th
2043
- case "Qo":
2044
- return localize3.ordinalNumber(quarter, { unit: "quarter" });
2045
- // Q1, Q2, Q3, Q4
2046
- case "QQQ":
2047
- return localize3.quarter(quarter, {
2048
- width: "abbreviated",
2049
- context: "formatting"
2050
- });
2051
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2052
- case "QQQQQ":
2053
- return localize3.quarter(quarter, {
2054
- width: "narrow",
2055
- context: "formatting"
2056
- });
2057
- // 1st quarter, 2nd quarter, ...
2058
- case "QQQQ":
2059
- default:
2060
- return localize3.quarter(quarter, {
2061
- width: "wide",
2062
- context: "formatting"
2063
- });
2064
- }
2065
- },
2066
- // Stand-alone quarter
2067
- q: function(date, token, localize3) {
2068
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
2069
- switch (token) {
2070
- // 1, 2, 3, 4
2071
- case "q":
2072
- return String(quarter);
2073
- // 01, 02, 03, 04
2074
- case "qq":
2075
- return addLeadingZeros(quarter, 2);
2076
- // 1st, 2nd, 3rd, 4th
2077
- case "qo":
2078
- return localize3.ordinalNumber(quarter, { unit: "quarter" });
2079
- // Q1, Q2, Q3, Q4
2080
- case "qqq":
2081
- return localize3.quarter(quarter, {
2082
- width: "abbreviated",
2083
- context: "standalone"
2084
- });
2085
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2086
- case "qqqqq":
2087
- return localize3.quarter(quarter, {
2088
- width: "narrow",
2089
- context: "standalone"
2090
- });
2091
- // 1st quarter, 2nd quarter, ...
2092
- case "qqqq":
2093
- default:
2094
- return localize3.quarter(quarter, {
2095
- width: "wide",
2096
- context: "standalone"
2097
- });
2098
- }
2099
- },
2100
- // Month
2101
- M: function(date, token, localize3) {
2102
- const month = date.getMonth();
2103
- switch (token) {
2104
- case "M":
2105
- case "MM":
2106
- return lightFormatters.M(date, token);
2107
- // 1st, 2nd, ..., 12th
2108
- case "Mo":
2109
- return localize3.ordinalNumber(month + 1, { unit: "month" });
2110
- // Jan, Feb, ..., Dec
2111
- case "MMM":
2112
- return localize3.month(month, {
2113
- width: "abbreviated",
2114
- context: "formatting"
2115
- });
2116
- // J, F, ..., D
2117
- case "MMMMM":
2118
- return localize3.month(month, {
2119
- width: "narrow",
2120
- context: "formatting"
2121
- });
2122
- // January, February, ..., December
2123
- case "MMMM":
2124
- default:
2125
- return localize3.month(month, { width: "wide", context: "formatting" });
2126
- }
2127
- },
2128
- // Stand-alone month
2129
- L: function(date, token, localize3) {
2130
- const month = date.getMonth();
2131
- switch (token) {
2132
- // 1, 2, ..., 12
2133
- case "L":
2134
- return String(month + 1);
2135
- // 01, 02, ..., 12
2136
- case "LL":
2137
- return addLeadingZeros(month + 1, 2);
2138
- // 1st, 2nd, ..., 12th
2139
- case "Lo":
2140
- return localize3.ordinalNumber(month + 1, { unit: "month" });
2141
- // Jan, Feb, ..., Dec
2142
- case "LLL":
2143
- return localize3.month(month, {
2144
- width: "abbreviated",
2145
- context: "standalone"
2146
- });
2147
- // J, F, ..., D
2148
- case "LLLLL":
2149
- return localize3.month(month, {
2150
- width: "narrow",
2151
- context: "standalone"
2152
- });
2153
- // January, February, ..., December
2154
- case "LLLL":
2155
- default:
2156
- return localize3.month(month, { width: "wide", context: "standalone" });
2157
- }
2158
- },
2159
- // Local week of year
2160
- w: function(date, token, localize3, options) {
2161
- const week = getWeek(date, options);
2162
- if (token === "wo") {
2163
- return localize3.ordinalNumber(week, { unit: "week" });
2164
- }
2165
- return addLeadingZeros(week, token.length);
2166
- },
2167
- // ISO week of year
2168
- I: function(date, token, localize3) {
2169
- const isoWeek = getISOWeek(date);
2170
- if (token === "Io") {
2171
- return localize3.ordinalNumber(isoWeek, { unit: "week" });
2172
- }
2173
- return addLeadingZeros(isoWeek, token.length);
2174
- },
2175
- // Day of the month
2176
- d: function(date, token, localize3) {
2177
- if (token === "do") {
2178
- return localize3.ordinalNumber(date.getDate(), { unit: "date" });
2179
- }
2180
- return lightFormatters.d(date, token);
2181
- },
2182
- // Day of year
2183
- D: function(date, token, localize3) {
2184
- const dayOfYear = getDayOfYear(date);
2185
- if (token === "Do") {
2186
- return localize3.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
2187
- }
2188
- return addLeadingZeros(dayOfYear, token.length);
2189
- },
2190
- // Day of week
2191
- E: function(date, token, localize3) {
2192
- const dayOfWeek = date.getDay();
2193
- switch (token) {
2194
- // Tue
2195
- case "E":
2196
- case "EE":
2197
- case "EEE":
2198
- return localize3.day(dayOfWeek, {
2199
- width: "abbreviated",
2200
- context: "formatting"
2201
- });
2202
- // T
2203
- case "EEEEE":
2204
- return localize3.day(dayOfWeek, {
2205
- width: "narrow",
2206
- context: "formatting"
2207
- });
2208
- // Tu
2209
- case "EEEEEE":
2210
- return localize3.day(dayOfWeek, {
2211
- width: "short",
2212
- context: "formatting"
2213
- });
2214
- // Tuesday
2215
- case "EEEE":
2216
- default:
2217
- return localize3.day(dayOfWeek, {
2218
- width: "wide",
2219
- context: "formatting"
2220
- });
2221
- }
2222
- },
2223
- // Local day of week
2224
- e: function(date, token, localize3, options) {
2225
- const dayOfWeek = date.getDay();
2226
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2227
- switch (token) {
2228
- // Numerical value (Nth day of week with current locale or weekStartsOn)
2229
- case "e":
2230
- return String(localDayOfWeek);
2231
- // Padded numerical value
2232
- case "ee":
2233
- return addLeadingZeros(localDayOfWeek, 2);
2234
- // 1st, 2nd, ..., 7th
2235
- case "eo":
2236
- return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
2237
- case "eee":
2238
- return localize3.day(dayOfWeek, {
2239
- width: "abbreviated",
2240
- context: "formatting"
2241
- });
2242
- // T
2243
- case "eeeee":
2244
- return localize3.day(dayOfWeek, {
2245
- width: "narrow",
2246
- context: "formatting"
2247
- });
2248
- // Tu
2249
- case "eeeeee":
2250
- return localize3.day(dayOfWeek, {
2251
- width: "short",
2252
- context: "formatting"
2253
- });
2254
- // Tuesday
2255
- case "eeee":
2256
- default:
2257
- return localize3.day(dayOfWeek, {
2258
- width: "wide",
2259
- context: "formatting"
2260
- });
2261
- }
2262
- },
2263
- // Stand-alone local day of week
2264
- c: function(date, token, localize3, options) {
2265
- const dayOfWeek = date.getDay();
2266
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2267
- switch (token) {
2268
- // Numerical value (same as in `e`)
2269
- case "c":
2270
- return String(localDayOfWeek);
2271
- // Padded numerical value
2272
- case "cc":
2273
- return addLeadingZeros(localDayOfWeek, token.length);
2274
- // 1st, 2nd, ..., 7th
2275
- case "co":
2276
- return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
2277
- case "ccc":
2278
- return localize3.day(dayOfWeek, {
2279
- width: "abbreviated",
2280
- context: "standalone"
2281
- });
2282
- // T
2283
- case "ccccc":
2284
- return localize3.day(dayOfWeek, {
2285
- width: "narrow",
2286
- context: "standalone"
2287
- });
2288
- // Tu
2289
- case "cccccc":
2290
- return localize3.day(dayOfWeek, {
2291
- width: "short",
2292
- context: "standalone"
2293
- });
2294
- // Tuesday
2295
- case "cccc":
2296
- default:
2297
- return localize3.day(dayOfWeek, {
2298
- width: "wide",
2299
- context: "standalone"
2300
- });
2301
- }
2302
- },
2303
- // ISO day of week
2304
- i: function(date, token, localize3) {
2305
- const dayOfWeek = date.getDay();
2306
- const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
2307
- switch (token) {
2308
- // 2
2309
- case "i":
2310
- return String(isoDayOfWeek);
2311
- // 02
2312
- case "ii":
2313
- return addLeadingZeros(isoDayOfWeek, token.length);
2314
- // 2nd
2315
- case "io":
2316
- return localize3.ordinalNumber(isoDayOfWeek, { unit: "day" });
2317
- // Tue
2318
- case "iii":
2319
- return localize3.day(dayOfWeek, {
2320
- width: "abbreviated",
2321
- context: "formatting"
2322
- });
2323
- // T
2324
- case "iiiii":
2325
- return localize3.day(dayOfWeek, {
2326
- width: "narrow",
2327
- context: "formatting"
2328
- });
2329
- // Tu
2330
- case "iiiiii":
2331
- return localize3.day(dayOfWeek, {
2332
- width: "short",
2333
- context: "formatting"
2334
- });
2335
- // Tuesday
2336
- case "iiii":
2337
- default:
2338
- return localize3.day(dayOfWeek, {
2339
- width: "wide",
2340
- context: "formatting"
2341
- });
2342
- }
2343
- },
2344
- // AM or PM
2345
- a: function(date, token, localize3) {
2346
- const hours = date.getHours();
2347
- const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2348
- switch (token) {
2349
- case "a":
2350
- case "aa":
2351
- return localize3.dayPeriod(dayPeriodEnumValue, {
2352
- width: "abbreviated",
2353
- context: "formatting"
2354
- });
2355
- case "aaa":
2356
- return localize3.dayPeriod(dayPeriodEnumValue, {
2357
- width: "abbreviated",
2358
- context: "formatting"
2359
- }).toLowerCase();
2360
- case "aaaaa":
2361
- return localize3.dayPeriod(dayPeriodEnumValue, {
2362
- width: "narrow",
2363
- context: "formatting"
2364
- });
2365
- case "aaaa":
2366
- default:
2367
- return localize3.dayPeriod(dayPeriodEnumValue, {
2368
- width: "wide",
2369
- context: "formatting"
2370
- });
2371
- }
2372
- },
2373
- // AM, PM, midnight, noon
2374
- b: function(date, token, localize3) {
2375
- const hours = date.getHours();
2376
- let dayPeriodEnumValue;
2377
- if (hours === 12) {
2378
- dayPeriodEnumValue = dayPeriodEnum.noon;
2379
- } else if (hours === 0) {
2380
- dayPeriodEnumValue = dayPeriodEnum.midnight;
2381
- } else {
2382
- dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2383
- }
2384
- switch (token) {
2385
- case "b":
2386
- case "bb":
2387
- return localize3.dayPeriod(dayPeriodEnumValue, {
2388
- width: "abbreviated",
2389
- context: "formatting"
2390
- });
2391
- case "bbb":
2392
- return localize3.dayPeriod(dayPeriodEnumValue, {
2393
- width: "abbreviated",
2394
- context: "formatting"
2395
- }).toLowerCase();
2396
- case "bbbbb":
2397
- return localize3.dayPeriod(dayPeriodEnumValue, {
2398
- width: "narrow",
2399
- context: "formatting"
2400
- });
2401
- case "bbbb":
2402
- default:
2403
- return localize3.dayPeriod(dayPeriodEnumValue, {
2404
- width: "wide",
2405
- context: "formatting"
2406
- });
2407
- }
2408
- },
2409
- // in the morning, in the afternoon, in the evening, at night
2410
- B: function(date, token, localize3) {
2411
- const hours = date.getHours();
2412
- let dayPeriodEnumValue;
2413
- if (hours >= 17) {
2414
- dayPeriodEnumValue = dayPeriodEnum.evening;
2415
- } else if (hours >= 12) {
2416
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
2417
- } else if (hours >= 4) {
2418
- dayPeriodEnumValue = dayPeriodEnum.morning;
2419
- } else {
2420
- dayPeriodEnumValue = dayPeriodEnum.night;
2421
- }
2422
- switch (token) {
2423
- case "B":
2424
- case "BB":
2425
- case "BBB":
2426
- return localize3.dayPeriod(dayPeriodEnumValue, {
2427
- width: "abbreviated",
2428
- context: "formatting"
2429
- });
2430
- case "BBBBB":
2431
- return localize3.dayPeriod(dayPeriodEnumValue, {
2432
- width: "narrow",
2433
- context: "formatting"
2434
- });
2435
- case "BBBB":
2436
- default:
2437
- return localize3.dayPeriod(dayPeriodEnumValue, {
2438
- width: "wide",
2439
- context: "formatting"
2440
- });
2441
- }
2442
- },
2443
- // Hour [1-12]
2444
- h: function(date, token, localize3) {
2445
- if (token === "ho") {
2446
- let hours = date.getHours() % 12;
2447
- if (hours === 0) hours = 12;
2448
- return localize3.ordinalNumber(hours, { unit: "hour" });
2449
- }
2450
- return lightFormatters.h(date, token);
2451
- },
2452
- // Hour [0-23]
2453
- H: function(date, token, localize3) {
2454
- if (token === "Ho") {
2455
- return localize3.ordinalNumber(date.getHours(), { unit: "hour" });
2456
- }
2457
- return lightFormatters.H(date, token);
2458
- },
2459
- // Hour [0-11]
2460
- K: function(date, token, localize3) {
2461
- const hours = date.getHours() % 12;
2462
- if (token === "Ko") {
2463
- return localize3.ordinalNumber(hours, { unit: "hour" });
2464
- }
2465
- return addLeadingZeros(hours, token.length);
2466
- },
2467
- // Hour [1-24]
2468
- k: function(date, token, localize3) {
2469
- let hours = date.getHours();
2470
- if (hours === 0) hours = 24;
2471
- if (token === "ko") {
2472
- return localize3.ordinalNumber(hours, { unit: "hour" });
2473
- }
2474
- return addLeadingZeros(hours, token.length);
2475
- },
2476
- // Minute
2477
- m: function(date, token, localize3) {
2478
- if (token === "mo") {
2479
- return localize3.ordinalNumber(date.getMinutes(), { unit: "minute" });
2480
- }
2481
- return lightFormatters.m(date, token);
2482
- },
2483
- // Second
2484
- s: function(date, token, localize3) {
2485
- if (token === "so") {
2486
- return localize3.ordinalNumber(date.getSeconds(), { unit: "second" });
2487
- }
2488
- return lightFormatters.s(date, token);
2489
- },
2490
- // Fraction of second
2491
- S: function(date, token) {
2492
- return lightFormatters.S(date, token);
2493
- },
2494
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2495
- X: function(date, token, _localize) {
2496
- const timezoneOffset = date.getTimezoneOffset();
2497
- if (timezoneOffset === 0) {
2498
- return "Z";
2499
- }
2500
- switch (token) {
2501
- // Hours and optional minutes
2502
- case "X":
2503
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
2504
- // Hours, minutes and optional seconds without `:` delimiter
2505
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2506
- // so this token always has the same output as `XX`
2507
- case "XXXX":
2508
- case "XX":
2509
- return formatTimezone(timezoneOffset);
2510
- // Hours, minutes and optional seconds with `:` delimiter
2511
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2512
- // so this token always has the same output as `XXX`
2513
- case "XXXXX":
2514
- case "XXX":
2515
- // Hours and minutes with `:` delimiter
2516
- default:
2517
- return formatTimezone(timezoneOffset, ":");
2518
- }
2519
- },
2520
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2521
- x: function(date, token, _localize) {
2522
- const timezoneOffset = date.getTimezoneOffset();
2523
- switch (token) {
2524
- // Hours and optional minutes
2525
- case "x":
2526
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
2527
- // Hours, minutes and optional seconds without `:` delimiter
2528
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2529
- // so this token always has the same output as `xx`
2530
- case "xxxx":
2531
- case "xx":
2532
- return formatTimezone(timezoneOffset);
2533
- // Hours, minutes and optional seconds with `:` delimiter
2534
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2535
- // so this token always has the same output as `xxx`
2536
- case "xxxxx":
2537
- case "xxx":
2538
- // Hours and minutes with `:` delimiter
2539
- default:
2540
- return formatTimezone(timezoneOffset, ":");
2541
- }
2542
- },
2543
- // Timezone (GMT)
2544
- O: function(date, token, _localize) {
2545
- const timezoneOffset = date.getTimezoneOffset();
2546
- switch (token) {
2547
- // Short
2548
- case "O":
2549
- case "OO":
2550
- case "OOO":
2551
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2552
- // Long
2553
- case "OOOO":
2554
- default:
2555
- return "GMT" + formatTimezone(timezoneOffset, ":");
2556
- }
2557
- },
2558
- // Timezone (specific non-location)
2559
- z: function(date, token, _localize) {
2560
- const timezoneOffset = date.getTimezoneOffset();
2561
- switch (token) {
2562
- // Short
2563
- case "z":
2564
- case "zz":
2565
- case "zzz":
2566
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2567
- // Long
2568
- case "zzzz":
2569
- default:
2570
- return "GMT" + formatTimezone(timezoneOffset, ":");
2571
- }
2572
- },
2573
- // Seconds timestamp
2574
- t: function(date, token, _localize) {
2575
- const timestamp = Math.trunc(+date / 1e3);
2576
- return addLeadingZeros(timestamp, token.length);
2577
- },
2578
- // Milliseconds timestamp
2579
- T: function(date, token, _localize) {
2580
- return addLeadingZeros(+date, token.length);
2581
- }
2582
- };
2583
- function formatTimezoneShort(offset, delimiter = "") {
2584
- const sign = offset > 0 ? "-" : "+";
2585
- const absOffset = Math.abs(offset);
2586
- const hours = Math.trunc(absOffset / 60);
2587
- const minutes = absOffset % 60;
2588
- if (minutes === 0) {
2589
- return sign + String(hours);
2590
- }
2591
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
2592
- }
2593
- function formatTimezoneWithOptionalMinutes(offset, delimiter) {
2594
- if (offset % 60 === 0) {
2595
- const sign = offset > 0 ? "-" : "+";
2596
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
2597
- }
2598
- return formatTimezone(offset, delimiter);
2599
- }
2600
- function formatTimezone(offset, delimiter = "") {
2601
- const sign = offset > 0 ? "-" : "+";
2602
- const absOffset = Math.abs(offset);
2603
- const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
2604
- const minutes = addLeadingZeros(absOffset % 60, 2);
2605
- return sign + hours + delimiter + minutes;
2606
- }
2607
-
2608
- // node_modules/date-fns/_lib/format/longFormatters.js
2609
- var dateLongFormatter = (pattern, formatLong3) => {
2610
- switch (pattern) {
2611
- case "P":
2612
- return formatLong3.date({ width: "short" });
2613
- case "PP":
2614
- return formatLong3.date({ width: "medium" });
2615
- case "PPP":
2616
- return formatLong3.date({ width: "long" });
2617
- case "PPPP":
2618
- default:
2619
- return formatLong3.date({ width: "full" });
2620
- }
2621
- };
2622
- var timeLongFormatter = (pattern, formatLong3) => {
2623
- switch (pattern) {
2624
- case "p":
2625
- return formatLong3.time({ width: "short" });
2626
- case "pp":
2627
- return formatLong3.time({ width: "medium" });
2628
- case "ppp":
2629
- return formatLong3.time({ width: "long" });
2630
- case "pppp":
2631
- default:
2632
- return formatLong3.time({ width: "full" });
2633
- }
2634
- };
2635
- var dateTimeLongFormatter = (pattern, formatLong3) => {
2636
- const matchResult = pattern.match(/(P+)(p+)?/) || [];
2637
- const datePattern = matchResult[1];
2638
- const timePattern = matchResult[2];
2639
- if (!timePattern) {
2640
- return dateLongFormatter(pattern, formatLong3);
2641
- }
2642
- let dateTimeFormat;
2643
- switch (datePattern) {
2644
- case "P":
2645
- dateTimeFormat = formatLong3.dateTime({ width: "short" });
2646
- break;
2647
- case "PP":
2648
- dateTimeFormat = formatLong3.dateTime({ width: "medium" });
2649
- break;
2650
- case "PPP":
2651
- dateTimeFormat = formatLong3.dateTime({ width: "long" });
2652
- break;
2653
- case "PPPP":
2654
- default:
2655
- dateTimeFormat = formatLong3.dateTime({ width: "full" });
2656
- break;
2657
- }
2658
- return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong3)).replace("{{time}}", timeLongFormatter(timePattern, formatLong3));
2659
- };
2660
- var longFormatters = {
2661
- p: timeLongFormatter,
2662
- P: dateTimeLongFormatter
2663
- };
2664
-
2665
- // node_modules/date-fns/_lib/protectedTokens.js
2666
- var dayOfYearTokenRE = /^D+$/;
2667
- var weekYearTokenRE = /^Y+$/;
2668
- var throwTokens = ["D", "DD", "YY", "YYYY"];
2669
- function isProtectedDayOfYearToken(token) {
2670
- return dayOfYearTokenRE.test(token);
2671
- }
2672
- function isProtectedWeekYearToken(token) {
2673
- return weekYearTokenRE.test(token);
2674
- }
2675
- function warnOrThrowProtectedError(token, format2, input) {
2676
- const _message = message(token, format2, input);
2677
- console.warn(_message);
2678
- if (throwTokens.includes(token)) throw new RangeError(_message);
2679
- }
2680
- function message(token, format2, input) {
2681
- const subject = token[0] === "Y" ? "years" : "days of the month";
2682
- return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2683
- }
2684
-
2685
- // node_modules/date-fns/format.js
2686
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2687
- var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2688
- var escapedStringRegExp = /^'([^]*?)'?$/;
2689
- var doubleQuoteRegExp = /''/g;
2690
- var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2691
- function format(date, formatStr, options) {
2692
- const defaultOptions2 = getDefaultOptions();
2693
- const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
2694
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
2695
- const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
2696
- const originalDate = toDate(date, options?.in);
2697
- if (!isValid(originalDate)) {
2698
- throw new RangeError("Invalid time value");
2699
- }
2700
- let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
2701
- const firstCharacter = substring[0];
2702
- if (firstCharacter === "p" || firstCharacter === "P") {
2703
- const longFormatter = longFormatters[firstCharacter];
2704
- return longFormatter(substring, locale.formatLong);
2705
- }
2706
- return substring;
2707
- }).join("").match(formattingTokensRegExp).map((substring) => {
2708
- if (substring === "''") {
2709
- return { isToken: false, value: "'" };
2710
- }
2711
- const firstCharacter = substring[0];
2712
- if (firstCharacter === "'") {
2713
- return { isToken: false, value: cleanEscapedString(substring) };
2714
- }
2715
- if (formatters[firstCharacter]) {
2716
- return { isToken: true, value: substring };
2717
- }
2718
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2719
- throw new RangeError(
2720
- "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
2721
- );
2722
- }
2723
- return { isToken: false, value: substring };
2724
- });
2725
- if (locale.localize.preprocessor) {
2726
- parts = locale.localize.preprocessor(originalDate, parts);
2727
- }
2728
- const formatterOptions = {
2729
- firstWeekContainsDate,
2730
- weekStartsOn,
2731
- locale
2732
- };
2733
- return parts.map((part) => {
2734
- if (!part.isToken) return part.value;
2735
- const token = part.value;
2736
- if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
2737
- warnOrThrowProtectedError(token, formatStr, String(date));
2738
- }
2739
- const formatter = formatters[token[0]];
2740
- return formatter(originalDate, token, locale.localize, formatterOptions);
2741
- }).join("");
2742
- }
2743
- function cleanEscapedString(input) {
2744
- const matched = input.match(escapedStringRegExp);
2745
- if (!matched) {
2746
- return input;
2747
- }
2748
- return matched[1].replace(doubleQuoteRegExp, "'");
2749
- }
2750
-
2751
- // src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
2752
- var import_buddhistEra = __toESM(require_buddhistEra());
2753
-
2754
- // node_modules/date-fns/locale/th/_lib/formatDistance.js
2755
- var formatDistanceLocale2 = {
2756
- lessThanXSeconds: {
2757
- one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
2758
- other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
2759
- },
2760
- xSeconds: {
2761
- one: "1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
2762
- other: "{{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
2763
- },
2764
- halfAMinute: "\u0E04\u0E23\u0E36\u0E48\u0E07\u0E19\u0E32\u0E17\u0E35",
2765
- lessThanXMinutes: {
2766
- one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E19\u0E32\u0E17\u0E35",
2767
- other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E19\u0E32\u0E17\u0E35"
2768
- },
2769
- xMinutes: {
2770
- one: "1 \u0E19\u0E32\u0E17\u0E35",
2771
- other: "{{count}} \u0E19\u0E32\u0E17\u0E35"
2772
- },
2773
- aboutXHours: {
2774
- one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
2775
- other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
2776
- },
2777
- xHours: {
2778
- one: "1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
2779
- other: "{{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
2780
- },
2781
- xDays: {
2782
- one: "1 \u0E27\u0E31\u0E19",
2783
- other: "{{count}} \u0E27\u0E31\u0E19"
2784
- },
2785
- aboutXWeeks: {
2786
- one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
2787
- other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
2788
- },
2789
- xWeeks: {
2790
- one: "1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
2791
- other: "{{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
2792
- },
2793
- aboutXMonths: {
2794
- one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
2795
- other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
2796
- },
2797
- xMonths: {
2798
- one: "1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
2799
- other: "{{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
2800
- },
2801
- aboutXYears: {
2802
- one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E1B\u0E35",
2803
- other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E1B\u0E35"
2804
- },
2805
- xYears: {
2806
- one: "1 \u0E1B\u0E35",
2807
- other: "{{count}} \u0E1B\u0E35"
2808
- },
2809
- overXYears: {
2810
- one: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 1 \u0E1B\u0E35",
2811
- other: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E1B\u0E35"
2812
- },
2813
- almostXYears: {
2814
- one: "\u0E40\u0E01\u0E37\u0E2D\u0E1A 1 \u0E1B\u0E35",
2815
- other: "\u0E40\u0E01\u0E37\u0E2D\u0E1A {{count}} \u0E1B\u0E35"
2816
- }
2817
- };
2818
- var formatDistance2 = (token, count, options) => {
2819
- let result;
2820
- const tokenValue = formatDistanceLocale2[token];
2821
- if (typeof tokenValue === "string") {
2822
- result = tokenValue;
2823
- } else if (count === 1) {
2824
- result = tokenValue.one;
2825
- } else {
2826
- result = tokenValue.other.replace("{{count}}", String(count));
2827
- }
2828
- if (options?.addSuffix) {
2829
- if (options.comparison && options.comparison > 0) {
2830
- if (token === "halfAMinute") {
2831
- return "\u0E43\u0E19" + result;
2832
- } else {
2833
- return "\u0E43\u0E19 " + result;
2834
- }
2835
- } else {
2836
- return result + "\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32";
2837
- }
2838
- }
2839
- return result;
2840
- };
2841
-
2842
- // node_modules/date-fns/locale/th/_lib/formatLong.js
2843
- var dateFormats2 = {
2844
- full: "\u0E27\u0E31\u0E19EEEE\u0E17\u0E35\u0E48 do MMMM y",
2845
- long: "do MMMM y",
2846
- medium: "d MMM y",
2847
- short: "dd/MM/yyyy"
2848
- };
2849
- var timeFormats2 = {
2850
- full: "H:mm:ss \u0E19. zzzz",
2851
- long: "H:mm:ss \u0E19. z",
2852
- medium: "H:mm:ss \u0E19.",
2853
- short: "H:mm \u0E19."
2854
- };
2855
- var dateTimeFormats2 = {
2856
- full: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
2857
- long: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
2858
- medium: "{{date}}, {{time}}",
2859
- short: "{{date}}, {{time}}"
2860
- };
2861
- var formatLong2 = {
2862
- date: buildFormatLongFn({
2863
- formats: dateFormats2,
2864
- defaultWidth: "full"
2865
- }),
2866
- time: buildFormatLongFn({
2867
- formats: timeFormats2,
2868
- defaultWidth: "medium"
2869
- }),
2870
- dateTime: buildFormatLongFn({
2871
- formats: dateTimeFormats2,
2872
- defaultWidth: "full"
2873
- })
2874
- };
2875
-
2876
- // node_modules/date-fns/locale/th/_lib/formatRelative.js
2877
- var formatRelativeLocale2 = {
2878
- lastWeek: "eeee'\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27\u0E40\u0E27\u0E25\u0E32' p",
2879
- yesterday: "'\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
2880
- today: "'\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
2881
- tomorrow: "'\u0E1E\u0E23\u0E38\u0E48\u0E07\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
2882
- nextWeek: "eeee '\u0E40\u0E27\u0E25\u0E32' p",
2883
- other: "P"
2884
- };
2885
- var formatRelative2 = (token, _date, _baseDate, _options) => formatRelativeLocale2[token];
2886
-
2887
- // node_modules/date-fns/locale/th/_lib/localize.js
2888
- var eraValues2 = {
2889
- narrow: ["B", "\u0E04\u0E28"],
2890
- abbreviated: ["BC", "\u0E04.\u0E28."],
2891
- wide: ["\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E01\u0E32\u0E25", "\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E4C\u0E28\u0E31\u0E01\u0E23\u0E32\u0E0A"]
2892
- };
2893
- var quarterValues2 = {
2894
- narrow: ["1", "2", "3", "4"],
2895
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
2896
- wide: ["\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E41\u0E23\u0E01", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E07", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E32\u0E21", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E35\u0E48"]
2897
- };
2898
- var dayValues2 = {
2899
- narrow: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
2900
- short: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
2901
- abbreviated: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
2902
- wide: ["\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C", "\u0E08\u0E31\u0E19\u0E17\u0E23\u0E4C", "\u0E2D\u0E31\u0E07\u0E04\u0E32\u0E23", "\u0E1E\u0E38\u0E18", "\u0E1E\u0E24\u0E2B\u0E31\u0E2A\u0E1A\u0E14\u0E35", "\u0E28\u0E38\u0E01\u0E23\u0E4C", "\u0E40\u0E2A\u0E32\u0E23\u0E4C"]
2903
- };
2904
- var monthValues2 = {
2905
- narrow: [
2906
- "\u0E21.\u0E04.",
2907
- "\u0E01.\u0E1E.",
2908
- "\u0E21\u0E35.\u0E04.",
2909
- "\u0E40\u0E21.\u0E22.",
2910
- "\u0E1E.\u0E04.",
2911
- "\u0E21\u0E34.\u0E22.",
2912
- "\u0E01.\u0E04.",
2913
- "\u0E2A.\u0E04.",
2914
- "\u0E01.\u0E22.",
2915
- "\u0E15.\u0E04.",
2916
- "\u0E1E.\u0E22.",
2917
- "\u0E18.\u0E04."
2918
- ],
2919
- abbreviated: [
2920
- "\u0E21.\u0E04.",
2921
- "\u0E01.\u0E1E.",
2922
- "\u0E21\u0E35.\u0E04.",
2923
- "\u0E40\u0E21.\u0E22.",
2924
- "\u0E1E.\u0E04.",
2925
- "\u0E21\u0E34.\u0E22.",
2926
- "\u0E01.\u0E04.",
2927
- "\u0E2A.\u0E04.",
2928
- "\u0E01.\u0E22.",
2929
- "\u0E15.\u0E04.",
2930
- "\u0E1E.\u0E22.",
2931
- "\u0E18.\u0E04."
2932
- ],
2933
- wide: [
2934
- "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
2935
- "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
2936
- "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
2937
- "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
2938
- "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
2939
- "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
2940
- "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
2941
- "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
2942
- "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
2943
- "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
2944
- "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
2945
- "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
2946
- ]
2947
- };
2948
- var dayPeriodValues2 = {
2949
- narrow: {
2950
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2951
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2952
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
2953
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2954
- morning: "\u0E40\u0E0A\u0E49\u0E32",
2955
- afternoon: "\u0E1A\u0E48\u0E32\u0E22",
2956
- evening: "\u0E40\u0E22\u0E47\u0E19",
2957
- night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
2958
- },
2959
- abbreviated: {
2960
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2961
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2962
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
2963
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2964
- morning: "\u0E40\u0E0A\u0E49\u0E32",
2965
- afternoon: "\u0E1A\u0E48\u0E32\u0E22",
2966
- evening: "\u0E40\u0E22\u0E47\u0E19",
2967
- night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
2968
- },
2969
- wide: {
2970
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2971
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2972
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
2973
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2974
- morning: "\u0E40\u0E0A\u0E49\u0E32",
2975
- afternoon: "\u0E1A\u0E48\u0E32\u0E22",
2976
- evening: "\u0E40\u0E22\u0E47\u0E19",
2977
- night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
2978
- }
2979
- };
2980
- var formattingDayPeriodValues2 = {
2981
- narrow: {
2982
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2983
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2984
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
2985
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2986
- morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
2987
- afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
2988
- evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
2989
- night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
2990
- },
2991
- abbreviated: {
2992
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2993
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2994
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
2995
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
2996
- morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
2997
- afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
2998
- evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
2999
- night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
3000
- },
3001
- wide: {
3002
- am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
3003
- pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
3004
- midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
3005
- noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
3006
- morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
3007
- afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
3008
- evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
3009
- night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
3010
- }
3011
- };
3012
- var ordinalNumber2 = (dirtyNumber, _options) => {
3013
- return String(dirtyNumber);
3014
- };
3015
- var localize2 = {
3016
- ordinalNumber: ordinalNumber2,
3017
- era: buildLocalizeFn({
3018
- values: eraValues2,
3019
- defaultWidth: "wide"
3020
- }),
3021
- quarter: buildLocalizeFn({
3022
- values: quarterValues2,
3023
- defaultWidth: "wide",
3024
- argumentCallback: (quarter) => quarter - 1
3025
- }),
3026
- month: buildLocalizeFn({
3027
- values: monthValues2,
3028
- defaultWidth: "wide"
3029
- }),
3030
- day: buildLocalizeFn({
3031
- values: dayValues2,
3032
- defaultWidth: "wide"
3033
- }),
3034
- dayPeriod: buildLocalizeFn({
3035
- values: dayPeriodValues2,
3036
- defaultWidth: "wide",
3037
- formattingValues: formattingDayPeriodValues2,
3038
- defaultFormattingWidth: "wide"
3039
- })
3040
- };
3041
-
3042
- // node_modules/date-fns/locale/th/_lib/match.js
3043
- var matchOrdinalNumberPattern2 = /^\d+/i;
3044
- var parseOrdinalNumberPattern2 = /\d+/i;
3045
- var matchEraPatterns2 = {
3046
- narrow: /^([bB]|[aA]|คศ)/i,
3047
- abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
3048
- wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i
3049
- };
3050
- var parseEraPatterns2 = {
3051
- any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i]
3052
- };
3053
- var matchQuarterPatterns2 = {
3054
- narrow: /^[1234]/i,
3055
- abbreviated: /^q[1234]/i,
3056
- wide: /^ไตรมาส(ที่)? ?[1234]/i
3057
- };
3058
- var parseQuarterPatterns2 = {
3059
- any: [/(1|แรก|หนึ่ง)/i, /(2|สอง)/i, /(3|สาม)/i, /(4|สี่)/i]
3060
- };
3061
- var matchMonthPatterns2 = {
3062
- narrow: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
3063
- abbreviated: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
3064
- wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i
3065
- };
3066
- var parseMonthPatterns2 = {
3067
- wide: [
3068
- /^มก/i,
3069
- /^กุม/i,
3070
- /^มี/i,
3071
- /^เม/i,
3072
- /^พฤษ/i,
3073
- /^มิ/i,
3074
- /^กรก/i,
3075
- /^ส/i,
3076
- /^กัน/i,
3077
- /^ต/i,
3078
- /^พฤศ/i,
3079
- /^ธ/i
3080
- ],
3081
- any: [
3082
- /^ม\.?ค\.?/i,
3083
- /^ก\.?พ\.?/i,
3084
- /^มี\.?ค\.?/i,
3085
- /^เม\.?ย\.?/i,
3086
- /^พ\.?ค\.?/i,
3087
- /^มิ\.?ย\.?/i,
3088
- /^ก\.?ค\.?/i,
3089
- /^ส\.?ค\.?/i,
3090
- /^ก\.?ย\.?/i,
3091
- /^ต\.?ค\.?/i,
3092
- /^พ\.?ย\.?/i,
3093
- /^ธ\.?ค\.?/i
3094
- ]
3095
- };
3096
- var matchDayPatterns2 = {
3097
- narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
3098
- short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
3099
- abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
3100
- wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i
3101
- };
3102
- var parseDayPatterns2 = {
3103
- wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i],
3104
- any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i]
3105
- };
3106
- var matchDayPeriodPatterns2 = {
3107
- any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i
3108
- };
3109
- var parseDayPeriodPatterns2 = {
3110
- any: {
3111
- am: /^ก่อนเที่ยง/i,
3112
- pm: /^หลังเที่ยง/i,
3113
- midnight: /^เที่ยงคืน/i,
3114
- noon: /^เที่ยง/i,
3115
- morning: /เช้า/i,
3116
- afternoon: /บ่าย/i,
3117
- evening: /เย็น/i,
3118
- night: /กลางคืน/i
3119
- }
3120
- };
3121
- var match2 = {
3122
- ordinalNumber: buildMatchPatternFn({
3123
- matchPattern: matchOrdinalNumberPattern2,
3124
- parsePattern: parseOrdinalNumberPattern2,
3125
- valueCallback: (value) => parseInt(value, 10)
3126
- }),
3127
- era: buildMatchFn({
3128
- matchPatterns: matchEraPatterns2,
3129
- defaultMatchWidth: "wide",
3130
- parsePatterns: parseEraPatterns2,
3131
- defaultParseWidth: "any"
3132
- }),
3133
- quarter: buildMatchFn({
3134
- matchPatterns: matchQuarterPatterns2,
3135
- defaultMatchWidth: "wide",
3136
- parsePatterns: parseQuarterPatterns2,
3137
- defaultParseWidth: "any",
3138
- valueCallback: (index) => index + 1
3139
- }),
3140
- month: buildMatchFn({
3141
- matchPatterns: matchMonthPatterns2,
3142
- defaultMatchWidth: "wide",
3143
- parsePatterns: parseMonthPatterns2,
3144
- defaultParseWidth: "any"
3145
- }),
3146
- day: buildMatchFn({
3147
- matchPatterns: matchDayPatterns2,
3148
- defaultMatchWidth: "wide",
3149
- parsePatterns: parseDayPatterns2,
3150
- defaultParseWidth: "any"
3151
- }),
3152
- dayPeriod: buildMatchFn({
3153
- matchPatterns: matchDayPeriodPatterns2,
3154
- defaultMatchWidth: "any",
3155
- parsePatterns: parseDayPeriodPatterns2,
3156
- defaultParseWidth: "any"
3157
- })
3158
- };
3159
-
3160
- // node_modules/date-fns/locale/th.js
3161
- var th = {
3162
- code: "th",
3163
- formatDistance: formatDistance2,
3164
- formatLong: formatLong2,
3165
- formatRelative: formatRelative2,
3166
- localize: localize2,
3167
- match: match2,
3168
- options: {
3169
- weekStartsOn: 0,
3170
- firstWeekContainsDate: 1
3171
- }
3172
- };
3173
-
3174
- // src/DatePicker/convertToBuddhist.ts
3175
- import th2 from "antd/es/date-picker/locale/th_TH";
3176
- var buddhistLocale = {
3177
- ...th2,
3178
- lang: {
3179
- ...th2.lang,
3180
- fieldDateFormat: "BBBB-MM-DD",
3181
- fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
3182
- yearFormat: "BBBB",
3183
- cellYearFormat: "BBBB"
3184
- }
3185
- };
3186
-
3187
- // src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
3188
1286
  import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
3189
- import_dayjs.default.extend(import_buddhistEra.default);
3190
1287
  function DatePickerBasic({
3191
1288
  value,
3192
1289
  onChange,
3193
1290
  required,
3194
- label,
1291
+ title,
1292
+ bottomText,
3195
1293
  error,
3196
1294
  placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
3197
1295
  disabled,
@@ -3202,6 +1300,8 @@ function DatePickerBasic({
3202
1300
  className,
3203
1301
  size
3204
1302
  }) {
1303
+ const dateFormat = "DD/MM/YYYY";
1304
+ import_dayjs.default.locale("th_TH");
3205
1305
  return /* @__PURE__ */ jsx21(
3206
1306
  ConfigProvider5,
3207
1307
  {
@@ -3214,52 +1314,52 @@ function DatePickerBasic({
3214
1314
  },
3215
1315
  children: /* @__PURE__ */ jsxs17("div", { className: "container-input", children: [
3216
1316
  /* @__PURE__ */ jsxs17("div", { children: [
3217
- /* @__PURE__ */ jsx21("span", { className: "body-1", children: label }),
1317
+ /* @__PURE__ */ jsx21("span", { className: "body-1", children: title }),
1318
+ " ",
3218
1319
  required && /* @__PURE__ */ jsx21("span", { className: "text-red-500", children: "*" })
3219
1320
  ] }),
3220
1321
  /* @__PURE__ */ jsx21(
3221
1322
  DatePicker,
3222
1323
  {
3223
1324
  className: `body-1 w-full ${className ?? ""}`,
3224
- value: value ? (0, import_dayjs.default)(value) : null,
1325
+ value,
3225
1326
  placeholder,
3226
- onChange: (date) => {
3227
- onChange(date ? date.toDate() : null);
3228
- },
1327
+ onChange,
3229
1328
  allowClear: true,
3230
1329
  disabled,
3231
- format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
3232
- /\d{4}$/,
3233
- (y) => String(parseInt(y) + 543)
3234
- ) : "",
3235
- defaultValue: defaultValue ? (0, import_dayjs.default)(defaultValue) : null,
3236
- disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
3237
- minDate: minDate ? (0, import_dayjs.default)(minDate) : void 0,
3238
- maxDate: maxDate ? (0, import_dayjs.default)(maxDate) : void 0,
3239
- size,
3240
- locale: buddhistLocale
1330
+ format: dateFormat,
1331
+ defaultValue,
1332
+ minDate,
1333
+ maxDate,
1334
+ disabledDate,
1335
+ size
3241
1336
  }
3242
1337
  ),
3243
- error && /* @__PURE__ */ jsx21("p", { className: "text-red-500 caption-1", children: error })
1338
+ /* @__PURE__ */ jsxs17("div", { children: [
1339
+ /* @__PURE__ */ jsx21("p", { className: "caption-1 text-gray-500", children: bottomText }),
1340
+ " ",
1341
+ error && /* @__PURE__ */ jsx21("p", { className: "caption-1 text-red-500 ", children: error })
1342
+ ] })
3244
1343
  ] })
3245
1344
  }
3246
1345
  );
3247
1346
  }
3248
1347
 
3249
1348
  // src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
3250
- var import_th2 = __toESM(require_th());
1349
+ var import_th3 = __toESM(require_th());
1350
+ var import_customParseFormat = __toESM(require_customParseFormat());
3251
1351
  var import_dayjs2 = __toESM(require_dayjs_min());
3252
- var import_buddhistEra2 = __toESM(require_buddhistEra());
3253
1352
  import { ConfigProvider as ConfigProvider6, DatePicker as DatePicker2 } from "antd";
3254
1353
  import thTH2 from "antd/locale/th_TH";
3255
1354
  import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3256
- import_dayjs2.default.extend(import_buddhistEra2.default);
1355
+ import_dayjs2.default.extend(import_customParseFormat.default);
3257
1356
  function DatePickerRangePicker({
3258
1357
  value,
3259
1358
  onChange,
3260
1359
  placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
3261
- label,
1360
+ title,
3262
1361
  required,
1362
+ bottomText,
3263
1363
  error,
3264
1364
  disabled,
3265
1365
  minDate,
@@ -3270,6 +1370,8 @@ function DatePickerRangePicker({
3270
1370
  onOpenChange,
3271
1371
  onCalendarChange
3272
1372
  }) {
1373
+ const dateFormat = "DD/MM/YYYY";
1374
+ import_dayjs2.default.locale("th_TH");
3273
1375
  return /* @__PURE__ */ jsx22(
3274
1376
  ConfigProvider6,
3275
1377
  {
@@ -3282,73 +1384,47 @@ function DatePickerRangePicker({
3282
1384
  },
3283
1385
  children: /* @__PURE__ */ jsxs18("div", { className: "container-input", children: [
3284
1386
  /* @__PURE__ */ jsxs18("div", { children: [
3285
- /* @__PURE__ */ jsx22("span", { className: "body-1", children: label }),
1387
+ /* @__PURE__ */ jsx22("span", { className: "body-1", children: title }),
3286
1388
  " ",
3287
1389
  required && /* @__PURE__ */ jsx22("span", { className: "text-red-500", children: "*" })
3288
1390
  ] }),
3289
1391
  /* @__PURE__ */ jsx22(
3290
1392
  DatePicker2.RangePicker,
3291
1393
  {
3292
- format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
3293
- /\d{4}$/,
3294
- (y) => String(parseInt(y) + 543)
3295
- ) : "",
3296
- value: value ? [
3297
- value[0] ? (0, import_dayjs2.default)(value[0]) : null,
3298
- value[1] ? (0, import_dayjs2.default)(value[1]) : null
3299
- ] : null,
1394
+ format: dateFormat,
1395
+ value,
3300
1396
  placeholder,
3301
1397
  className: `body-1 w-full ${className ?? ""}`,
3302
- onChange: (dates, dateStrings) => {
3303
- if (!dates) {
3304
- onChange(null);
3305
- } else {
3306
- onChange([
3307
- dates[0] ? dates[0].toDate() : null,
3308
- dates[1] ? dates[1].toDate() : null
3309
- ]);
3310
- }
3311
- },
1398
+ onChange,
3312
1399
  allowClear: true,
3313
1400
  disabled,
3314
- disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
3315
- minDate: minDate ? (0, import_dayjs2.default)(minDate) : void 0,
3316
- maxDate: maxDate ? (0, import_dayjs2.default)(maxDate) : void 0,
1401
+ minDate,
1402
+ maxDate,
1403
+ disabledDate,
3317
1404
  size,
3318
1405
  onOpenChange,
3319
- onCalendarChange: (dates, dateStrings, info) => {
3320
- if (!dates) {
3321
- onCalendarChange?.([null, null], dateStrings, info);
3322
- } else {
3323
- onCalendarChange?.(
3324
- [
3325
- dates[0] ? dates[0].toDate() : null,
3326
- dates[1] ? dates[1].toDate() : null
3327
- ],
3328
- dateStrings,
3329
- info
3330
- );
3331
- }
3332
- },
3333
- locale: buddhistLocale
1406
+ onCalendarChange
3334
1407
  }
3335
1408
  ),
3336
- error && /* @__PURE__ */ jsx22("p", { className: "text-red-500 caption-1", children: error })
1409
+ /* @__PURE__ */ jsxs18("div", { children: [
1410
+ /* @__PURE__ */ jsx22("p", { className: "caption-1 text-gray-500", children: bottomText }),
1411
+ " ",
1412
+ error && /* @__PURE__ */ jsx22("p", { className: "caption-1 text-red-500 ", children: error })
1413
+ ] })
3337
1414
  ] })
3338
1415
  }
3339
1416
  );
3340
1417
  }
3341
1418
 
3342
1419
  // src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
3343
- var import_dayjs3 = __toESM(require_dayjs_min());
3344
1420
  import { ConfigProvider as ConfigProvider7, TimePicker } from "antd";
3345
- import thTH3 from "antd/locale/th_TH";
3346
1421
  import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
3347
1422
  function TimePickerBasic({
3348
1423
  value,
3349
1424
  onChange,
3350
1425
  required,
3351
- label,
1426
+ title,
1427
+ bottomText,
3352
1428
  error,
3353
1429
  placeholder,
3354
1430
  disabled,
@@ -3357,7 +1433,6 @@ function TimePickerBasic({
3357
1433
  return /* @__PURE__ */ jsx23(
3358
1434
  ConfigProvider7,
3359
1435
  {
3360
- locale: thTH3,
3361
1436
  theme: {
3362
1437
  token: {
3363
1438
  fontFamily: "Kanit"
@@ -3365,7 +1440,7 @@ function TimePickerBasic({
3365
1440
  },
3366
1441
  children: /* @__PURE__ */ jsxs19("div", { className: "container-input", children: [
3367
1442
  /* @__PURE__ */ jsxs19("div", { children: [
3368
- /* @__PURE__ */ jsx23("span", { className: "body-1", children: label }),
1443
+ /* @__PURE__ */ jsx23("span", { className: "body-1", children: title }),
3369
1444
  " ",
3370
1445
  required && /* @__PURE__ */ jsx23("span", { className: "text-red-500", children: "*" })
3371
1446
  ] }),
@@ -3374,32 +1449,33 @@ function TimePickerBasic({
3374
1449
  {
3375
1450
  format: "HH:mm",
3376
1451
  className: `body-1 w-full ${className ?? ""}`,
3377
- value: value ? (0, import_dayjs3.default)(value) : null,
1452
+ value,
3378
1453
  placeholder,
3379
- onChange: (time) => {
3380
- onChange(time ? time.toDate() : null);
3381
- },
1454
+ onChange,
3382
1455
  allowClear: true,
3383
1456
  disabled
3384
1457
  }
3385
1458
  ),
3386
- error && /* @__PURE__ */ jsx23("p", { className: "text-red-500 caption-1", children: error })
1459
+ /* @__PURE__ */ jsxs19("div", { children: [
1460
+ /* @__PURE__ */ jsx23("p", { className: "caption-1 text-gray-500", children: bottomText }),
1461
+ " ",
1462
+ error && /* @__PURE__ */ jsx23("p", { className: "caption-1 text-red-500 ", children: error })
1463
+ ] })
3387
1464
  ] })
3388
1465
  }
3389
1466
  );
3390
1467
  }
3391
1468
 
3392
1469
  // src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
3393
- var import_dayjs4 = __toESM(require_dayjs_min());
3394
1470
  import { ConfigProvider as ConfigProvider8, TimePicker as TimePicker2 } from "antd";
3395
- import thTH4 from "antd/locale/th_TH";
3396
1471
  import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
3397
1472
  function TimePickerRangePicker({
3398
1473
  value,
3399
1474
  onChange,
3400
1475
  placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
3401
- label,
1476
+ title,
3402
1477
  required,
1478
+ bottomText,
3403
1479
  error,
3404
1480
  disabled,
3405
1481
  className
@@ -3407,7 +1483,6 @@ function TimePickerRangePicker({
3407
1483
  return /* @__PURE__ */ jsx24(
3408
1484
  ConfigProvider8,
3409
1485
  {
3410
- locale: thTH4,
3411
1486
  theme: {
3412
1487
  token: {
3413
1488
  fontFamily: "Kanit"
@@ -3415,7 +1490,7 @@ function TimePickerRangePicker({
3415
1490
  },
3416
1491
  children: /* @__PURE__ */ jsxs20("div", { className: "container-input", children: [
3417
1492
  /* @__PURE__ */ jsxs20("div", { children: [
3418
- /* @__PURE__ */ jsx24("span", { className: "body-1", children: label }),
1493
+ /* @__PURE__ */ jsx24("span", { className: "body-1", children: title }),
3419
1494
  " ",
3420
1495
  required && /* @__PURE__ */ jsx24("span", { className: "text-red-500", children: "*" })
3421
1496
  ] }),
@@ -3423,28 +1498,19 @@ function TimePickerRangePicker({
3423
1498
  TimePicker2.RangePicker,
3424
1499
  {
3425
1500
  format: "HH:mm",
3426
- value: value ? [
3427
- value[0] ? (0, import_dayjs4.default)(value[0]) : null,
3428
- value[1] ? (0, import_dayjs4.default)(value[1]) : null
3429
- ] : null,
1501
+ value,
3430
1502
  placeholder,
3431
1503
  className: `body-1 w-full ${className ?? ""}`,
3432
- onChange: (dates, dateStrings) => {
3433
- if (!dates) {
3434
- onChange(null);
3435
- } else {
3436
- onChange([
3437
- dates[0] ? dates[0].toDate() : null,
3438
- dates[1] ? dates[1].toDate() : null
3439
- ]);
3440
- }
3441
- },
1504
+ onChange,
3442
1505
  allowClear: true,
3443
- disabled,
3444
- showNow: true
1506
+ disabled
3445
1507
  }
3446
1508
  ),
3447
- error && /* @__PURE__ */ jsx24("p", { className: "text-red-500 caption-1", children: error })
1509
+ /* @__PURE__ */ jsxs20("div", { children: [
1510
+ /* @__PURE__ */ jsx24("p", { className: "caption-1 text-gray-500", children: bottomText }),
1511
+ " ",
1512
+ error && /* @__PURE__ */ jsx24("p", { className: "caption-1 text-red-500 ", children: error })
1513
+ ] })
3448
1514
  ] })
3449
1515
  }
3450
1516
  );
@@ -3494,13 +1560,13 @@ function _defineProperty(e, r, t) {
3494
1560
  // node_modules/@ant-design/fast-color/es/FastColor.js
3495
1561
  var round = Math.round;
3496
1562
  function splitColorStr(str, parseNum) {
3497
- const match3 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
3498
- const numList = match3.map((item) => parseFloat(item));
1563
+ const match = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
1564
+ const numList = match.map((item) => parseFloat(item));
3499
1565
  for (let i = 0; i < 3; i += 1) {
3500
- numList[i] = parseNum(numList[i] || 0, match3[i] || "", i);
1566
+ numList[i] = parseNum(numList[i] || 0, match[i] || "", i);
3501
1567
  }
3502
- if (match3[3]) {
3503
- numList[3] = match3[3].includes("%") ? numList[3] / 100 : numList[3];
1568
+ if (match[3]) {
1569
+ numList[3] = match[3].includes("%") ? numList[3] / 100 : numList[3];
3504
1570
  } else {
3505
1571
  numList[3] = 1;
3506
1572
  }
@@ -4164,11 +2230,10 @@ function genPresets(presets = presetPalettes) {
4164
2230
  function ColorPalettePickerBasic({
4165
2231
  value,
4166
2232
  onChange,
4167
- require: require2,
2233
+ required,
4168
2234
  title,
4169
2235
  bottomText,
4170
- showError,
4171
- errorMessage,
2236
+ error,
4172
2237
  disabled,
4173
2238
  allowClear,
4174
2239
  defaultFormat,
@@ -4195,7 +2260,7 @@ function ColorPalettePickerBasic({
4195
2260
  /* @__PURE__ */ jsxs21("div", { children: [
4196
2261
  /* @__PURE__ */ jsx25("span", { className: "body-1", children: title }),
4197
2262
  " ",
4198
- require2 && /* @__PURE__ */ jsx25("span", { className: "text-red-500", children: "*" })
2263
+ required && /* @__PURE__ */ jsx25("span", { className: "text-red-500", children: "*" })
4199
2264
  ] }),
4200
2265
  /* @__PURE__ */ jsx25(
4201
2266
  ColorPicker2,
@@ -4225,7 +2290,7 @@ function ColorPalettePickerBasic({
4225
2290
  /* @__PURE__ */ jsxs21("div", { children: [
4226
2291
  /* @__PURE__ */ jsx25("p", { className: "caption-1 text-gray-500", children: bottomText }),
4227
2292
  " ",
4228
- showError && /* @__PURE__ */ jsx25("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2293
+ error && /* @__PURE__ */ jsx25("p", { className: "caption-1 text-red-500 ", children: error })
4229
2294
  ] })
4230
2295
  ] })
4231
2296
  }
@@ -4240,10 +2305,9 @@ function SelectField({
4240
2305
  onChange,
4241
2306
  placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
4242
2307
  title,
4243
- require: require2,
2308
+ required,
4244
2309
  bottomText,
4245
- showError,
4246
- errorMessage,
2310
+ error,
4247
2311
  disabled,
4248
2312
  defaultValue,
4249
2313
  options,
@@ -4267,7 +2331,7 @@ function SelectField({
4267
2331
  /* @__PURE__ */ jsxs22("div", { children: [
4268
2332
  /* @__PURE__ */ jsx26("span", { className: "body-1", children: title }),
4269
2333
  " ",
4270
- require2 && /* @__PURE__ */ jsx26("span", { className: "text-red-500", children: "*" })
2334
+ required && /* @__PURE__ */ jsx26("span", { className: "text-red-500", children: "*" })
4271
2335
  ] }),
4272
2336
  /* @__PURE__ */ jsx26(
4273
2337
  Select,
@@ -4284,7 +2348,19 @@ function SelectField({
4284
2348
  options,
4285
2349
  mode,
4286
2350
  onSearch: handleSearch,
4287
- prefix: prefix ? /* @__PURE__ */ jsx26("span", { style: { width: prefixSize, height: prefixSize, display: "flex", alignItems: "center", justifyContent: "center" }, children: prefix }) : void 0,
2351
+ prefix: prefix ? /* @__PURE__ */ jsx26(
2352
+ "span",
2353
+ {
2354
+ style: {
2355
+ width: prefixSize,
2356
+ height: prefixSize,
2357
+ display: "flex",
2358
+ alignItems: "center",
2359
+ justifyContent: "center"
2360
+ },
2361
+ children: prefix
2362
+ }
2363
+ ) : void 0,
4288
2364
  allowClear: true,
4289
2365
  onClear
4290
2366
  }
@@ -4292,7 +2368,7 @@ function SelectField({
4292
2368
  /* @__PURE__ */ jsxs22("div", { children: [
4293
2369
  /* @__PURE__ */ jsx26("p", { className: "caption-1 text-gray-500", children: bottomText }),
4294
2370
  " ",
4295
- showError && /* @__PURE__ */ jsx26("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2371
+ error && /* @__PURE__ */ jsx26("p", { className: "caption-1 text-red-500 ", children: error })
4296
2372
  ] })
4297
2373
  ] })
4298
2374
  }
@@ -4307,10 +2383,9 @@ function SelectFieldGroup({
4307
2383
  onChange,
4308
2384
  placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
4309
2385
  title,
4310
- require: require2,
2386
+ required,
4311
2387
  bottomText,
4312
- showError,
4313
- errorMessage,
2388
+ error,
4314
2389
  disabled,
4315
2390
  defaultValue,
4316
2391
  options,
@@ -4332,7 +2407,7 @@ function SelectFieldGroup({
4332
2407
  /* @__PURE__ */ jsxs23("div", { children: [
4333
2408
  /* @__PURE__ */ jsx27("span", { className: "body-1", children: title }),
4334
2409
  " ",
4335
- require2 && /* @__PURE__ */ jsx27("span", { className: "text-red-500", children: "*" })
2410
+ required && /* @__PURE__ */ jsx27("span", { className: "text-red-500", children: "*" })
4336
2411
  ] }),
4337
2412
  /* @__PURE__ */ jsx27(
4338
2413
  Select2,
@@ -4368,7 +2443,7 @@ function SelectFieldGroup({
4368
2443
  /* @__PURE__ */ jsxs23("div", { children: [
4369
2444
  /* @__PURE__ */ jsx27("p", { className: "caption-1 text-gray-500", children: bottomText }),
4370
2445
  " ",
4371
- showError && /* @__PURE__ */ jsx27("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2446
+ error && /* @__PURE__ */ jsx27("p", { className: "caption-1 text-red-500 ", children: error })
4372
2447
  ] })
4373
2448
  ] })
4374
2449
  }
@@ -4395,11 +2470,10 @@ function SelectFieldStatus({
4395
2470
  onChange,
4396
2471
  placeholder,
4397
2472
  title,
4398
- require: require2,
2473
+ required,
4399
2474
  bottomText,
4400
2475
  disabled,
4401
- showError,
4402
- errorMessage,
2476
+ error,
4403
2477
  options,
4404
2478
  className
4405
2479
  }) {
@@ -4424,7 +2498,7 @@ function SelectFieldStatus({
4424
2498
  /* @__PURE__ */ jsxs24("div", { children: [
4425
2499
  /* @__PURE__ */ jsx28("span", { className: "body-1", children: title }),
4426
2500
  " ",
4427
- require2 && /* @__PURE__ */ jsx28("span", { className: "text-red-500", children: "*" })
2501
+ required && /* @__PURE__ */ jsx28("span", { className: "text-red-500", children: "*" })
4428
2502
  ] }),
4429
2503
  /* @__PURE__ */ jsx28(
4430
2504
  Select3,
@@ -4444,7 +2518,7 @@ function SelectFieldStatus({
4444
2518
  /* @__PURE__ */ jsxs24("div", { children: [
4445
2519
  /* @__PURE__ */ jsx28("p", { className: "caption-1 text-gray-500", children: bottomText }),
4446
2520
  " ",
4447
- showError && /* @__PURE__ */ jsx28("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2521
+ error && /* @__PURE__ */ jsx28("p", { className: "caption-1 text-red-500 ", children: error })
4448
2522
  ] })
4449
2523
  ] })
4450
2524
  }
@@ -4468,11 +2542,10 @@ function SelectFieldStatusReport({
4468
2542
  onChange,
4469
2543
  placeholder,
4470
2544
  title,
4471
- require: require2,
2545
+ required,
4472
2546
  bottomText,
4473
2547
  disabled,
4474
- showError,
4475
- errorMessage,
2548
+ error,
4476
2549
  className,
4477
2550
  options
4478
2551
  }) {
@@ -4497,7 +2570,7 @@ function SelectFieldStatusReport({
4497
2570
  /* @__PURE__ */ jsxs25("div", { children: [
4498
2571
  /* @__PURE__ */ jsx29("span", { className: "body-1", children: title }),
4499
2572
  " ",
4500
- require2 && /* @__PURE__ */ jsx29("span", { className: "text-red-500", children: "*" })
2573
+ required && /* @__PURE__ */ jsx29("span", { className: "text-red-500", children: "*" })
4501
2574
  ] }),
4502
2575
  /* @__PURE__ */ jsx29(
4503
2576
  Select4,
@@ -4517,7 +2590,7 @@ function SelectFieldStatusReport({
4517
2590
  /* @__PURE__ */ jsxs25("div", { children: [
4518
2591
  /* @__PURE__ */ jsx29("p", { className: "caption-1 text-gray-500", children: bottomText }),
4519
2592
  " ",
4520
- showError && /* @__PURE__ */ jsx29("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2593
+ error && /* @__PURE__ */ jsx29("p", { className: "caption-1 text-red-500 ", children: error })
4521
2594
  ] })
4522
2595
  ] })
4523
2596
  }
@@ -4530,12 +2603,11 @@ import { useState as useState6 } from "react";
4530
2603
  import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
4531
2604
  function SelectFieldTag({
4532
2605
  title,
4533
- require: require2,
2606
+ required,
4534
2607
  bottomText,
4535
2608
  placeholder,
4536
2609
  options,
4537
- showError,
4538
- errorMessage,
2610
+ error,
4539
2611
  value: controlledValue,
4540
2612
  className,
4541
2613
  onChange,
@@ -4574,7 +2646,7 @@ function SelectFieldTag({
4574
2646
  /* @__PURE__ */ jsxs26("div", { children: [
4575
2647
  /* @__PURE__ */ jsx30("span", { className: "body-1", children: title }),
4576
2648
  " ",
4577
- require2 && /* @__PURE__ */ jsx30("span", { className: "text-red-500", children: "*" })
2649
+ required && /* @__PURE__ */ jsx30("span", { className: "text-red-500", children: "*" })
4578
2650
  ] }),
4579
2651
  /* @__PURE__ */ jsx30(
4580
2652
  Select5,
@@ -4598,7 +2670,7 @@ function SelectFieldTag({
4598
2670
  /* @__PURE__ */ jsxs26("div", { children: [
4599
2671
  /* @__PURE__ */ jsx30("p", { className: "caption-1 text-gray-500", children: bottomText }),
4600
2672
  " ",
4601
- showError && /* @__PURE__ */ jsx30("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2673
+ error && /* @__PURE__ */ jsx30("p", { className: "caption-1 text-red-500 ", children: error })
4602
2674
  ] })
4603
2675
  ] })
4604
2676
  }
@@ -4614,11 +2686,10 @@ function SelectCustom({
4614
2686
  title = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
4615
2687
  placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
4616
2688
  options,
4617
- require: require2 = false,
2689
+ required = false,
4618
2690
  onChange,
4619
2691
  bottomText,
4620
- showError,
4621
- errorMessage,
2692
+ error,
4622
2693
  onClear
4623
2694
  }) {
4624
2695
  const [value, setValue] = useState7([]);
@@ -4653,7 +2724,7 @@ function SelectCustom({
4653
2724
  /* @__PURE__ */ jsxs27("div", { children: [
4654
2725
  /* @__PURE__ */ jsx31("span", { className: "body-1", children: title }),
4655
2726
  " ",
4656
- require2 && /* @__PURE__ */ jsx31("span", { className: "text-red-500", children: "*" })
2727
+ required && /* @__PURE__ */ jsx31("span", { className: "text-red-500", children: "*" })
4657
2728
  ] }),
4658
2729
  /* @__PURE__ */ jsx31(
4659
2730
  Select6,
@@ -4669,31 +2740,18 @@ function SelectCustom({
4669
2740
  /* @__PURE__ */ jsxs27("div", { children: [
4670
2741
  /* @__PURE__ */ jsx31("p", { className: "caption-1 text-gray-500", children: bottomText }),
4671
2742
  " ",
4672
- showError && /* @__PURE__ */ jsx31("p", { className: "caption-1 text-red-500 ", children: errorMessage })
2743
+ error && /* @__PURE__ */ jsx31("p", { className: "caption-1 text-red-500 ", children: error })
4673
2744
  ] }),
4674
- /* @__PURE__ */ jsx31("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ jsxs27(
4675
- "div",
4676
- {
4677
- className: "flex justify-between items-center py-[2px] body-1",
4678
- children: [
4679
- /* @__PURE__ */ jsxs27("div", { className: "flex flex-row gap-[8px]", children: [
4680
- /* @__PURE__ */ jsxs27("p", { children: [
4681
- index + 1,
4682
- "."
4683
- ] }),
4684
- /* @__PURE__ */ jsx31("p", { children: v })
4685
- ] }),
4686
- /* @__PURE__ */ jsx31(
4687
- IconTrash,
4688
- {
4689
- className: "cursor-pointer",
4690
- onClick: () => handleDelete(v)
4691
- }
4692
- )
4693
- ]
4694
- },
4695
- index
4696
- )) })
2745
+ /* @__PURE__ */ jsx31("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ jsxs27("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
2746
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-row gap-[8px]", children: [
2747
+ /* @__PURE__ */ jsxs27("p", { children: [
2748
+ index + 1,
2749
+ "."
2750
+ ] }),
2751
+ /* @__PURE__ */ jsx31("p", { children: v })
2752
+ ] }),
2753
+ /* @__PURE__ */ jsx31(IconTrash, { className: "cursor-pointer", onClick: () => handleDelete(v) })
2754
+ ] }, index)) })
4697
2755
  ] })
4698
2756
  }
4699
2757
  );
@@ -5131,7 +3189,7 @@ function ProgressBar({
5131
3189
  }
5132
3190
 
5133
3191
  // src/KpiSection/KpiSection.tsx
5134
- import { ConfigProvider as ConfigProvider20, message as message2 } from "antd";
3192
+ import { ConfigProvider as ConfigProvider20, message } from "antd";
5135
3193
  import { useEffect as useEffect3, useState as useState12 } from "react";
5136
3194
 
5137
3195
  // src/KpiSection/hooks/useGetKpiSection.ts
@@ -5281,13 +3339,7 @@ function useGetKpiSection() {
5281
3339
  }
5282
3340
 
5283
3341
  // src/KpiSection/KpiSection.tsx
5284
- import {
5285
- IconCheck as IconCheck2,
5286
- IconCirclePlus,
5287
- IconPencil,
5288
- IconTrash as IconTrash3,
5289
- IconX as IconX2
5290
- } from "@tabler/icons-react";
3342
+ import { IconCheck as IconCheck2, IconCirclePlus, IconPencil, IconTrash as IconTrash3, IconX as IconX2 } from "@tabler/icons-react";
5291
3343
  import { Fragment as Fragment6, jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
5292
3344
  function KpiSection({ type, onChangeKpiList }) {
5293
3345
  const {
@@ -5308,7 +3360,7 @@ function KpiSection({ type, onChangeKpiList }) {
5308
3360
  itemErrors,
5309
3361
  setItemErrors
5310
3362
  } = useGetKpiSection();
5311
- const [messageApi2, messageContainer] = message2.useMessage();
3363
+ const [messageApi2, messageContainer] = message.useMessage();
5312
3364
  const [hasShownError, setHasShownError] = useState12(false);
5313
3365
  useEffect3(() => {
5314
3366
  setMessageApi(messageApi2);
@@ -5337,11 +3389,10 @@ function KpiSection({ type, onChangeKpiList }) {
5337
3389
  value: nameKpi,
5338
3390
  title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
5339
3391
  placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
5340
- require: true,
3392
+ required: true,
5341
3393
  onChange: (value) => setNameKpi(value ?? ""),
5342
3394
  className: "h-[32px]",
5343
- showError: !!errors.nameKpi,
5344
- errorMessage: errors.nameKpi
3395
+ error: errors.nameKpi
5345
3396
  }
5346
3397
  ),
5347
3398
  /* @__PURE__ */ jsx37(
@@ -5350,7 +3401,7 @@ function KpiSection({ type, onChangeKpiList }) {
5350
3401
  value: kpiValue,
5351
3402
  title: "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
5352
3403
  placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
5353
- require: true,
3404
+ required: true,
5354
3405
  onChange: (value) => {
5355
3406
  if (value === void 0 || value === "") {
5356
3407
  setKpiValue("");
@@ -5365,8 +3416,7 @@ function KpiSection({ type, onChangeKpiList }) {
5365
3416
  }
5366
3417
  }
5367
3418
  },
5368
- showError: !!errors.kpiValue,
5369
- errorMessage: errors.kpiValue
3419
+ error: errors.kpiValue
5370
3420
  }
5371
3421
  ),
5372
3422
  /* @__PURE__ */ jsx37(
@@ -5375,27 +3425,20 @@ function KpiSection({ type, onChangeKpiList }) {
5375
3425
  value: unitValue,
5376
3426
  title: "\u0E2B\u0E19\u0E48\u0E27\u0E22",
5377
3427
  placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
5378
- require: true,
3428
+ required: true,
5379
3429
  onChange: (value) => setUnitValue(value ?? ""),
5380
3430
  className: "h-[32px]",
5381
- showError: !!errors.unitValue,
5382
- errorMessage: errors.unitValue
3431
+ error: errors.unitValue
5383
3432
  }
5384
3433
  ),
5385
- /* @__PURE__ */ jsx37(
5386
- "div",
3434
+ /* @__PURE__ */ jsx37("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx37(
3435
+ IconCirclePlus,
5387
3436
  {
5388
- className: `flex justify-end mt-[28px]`,
5389
- children: /* @__PURE__ */ jsx37(
5390
- IconCirclePlus,
5391
- {
5392
- className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
5393
- stroke: 1,
5394
- onClick: () => handleAddKpi(type)
5395
- }
5396
- )
3437
+ className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
3438
+ stroke: 1,
3439
+ onClick: () => handleAddKpi(type)
5397
3440
  }
5398
- )
3441
+ ) })
5399
3442
  ] }),
5400
3443
  /* @__PURE__ */ jsx37("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs32(
5401
3444
  "div",
@@ -5412,12 +3455,9 @@ function KpiSection({ type, onChangeKpiList }) {
5412
3455
  {
5413
3456
  value: kpi.name,
5414
3457
  onChange: (value) => setKpiList(
5415
- (prev) => prev.map(
5416
- (item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
5417
- )
3458
+ (prev) => prev.map((item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item)
5418
3459
  ),
5419
- showError: !!itemErrors[kpi.id]?.name,
5420
- errorMessage: itemErrors[kpi.id]?.name
3460
+ error: itemErrors[kpi.id]?.name
5421
3461
  }
5422
3462
  ),
5423
3463
  /* @__PURE__ */ jsx37(
@@ -5427,16 +3467,12 @@ function KpiSection({ type, onChangeKpiList }) {
5427
3467
  onChange: (value) => {
5428
3468
  if (value === void 0 || value === "") {
5429
3469
  setKpiList(
5430
- (prev) => prev.map(
5431
- (item) => item.id === kpi.id ? { ...item, value: "" } : item
5432
- )
3470
+ (prev) => prev.map((item) => item.id === kpi.id ? { ...item, value: "" } : item)
5433
3471
  );
5434
3472
  setHasShownError(false);
5435
3473
  } else if (/^\d*\.?\d*$/.test(value)) {
5436
3474
  setKpiList(
5437
- (prev) => prev.map(
5438
- (item) => item.id === kpi.id ? { ...item, value } : item
5439
- )
3475
+ (prev) => prev.map((item) => item.id === kpi.id ? { ...item, value } : item)
5440
3476
  );
5441
3477
  setHasShownError(false);
5442
3478
  } else {
@@ -5446,8 +3482,7 @@ function KpiSection({ type, onChangeKpiList }) {
5446
3482
  }
5447
3483
  }
5448
3484
  },
5449
- showError: !!itemErrors[kpi.id]?.value,
5450
- errorMessage: itemErrors[kpi.id]?.value
3485
+ error: itemErrors[kpi.id]?.value
5451
3486
  }
5452
3487
  ),
5453
3488
  /* @__PURE__ */ jsx37(
@@ -5455,12 +3490,9 @@ function KpiSection({ type, onChangeKpiList }) {
5455
3490
  {
5456
3491
  value: kpi.unit,
5457
3492
  onChange: (value) => setKpiList(
5458
- (prev) => prev.map(
5459
- (item) => item.id === kpi.id ? { ...item, unit: value ?? "" } : item
5460
- )
3493
+ (prev) => prev.map((item) => item.id === kpi.id ? { ...item, unit: value ?? "" } : item)
5461
3494
  ),
5462
- showError: !!itemErrors[kpi.id]?.unit,
5463
- errorMessage: itemErrors[kpi.id]?.unit
3495
+ error: itemErrors[kpi.id]?.unit
5464
3496
  }
5465
3497
  ),
5466
3498
  /* @__PURE__ */ jsxs32(
@@ -5475,13 +3507,7 @@ function KpiSection({ type, onChangeKpiList }) {
5475
3507
  onClick: () => handleSave(kpi.id, type)
5476
3508
  }
5477
3509
  ),
5478
- /* @__PURE__ */ jsx37(
5479
- IconX2,
5480
- {
5481
- className: "w-[30px] h-[30px] cursor-pointer",
5482
- onClick: () => handleCancel(kpi.id)
5483
- }
5484
- )
3510
+ /* @__PURE__ */ jsx37(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
5485
3511
  ]
5486
3512
  }
5487
3513
  )
@@ -5490,20 +3516,8 @@ function KpiSection({ type, onChangeKpiList }) {
5490
3516
  /* @__PURE__ */ jsx37("p", { className: "body-1", children: kpi.value }),
5491
3517
  /* @__PURE__ */ jsx37("p", { className: "body-1", children: kpi.unit }),
5492
3518
  /* @__PURE__ */ jsxs32("div", { className: "flex gap-3 justify-end", children: [
5493
- /* @__PURE__ */ jsx37(
5494
- IconPencil,
5495
- {
5496
- className: "w-[30px] h-[30px] cursor-pointer",
5497
- onClick: () => handleEdit(kpi.id)
5498
- }
5499
- ),
5500
- /* @__PURE__ */ jsx37(
5501
- IconTrash3,
5502
- {
5503
- className: "w-[30px] h-[30px] cursor-pointer",
5504
- onClick: () => handleDelete(kpi.id)
5505
- }
5506
- )
3519
+ /* @__PURE__ */ jsx37(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
3520
+ /* @__PURE__ */ jsx37(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
5507
3521
  ] })
5508
3522
  ] })
5509
3523
  ]
@@ -5519,96 +3533,61 @@ function KpiSection({ type, onChangeKpiList }) {
5519
3533
  value: nameKpi,
5520
3534
  title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
5521
3535
  placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
5522
- require: true,
3536
+ required: true,
5523
3537
  onChange: (value) => setNameKpi(value ?? ""),
5524
3538
  className: "h-[32px]",
5525
- showError: !!errors.nameKpi,
5526
- errorMessage: errors.nameKpi
3539
+ error: errors.nameKpi
5527
3540
  }
5528
3541
  ),
5529
- /* @__PURE__ */ jsx37(
5530
- "div",
3542
+ /* @__PURE__ */ jsx37("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ jsx37(
3543
+ IconCirclePlus,
5531
3544
  {
5532
- className: `flex justify-end mt-[28px]`,
5533
- children: /* @__PURE__ */ jsx37(
5534
- IconCirclePlus,
5535
- {
5536
- className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
5537
- stroke: 1,
5538
- onClick: () => handleAddKpi(type)
5539
- }
5540
- )
3545
+ className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
3546
+ stroke: 1,
3547
+ onClick: () => handleAddKpi(type)
5541
3548
  }
5542
- )
3549
+ ) })
5543
3550
  ] }),
5544
- /* @__PURE__ */ jsx37("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs32(
5545
- "div",
5546
- {
5547
- className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]",
5548
- children: [
5549
- /* @__PURE__ */ jsxs32("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
5550
- index + 1,
5551
- "."
5552
- ] }),
5553
- kpi.isEditing ? /* @__PURE__ */ jsxs32(Fragment6, { children: [
5554
- /* @__PURE__ */ jsx37(
5555
- InputField,
5556
- {
5557
- value: kpi.name,
5558
- onChange: (value) => setKpiList(
5559
- (prev) => prev.map(
5560
- (item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
5561
- )
5562
- ),
5563
- showError: !!itemErrors[kpi.id]?.name,
5564
- errorMessage: itemErrors[kpi.id]?.name
5565
- }
3551
+ /* @__PURE__ */ jsx37("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs32("div", { className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]", children: [
3552
+ /* @__PURE__ */ jsxs32("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
3553
+ index + 1,
3554
+ "."
3555
+ ] }),
3556
+ kpi.isEditing ? /* @__PURE__ */ jsxs32(Fragment6, { children: [
3557
+ /* @__PURE__ */ jsx37(
3558
+ InputField,
3559
+ {
3560
+ value: kpi.name,
3561
+ onChange: (value) => setKpiList(
3562
+ (prev) => prev.map((item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item)
5566
3563
  ),
5567
- /* @__PURE__ */ jsxs32(
5568
- "div",
5569
- {
5570
- className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
5571
- children: [
5572
- /* @__PURE__ */ jsx37(
5573
- IconCheck2,
5574
- {
5575
- className: "w-[30px] h-[30px] cursor-pointer",
5576
- onClick: () => handleSave(kpi.id, type)
5577
- }
5578
- ),
5579
- /* @__PURE__ */ jsx37(
5580
- IconX2,
5581
- {
5582
- className: "w-[30px] h-[30px] cursor-pointer",
5583
- onClick: () => handleCancel(kpi.id)
5584
- }
5585
- )
5586
- ]
5587
- }
5588
- )
5589
- ] }) : /* @__PURE__ */ jsxs32(Fragment6, { children: [
5590
- /* @__PURE__ */ jsx37("p", { className: "body-1", children: kpi.name }),
5591
- /* @__PURE__ */ jsxs32("div", { className: "flex gap-3 justify-end", children: [
3564
+ error: itemErrors[kpi.id]?.name
3565
+ }
3566
+ ),
3567
+ /* @__PURE__ */ jsxs32(
3568
+ "div",
3569
+ {
3570
+ className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
3571
+ children: [
5592
3572
  /* @__PURE__ */ jsx37(
5593
- IconPencil,
3573
+ IconCheck2,
5594
3574
  {
5595
3575
  className: "w-[30px] h-[30px] cursor-pointer",
5596
- onClick: () => handleEdit(kpi.id)
3576
+ onClick: () => handleSave(kpi.id, type)
5597
3577
  }
5598
3578
  ),
5599
- /* @__PURE__ */ jsx37(
5600
- IconTrash3,
5601
- {
5602
- className: "w-[30px] h-[30px] cursor-pointer",
5603
- onClick: () => handleDelete(kpi.id)
5604
- }
5605
- )
5606
- ] })
5607
- ] })
5608
- ]
5609
- },
5610
- kpi.id
5611
- )) })
3579
+ /* @__PURE__ */ jsx37(IconX2, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
3580
+ ]
3581
+ }
3582
+ )
3583
+ ] }) : /* @__PURE__ */ jsxs32(Fragment6, { children: [
3584
+ /* @__PURE__ */ jsx37("p", { className: "body-1", children: kpi.name }),
3585
+ /* @__PURE__ */ jsxs32("div", { className: "flex gap-3 justify-end", children: [
3586
+ /* @__PURE__ */ jsx37(IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
3587
+ /* @__PURE__ */ jsx37(IconTrash3, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
3588
+ ] })
3589
+ ] })
3590
+ ] }, kpi.id)) })
5612
3591
  ] })
5613
3592
  ] })
5614
3593
  }