@otfdashkit/ui 0.1.0 → 0.1.1

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.
Files changed (4) hide show
  1. package/README.md +112 -0
  2. package/dist/index.js +96 -1801
  3. package/dist/index.mjs +40 -1745
  4. package/package.json +23 -5
package/dist/index.mjs CHANGED
@@ -42,6 +42,7 @@ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
42
42
  import * as TogglePrimitive from '@radix-ui/react-toggle';
43
43
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
44
44
  import { useReactTable, getCoreRowModel, flexRender, getFilteredRowModel, getSortedRowModel, getPaginationRowModel } from '@tanstack/react-table';
45
+ import { addDays, format, startOfWeek as startOfWeek$1, isSameMonth, isSameDay as isSameDay$1, endOfDay, startOfDay, endOfWeek, endOfMonth, startOfMonth, differenceInCalendarDays, differenceInCalendarWeeks, differenceInCalendarMonths, addMonths, addWeeks, addHours, differenceInMinutes } from 'date-fns';
45
46
  import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, pointerWithin, useDraggable, useDroppable, DragOverlay, closestCenter } from '@dnd-kit/core';
46
47
  import { useSortable, SortableContext, verticalListSortingStrategy, sortableKeyboardCoordinates, arrayMove } from '@dnd-kit/sortable';
47
48
  import { CSS } from '@dnd-kit/utilities';
@@ -362,7 +363,7 @@ function Calendar({
362
363
  showOutsideDays = true,
363
364
  captionLayout = "label",
364
365
  buttonVariant = "ghost",
365
- formatters: formatters2,
366
+ formatters,
366
367
  components,
367
368
  ...props
368
369
  }) {
@@ -380,7 +381,7 @@ function Calendar({
380
381
  captionLayout,
381
382
  formatters: {
382
383
  formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
383
- ...formatters2
384
+ ...formatters
384
385
  },
385
386
  classNames: {
386
387
  root: cn("w-fit", defaultClassNames.root),
@@ -5393,1712 +5394,6 @@ function Filters({ filters, value, onChange, className }) {
5393
5394
  /* @__PURE__ */ jsx(AddFilterPopover, { filters, onAdd: (fv) => onChange([...value, fv]) })
5394
5395
  ] });
5395
5396
  }
5396
- var millisecondsInWeek = 6048e5;
5397
- var millisecondsInDay = 864e5;
5398
- var millisecondsInMinute = 6e4;
5399
- var millisecondsInHour = 36e5;
5400
- var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
5401
-
5402
- // node_modules/date-fns/constructFrom.js
5403
- function constructFrom(date, value) {
5404
- if (typeof date === "function") return date(value);
5405
- if (date && typeof date === "object" && constructFromSymbol in date)
5406
- return date[constructFromSymbol](value);
5407
- if (date instanceof Date) return new date.constructor(value);
5408
- return new Date(value);
5409
- }
5410
-
5411
- // node_modules/date-fns/toDate.js
5412
- function toDate(argument, context) {
5413
- return constructFrom(context || argument, argument);
5414
- }
5415
-
5416
- // node_modules/date-fns/addDays.js
5417
- function addDays(date, amount, options) {
5418
- const _date = toDate(date, options?.in);
5419
- if (isNaN(amount)) return constructFrom(date, NaN);
5420
- if (!amount) return _date;
5421
- _date.setDate(_date.getDate() + amount);
5422
- return _date;
5423
- }
5424
-
5425
- // node_modules/date-fns/addMonths.js
5426
- function addMonths(date, amount, options) {
5427
- const _date = toDate(date, options?.in);
5428
- if (isNaN(amount)) return constructFrom(date, NaN);
5429
- if (!amount) {
5430
- return _date;
5431
- }
5432
- const dayOfMonth = _date.getDate();
5433
- const endOfDesiredMonth = constructFrom(date, _date.getTime());
5434
- endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
5435
- const daysInMonth = endOfDesiredMonth.getDate();
5436
- if (dayOfMonth >= daysInMonth) {
5437
- return endOfDesiredMonth;
5438
- } else {
5439
- _date.setFullYear(
5440
- endOfDesiredMonth.getFullYear(),
5441
- endOfDesiredMonth.getMonth(),
5442
- dayOfMonth
5443
- );
5444
- return _date;
5445
- }
5446
- }
5447
-
5448
- // node_modules/date-fns/addMilliseconds.js
5449
- function addMilliseconds(date, amount, options) {
5450
- return constructFrom(date, +toDate(date) + amount);
5451
- }
5452
-
5453
- // node_modules/date-fns/addHours.js
5454
- function addHours(date, amount, options) {
5455
- return addMilliseconds(date, amount * millisecondsInHour);
5456
- }
5457
-
5458
- // node_modules/date-fns/_lib/defaultOptions.js
5459
- var defaultOptions = {};
5460
- function getDefaultOptions() {
5461
- return defaultOptions;
5462
- }
5463
-
5464
- // node_modules/date-fns/startOfWeek.js
5465
- function startOfWeek2(date, options) {
5466
- const defaultOptions2 = getDefaultOptions();
5467
- const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
5468
- const _date = toDate(date, options?.in);
5469
- const day = _date.getDay();
5470
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
5471
- _date.setDate(_date.getDate() - diff);
5472
- _date.setHours(0, 0, 0, 0);
5473
- return _date;
5474
- }
5475
-
5476
- // node_modules/date-fns/startOfISOWeek.js
5477
- function startOfISOWeek(date, options) {
5478
- return startOfWeek2(date, { ...options, weekStartsOn: 1 });
5479
- }
5480
-
5481
- // node_modules/date-fns/getISOWeekYear.js
5482
- function getISOWeekYear(date, options) {
5483
- const _date = toDate(date, options?.in);
5484
- const year = _date.getFullYear();
5485
- const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
5486
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
5487
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
5488
- const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
5489
- const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
5490
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
5491
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
5492
- const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
5493
- if (_date.getTime() >= startOfNextYear.getTime()) {
5494
- return year + 1;
5495
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
5496
- return year;
5497
- } else {
5498
- return year - 1;
5499
- }
5500
- }
5501
-
5502
- // node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
5503
- function getTimezoneOffsetInMilliseconds(date) {
5504
- const _date = toDate(date);
5505
- const utcDate = new Date(
5506
- Date.UTC(
5507
- _date.getFullYear(),
5508
- _date.getMonth(),
5509
- _date.getDate(),
5510
- _date.getHours(),
5511
- _date.getMinutes(),
5512
- _date.getSeconds(),
5513
- _date.getMilliseconds()
5514
- )
5515
- );
5516
- utcDate.setUTCFullYear(_date.getFullYear());
5517
- return +date - +utcDate;
5518
- }
5519
-
5520
- // node_modules/date-fns/_lib/normalizeDates.js
5521
- function normalizeDates(context, ...dates) {
5522
- const normalize = constructFrom.bind(
5523
- null,
5524
- context || dates.find((date) => typeof date === "object")
5525
- );
5526
- return dates.map(normalize);
5527
- }
5528
-
5529
- // node_modules/date-fns/startOfDay.js
5530
- function startOfDay(date, options) {
5531
- const _date = toDate(date, options?.in);
5532
- _date.setHours(0, 0, 0, 0);
5533
- return _date;
5534
- }
5535
-
5536
- // node_modules/date-fns/differenceInCalendarDays.js
5537
- function differenceInCalendarDays(laterDate, earlierDate, options) {
5538
- const [laterDate_, earlierDate_] = normalizeDates(
5539
- options?.in,
5540
- laterDate,
5541
- earlierDate
5542
- );
5543
- const laterStartOfDay = startOfDay(laterDate_);
5544
- const earlierStartOfDay = startOfDay(earlierDate_);
5545
- const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
5546
- const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
5547
- return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
5548
- }
5549
-
5550
- // node_modules/date-fns/startOfISOWeekYear.js
5551
- function startOfISOWeekYear(date, options) {
5552
- const year = getISOWeekYear(date, options);
5553
- const fourthOfJanuary = constructFrom(date, 0);
5554
- fourthOfJanuary.setFullYear(year, 0, 4);
5555
- fourthOfJanuary.setHours(0, 0, 0, 0);
5556
- return startOfISOWeek(fourthOfJanuary);
5557
- }
5558
-
5559
- // node_modules/date-fns/addWeeks.js
5560
- function addWeeks(date, amount, options) {
5561
- return addDays(date, amount * 7, options);
5562
- }
5563
-
5564
- // node_modules/date-fns/isSameDay.js
5565
- function isSameDay(laterDate, earlierDate, options) {
5566
- const [dateLeft_, dateRight_] = normalizeDates(
5567
- options?.in,
5568
- laterDate,
5569
- earlierDate
5570
- );
5571
- return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
5572
- }
5573
-
5574
- // node_modules/date-fns/isDate.js
5575
- function isDate(value) {
5576
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
5577
- }
5578
-
5579
- // node_modules/date-fns/isValid.js
5580
- function isValid(date) {
5581
- return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
5582
- }
5583
-
5584
- // node_modules/date-fns/differenceInCalendarMonths.js
5585
- function differenceInCalendarMonths(laterDate, earlierDate, options) {
5586
- const [laterDate_, earlierDate_] = normalizeDates(
5587
- options?.in,
5588
- laterDate,
5589
- earlierDate
5590
- );
5591
- const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
5592
- const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
5593
- return yearsDiff * 12 + monthsDiff;
5594
- }
5595
-
5596
- // node_modules/date-fns/differenceInCalendarWeeks.js
5597
- function differenceInCalendarWeeks(laterDate, earlierDate, options) {
5598
- const [laterDate_, earlierDate_] = normalizeDates(
5599
- options?.in,
5600
- laterDate,
5601
- earlierDate
5602
- );
5603
- const laterStartOfWeek = startOfWeek2(laterDate_, options);
5604
- const earlierStartOfWeek = startOfWeek2(earlierDate_, options);
5605
- const laterTimestamp = +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);
5606
- const earlierTimestamp = +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);
5607
- return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);
5608
- }
5609
-
5610
- // node_modules/date-fns/_lib/getRoundingMethod.js
5611
- function getRoundingMethod(method) {
5612
- return (number) => {
5613
- const round = Math.trunc;
5614
- const result = round(number);
5615
- return result === 0 ? 0 : result;
5616
- };
5617
- }
5618
-
5619
- // node_modules/date-fns/differenceInMilliseconds.js
5620
- function differenceInMilliseconds(laterDate, earlierDate) {
5621
- return +toDate(laterDate) - +toDate(earlierDate);
5622
- }
5623
-
5624
- // node_modules/date-fns/differenceInMinutes.js
5625
- function differenceInMinutes(dateLeft, dateRight, options) {
5626
- const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
5627
- return getRoundingMethod()(diff);
5628
- }
5629
-
5630
- // node_modules/date-fns/endOfDay.js
5631
- function endOfDay(date, options) {
5632
- const _date = toDate(date, options?.in);
5633
- _date.setHours(23, 59, 59, 999);
5634
- return _date;
5635
- }
5636
-
5637
- // node_modules/date-fns/endOfMonth.js
5638
- function endOfMonth(date, options) {
5639
- const _date = toDate(date, options?.in);
5640
- const month = _date.getMonth();
5641
- _date.setFullYear(_date.getFullYear(), month + 1, 0);
5642
- _date.setHours(23, 59, 59, 999);
5643
- return _date;
5644
- }
5645
-
5646
- // node_modules/date-fns/startOfMonth.js
5647
- function startOfMonth(date, options) {
5648
- const _date = toDate(date, options?.in);
5649
- _date.setDate(1);
5650
- _date.setHours(0, 0, 0, 0);
5651
- return _date;
5652
- }
5653
-
5654
- // node_modules/date-fns/startOfYear.js
5655
- function startOfYear(date, options) {
5656
- const date_ = toDate(date, options?.in);
5657
- date_.setFullYear(date_.getFullYear(), 0, 1);
5658
- date_.setHours(0, 0, 0, 0);
5659
- return date_;
5660
- }
5661
-
5662
- // node_modules/date-fns/endOfWeek.js
5663
- function endOfWeek(date, options) {
5664
- const weekStartsOn = options?.weekStartsOn;
5665
- const _date = toDate(date, options?.in);
5666
- const day = _date.getDay();
5667
- const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
5668
- _date.setDate(_date.getDate() + diff);
5669
- _date.setHours(23, 59, 59, 999);
5670
- return _date;
5671
- }
5672
-
5673
- // node_modules/date-fns/locale/en-US/_lib/formatDistance.js
5674
- var formatDistanceLocale = {
5675
- lessThanXSeconds: {
5676
- one: "less than a second",
5677
- other: "less than {{count}} seconds"
5678
- },
5679
- xSeconds: {
5680
- one: "1 second",
5681
- other: "{{count}} seconds"
5682
- },
5683
- halfAMinute: "half a minute",
5684
- lessThanXMinutes: {
5685
- one: "less than a minute",
5686
- other: "less than {{count}} minutes"
5687
- },
5688
- xMinutes: {
5689
- one: "1 minute",
5690
- other: "{{count}} minutes"
5691
- },
5692
- aboutXHours: {
5693
- one: "about 1 hour",
5694
- other: "about {{count}} hours"
5695
- },
5696
- xHours: {
5697
- one: "1 hour",
5698
- other: "{{count}} hours"
5699
- },
5700
- xDays: {
5701
- one: "1 day",
5702
- other: "{{count}} days"
5703
- },
5704
- aboutXWeeks: {
5705
- one: "about 1 week",
5706
- other: "about {{count}} weeks"
5707
- },
5708
- xWeeks: {
5709
- one: "1 week",
5710
- other: "{{count}} weeks"
5711
- },
5712
- aboutXMonths: {
5713
- one: "about 1 month",
5714
- other: "about {{count}} months"
5715
- },
5716
- xMonths: {
5717
- one: "1 month",
5718
- other: "{{count}} months"
5719
- },
5720
- aboutXYears: {
5721
- one: "about 1 year",
5722
- other: "about {{count}} years"
5723
- },
5724
- xYears: {
5725
- one: "1 year",
5726
- other: "{{count}} years"
5727
- },
5728
- overXYears: {
5729
- one: "over 1 year",
5730
- other: "over {{count}} years"
5731
- },
5732
- almostXYears: {
5733
- one: "almost 1 year",
5734
- other: "almost {{count}} years"
5735
- }
5736
- };
5737
- var formatDistance = (token, count, options) => {
5738
- let result;
5739
- const tokenValue = formatDistanceLocale[token];
5740
- if (typeof tokenValue === "string") {
5741
- result = tokenValue;
5742
- } else if (count === 1) {
5743
- result = tokenValue.one;
5744
- } else {
5745
- result = tokenValue.other.replace("{{count}}", count.toString());
5746
- }
5747
- if (options?.addSuffix) {
5748
- if (options.comparison && options.comparison > 0) {
5749
- return "in " + result;
5750
- } else {
5751
- return result + " ago";
5752
- }
5753
- }
5754
- return result;
5755
- };
5756
-
5757
- // node_modules/date-fns/locale/_lib/buildFormatLongFn.js
5758
- function buildFormatLongFn(args) {
5759
- return (options = {}) => {
5760
- const width = options.width ? String(options.width) : args.defaultWidth;
5761
- const format2 = args.formats[width] || args.formats[args.defaultWidth];
5762
- return format2;
5763
- };
5764
- }
5765
-
5766
- // node_modules/date-fns/locale/en-US/_lib/formatLong.js
5767
- var dateFormats = {
5768
- full: "EEEE, MMMM do, y",
5769
- long: "MMMM do, y",
5770
- medium: "MMM d, y",
5771
- short: "MM/dd/yyyy"
5772
- };
5773
- var timeFormats = {
5774
- full: "h:mm:ss a zzzz",
5775
- long: "h:mm:ss a z",
5776
- medium: "h:mm:ss a",
5777
- short: "h:mm a"
5778
- };
5779
- var dateTimeFormats = {
5780
- full: "{{date}} 'at' {{time}}",
5781
- long: "{{date}} 'at' {{time}}",
5782
- medium: "{{date}}, {{time}}",
5783
- short: "{{date}}, {{time}}"
5784
- };
5785
- var formatLong = {
5786
- date: buildFormatLongFn({
5787
- formats: dateFormats,
5788
- defaultWidth: "full"
5789
- }),
5790
- time: buildFormatLongFn({
5791
- formats: timeFormats,
5792
- defaultWidth: "full"
5793
- }),
5794
- dateTime: buildFormatLongFn({
5795
- formats: dateTimeFormats,
5796
- defaultWidth: "full"
5797
- })
5798
- };
5799
-
5800
- // node_modules/date-fns/locale/en-US/_lib/formatRelative.js
5801
- var formatRelativeLocale = {
5802
- lastWeek: "'last' eeee 'at' p",
5803
- yesterday: "'yesterday at' p",
5804
- today: "'today at' p",
5805
- tomorrow: "'tomorrow at' p",
5806
- nextWeek: "eeee 'at' p",
5807
- other: "P"
5808
- };
5809
- var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
5810
-
5811
- // node_modules/date-fns/locale/_lib/buildLocalizeFn.js
5812
- function buildLocalizeFn(args) {
5813
- return (value, options) => {
5814
- const context = options?.context ? String(options.context) : "standalone";
5815
- let valuesArray;
5816
- if (context === "formatting" && args.formattingValues) {
5817
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
5818
- const width = options?.width ? String(options.width) : defaultWidth;
5819
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
5820
- } else {
5821
- const defaultWidth = args.defaultWidth;
5822
- const width = options?.width ? String(options.width) : args.defaultWidth;
5823
- valuesArray = args.values[width] || args.values[defaultWidth];
5824
- }
5825
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
5826
- return valuesArray[index];
5827
- };
5828
- }
5829
-
5830
- // node_modules/date-fns/locale/en-US/_lib/localize.js
5831
- var eraValues = {
5832
- narrow: ["B", "A"],
5833
- abbreviated: ["BC", "AD"],
5834
- wide: ["Before Christ", "Anno Domini"]
5835
- };
5836
- var quarterValues = {
5837
- narrow: ["1", "2", "3", "4"],
5838
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
5839
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
5840
- };
5841
- var monthValues = {
5842
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
5843
- abbreviated: [
5844
- "Jan",
5845
- "Feb",
5846
- "Mar",
5847
- "Apr",
5848
- "May",
5849
- "Jun",
5850
- "Jul",
5851
- "Aug",
5852
- "Sep",
5853
- "Oct",
5854
- "Nov",
5855
- "Dec"
5856
- ],
5857
- wide: [
5858
- "January",
5859
- "February",
5860
- "March",
5861
- "April",
5862
- "May",
5863
- "June",
5864
- "July",
5865
- "August",
5866
- "September",
5867
- "October",
5868
- "November",
5869
- "December"
5870
- ]
5871
- };
5872
- var dayValues = {
5873
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
5874
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
5875
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
5876
- wide: [
5877
- "Sunday",
5878
- "Monday",
5879
- "Tuesday",
5880
- "Wednesday",
5881
- "Thursday",
5882
- "Friday",
5883
- "Saturday"
5884
- ]
5885
- };
5886
- var dayPeriodValues = {
5887
- narrow: {
5888
- am: "a",
5889
- pm: "p",
5890
- midnight: "mi",
5891
- noon: "n",
5892
- morning: "morning",
5893
- afternoon: "afternoon",
5894
- evening: "evening",
5895
- night: "night"
5896
- },
5897
- abbreviated: {
5898
- am: "AM",
5899
- pm: "PM",
5900
- midnight: "midnight",
5901
- noon: "noon",
5902
- morning: "morning",
5903
- afternoon: "afternoon",
5904
- evening: "evening",
5905
- night: "night"
5906
- },
5907
- wide: {
5908
- am: "a.m.",
5909
- pm: "p.m.",
5910
- midnight: "midnight",
5911
- noon: "noon",
5912
- morning: "morning",
5913
- afternoon: "afternoon",
5914
- evening: "evening",
5915
- night: "night"
5916
- }
5917
- };
5918
- var formattingDayPeriodValues = {
5919
- narrow: {
5920
- am: "a",
5921
- pm: "p",
5922
- midnight: "mi",
5923
- noon: "n",
5924
- morning: "in the morning",
5925
- afternoon: "in the afternoon",
5926
- evening: "in the evening",
5927
- night: "at night"
5928
- },
5929
- abbreviated: {
5930
- am: "AM",
5931
- pm: "PM",
5932
- midnight: "midnight",
5933
- noon: "noon",
5934
- morning: "in the morning",
5935
- afternoon: "in the afternoon",
5936
- evening: "in the evening",
5937
- night: "at night"
5938
- },
5939
- wide: {
5940
- am: "a.m.",
5941
- pm: "p.m.",
5942
- midnight: "midnight",
5943
- noon: "noon",
5944
- morning: "in the morning",
5945
- afternoon: "in the afternoon",
5946
- evening: "in the evening",
5947
- night: "at night"
5948
- }
5949
- };
5950
- var ordinalNumber = (dirtyNumber, _options) => {
5951
- const number = Number(dirtyNumber);
5952
- const rem100 = number % 100;
5953
- if (rem100 > 20 || rem100 < 10) {
5954
- switch (rem100 % 10) {
5955
- case 1:
5956
- return number + "st";
5957
- case 2:
5958
- return number + "nd";
5959
- case 3:
5960
- return number + "rd";
5961
- }
5962
- }
5963
- return number + "th";
5964
- };
5965
- var localize = {
5966
- ordinalNumber,
5967
- era: buildLocalizeFn({
5968
- values: eraValues,
5969
- defaultWidth: "wide"
5970
- }),
5971
- quarter: buildLocalizeFn({
5972
- values: quarterValues,
5973
- defaultWidth: "wide",
5974
- argumentCallback: (quarter) => quarter - 1
5975
- }),
5976
- month: buildLocalizeFn({
5977
- values: monthValues,
5978
- defaultWidth: "wide"
5979
- }),
5980
- day: buildLocalizeFn({
5981
- values: dayValues,
5982
- defaultWidth: "wide"
5983
- }),
5984
- dayPeriod: buildLocalizeFn({
5985
- values: dayPeriodValues,
5986
- defaultWidth: "wide",
5987
- formattingValues: formattingDayPeriodValues,
5988
- defaultFormattingWidth: "wide"
5989
- })
5990
- };
5991
-
5992
- // node_modules/date-fns/locale/_lib/buildMatchFn.js
5993
- function buildMatchFn(args) {
5994
- return (string, options = {}) => {
5995
- const width = options.width;
5996
- const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
5997
- const matchResult = string.match(matchPattern);
5998
- if (!matchResult) {
5999
- return null;
6000
- }
6001
- const matchedString = matchResult[0];
6002
- const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
6003
- const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
6004
- // [TODO] -- I challenge you to fix the type
6005
- findKey(parsePatterns, (pattern) => pattern.test(matchedString))
6006
- );
6007
- let value;
6008
- value = args.valueCallback ? args.valueCallback(key) : key;
6009
- value = options.valueCallback ? (
6010
- // [TODO] -- I challenge you to fix the type
6011
- options.valueCallback(value)
6012
- ) : value;
6013
- const rest = string.slice(matchedString.length);
6014
- return { value, rest };
6015
- };
6016
- }
6017
- function findKey(object, predicate) {
6018
- for (const key in object) {
6019
- if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
6020
- return key;
6021
- }
6022
- }
6023
- return void 0;
6024
- }
6025
- function findIndex(array, predicate) {
6026
- for (let key = 0; key < array.length; key++) {
6027
- if (predicate(array[key])) {
6028
- return key;
6029
- }
6030
- }
6031
- return void 0;
6032
- }
6033
-
6034
- // node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
6035
- function buildMatchPatternFn(args) {
6036
- return (string, options = {}) => {
6037
- const matchResult = string.match(args.matchPattern);
6038
- if (!matchResult) return null;
6039
- const matchedString = matchResult[0];
6040
- const parseResult = string.match(args.parsePattern);
6041
- if (!parseResult) return null;
6042
- let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
6043
- value = options.valueCallback ? options.valueCallback(value) : value;
6044
- const rest = string.slice(matchedString.length);
6045
- return { value, rest };
6046
- };
6047
- }
6048
-
6049
- // node_modules/date-fns/locale/en-US/_lib/match.js
6050
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
6051
- var parseOrdinalNumberPattern = /\d+/i;
6052
- var matchEraPatterns = {
6053
- narrow: /^(b|a)/i,
6054
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
6055
- wide: /^(before christ|before common era|anno domini|common era)/i
6056
- };
6057
- var parseEraPatterns = {
6058
- any: [/^b/i, /^(a|c)/i]
6059
- };
6060
- var matchQuarterPatterns = {
6061
- narrow: /^[1234]/i,
6062
- abbreviated: /^q[1234]/i,
6063
- wide: /^[1234](th|st|nd|rd)? quarter/i
6064
- };
6065
- var parseQuarterPatterns = {
6066
- any: [/1/i, /2/i, /3/i, /4/i]
6067
- };
6068
- var matchMonthPatterns = {
6069
- narrow: /^[jfmasond]/i,
6070
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
6071
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
6072
- };
6073
- var parseMonthPatterns = {
6074
- narrow: [
6075
- /^j/i,
6076
- /^f/i,
6077
- /^m/i,
6078
- /^a/i,
6079
- /^m/i,
6080
- /^j/i,
6081
- /^j/i,
6082
- /^a/i,
6083
- /^s/i,
6084
- /^o/i,
6085
- /^n/i,
6086
- /^d/i
6087
- ],
6088
- any: [
6089
- /^ja/i,
6090
- /^f/i,
6091
- /^mar/i,
6092
- /^ap/i,
6093
- /^may/i,
6094
- /^jun/i,
6095
- /^jul/i,
6096
- /^au/i,
6097
- /^s/i,
6098
- /^o/i,
6099
- /^n/i,
6100
- /^d/i
6101
- ]
6102
- };
6103
- var matchDayPatterns = {
6104
- narrow: /^[smtwf]/i,
6105
- short: /^(su|mo|tu|we|th|fr|sa)/i,
6106
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
6107
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
6108
- };
6109
- var parseDayPatterns = {
6110
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
6111
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
6112
- };
6113
- var matchDayPeriodPatterns = {
6114
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
6115
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
6116
- };
6117
- var parseDayPeriodPatterns = {
6118
- any: {
6119
- am: /^a/i,
6120
- pm: /^p/i,
6121
- midnight: /^mi/i,
6122
- noon: /^no/i,
6123
- morning: /morning/i,
6124
- afternoon: /afternoon/i,
6125
- evening: /evening/i,
6126
- night: /night/i
6127
- }
6128
- };
6129
- var match = {
6130
- ordinalNumber: buildMatchPatternFn({
6131
- matchPattern: matchOrdinalNumberPattern,
6132
- parsePattern: parseOrdinalNumberPattern,
6133
- valueCallback: (value) => parseInt(value, 10)
6134
- }),
6135
- era: buildMatchFn({
6136
- matchPatterns: matchEraPatterns,
6137
- defaultMatchWidth: "wide",
6138
- parsePatterns: parseEraPatterns,
6139
- defaultParseWidth: "any"
6140
- }),
6141
- quarter: buildMatchFn({
6142
- matchPatterns: matchQuarterPatterns,
6143
- defaultMatchWidth: "wide",
6144
- parsePatterns: parseQuarterPatterns,
6145
- defaultParseWidth: "any",
6146
- valueCallback: (index) => index + 1
6147
- }),
6148
- month: buildMatchFn({
6149
- matchPatterns: matchMonthPatterns,
6150
- defaultMatchWidth: "wide",
6151
- parsePatterns: parseMonthPatterns,
6152
- defaultParseWidth: "any"
6153
- }),
6154
- day: buildMatchFn({
6155
- matchPatterns: matchDayPatterns,
6156
- defaultMatchWidth: "wide",
6157
- parsePatterns: parseDayPatterns,
6158
- defaultParseWidth: "any"
6159
- }),
6160
- dayPeriod: buildMatchFn({
6161
- matchPatterns: matchDayPeriodPatterns,
6162
- defaultMatchWidth: "any",
6163
- parsePatterns: parseDayPeriodPatterns,
6164
- defaultParseWidth: "any"
6165
- })
6166
- };
6167
-
6168
- // node_modules/date-fns/locale/en-US.js
6169
- var enUS = {
6170
- code: "en-US",
6171
- formatDistance,
6172
- formatLong,
6173
- formatRelative,
6174
- localize,
6175
- match,
6176
- options: {
6177
- weekStartsOn: 0,
6178
- firstWeekContainsDate: 1
6179
- }
6180
- };
6181
-
6182
- // node_modules/date-fns/getDayOfYear.js
6183
- function getDayOfYear(date, options) {
6184
- const _date = toDate(date, options?.in);
6185
- const diff = differenceInCalendarDays(_date, startOfYear(_date));
6186
- const dayOfYear = diff + 1;
6187
- return dayOfYear;
6188
- }
6189
-
6190
- // node_modules/date-fns/getISOWeek.js
6191
- function getISOWeek(date, options) {
6192
- const _date = toDate(date, options?.in);
6193
- const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
6194
- return Math.round(diff / millisecondsInWeek) + 1;
6195
- }
6196
-
6197
- // node_modules/date-fns/getWeekYear.js
6198
- function getWeekYear(date, options) {
6199
- const _date = toDate(date, options?.in);
6200
- const year = _date.getFullYear();
6201
- const defaultOptions2 = getDefaultOptions();
6202
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
6203
- const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
6204
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
6205
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
6206
- const startOfNextYear = startOfWeek2(firstWeekOfNextYear, options);
6207
- const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
6208
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
6209
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
6210
- const startOfThisYear = startOfWeek2(firstWeekOfThisYear, options);
6211
- if (+_date >= +startOfNextYear) {
6212
- return year + 1;
6213
- } else if (+_date >= +startOfThisYear) {
6214
- return year;
6215
- } else {
6216
- return year - 1;
6217
- }
6218
- }
6219
-
6220
- // node_modules/date-fns/startOfWeekYear.js
6221
- function startOfWeekYear(date, options) {
6222
- const defaultOptions2 = getDefaultOptions();
6223
- const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
6224
- const year = getWeekYear(date, options);
6225
- const firstWeek = constructFrom(options?.in || date, 0);
6226
- firstWeek.setFullYear(year, 0, firstWeekContainsDate);
6227
- firstWeek.setHours(0, 0, 0, 0);
6228
- const _date = startOfWeek2(firstWeek, options);
6229
- return _date;
6230
- }
6231
-
6232
- // node_modules/date-fns/getWeek.js
6233
- function getWeek(date, options) {
6234
- const _date = toDate(date, options?.in);
6235
- const diff = +startOfWeek2(_date, options) - +startOfWeekYear(_date, options);
6236
- return Math.round(diff / millisecondsInWeek) + 1;
6237
- }
6238
-
6239
- // node_modules/date-fns/_lib/addLeadingZeros.js
6240
- function addLeadingZeros(number, targetLength) {
6241
- const sign = number < 0 ? "-" : "";
6242
- const output = Math.abs(number).toString().padStart(targetLength, "0");
6243
- return sign + output;
6244
- }
6245
-
6246
- // node_modules/date-fns/_lib/format/lightFormatters.js
6247
- var lightFormatters = {
6248
- // Year
6249
- y(date, token) {
6250
- const signedYear = date.getFullYear();
6251
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
6252
- return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
6253
- },
6254
- // Month
6255
- M(date, token) {
6256
- const month = date.getMonth();
6257
- return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
6258
- },
6259
- // Day of the month
6260
- d(date, token) {
6261
- return addLeadingZeros(date.getDate(), token.length);
6262
- },
6263
- // AM or PM
6264
- a(date, token) {
6265
- const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
6266
- switch (token) {
6267
- case "a":
6268
- case "aa":
6269
- return dayPeriodEnumValue.toUpperCase();
6270
- case "aaa":
6271
- return dayPeriodEnumValue;
6272
- case "aaaaa":
6273
- return dayPeriodEnumValue[0];
6274
- case "aaaa":
6275
- default:
6276
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
6277
- }
6278
- },
6279
- // Hour [1-12]
6280
- h(date, token) {
6281
- return addLeadingZeros(date.getHours() % 12 || 12, token.length);
6282
- },
6283
- // Hour [0-23]
6284
- H(date, token) {
6285
- return addLeadingZeros(date.getHours(), token.length);
6286
- },
6287
- // Minute
6288
- m(date, token) {
6289
- return addLeadingZeros(date.getMinutes(), token.length);
6290
- },
6291
- // Second
6292
- s(date, token) {
6293
- return addLeadingZeros(date.getSeconds(), token.length);
6294
- },
6295
- // Fraction of second
6296
- S(date, token) {
6297
- const numberOfDigits = token.length;
6298
- const milliseconds = date.getMilliseconds();
6299
- const fractionalSeconds = Math.trunc(
6300
- milliseconds * Math.pow(10, numberOfDigits - 3)
6301
- );
6302
- return addLeadingZeros(fractionalSeconds, token.length);
6303
- }
6304
- };
6305
-
6306
- // node_modules/date-fns/_lib/format/formatters.js
6307
- var dayPeriodEnum = {
6308
- midnight: "midnight",
6309
- noon: "noon",
6310
- morning: "morning",
6311
- afternoon: "afternoon",
6312
- evening: "evening",
6313
- night: "night"
6314
- };
6315
- var formatters = {
6316
- // Era
6317
- G: function(date, token, localize2) {
6318
- const era = date.getFullYear() > 0 ? 1 : 0;
6319
- switch (token) {
6320
- // AD, BC
6321
- case "G":
6322
- case "GG":
6323
- case "GGG":
6324
- return localize2.era(era, { width: "abbreviated" });
6325
- // A, B
6326
- case "GGGGG":
6327
- return localize2.era(era, { width: "narrow" });
6328
- // Anno Domini, Before Christ
6329
- case "GGGG":
6330
- default:
6331
- return localize2.era(era, { width: "wide" });
6332
- }
6333
- },
6334
- // Year
6335
- y: function(date, token, localize2) {
6336
- if (token === "yo") {
6337
- const signedYear = date.getFullYear();
6338
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
6339
- return localize2.ordinalNumber(year, { unit: "year" });
6340
- }
6341
- return lightFormatters.y(date, token);
6342
- },
6343
- // Local week-numbering year
6344
- Y: function(date, token, localize2, options) {
6345
- const signedWeekYear = getWeekYear(date, options);
6346
- const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
6347
- if (token === "YY") {
6348
- const twoDigitYear = weekYear % 100;
6349
- return addLeadingZeros(twoDigitYear, 2);
6350
- }
6351
- if (token === "Yo") {
6352
- return localize2.ordinalNumber(weekYear, { unit: "year" });
6353
- }
6354
- return addLeadingZeros(weekYear, token.length);
6355
- },
6356
- // ISO week-numbering year
6357
- R: function(date, token) {
6358
- const isoWeekYear = getISOWeekYear(date);
6359
- return addLeadingZeros(isoWeekYear, token.length);
6360
- },
6361
- // Extended year. This is a single number designating the year of this calendar system.
6362
- // The main difference between `y` and `u` localizers are B.C. years:
6363
- // | Year | `y` | `u` |
6364
- // |------|-----|-----|
6365
- // | AC 1 | 1 | 1 |
6366
- // | BC 1 | 1 | 0 |
6367
- // | BC 2 | 2 | -1 |
6368
- // Also `yy` always returns the last two digits of a year,
6369
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
6370
- u: function(date, token) {
6371
- const year = date.getFullYear();
6372
- return addLeadingZeros(year, token.length);
6373
- },
6374
- // Quarter
6375
- Q: function(date, token, localize2) {
6376
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
6377
- switch (token) {
6378
- // 1, 2, 3, 4
6379
- case "Q":
6380
- return String(quarter);
6381
- // 01, 02, 03, 04
6382
- case "QQ":
6383
- return addLeadingZeros(quarter, 2);
6384
- // 1st, 2nd, 3rd, 4th
6385
- case "Qo":
6386
- return localize2.ordinalNumber(quarter, { unit: "quarter" });
6387
- // Q1, Q2, Q3, Q4
6388
- case "QQQ":
6389
- return localize2.quarter(quarter, {
6390
- width: "abbreviated",
6391
- context: "formatting"
6392
- });
6393
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
6394
- case "QQQQQ":
6395
- return localize2.quarter(quarter, {
6396
- width: "narrow",
6397
- context: "formatting"
6398
- });
6399
- // 1st quarter, 2nd quarter, ...
6400
- case "QQQQ":
6401
- default:
6402
- return localize2.quarter(quarter, {
6403
- width: "wide",
6404
- context: "formatting"
6405
- });
6406
- }
6407
- },
6408
- // Stand-alone quarter
6409
- q: function(date, token, localize2) {
6410
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
6411
- switch (token) {
6412
- // 1, 2, 3, 4
6413
- case "q":
6414
- return String(quarter);
6415
- // 01, 02, 03, 04
6416
- case "qq":
6417
- return addLeadingZeros(quarter, 2);
6418
- // 1st, 2nd, 3rd, 4th
6419
- case "qo":
6420
- return localize2.ordinalNumber(quarter, { unit: "quarter" });
6421
- // Q1, Q2, Q3, Q4
6422
- case "qqq":
6423
- return localize2.quarter(quarter, {
6424
- width: "abbreviated",
6425
- context: "standalone"
6426
- });
6427
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
6428
- case "qqqqq":
6429
- return localize2.quarter(quarter, {
6430
- width: "narrow",
6431
- context: "standalone"
6432
- });
6433
- // 1st quarter, 2nd quarter, ...
6434
- case "qqqq":
6435
- default:
6436
- return localize2.quarter(quarter, {
6437
- width: "wide",
6438
- context: "standalone"
6439
- });
6440
- }
6441
- },
6442
- // Month
6443
- M: function(date, token, localize2) {
6444
- const month = date.getMonth();
6445
- switch (token) {
6446
- case "M":
6447
- case "MM":
6448
- return lightFormatters.M(date, token);
6449
- // 1st, 2nd, ..., 12th
6450
- case "Mo":
6451
- return localize2.ordinalNumber(month + 1, { unit: "month" });
6452
- // Jan, Feb, ..., Dec
6453
- case "MMM":
6454
- return localize2.month(month, {
6455
- width: "abbreviated",
6456
- context: "formatting"
6457
- });
6458
- // J, F, ..., D
6459
- case "MMMMM":
6460
- return localize2.month(month, {
6461
- width: "narrow",
6462
- context: "formatting"
6463
- });
6464
- // January, February, ..., December
6465
- case "MMMM":
6466
- default:
6467
- return localize2.month(month, { width: "wide", context: "formatting" });
6468
- }
6469
- },
6470
- // Stand-alone month
6471
- L: function(date, token, localize2) {
6472
- const month = date.getMonth();
6473
- switch (token) {
6474
- // 1, 2, ..., 12
6475
- case "L":
6476
- return String(month + 1);
6477
- // 01, 02, ..., 12
6478
- case "LL":
6479
- return addLeadingZeros(month + 1, 2);
6480
- // 1st, 2nd, ..., 12th
6481
- case "Lo":
6482
- return localize2.ordinalNumber(month + 1, { unit: "month" });
6483
- // Jan, Feb, ..., Dec
6484
- case "LLL":
6485
- return localize2.month(month, {
6486
- width: "abbreviated",
6487
- context: "standalone"
6488
- });
6489
- // J, F, ..., D
6490
- case "LLLLL":
6491
- return localize2.month(month, {
6492
- width: "narrow",
6493
- context: "standalone"
6494
- });
6495
- // January, February, ..., December
6496
- case "LLLL":
6497
- default:
6498
- return localize2.month(month, { width: "wide", context: "standalone" });
6499
- }
6500
- },
6501
- // Local week of year
6502
- w: function(date, token, localize2, options) {
6503
- const week = getWeek(date, options);
6504
- if (token === "wo") {
6505
- return localize2.ordinalNumber(week, { unit: "week" });
6506
- }
6507
- return addLeadingZeros(week, token.length);
6508
- },
6509
- // ISO week of year
6510
- I: function(date, token, localize2) {
6511
- const isoWeek = getISOWeek(date);
6512
- if (token === "Io") {
6513
- return localize2.ordinalNumber(isoWeek, { unit: "week" });
6514
- }
6515
- return addLeadingZeros(isoWeek, token.length);
6516
- },
6517
- // Day of the month
6518
- d: function(date, token, localize2) {
6519
- if (token === "do") {
6520
- return localize2.ordinalNumber(date.getDate(), { unit: "date" });
6521
- }
6522
- return lightFormatters.d(date, token);
6523
- },
6524
- // Day of year
6525
- D: function(date, token, localize2) {
6526
- const dayOfYear = getDayOfYear(date);
6527
- if (token === "Do") {
6528
- return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
6529
- }
6530
- return addLeadingZeros(dayOfYear, token.length);
6531
- },
6532
- // Day of week
6533
- E: function(date, token, localize2) {
6534
- const dayOfWeek = date.getDay();
6535
- switch (token) {
6536
- // Tue
6537
- case "E":
6538
- case "EE":
6539
- case "EEE":
6540
- return localize2.day(dayOfWeek, {
6541
- width: "abbreviated",
6542
- context: "formatting"
6543
- });
6544
- // T
6545
- case "EEEEE":
6546
- return localize2.day(dayOfWeek, {
6547
- width: "narrow",
6548
- context: "formatting"
6549
- });
6550
- // Tu
6551
- case "EEEEEE":
6552
- return localize2.day(dayOfWeek, {
6553
- width: "short",
6554
- context: "formatting"
6555
- });
6556
- // Tuesday
6557
- case "EEEE":
6558
- default:
6559
- return localize2.day(dayOfWeek, {
6560
- width: "wide",
6561
- context: "formatting"
6562
- });
6563
- }
6564
- },
6565
- // Local day of week
6566
- e: function(date, token, localize2, options) {
6567
- const dayOfWeek = date.getDay();
6568
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
6569
- switch (token) {
6570
- // Numerical value (Nth day of week with current locale or weekStartsOn)
6571
- case "e":
6572
- return String(localDayOfWeek);
6573
- // Padded numerical value
6574
- case "ee":
6575
- return addLeadingZeros(localDayOfWeek, 2);
6576
- // 1st, 2nd, ..., 7th
6577
- case "eo":
6578
- return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
6579
- case "eee":
6580
- return localize2.day(dayOfWeek, {
6581
- width: "abbreviated",
6582
- context: "formatting"
6583
- });
6584
- // T
6585
- case "eeeee":
6586
- return localize2.day(dayOfWeek, {
6587
- width: "narrow",
6588
- context: "formatting"
6589
- });
6590
- // Tu
6591
- case "eeeeee":
6592
- return localize2.day(dayOfWeek, {
6593
- width: "short",
6594
- context: "formatting"
6595
- });
6596
- // Tuesday
6597
- case "eeee":
6598
- default:
6599
- return localize2.day(dayOfWeek, {
6600
- width: "wide",
6601
- context: "formatting"
6602
- });
6603
- }
6604
- },
6605
- // Stand-alone local day of week
6606
- c: function(date, token, localize2, options) {
6607
- const dayOfWeek = date.getDay();
6608
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
6609
- switch (token) {
6610
- // Numerical value (same as in `e`)
6611
- case "c":
6612
- return String(localDayOfWeek);
6613
- // Padded numerical value
6614
- case "cc":
6615
- return addLeadingZeros(localDayOfWeek, token.length);
6616
- // 1st, 2nd, ..., 7th
6617
- case "co":
6618
- return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
6619
- case "ccc":
6620
- return localize2.day(dayOfWeek, {
6621
- width: "abbreviated",
6622
- context: "standalone"
6623
- });
6624
- // T
6625
- case "ccccc":
6626
- return localize2.day(dayOfWeek, {
6627
- width: "narrow",
6628
- context: "standalone"
6629
- });
6630
- // Tu
6631
- case "cccccc":
6632
- return localize2.day(dayOfWeek, {
6633
- width: "short",
6634
- context: "standalone"
6635
- });
6636
- // Tuesday
6637
- case "cccc":
6638
- default:
6639
- return localize2.day(dayOfWeek, {
6640
- width: "wide",
6641
- context: "standalone"
6642
- });
6643
- }
6644
- },
6645
- // ISO day of week
6646
- i: function(date, token, localize2) {
6647
- const dayOfWeek = date.getDay();
6648
- const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
6649
- switch (token) {
6650
- // 2
6651
- case "i":
6652
- return String(isoDayOfWeek);
6653
- // 02
6654
- case "ii":
6655
- return addLeadingZeros(isoDayOfWeek, token.length);
6656
- // 2nd
6657
- case "io":
6658
- return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
6659
- // Tue
6660
- case "iii":
6661
- return localize2.day(dayOfWeek, {
6662
- width: "abbreviated",
6663
- context: "formatting"
6664
- });
6665
- // T
6666
- case "iiiii":
6667
- return localize2.day(dayOfWeek, {
6668
- width: "narrow",
6669
- context: "formatting"
6670
- });
6671
- // Tu
6672
- case "iiiiii":
6673
- return localize2.day(dayOfWeek, {
6674
- width: "short",
6675
- context: "formatting"
6676
- });
6677
- // Tuesday
6678
- case "iiii":
6679
- default:
6680
- return localize2.day(dayOfWeek, {
6681
- width: "wide",
6682
- context: "formatting"
6683
- });
6684
- }
6685
- },
6686
- // AM or PM
6687
- a: function(date, token, localize2) {
6688
- const hours = date.getHours();
6689
- const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
6690
- switch (token) {
6691
- case "a":
6692
- case "aa":
6693
- return localize2.dayPeriod(dayPeriodEnumValue, {
6694
- width: "abbreviated",
6695
- context: "formatting"
6696
- });
6697
- case "aaa":
6698
- return localize2.dayPeriod(dayPeriodEnumValue, {
6699
- width: "abbreviated",
6700
- context: "formatting"
6701
- }).toLowerCase();
6702
- case "aaaaa":
6703
- return localize2.dayPeriod(dayPeriodEnumValue, {
6704
- width: "narrow",
6705
- context: "formatting"
6706
- });
6707
- case "aaaa":
6708
- default:
6709
- return localize2.dayPeriod(dayPeriodEnumValue, {
6710
- width: "wide",
6711
- context: "formatting"
6712
- });
6713
- }
6714
- },
6715
- // AM, PM, midnight, noon
6716
- b: function(date, token, localize2) {
6717
- const hours = date.getHours();
6718
- let dayPeriodEnumValue;
6719
- if (hours === 12) {
6720
- dayPeriodEnumValue = dayPeriodEnum.noon;
6721
- } else if (hours === 0) {
6722
- dayPeriodEnumValue = dayPeriodEnum.midnight;
6723
- } else {
6724
- dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
6725
- }
6726
- switch (token) {
6727
- case "b":
6728
- case "bb":
6729
- return localize2.dayPeriod(dayPeriodEnumValue, {
6730
- width: "abbreviated",
6731
- context: "formatting"
6732
- });
6733
- case "bbb":
6734
- return localize2.dayPeriod(dayPeriodEnumValue, {
6735
- width: "abbreviated",
6736
- context: "formatting"
6737
- }).toLowerCase();
6738
- case "bbbbb":
6739
- return localize2.dayPeriod(dayPeriodEnumValue, {
6740
- width: "narrow",
6741
- context: "formatting"
6742
- });
6743
- case "bbbb":
6744
- default:
6745
- return localize2.dayPeriod(dayPeriodEnumValue, {
6746
- width: "wide",
6747
- context: "formatting"
6748
- });
6749
- }
6750
- },
6751
- // in the morning, in the afternoon, in the evening, at night
6752
- B: function(date, token, localize2) {
6753
- const hours = date.getHours();
6754
- let dayPeriodEnumValue;
6755
- if (hours >= 17) {
6756
- dayPeriodEnumValue = dayPeriodEnum.evening;
6757
- } else if (hours >= 12) {
6758
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
6759
- } else if (hours >= 4) {
6760
- dayPeriodEnumValue = dayPeriodEnum.morning;
6761
- } else {
6762
- dayPeriodEnumValue = dayPeriodEnum.night;
6763
- }
6764
- switch (token) {
6765
- case "B":
6766
- case "BB":
6767
- case "BBB":
6768
- return localize2.dayPeriod(dayPeriodEnumValue, {
6769
- width: "abbreviated",
6770
- context: "formatting"
6771
- });
6772
- case "BBBBB":
6773
- return localize2.dayPeriod(dayPeriodEnumValue, {
6774
- width: "narrow",
6775
- context: "formatting"
6776
- });
6777
- case "BBBB":
6778
- default:
6779
- return localize2.dayPeriod(dayPeriodEnumValue, {
6780
- width: "wide",
6781
- context: "formatting"
6782
- });
6783
- }
6784
- },
6785
- // Hour [1-12]
6786
- h: function(date, token, localize2) {
6787
- if (token === "ho") {
6788
- let hours = date.getHours() % 12;
6789
- if (hours === 0) hours = 12;
6790
- return localize2.ordinalNumber(hours, { unit: "hour" });
6791
- }
6792
- return lightFormatters.h(date, token);
6793
- },
6794
- // Hour [0-23]
6795
- H: function(date, token, localize2) {
6796
- if (token === "Ho") {
6797
- return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
6798
- }
6799
- return lightFormatters.H(date, token);
6800
- },
6801
- // Hour [0-11]
6802
- K: function(date, token, localize2) {
6803
- const hours = date.getHours() % 12;
6804
- if (token === "Ko") {
6805
- return localize2.ordinalNumber(hours, { unit: "hour" });
6806
- }
6807
- return addLeadingZeros(hours, token.length);
6808
- },
6809
- // Hour [1-24]
6810
- k: function(date, token, localize2) {
6811
- let hours = date.getHours();
6812
- if (hours === 0) hours = 24;
6813
- if (token === "ko") {
6814
- return localize2.ordinalNumber(hours, { unit: "hour" });
6815
- }
6816
- return addLeadingZeros(hours, token.length);
6817
- },
6818
- // Minute
6819
- m: function(date, token, localize2) {
6820
- if (token === "mo") {
6821
- return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
6822
- }
6823
- return lightFormatters.m(date, token);
6824
- },
6825
- // Second
6826
- s: function(date, token, localize2) {
6827
- if (token === "so") {
6828
- return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
6829
- }
6830
- return lightFormatters.s(date, token);
6831
- },
6832
- // Fraction of second
6833
- S: function(date, token) {
6834
- return lightFormatters.S(date, token);
6835
- },
6836
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
6837
- X: function(date, token, _localize) {
6838
- const timezoneOffset = date.getTimezoneOffset();
6839
- if (timezoneOffset === 0) {
6840
- return "Z";
6841
- }
6842
- switch (token) {
6843
- // Hours and optional minutes
6844
- case "X":
6845
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
6846
- // Hours, minutes and optional seconds without `:` delimiter
6847
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
6848
- // so this token always has the same output as `XX`
6849
- case "XXXX":
6850
- case "XX":
6851
- return formatTimezone(timezoneOffset);
6852
- // Hours, minutes and optional seconds with `:` delimiter
6853
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
6854
- // so this token always has the same output as `XXX`
6855
- case "XXXXX":
6856
- case "XXX":
6857
- // Hours and minutes with `:` delimiter
6858
- default:
6859
- return formatTimezone(timezoneOffset, ":");
6860
- }
6861
- },
6862
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
6863
- x: function(date, token, _localize) {
6864
- const timezoneOffset = date.getTimezoneOffset();
6865
- switch (token) {
6866
- // Hours and optional minutes
6867
- case "x":
6868
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
6869
- // Hours, minutes and optional seconds without `:` delimiter
6870
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
6871
- // so this token always has the same output as `xx`
6872
- case "xxxx":
6873
- case "xx":
6874
- return formatTimezone(timezoneOffset);
6875
- // Hours, minutes and optional seconds with `:` delimiter
6876
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
6877
- // so this token always has the same output as `xxx`
6878
- case "xxxxx":
6879
- case "xxx":
6880
- // Hours and minutes with `:` delimiter
6881
- default:
6882
- return formatTimezone(timezoneOffset, ":");
6883
- }
6884
- },
6885
- // Timezone (GMT)
6886
- O: function(date, token, _localize) {
6887
- const timezoneOffset = date.getTimezoneOffset();
6888
- switch (token) {
6889
- // Short
6890
- case "O":
6891
- case "OO":
6892
- case "OOO":
6893
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
6894
- // Long
6895
- case "OOOO":
6896
- default:
6897
- return "GMT" + formatTimezone(timezoneOffset, ":");
6898
- }
6899
- },
6900
- // Timezone (specific non-location)
6901
- z: function(date, token, _localize) {
6902
- const timezoneOffset = date.getTimezoneOffset();
6903
- switch (token) {
6904
- // Short
6905
- case "z":
6906
- case "zz":
6907
- case "zzz":
6908
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
6909
- // Long
6910
- case "zzzz":
6911
- default:
6912
- return "GMT" + formatTimezone(timezoneOffset, ":");
6913
- }
6914
- },
6915
- // Seconds timestamp
6916
- t: function(date, token, _localize) {
6917
- const timestamp = Math.trunc(+date / 1e3);
6918
- return addLeadingZeros(timestamp, token.length);
6919
- },
6920
- // Milliseconds timestamp
6921
- T: function(date, token, _localize) {
6922
- return addLeadingZeros(+date, token.length);
6923
- }
6924
- };
6925
- function formatTimezoneShort(offset, delimiter = "") {
6926
- const sign = offset > 0 ? "-" : "+";
6927
- const absOffset = Math.abs(offset);
6928
- const hours = Math.trunc(absOffset / 60);
6929
- const minutes = absOffset % 60;
6930
- if (minutes === 0) {
6931
- return sign + String(hours);
6932
- }
6933
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
6934
- }
6935
- function formatTimezoneWithOptionalMinutes(offset, delimiter) {
6936
- if (offset % 60 === 0) {
6937
- const sign = offset > 0 ? "-" : "+";
6938
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
6939
- }
6940
- return formatTimezone(offset, delimiter);
6941
- }
6942
- function formatTimezone(offset, delimiter = "") {
6943
- const sign = offset > 0 ? "-" : "+";
6944
- const absOffset = Math.abs(offset);
6945
- const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
6946
- const minutes = addLeadingZeros(absOffset % 60, 2);
6947
- return sign + hours + delimiter + minutes;
6948
- }
6949
-
6950
- // node_modules/date-fns/_lib/format/longFormatters.js
6951
- var dateLongFormatter = (pattern, formatLong2) => {
6952
- switch (pattern) {
6953
- case "P":
6954
- return formatLong2.date({ width: "short" });
6955
- case "PP":
6956
- return formatLong2.date({ width: "medium" });
6957
- case "PPP":
6958
- return formatLong2.date({ width: "long" });
6959
- case "PPPP":
6960
- default:
6961
- return formatLong2.date({ width: "full" });
6962
- }
6963
- };
6964
- var timeLongFormatter = (pattern, formatLong2) => {
6965
- switch (pattern) {
6966
- case "p":
6967
- return formatLong2.time({ width: "short" });
6968
- case "pp":
6969
- return formatLong2.time({ width: "medium" });
6970
- case "ppp":
6971
- return formatLong2.time({ width: "long" });
6972
- case "pppp":
6973
- default:
6974
- return formatLong2.time({ width: "full" });
6975
- }
6976
- };
6977
- var dateTimeLongFormatter = (pattern, formatLong2) => {
6978
- const matchResult = pattern.match(/(P+)(p+)?/) || [];
6979
- const datePattern = matchResult[1];
6980
- const timePattern = matchResult[2];
6981
- if (!timePattern) {
6982
- return dateLongFormatter(pattern, formatLong2);
6983
- }
6984
- let dateTimeFormat;
6985
- switch (datePattern) {
6986
- case "P":
6987
- dateTimeFormat = formatLong2.dateTime({ width: "short" });
6988
- break;
6989
- case "PP":
6990
- dateTimeFormat = formatLong2.dateTime({ width: "medium" });
6991
- break;
6992
- case "PPP":
6993
- dateTimeFormat = formatLong2.dateTime({ width: "long" });
6994
- break;
6995
- case "PPPP":
6996
- default:
6997
- dateTimeFormat = formatLong2.dateTime({ width: "full" });
6998
- break;
6999
- }
7000
- return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
7001
- };
7002
- var longFormatters = {
7003
- p: timeLongFormatter,
7004
- P: dateTimeLongFormatter
7005
- };
7006
-
7007
- // node_modules/date-fns/_lib/protectedTokens.js
7008
- var dayOfYearTokenRE = /^D+$/;
7009
- var weekYearTokenRE = /^Y+$/;
7010
- var throwTokens = ["D", "DD", "YY", "YYYY"];
7011
- function isProtectedDayOfYearToken(token) {
7012
- return dayOfYearTokenRE.test(token);
7013
- }
7014
- function isProtectedWeekYearToken(token) {
7015
- return weekYearTokenRE.test(token);
7016
- }
7017
- function warnOrThrowProtectedError(token, format2, input) {
7018
- const _message = message(token, format2, input);
7019
- console.warn(_message);
7020
- if (throwTokens.includes(token)) throw new RangeError(_message);
7021
- }
7022
- function message(token, format2, input) {
7023
- const subject = token[0] === "Y" ? "years" : "days of the month";
7024
- 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`;
7025
- }
7026
-
7027
- // node_modules/date-fns/format.js
7028
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
7029
- var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
7030
- var escapedStringRegExp = /^'([^]*?)'?$/;
7031
- var doubleQuoteRegExp = /''/g;
7032
- var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
7033
- function format(date, formatStr, options) {
7034
- const defaultOptions2 = getDefaultOptions();
7035
- const locale = defaultOptions2.locale ?? enUS;
7036
- const firstWeekContainsDate = defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
7037
- const weekStartsOn = defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
7038
- const originalDate = toDate(date, options?.in);
7039
- if (!isValid(originalDate)) {
7040
- throw new RangeError("Invalid time value");
7041
- }
7042
- let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
7043
- const firstCharacter = substring[0];
7044
- if (firstCharacter === "p" || firstCharacter === "P") {
7045
- const longFormatter = longFormatters[firstCharacter];
7046
- return longFormatter(substring, locale.formatLong);
7047
- }
7048
- return substring;
7049
- }).join("").match(formattingTokensRegExp).map((substring) => {
7050
- if (substring === "''") {
7051
- return { isToken: false, value: "'" };
7052
- }
7053
- const firstCharacter = substring[0];
7054
- if (firstCharacter === "'") {
7055
- return { isToken: false, value: cleanEscapedString(substring) };
7056
- }
7057
- if (formatters[firstCharacter]) {
7058
- return { isToken: true, value: substring };
7059
- }
7060
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
7061
- throw new RangeError(
7062
- "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
7063
- );
7064
- }
7065
- return { isToken: false, value: substring };
7066
- });
7067
- if (locale.localize.preprocessor) {
7068
- parts = locale.localize.preprocessor(originalDate, parts);
7069
- }
7070
- const formatterOptions = {
7071
- firstWeekContainsDate,
7072
- weekStartsOn,
7073
- locale
7074
- };
7075
- return parts.map((part) => {
7076
- if (!part.isToken) return part.value;
7077
- const token = part.value;
7078
- if (isProtectedWeekYearToken(token) || isProtectedDayOfYearToken(token)) {
7079
- warnOrThrowProtectedError(token, formatStr, String(date));
7080
- }
7081
- const formatter = formatters[token[0]];
7082
- return formatter(originalDate, token, locale.localize, formatterOptions);
7083
- }).join("");
7084
- }
7085
- function cleanEscapedString(input) {
7086
- const matched = input.match(escapedStringRegExp);
7087
- if (!matched) {
7088
- return input;
7089
- }
7090
- return matched[1].replace(doubleQuoteRegExp, "'");
7091
- }
7092
-
7093
- // node_modules/date-fns/isSameMonth.js
7094
- function isSameMonth(laterDate, earlierDate, options) {
7095
- const [laterDate_, earlierDate_] = normalizeDates(
7096
- options?.in,
7097
- laterDate,
7098
- earlierDate
7099
- );
7100
- return laterDate_.getFullYear() === earlierDate_.getFullYear() && laterDate_.getMonth() === earlierDate_.getMonth();
7101
- }
7102
5397
  var DEFAULT_COLUMN_WIDTH = {
7103
5398
  days: 56,
7104
5399
  weeks: 80,
@@ -7112,7 +5407,7 @@ var EDGE_HIT_PX = 8;
7112
5407
  var LONG_PRESS_MS = 300;
7113
5408
  function startOfScale(date, scale) {
7114
5409
  if (scale === "days") return startOfDay(date);
7115
- if (scale === "weeks") return startOfWeek2(date, { weekStartsOn: 1 });
5410
+ if (scale === "weeks") return startOfWeek$1(date, { weekStartsOn: 1 });
7116
5411
  return startOfMonth(date);
7117
5412
  }
7118
5413
  function endOfScale(date, scale) {
@@ -9194,7 +7489,7 @@ function ArrayField({
9194
7489
  }
9195
7490
  var DAYS2 = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
9196
7491
  var MONTHS2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
9197
- function isSameDay2(a, b) {
7492
+ function isSameDay(a, b) {
9198
7493
  return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
9199
7494
  }
9200
7495
  function getDaysInMonth(year, month) {
@@ -9213,8 +7508,8 @@ function CalendarGrid({ year, month, selected, onSelect }) {
9213
7508
  cells.map((day, i) => {
9214
7509
  if (!day) return /* @__PURE__ */ jsx("div", {}, i);
9215
7510
  const date = new Date(year, month, day);
9216
- const isToday = isSameDay2(date, today);
9217
- const isSelected = selected && isSameDay2(date, selected);
7511
+ const isToday = isSameDay(date, today);
7512
+ const isSelected = selected && isSameDay(date, selected);
9218
7513
  return /* @__PURE__ */ jsx(
9219
7514
  "button",
9220
7515
  {
@@ -9394,18 +7689,18 @@ function AutoForm({ schema, onSubmit, defaultValues, submitLabel = "Submit" }) {
9394
7689
  var HEX_RE = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
9395
7690
  var RGB_RE = /^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*(0|1|0?\.\d+)\s*)?\)$/i;
9396
7691
  var HSL_RE = /^hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(,\s*(0|1|0?\.\d+)\s*)?\)$/i;
9397
- function isValid2(value, format2, showAlpha) {
9398
- if (format2 === "hex") {
7692
+ function isValid(value, format3, showAlpha) {
7693
+ if (format3 === "hex") {
9399
7694
  if (!HEX_RE.test(value)) return false;
9400
7695
  if (!showAlpha && (value.length === 5 || value.length === 9)) return false;
9401
7696
  return true;
9402
7697
  }
9403
- if (format2 === "rgb") return RGB_RE.test(value);
7698
+ if (format3 === "rgb") return RGB_RE.test(value);
9404
7699
  return HSL_RE.test(value);
9405
7700
  }
9406
- function defaultFor(format2, showAlpha) {
9407
- if (format2 === "hex") return showAlpha ? "#3b82f6ff" : "#3b82f6";
9408
- if (format2 === "rgb") return showAlpha ? "rgba(59, 130, 246, 1)" : "rgb(59, 130, 246)";
7701
+ function defaultFor(format3, showAlpha) {
7702
+ if (format3 === "hex") return showAlpha ? "#3b82f6ff" : "#3b82f6";
7703
+ if (format3 === "rgb") return showAlpha ? "rgba(59, 130, 246, 1)" : "rgb(59, 130, 246)";
9409
7704
  return showAlpha ? "hsla(217, 91%, 60%, 1)" : "hsl(217, 91%, 60%)";
9410
7705
  }
9411
7706
  var ColorPicker = React131__default.forwardRef(
@@ -9413,7 +7708,7 @@ var ColorPicker = React131__default.forwardRef(
9413
7708
  value: valueProp,
9414
7709
  defaultValue,
9415
7710
  onValueChange,
9416
- format: format2 = "hex",
7711
+ format: format3 = "hex",
9417
7712
  showAlpha = false,
9418
7713
  swatches,
9419
7714
  showEyeDropper = true,
@@ -9421,7 +7716,7 @@ var ColorPicker = React131__default.forwardRef(
9421
7716
  className,
9422
7717
  ...props
9423
7718
  }, ref) => {
9424
- const fallback = defaultValue ?? defaultFor(format2, showAlpha);
7719
+ const fallback = defaultValue ?? defaultFor(format3, showAlpha);
9425
7720
  const isControlled = valueProp !== void 0;
9426
7721
  const [internal, setInternal] = React131__default.useState(fallback);
9427
7722
  const value = isControlled ? valueProp : internal;
@@ -9447,7 +7742,7 @@ var ColorPicker = React131__default.forwardRef(
9447
7742
  const handleDraftChange = (e) => {
9448
7743
  const next = e.target.value;
9449
7744
  setDraft(next);
9450
- const valid = isValid2(next, format2, showAlpha);
7745
+ const valid = isValid(next, format3, showAlpha);
9451
7746
  setDraftValid(valid || next === "");
9452
7747
  if (valid) commit(next);
9453
7748
  };
@@ -9470,9 +7765,9 @@ var ColorPicker = React131__default.forwardRef(
9470
7765
  disabled && "pointer-events-none opacity-50 grayscale"
9471
7766
  )
9472
7767
  };
9473
- if (format2 === "hex" && showAlpha) return /* @__PURE__ */ jsx(HexAlphaColorPicker, { ...common });
9474
- if (format2 === "hex") return /* @__PURE__ */ jsx(HexColorPicker, { ...common });
9475
- if (format2 === "rgb") return /* @__PURE__ */ jsx(RgbStringColorPicker, { ...common });
7768
+ if (format3 === "hex" && showAlpha) return /* @__PURE__ */ jsx(HexAlphaColorPicker, { ...common });
7769
+ if (format3 === "hex") return /* @__PURE__ */ jsx(HexColorPicker, { ...common });
7770
+ if (format3 === "rgb") return /* @__PURE__ */ jsx(RgbStringColorPicker, { ...common });
9476
7771
  return /* @__PURE__ */ jsx(HslStringColorPicker, { ...common });
9477
7772
  })();
9478
7773
  const showDropper = showEyeDropper && eyeDropperSupported;
@@ -9540,7 +7835,7 @@ var ColorPicker = React131__default.forwardRef(
9540
7835
  "font-mono text-xs",
9541
7836
  !draftValid && "border-[hsl(var(--destructive))] focus-visible:ring-[hsl(var(--destructive))]"
9542
7837
  ),
9543
- "aria-label": `Color value (${format2})`,
7838
+ "aria-label": `Color value (${format3})`,
9544
7839
  "aria-invalid": !draftValid
9545
7840
  }
9546
7841
  ),
@@ -10795,9 +9090,9 @@ function nextId() {
10795
9090
  return `toast-${++_id}`;
10796
9091
  }
10797
9092
  var toastEmitter = {
10798
- emit(message2, options = {}) {
9093
+ emit(message, options = {}) {
10799
9094
  const id = options.id ?? nextId();
10800
- const event = { id, message: message2, options };
9095
+ const event = { id, message, options };
10801
9096
  listeners.forEach((fn) => fn(event));
10802
9097
  return id;
10803
9098
  },
@@ -10819,13 +9114,13 @@ var toastEmitter = {
10819
9114
  };
10820
9115
  }
10821
9116
  };
10822
- function toastFn(message2, opts) {
10823
- return toastEmitter.emit(message2, opts);
9117
+ function toastFn(message, opts) {
9118
+ return toastEmitter.emit(message, opts);
10824
9119
  }
10825
- toastFn.success = (message2, opts) => toastEmitter.emit(message2, { ...opts, type: "success" });
10826
- toastFn.error = (message2, opts) => toastEmitter.emit(message2, { ...opts, type: "error" });
10827
- toastFn.warning = (message2, opts) => toastEmitter.emit(message2, { ...opts, type: "warning" });
10828
- toastFn.info = (message2, opts) => toastEmitter.emit(message2, { ...opts, type: "info" });
9120
+ toastFn.success = (message, opts) => toastEmitter.emit(message, { ...opts, type: "success" });
9121
+ toastFn.error = (message, opts) => toastEmitter.emit(message, { ...opts, type: "error" });
9122
+ toastFn.warning = (message, opts) => toastEmitter.emit(message, { ...opts, type: "warning" });
9123
+ toastFn.info = (message, opts) => toastEmitter.emit(message, { ...opts, type: "info" });
10829
9124
  toastFn.dismiss = (id) => toastEmitter.dismiss(id);
10830
9125
  var iconMap = {
10831
9126
  success: /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4 text-green-500" }),
@@ -10987,8 +9282,8 @@ GradientHeading.displayName = "GradientHeading";
10987
9282
  function easeOutExpo(t) {
10988
9283
  return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
10989
9284
  }
10990
- function formatNumber(value, decimals, format2, locale) {
10991
- if (format2) {
9285
+ function formatNumber(value, decimals, format3, locale) {
9286
+ if (format3) {
10992
9287
  return new Intl.NumberFormat(locale, {
10993
9288
  minimumFractionDigits: decimals,
10994
9289
  maximumFractionDigits: decimals
@@ -11007,7 +9302,7 @@ var AnimatedNumber = React131__default.forwardRef(
11007
9302
  easing = easeOutExpo,
11008
9303
  autoStart = true,
11009
9304
  locale,
11010
- format: format2 = true,
9305
+ format: format3 = true,
11011
9306
  className,
11012
9307
  ...props
11013
9308
  }, ref) => {
@@ -11085,7 +9380,7 @@ var AnimatedNumber = React131__default.forwardRef(
11085
9380
  ...props,
11086
9381
  children: [
11087
9382
  prefix,
11088
- formatNumber(displayed, decimals, format2, locale),
9383
+ formatNumber(displayed, decimals, format3, locale),
11089
9384
  suffix
11090
9385
  ]
11091
9386
  }
@@ -12200,13 +10495,13 @@ function eventOverlapsDay(event, day) {
12200
10495
  }
12201
10496
  function getMonthMatrix(date, weekStartsOn) {
12202
10497
  const monthStart = startOfMonth(date);
12203
- const gridStart = startOfWeek2(monthStart, { weekStartsOn });
10498
+ const gridStart = startOfWeek$1(monthStart, { weekStartsOn });
12204
10499
  const cells = [];
12205
10500
  for (let i = 0; i < 42; i++) cells.push(addDays(gridStart, i));
12206
10501
  return cells;
12207
10502
  }
12208
10503
  function getWeekDays(date, weekStartsOn) {
12209
- const start = startOfWeek2(date, { weekStartsOn });
10504
+ const start = startOfWeek$1(date, { weekStartsOn });
12210
10505
  return Array.from({ length: 7 }, (_, i) => addDays(start, i));
12211
10506
  }
12212
10507
  var EventCalendar = React131__default.forwardRef(
@@ -12266,7 +10561,7 @@ var EventCalendar = React131__default.forwardRef(
12266
10561
  const headerLabel = React131__default.useMemo(() => {
12267
10562
  if (view === "month") return format(date, "MMMM yyyy");
12268
10563
  if (view === "week") {
12269
- const start = startOfWeek2(date, { weekStartsOn });
10564
+ const start = startOfWeek$1(date, { weekStartsOn });
12270
10565
  const end = addDays(start, 6);
12271
10566
  if (isSameMonth(start, end)) return `${format(start, "MMM d")} \u2013 ${format(end, "d, yyyy")}`;
12272
10567
  return `${format(start, "MMM d")} \u2013 ${format(end, "MMM d, yyyy")}`;
@@ -12417,7 +10712,7 @@ function MonthView({
12417
10712
  [date, weekStartsOn]
12418
10713
  );
12419
10714
  const weekdayLabels = React131__default.useMemo(() => {
12420
- const start = startOfWeek2(/* @__PURE__ */ new Date(), { weekStartsOn });
10715
+ const start = startOfWeek$1(/* @__PURE__ */ new Date(), { weekStartsOn });
12421
10716
  return Array.from({ length: 7 }, (_, i) => format(addDays(start, i), "EEE"));
12422
10717
  }, [weekStartsOn]);
12423
10718
  const today = /* @__PURE__ */ new Date();
@@ -12432,7 +10727,7 @@ function MonthView({
12432
10727
  )) }),
12433
10728
  /* @__PURE__ */ jsx("div", { role: "grid", "aria-label": "Month grid", className: "grid grid-cols-7", children: cells.map((cell) => {
12434
10729
  const inMonth = isSameMonth(cell, date);
12435
- const isToday = isSameDay(cell, today);
10730
+ const isToday = isSameDay$1(cell, today);
12436
10731
  const dayEvents = events.filter((ev) => eventOverlapsDay(ev, cell)).sort((a, b) => a.start.getTime() - b.start.getTime());
12437
10732
  const visible = dayEvents.slice(0, 3);
12438
10733
  const overflow = dayEvents.length - visible.length;
@@ -12593,7 +10888,7 @@ function HourGrid({
12593
10888
  DayColumn,
12594
10889
  {
12595
10890
  day,
12596
- isToday: isSameDay(day, today),
10891
+ isToday: isSameDay$1(day, today),
12597
10892
  events: events.filter((ev) => eventOverlapsDay(ev, day)),
12598
10893
  onEventClick,
12599
10894
  onEventCreate,
@@ -12888,7 +11183,7 @@ function buildDefaultCrop(defaultCrop, aspect, imgWidth, imgHeight) {
12888
11183
  }
12889
11184
  return { unit: "%", x: 10, y: 10, width: 80, height: 80 };
12890
11185
  }
12891
- async function extractCroppedDataUrl(image, crop, format2, quality) {
11186
+ async function extractCroppedDataUrl(image, crop, format3, quality) {
12892
11187
  const scaleX = image.naturalWidth / image.width;
12893
11188
  const scaleY = image.naturalHeight / image.height;
12894
11189
  const canvas = document.createElement("canvas");
@@ -12908,7 +11203,7 @@ async function extractCroppedDataUrl(image, crop, format2, quality) {
12908
11203
  canvas.width,
12909
11204
  canvas.height
12910
11205
  );
12911
- const mime = format2 === "jpeg" ? "image/jpeg" : format2 === "webp" ? "image/webp" : "image/png";
11206
+ const mime = format3 === "jpeg" ? "image/jpeg" : format3 === "webp" ? "image/webp" : "image/png";
12912
11207
  return canvas.toDataURL(mime, quality);
12913
11208
  }
12914
11209
  var ImageCrop = React131__default.forwardRef(