@hero-design/rn 8.112.4 → 8.112.5

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 (118) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +6 -0
  3. package/es/index.js +1760 -1359
  4. package/jest.config.js +1 -1
  5. package/lib/index.js +1760 -1359
  6. package/package.json +2 -2
  7. package/src/components/Accordion/AccordionItem.tsx +1 -1
  8. package/src/components/AnimatedScroller/AnimatedScrollable.tsx +1 -1
  9. package/src/components/AnimatedScroller/SectionListWithFAB.tsx +1 -1
  10. package/src/components/Button/UtilityButton/index.tsx +1 -1
  11. package/src/components/Calendar/CalendarRange.tsx +1 -1
  12. package/src/components/Calendar/CalendarRowItem.tsx +1 -1
  13. package/src/components/Calendar/index.tsx +1 -1
  14. package/src/components/Chart/Line/Line.tsx +3 -4
  15. package/src/components/Chart/index.tsx +0 -2
  16. package/src/components/Chart/shared/ChartHeader.tsx +1 -1
  17. package/src/components/Chart/shared/hooks/useColorScale.ts +2 -2
  18. package/src/components/Chart/shared/hooks/useGenerateTicks.ts +2 -2
  19. package/src/components/Chart/shared/hooks/useScaleBandX.ts +3 -3
  20. package/src/components/Chart/shared/hooks/useScaleLinearY.ts +3 -4
  21. package/src/components/Chart/types.ts +0 -8
  22. package/src/components/Checkbox/utils.ts +1 -1
  23. package/src/components/Chip/index.tsx +1 -1
  24. package/src/components/DatePicker/hooks/__tests__/useFormatDate.spec.ts +7 -5
  25. package/src/components/DatePicker/hooks/useFormatDate.ts +1 -1
  26. package/src/components/DatePicker/types.ts +1 -1
  27. package/src/components/FloatingIsland/index.tsx +1 -1
  28. package/src/components/Illustration/index.tsx +1 -1
  29. package/src/components/List/BasicListItem.tsx +1 -1
  30. package/src/components/List/StyledListItem.tsx +2 -2
  31. package/src/components/LocaleProvider/__tests__/utils.specs.ts +1 -2
  32. package/src/components/LocaleProvider/index.tsx +1 -1
  33. package/src/components/LocaleProvider/utils.ts +2 -3
  34. package/src/components/Portal/index.tsx +1 -1
  35. package/src/components/Portal/types.tsx +2 -2
  36. package/src/components/Radio/Radio.tsx +1 -1
  37. package/src/components/Rate/index.tsx +2 -2
  38. package/src/components/RefreshControl/index.tsx +1 -1
  39. package/src/components/RichTextEditor/RichTextEditor.tsx +1 -1
  40. package/src/components/RichTextEditor/utils/events.ts +1 -1
  41. package/src/components/Search/SearchOneLine.tsx +1 -1
  42. package/src/components/Search/StyledSearch.tsx +1 -1
  43. package/src/components/SectionHeading/index.tsx +1 -1
  44. package/src/components/Select/helpers.tsx +1 -1
  45. package/src/components/Skeleton/index.tsx +1 -1
  46. package/src/components/Slider/RangeSlider.tsx +1 -1
  47. package/src/components/StatusScreens/Success/index.tsx +1 -1
  48. package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +1 -1
  49. package/src/components/Tabs/TabWithBadge.tsx +2 -2
  50. package/src/components/TextInput/index.tsx +2 -2
  51. package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
  52. package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
  53. package/src/components/TimePicker/types.ts +1 -1
  54. package/src/components/Toast/ToastContext.ts +1 -1
  55. package/src/components/Toolbar/index.tsx +1 -1
  56. package/src/components/Typography/Label/index.tsx +1 -1
  57. package/src/theme/global/colors/types.ts +1 -1
  58. package/src/theme/global/shadows/index.ts +0 -3
  59. package/src/theme/global/shadows/types.ts +1 -1
  60. package/src/theme/global/sizes.ts +1 -0
  61. package/src/theme/global/typography.ts +2 -1
  62. package/types/components/Accordion/AccordionItem.d.ts +1 -1
  63. package/types/components/AnimatedScroller/AnimatedScrollable.d.ts +1 -1
  64. package/types/components/AnimatedScroller/SectionListWithFAB.d.ts +1 -1
  65. package/types/components/Button/UtilityButton/index.d.ts +1 -1
  66. package/types/components/Calendar/CalendarRowItem.d.ts +1 -1
  67. package/types/components/Chart/index.d.ts +0 -3
  68. package/types/components/Chart/shared/ChartHeader.d.ts +1 -1
  69. package/types/components/Chart/shared/hooks/useScaleBandX.d.ts +2 -3
  70. package/types/components/Chart/shared/hooks/useScaleLinearY.d.ts +2 -3
  71. package/types/components/Chart/types.d.ts +1 -7
  72. package/types/components/Checkbox/utils.d.ts +2 -1
  73. package/types/components/Chip/index.d.ts +1 -1
  74. package/types/components/DatePicker/types.d.ts +1 -1
  75. package/types/components/FloatingIsland/index.d.ts +1 -1
  76. package/types/components/Illustration/index.d.ts +1 -1
  77. package/types/components/List/BasicListItem.d.ts +1 -1
  78. package/types/components/List/StyledListItem.d.ts +2 -2
  79. package/types/components/LocaleProvider/utils.d.ts +1 -1
  80. package/types/components/Portal/index.d.ts +1 -1
  81. package/types/components/Portal/types.d.ts +3 -2
  82. package/types/components/Radio/Radio.d.ts +1 -1
  83. package/types/components/Rate/index.d.ts +2 -2
  84. package/types/components/RefreshControl/index.d.ts +1 -1
  85. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -4
  86. package/types/components/RichTextEditor/utils/events.d.ts +2 -1
  87. package/types/components/Search/SearchOneLine.d.ts +1 -1
  88. package/types/components/Search/StyledSearch.d.ts +2 -1
  89. package/types/components/SectionHeading/index.d.ts +1 -1
  90. package/types/components/Select/helpers.d.ts +2 -1
  91. package/types/components/Skeleton/index.d.ts +1 -1
  92. package/types/components/Slider/RangeSlider.d.ts +1 -1
  93. package/types/components/StatusScreens/Success/index.d.ts +1 -1
  94. package/types/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.d.ts +1 -1
  95. package/types/components/Tabs/TabWithBadge.d.ts +2 -2
  96. package/types/components/TextInput/index.d.ts +2 -2
  97. package/types/components/TimePicker/types.d.ts +1 -1
  98. package/types/components/Toast/ToastContext.d.ts +2 -1
  99. package/types/components/Toolbar/index.d.ts +1 -1
  100. package/types/components/Typography/Label/index.d.ts +1 -1
  101. package/types/theme/components/alert.d.ts +10 -1
  102. package/types/theme/components/bottomNavigation.d.ts +10 -1
  103. package/types/theme/components/chip.d.ts +10 -1
  104. package/types/theme/components/fab.d.ts +10 -1
  105. package/types/theme/components/floatingIsland.d.ts +10 -1
  106. package/types/theme/components/list.d.ts +10 -1
  107. package/types/theme/components/search.d.ts +10 -1
  108. package/types/theme/components/segmentedControl.d.ts +10 -1
  109. package/types/theme/components/slider.d.ts +10 -1
  110. package/types/theme/components/toast.d.ts +10 -1
  111. package/types/theme/global/colors/types.d.ts +2 -1
  112. package/types/theme/global/index.d.ts +1 -1
  113. package/types/theme/global/shadows/index.d.ts +0 -2
  114. package/types/theme/global/shadows/types.d.ts +2 -1
  115. package/types/theme/global/typography.d.ts +1 -1
  116. package/.cursor/rules/performance-optimization.mdc +0 -64
  117. package/.cursor/rules/rn-rules.mdc +0 -165
  118. package/.cursor/rules/testing-rules.mdc +0 -114
package/es/index.js CHANGED
@@ -588,14 +588,14 @@ function _toPropertyKey(t) {
588
588
  var i = _toPrimitive(t, "string");
589
589
  return "symbol" == typeof i ? i : i + "";
590
590
  }
591
- function _typeof$1(o) {
591
+ function _typeof(o) {
592
592
  "@babel/helpers - typeof";
593
593
 
594
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
594
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
595
595
  return typeof o;
596
596
  } : function (o) {
597
597
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
598
- }, _typeof$1(o);
598
+ }, _typeof(o);
599
599
  }
600
600
  function _unsupportedIterableToArray(r, a) {
601
601
  if (r) {
@@ -1087,7 +1087,7 @@ function requireCamelize() {
1087
1087
  return walk(obj);
1088
1088
  };
1089
1089
  function walk(obj) {
1090
- if (!obj || _typeof$1(obj) !== 'object') return obj;
1090
+ if (!obj || _typeof(obj) !== 'object') return obj;
1091
1091
  if (isDate(obj) || isRegex(obj)) return obj;
1092
1092
  if (isArray(obj)) return map(obj, walk);
1093
1093
  return reduce(objectKeys(obj), function (acc, key) {
@@ -1450,7 +1450,7 @@ function requireCssToReactNative() {
1450
1450
  value: true
1451
1451
  });
1452
1452
  function _interopDefault(ex) {
1453
- return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
1453
+ return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
1454
1454
  }
1455
1455
  var parse = requireLib$1();
1456
1456
  var parse__default = _interopDefault(parse);
@@ -3333,7 +3333,7 @@ var generated = {};
3333
3333
  var buffer = '';
3334
3334
  var lastType;
3335
3335
  function handleInterpolation(interpolation, i, arr) {
3336
- var type = _typeof$1(interpolation);
3336
+ var type = _typeof(interpolation);
3337
3337
  if (type === 'string') {
3338
3338
  // strip comments
3339
3339
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -6790,7 +6790,7 @@ var _deepCompareValue = function deepCompareValue(a, b) {
6790
6790
  // If either is null or undefined (but they are not strictly equal), return false
6791
6791
  if (a == null || b == null) return false;
6792
6792
  // If types don't match, they can't be equal
6793
- if (_typeof$1(a) !== _typeof$1(b)) return false;
6793
+ if (_typeof(a) !== _typeof(b)) return false;
6794
6794
  // Handle array comparison
6795
6795
  if (Array.isArray(a) && Array.isArray(b)) {
6796
6796
  if (a.length !== b.length) return false;
@@ -6801,7 +6801,7 @@ var _deepCompareValue = function deepCompareValue(a, b) {
6801
6801
  // If one is array and the other isn't, return false
6802
6802
  if (Array.isArray(a) !== Array.isArray(b)) return false;
6803
6803
  // Handle object comparison
6804
- if (_typeof$1(a) === 'object' && _typeof$1(b) === 'object') {
6804
+ if (_typeof(a) === 'object' && _typeof(b) === 'object') {
6805
6805
  var keysA = Object.keys(a);
6806
6806
  var keysB = Object.keys(b);
6807
6807
  if (keysA.length !== keysB.length) return false;
@@ -11336,57 +11336,91 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
11336
11336
  ScrollView: BottomSheetScrollView
11337
11337
  });
11338
11338
 
11339
- function _typeof(o) {
11340
- "@babel/helpers - typeof";
11339
+ /**
11340
+ * @module constants
11341
+ * @summary Useful constants
11342
+ * @description
11343
+ * Collection of useful date constants.
11344
+ *
11345
+ * The constants could be imported from `date-fns/constants`:
11346
+ *
11347
+ * ```ts
11348
+ * import { maxTime, minTime } from "./constants/date-fns/constants";
11349
+ *
11350
+ * function isAllowedTime(time) {
11351
+ * return time <= maxTime && time >= minTime;
11352
+ * }
11353
+ * ```
11354
+ */
11341
11355
 
11342
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
11343
- return typeof o;
11344
- } : function (o) {
11345
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
11346
- }, _typeof(o);
11347
- }
11348
11356
 
11349
- function requiredArgs(required, args) {
11350
- if (args.length < required) {
11351
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
11352
- }
11353
- }
11357
+ /**
11358
+ * @constant
11359
+ * @name millisecondsInWeek
11360
+ * @summary Milliseconds in 1 week.
11361
+ */
11362
+ var millisecondsInWeek = 604800000;
11354
11363
 
11355
11364
  /**
11356
- * @name isDate
11357
- * @category Common Helpers
11358
- * @summary Is the given value a date?
11365
+ * @constant
11366
+ * @name millisecondsInDay
11367
+ * @summary Milliseconds in 1 day.
11368
+ */
11369
+ var millisecondsInDay = 86400000;
11370
+
11371
+ /**
11372
+ * @constant
11373
+ * @name constructFromSymbol
11374
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
11375
+ *
11376
+ * The symbol is used to enable the `constructFrom` function to construct a date
11377
+ * using a reference date and a value. It allows to transfer extra properties
11378
+ * from the reference date to the new date. It's useful for extensions like
11379
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
11380
+ * a constructor argument.
11381
+ */
11382
+ var constructFromSymbol = Symbol["for"]("constructDateFrom");
11383
+
11384
+ /**
11385
+ * @name constructFrom
11386
+ * @category Generic Helpers
11387
+ * @summary Constructs a date using the reference date and the value
11359
11388
  *
11360
11389
  * @description
11361
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
11390
+ * The function constructs a new date using the constructor from the reference
11391
+ * date and the given value. It helps to build generic functions that accept
11392
+ * date extensions.
11362
11393
  *
11363
- * @param {*} value - the value to check
11364
- * @returns {boolean} true if the given value is a date
11365
- * @throws {TypeError} 1 arguments required
11394
+ * It defaults to `Date` if the passed reference date is a number or a string.
11366
11395
  *
11367
- * @example
11368
- * // For a valid date:
11369
- * const result = isDate(new Date())
11370
- * //=> true
11396
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
11397
+ * enabling to transfer extra properties from the reference date to the new date.
11398
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
11399
+ * that accept a time zone as a constructor argument.
11371
11400
  *
11372
- * @example
11373
- * // For an invalid date:
11374
- * const result = isDate(new Date(NaN))
11375
- * //=> true
11401
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11376
11402
  *
11377
- * @example
11378
- * // For some value:
11379
- * const result = isDate('2014-02-31')
11380
- * //=> false
11403
+ * @param date - The reference date to take constructor from
11404
+ * @param value - The value to create the date
11405
+ *
11406
+ * @returns Date initialized using the given date and value
11381
11407
  *
11382
11408
  * @example
11383
- * // For an object:
11384
- * const result = isDate({})
11385
- * //=> false
11409
+ * import { constructFrom } from "./constructFrom/date-fns";
11410
+ *
11411
+ * // A function that clones a date preserving the original type
11412
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
11413
+ * return constructFrom(
11414
+ * date, // Use constructor from the given date
11415
+ * date.getTime() // Use the date value to create a new date
11416
+ * );
11417
+ * }
11386
11418
  */
11387
- function isDate(value) {
11388
- requiredArgs(1, arguments);
11389
- return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
11419
+ function constructFrom(date, value) {
11420
+ if (typeof date === "function") return date(value);
11421
+ if (date && _typeof(date) === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
11422
+ if (date instanceof Date) return new date.constructor(value);
11423
+ return new Date(value);
11390
11424
  }
11391
11425
 
11392
11426
  /**
@@ -11403,11 +11437,19 @@ function isDate(value) {
11403
11437
  *
11404
11438
  * If the argument is none of the above, the function returns Invalid Date.
11405
11439
  *
11440
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
11441
+ * enabling to transfer extra properties from the reference date to the new date.
11442
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
11443
+ * that accept a time zone as a constructor argument.
11444
+ *
11406
11445
  * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
11407
11446
  *
11408
- * @param {Date|Number} argument - the value to convert
11409
- * @returns {Date} the parsed date in the local time zone
11410
- * @throws {TypeError} 1 argument required
11447
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11448
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11449
+ *
11450
+ * @param argument - The value to convert
11451
+ *
11452
+ * @returns The parsed date in the local time zone
11411
11453
  *
11412
11454
  * @example
11413
11455
  * // Clone the date:
@@ -11419,27 +11461,346 @@ function isDate(value) {
11419
11461
  * const result = toDate(1392098430000)
11420
11462
  * //=> Tue Feb 11 2014 11:30:30
11421
11463
  */
11422
- function toDate(argument) {
11423
- requiredArgs(1, arguments);
11424
- var argStr = Object.prototype.toString.call(argument);
11425
-
11426
- // Clone the date
11427
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
11428
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
11429
- return new Date(argument.getTime());
11430
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
11431
- return new Date(argument);
11432
- } else {
11433
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
11434
- // eslint-disable-next-line no-console
11435
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
11436
- // eslint-disable-next-line no-console
11437
- console.warn(new Error().stack);
11464
+ function toDate(argument, context) {
11465
+ // [TODO] Get rid of `toDate` or `constructFrom`?
11466
+ return constructFrom(context || argument, argument);
11467
+ }
11468
+
11469
+ /**
11470
+ * Converts a function to a curried function that accepts arguments in reverse
11471
+ * order.
11472
+ *
11473
+ * @param fn - The function to convert to FP
11474
+ * @param arity - The arity of the function
11475
+ * @param curriedArgs - The curried arguments
11476
+ *
11477
+ * @returns FP version of the function
11478
+ *
11479
+ * @private
11480
+ */
11481
+ function convertToFP(fn, arity) {
11482
+ var curriedArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11483
+ return curriedArgs.length >= arity ? fn.apply(void 0, _toConsumableArray(curriedArgs.slice(0, arity).reverse())) : function () {
11484
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11485
+ args[_key] = arguments[_key];
11438
11486
  }
11439
- return new Date(NaN);
11487
+ return convertToFP(fn, arity, curriedArgs.concat(args));
11488
+ };
11489
+ }
11490
+
11491
+ var defaultOptions = {};
11492
+ function getDefaultOptions() {
11493
+ return defaultOptions;
11494
+ }
11495
+ function setDefaultOptions$1(newOptions) {
11496
+ defaultOptions = newOptions;
11497
+ }
11498
+
11499
+ /**
11500
+ * The {@link startOfWeek} function options.
11501
+ */
11502
+
11503
+ /**
11504
+ * @name startOfWeek
11505
+ * @category Week Helpers
11506
+ * @summary Return the start of a week for the given date.
11507
+ *
11508
+ * @description
11509
+ * Return the start of a week for the given date.
11510
+ * The result will be in the local timezone.
11511
+ *
11512
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11513
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11514
+ *
11515
+ * @param date - The original date
11516
+ * @param options - An object with options
11517
+ *
11518
+ * @returns The start of a week
11519
+ *
11520
+ * @example
11521
+ * // The start of a week for 2 September 2014 11:55:00:
11522
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
11523
+ * //=> Sun Aug 31 2014 00:00:00
11524
+ *
11525
+ * @example
11526
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
11527
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
11528
+ * //=> Mon Sep 01 2014 00:00:00
11529
+ */
11530
+ function startOfWeek(date, options) {
11531
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _defaultOptions$local;
11532
+ var defaultOptions = getDefaultOptions();
11533
+ var weekStartsOn = (_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 || (_defaultOptions$local = _defaultOptions$local.options) === null || _defaultOptions$local === void 0 ? void 0 : _defaultOptions$local.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0;
11534
+ var _date = toDate(date, options === null || options === void 0 ? void 0 : options["in"]);
11535
+ var day = _date.getDay();
11536
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
11537
+ _date.setDate(_date.getDate() - diff);
11538
+ _date.setHours(0, 0, 0, 0);
11539
+ return _date;
11540
+ }
11541
+
11542
+ /**
11543
+ * The {@link startOfISOWeek} function options.
11544
+ */
11545
+
11546
+ /**
11547
+ * @name startOfISOWeek
11548
+ * @category ISO Week Helpers
11549
+ * @summary Return the start of an ISO week for the given date.
11550
+ *
11551
+ * @description
11552
+ * Return the start of an ISO week for the given date.
11553
+ * The result will be in the local timezone.
11554
+ *
11555
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
11556
+ *
11557
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11558
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11559
+ *
11560
+ * @param date - The original date
11561
+ * @param options - An object with options
11562
+ *
11563
+ * @returns The start of an ISO week
11564
+ *
11565
+ * @example
11566
+ * // The start of an ISO week for 2 September 2014 11:55:00:
11567
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
11568
+ * //=> Mon Sep 01 2014 00:00:00
11569
+ */
11570
+ function startOfISOWeek(date, options) {
11571
+ return startOfWeek(date, _objectSpread2(_objectSpread2({}, options), {}, {
11572
+ weekStartsOn: 1
11573
+ }));
11574
+ }
11575
+
11576
+ /**
11577
+ * The {@link getISOWeekYear} function options.
11578
+ */
11579
+
11580
+ /**
11581
+ * @name getISOWeekYear
11582
+ * @category ISO Week-Numbering Year Helpers
11583
+ * @summary Get the ISO week-numbering year of the given date.
11584
+ *
11585
+ * @description
11586
+ * Get the ISO week-numbering year of the given date,
11587
+ * which always starts 3 days before the year's first Thursday.
11588
+ *
11589
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
11590
+ *
11591
+ * @param date - The given date
11592
+ *
11593
+ * @returns The ISO week-numbering year
11594
+ *
11595
+ * @example
11596
+ * // Which ISO-week numbering year is 2 January 2005?
11597
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
11598
+ * //=> 2004
11599
+ */
11600
+ function getISOWeekYear(date, options) {
11601
+ var _date = toDate(date, void 0 );
11602
+ var year = _date.getFullYear();
11603
+ var fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
11604
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
11605
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
11606
+ var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
11607
+ var fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
11608
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
11609
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
11610
+ var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
11611
+ if (_date.getTime() >= startOfNextYear.getTime()) {
11612
+ return year + 1;
11613
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
11614
+ return year;
11615
+ } else {
11616
+ return year - 1;
11440
11617
  }
11441
11618
  }
11442
11619
 
11620
+ /**
11621
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
11622
+ * They usually appear for dates that denote time before the timezones were introduced
11623
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
11624
+ * and GMT+01:00:00 after that date)
11625
+ *
11626
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
11627
+ * which would lead to incorrect calculations.
11628
+ *
11629
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
11630
+ */
11631
+ function getTimezoneOffsetInMilliseconds(date) {
11632
+ var _date = toDate(date);
11633
+ var utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
11634
+ utcDate.setUTCFullYear(_date.getFullYear());
11635
+ return +date - +utcDate;
11636
+ }
11637
+
11638
+ function normalizeDates(context) {
11639
+ for (var _len = arguments.length, dates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11640
+ dates[_key - 1] = arguments[_key];
11641
+ }
11642
+ var normalize = constructFrom.bind(null, dates.find(function (date) {
11643
+ return _typeof(date) === "object";
11644
+ }));
11645
+ return dates.map(normalize);
11646
+ }
11647
+
11648
+ /**
11649
+ * The {@link startOfDay} function options.
11650
+ */
11651
+
11652
+ /**
11653
+ * @name startOfDay
11654
+ * @category Day Helpers
11655
+ * @summary Return the start of a day for the given date.
11656
+ *
11657
+ * @description
11658
+ * Return the start of a day for the given date.
11659
+ * The result will be in the local timezone.
11660
+ *
11661
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11662
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11663
+ *
11664
+ * @param date - The original date
11665
+ * @param options - The options
11666
+ *
11667
+ * @returns The start of a day
11668
+ *
11669
+ * @example
11670
+ * // The start of a day for 2 September 2014 11:55:00:
11671
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
11672
+ * //=> Tue Sep 02 2014 00:00:00
11673
+ */
11674
+ function startOfDay(date, options) {
11675
+ var _date = toDate(date, void 0 );
11676
+ _date.setHours(0, 0, 0, 0);
11677
+ return _date;
11678
+ }
11679
+
11680
+ /**
11681
+ * The {@link differenceInCalendarDays} function options.
11682
+ */
11683
+
11684
+ /**
11685
+ * @name differenceInCalendarDays
11686
+ * @category Day Helpers
11687
+ * @summary Get the number of calendar days between the given dates.
11688
+ *
11689
+ * @description
11690
+ * Get the number of calendar days between the given dates. This means that the times are removed
11691
+ * from the dates and then the difference in days is calculated.
11692
+ *
11693
+ * @param laterDate - The later date
11694
+ * @param earlierDate - The earlier date
11695
+ * @param options - The options object
11696
+ *
11697
+ * @returns The number of calendar days
11698
+ *
11699
+ * @example
11700
+ * // How many calendar days are between
11701
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
11702
+ * const result = differenceInCalendarDays(
11703
+ * new Date(2012, 6, 2, 0, 0),
11704
+ * new Date(2011, 6, 2, 23, 0)
11705
+ * )
11706
+ * //=> 366
11707
+ * // How many calendar days are between
11708
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
11709
+ * const result = differenceInCalendarDays(
11710
+ * new Date(2011, 6, 3, 0, 1),
11711
+ * new Date(2011, 6, 2, 23, 59)
11712
+ * )
11713
+ * //=> 1
11714
+ */
11715
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
11716
+ var _normalizeDates = normalizeDates(void 0 , laterDate, earlierDate),
11717
+ _normalizeDates2 = _slicedToArray(_normalizeDates, 2),
11718
+ laterDate_ = _normalizeDates2[0],
11719
+ earlierDate_ = _normalizeDates2[1];
11720
+ var laterStartOfDay = startOfDay(laterDate_);
11721
+ var earlierStartOfDay = startOfDay(earlierDate_);
11722
+ var laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
11723
+ var earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
11724
+
11725
+ // Round the number of days to the nearest integer because the number of
11726
+ // milliseconds in a day is not constant (e.g. it's different in the week of
11727
+ // the daylight saving time clock shift).
11728
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
11729
+ }
11730
+
11731
+ /**
11732
+ * The {@link startOfISOWeekYear} function options.
11733
+ */
11734
+
11735
+ /**
11736
+ * @name startOfISOWeekYear
11737
+ * @category ISO Week-Numbering Year Helpers
11738
+ * @summary Return the start of an ISO week-numbering year for the given date.
11739
+ *
11740
+ * @description
11741
+ * Return the start of an ISO week-numbering year,
11742
+ * which always starts 3 days before the year's first Thursday.
11743
+ * The result will be in the local timezone.
11744
+ *
11745
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
11746
+ *
11747
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11748
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11749
+ *
11750
+ * @param date - The original date
11751
+ * @param options - An object with options
11752
+ *
11753
+ * @returns The start of an ISO week-numbering year
11754
+ *
11755
+ * @example
11756
+ * // The start of an ISO week-numbering year for 2 July 2005:
11757
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
11758
+ * //=> Mon Jan 03 2005 00:00:00
11759
+ */
11760
+ function startOfISOWeekYear(date, options) {
11761
+ var year = getISOWeekYear(date);
11762
+ var fourthOfJanuary = constructFrom(date, 0);
11763
+ fourthOfJanuary.setFullYear(year, 0, 4);
11764
+ fourthOfJanuary.setHours(0, 0, 0, 0);
11765
+ return startOfISOWeek(fourthOfJanuary);
11766
+ }
11767
+
11768
+ /**
11769
+ * @name isDate
11770
+ * @category Common Helpers
11771
+ * @summary Is the given value a date?
11772
+ *
11773
+ * @description
11774
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
11775
+ *
11776
+ * @param value - The value to check
11777
+ *
11778
+ * @returns True if the given value is a date
11779
+ *
11780
+ * @example
11781
+ * // For a valid date:
11782
+ * const result = isDate(new Date())
11783
+ * //=> true
11784
+ *
11785
+ * @example
11786
+ * // For an invalid date:
11787
+ * const result = isDate(new Date(NaN))
11788
+ * //=> true
11789
+ *
11790
+ * @example
11791
+ * // For some value:
11792
+ * const result = isDate('2014-02-31')
11793
+ * //=> false
11794
+ *
11795
+ * @example
11796
+ * // For an object:
11797
+ * const result = isDate({})
11798
+ * //=> false
11799
+ */
11800
+ function isDate(value) {
11801
+ return value instanceof Date || _typeof(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
11802
+ }
11803
+
11443
11804
  /**
11444
11805
  * @name isValid
11445
11806
  * @category Common Helpers
@@ -11447,14 +11808,14 @@ function toDate(argument) {
11447
11808
  *
11448
11809
  * @description
11449
11810
  * Returns false if argument is Invalid Date and true otherwise.
11450
- * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
11811
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
11451
11812
  * Invalid Date is a Date, whose time value is NaN.
11452
11813
  *
11453
11814
  * Time value of Date: http://es5.github.io/#x15.9.1.1
11454
11815
  *
11455
- * @param {*} date - the date to check
11456
- * @returns {Boolean} the date is valid
11457
- * @throws {TypeError} 1 argument required
11816
+ * @param date - The date to check
11817
+ *
11818
+ * @returns The date is valid
11458
11819
  *
11459
11820
  * @example
11460
11821
  * // For the valid date:
@@ -11462,7 +11823,7 @@ function toDate(argument) {
11462
11823
  * //=> true
11463
11824
  *
11464
11825
  * @example
11465
- * // For the value, convertable into a date:
11826
+ * // For the value, convertible into a date:
11466
11827
  * const result = isValid(1393804800000)
11467
11828
  * //=> true
11468
11829
  *
@@ -11471,227 +11832,794 @@ function toDate(argument) {
11471
11832
  * const result = isValid(new Date(''))
11472
11833
  * //=> false
11473
11834
  */
11474
- function isValid(dirtyDate) {
11475
- requiredArgs(1, arguments);
11476
- if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
11477
- return false;
11478
- }
11479
- var date = toDate(dirtyDate);
11480
- return !isNaN(Number(date));
11835
+ function isValid(date) {
11836
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
11481
11837
  }
11482
11838
 
11483
- function toInteger(dirtyNumber) {
11484
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
11485
- return NaN;
11486
- }
11487
- var number = Number(dirtyNumber);
11488
- if (isNaN(number)) {
11489
- return number;
11490
- }
11491
- return number < 0 ? Math.ceil(number) : Math.floor(number);
11492
- }
11839
+ /**
11840
+ * The {@link startOfYear} function options.
11841
+ */
11493
11842
 
11494
11843
  /**
11495
- * @name addMilliseconds
11496
- * @category Millisecond Helpers
11497
- * @summary Add the specified number of milliseconds to the given date.
11844
+ * @name startOfYear
11845
+ * @category Year Helpers
11846
+ * @summary Return the start of a year for the given date.
11498
11847
  *
11499
11848
  * @description
11500
- * Add the specified number of milliseconds to the given date.
11849
+ * Return the start of a year for the given date.
11850
+ * The result will be in the local timezone.
11851
+ *
11852
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
11853
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
11854
+ *
11855
+ * @param date - The original date
11856
+ * @param options - The options
11501
11857
  *
11502
- * @param {Date|Number} date - the date to be changed
11503
- * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
11504
- * @returns {Date} the new date with the milliseconds added
11505
- * @throws {TypeError} 2 arguments required
11858
+ * @returns The start of a year
11506
11859
  *
11507
11860
  * @example
11508
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
11509
- * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
11510
- * //=> Thu Jul 10 2014 12:45:30.750
11861
+ * // The start of a year for 2 September 2014 11:55:00:
11862
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
11863
+ * //=> Wed Jan 01 2014 00:00:00
11511
11864
  */
11512
- function addMilliseconds(dirtyDate, dirtyAmount) {
11513
- requiredArgs(2, arguments);
11514
- var timestamp = toDate(dirtyDate).getTime();
11515
- var amount = toInteger(dirtyAmount);
11516
- return new Date(timestamp + amount);
11865
+ function startOfYear(date, options) {
11866
+ var date_ = toDate(date, void 0 );
11867
+ date_.setFullYear(date_.getFullYear(), 0, 1);
11868
+ date_.setHours(0, 0, 0, 0);
11869
+ return date_;
11517
11870
  }
11518
11871
 
11872
+ var formatDistanceLocale$1 = {
11873
+ lessThanXSeconds: {
11874
+ one: "less than a second",
11875
+ other: "less than {{count}} seconds"
11876
+ },
11877
+ xSeconds: {
11878
+ one: "1 second",
11879
+ other: "{{count}} seconds"
11880
+ },
11881
+ halfAMinute: "half a minute",
11882
+ lessThanXMinutes: {
11883
+ one: "less than a minute",
11884
+ other: "less than {{count}} minutes"
11885
+ },
11886
+ xMinutes: {
11887
+ one: "1 minute",
11888
+ other: "{{count}} minutes"
11889
+ },
11890
+ aboutXHours: {
11891
+ one: "about 1 hour",
11892
+ other: "about {{count}} hours"
11893
+ },
11894
+ xHours: {
11895
+ one: "1 hour",
11896
+ other: "{{count}} hours"
11897
+ },
11898
+ xDays: {
11899
+ one: "1 day",
11900
+ other: "{{count}} days"
11901
+ },
11902
+ aboutXWeeks: {
11903
+ one: "about 1 week",
11904
+ other: "about {{count}} weeks"
11905
+ },
11906
+ xWeeks: {
11907
+ one: "1 week",
11908
+ other: "{{count}} weeks"
11909
+ },
11910
+ aboutXMonths: {
11911
+ one: "about 1 month",
11912
+ other: "about {{count}} months"
11913
+ },
11914
+ xMonths: {
11915
+ one: "1 month",
11916
+ other: "{{count}} months"
11917
+ },
11918
+ aboutXYears: {
11919
+ one: "about 1 year",
11920
+ other: "about {{count}} years"
11921
+ },
11922
+ xYears: {
11923
+ one: "1 year",
11924
+ other: "{{count}} years"
11925
+ },
11926
+ overXYears: {
11927
+ one: "over 1 year",
11928
+ other: "over {{count}} years"
11929
+ },
11930
+ almostXYears: {
11931
+ one: "almost 1 year",
11932
+ other: "almost {{count}} years"
11933
+ }
11934
+ };
11935
+ var formatDistance$1 = function formatDistance(token, count, options) {
11936
+ var result;
11937
+ var tokenValue = formatDistanceLocale$1[token];
11938
+ if (typeof tokenValue === "string") {
11939
+ result = tokenValue;
11940
+ } else if (count === 1) {
11941
+ result = tokenValue.one;
11942
+ } else {
11943
+ result = tokenValue.other.replace("{{count}}", count.toString());
11944
+ }
11945
+ if (options !== null && options !== void 0 && options.addSuffix) {
11946
+ if (options.comparison && options.comparison > 0) {
11947
+ return "in " + result;
11948
+ } else {
11949
+ return result + " ago";
11950
+ }
11951
+ }
11952
+ return result;
11953
+ };
11954
+
11955
+ function buildFormatLongFn(args) {
11956
+ return function () {
11957
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11958
+ // TODO: Remove String()
11959
+ var width = options.width ? String(options.width) : args.defaultWidth;
11960
+ var format = args.formats[width] || args.formats[args.defaultWidth];
11961
+ return format;
11962
+ };
11963
+ }
11964
+
11965
+ var dateFormats$2 = {
11966
+ full: "EEEE, MMMM do, y",
11967
+ "long": "MMMM do, y",
11968
+ medium: "MMM d, y",
11969
+ "short": "MM/dd/yyyy"
11970
+ };
11971
+ var timeFormats$2 = {
11972
+ full: "h:mm:ss a zzzz",
11973
+ "long": "h:mm:ss a z",
11974
+ medium: "h:mm:ss a",
11975
+ "short": "h:mm a"
11976
+ };
11977
+ var dateTimeFormats$2 = {
11978
+ full: "{{date}} 'at' {{time}}",
11979
+ "long": "{{date}} 'at' {{time}}",
11980
+ medium: "{{date}}, {{time}}",
11981
+ "short": "{{date}}, {{time}}"
11982
+ };
11983
+ var formatLong$2 = {
11984
+ date: buildFormatLongFn({
11985
+ formats: dateFormats$2,
11986
+ defaultWidth: "full"
11987
+ }),
11988
+ time: buildFormatLongFn({
11989
+ formats: timeFormats$2,
11990
+ defaultWidth: "full"
11991
+ }),
11992
+ dateTime: buildFormatLongFn({
11993
+ formats: dateTimeFormats$2,
11994
+ defaultWidth: "full"
11995
+ })
11996
+ };
11997
+
11998
+ var formatRelativeLocale = {
11999
+ lastWeek: "'last' eeee 'at' p",
12000
+ yesterday: "'yesterday at' p",
12001
+ today: "'today at' p",
12002
+ tomorrow: "'tomorrow at' p",
12003
+ nextWeek: "eeee 'at' p",
12004
+ other: "P"
12005
+ };
12006
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
12007
+ return formatRelativeLocale[token];
12008
+ };
12009
+
11519
12010
  /**
11520
- * @name subMilliseconds
11521
- * @category Millisecond Helpers
11522
- * @summary Subtract the specified number of milliseconds from the given date.
12011
+ * The localize function argument callback which allows to convert raw value to
12012
+ * the actual type.
11523
12013
  *
11524
- * @description
11525
- * Subtract the specified number of milliseconds from the given date.
11526
- *
11527
- * @param {Date|Number} date - the date to be changed
11528
- * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
11529
- * @returns {Date} the new date with the milliseconds subtracted
11530
- * @throws {TypeError} 2 arguments required
12014
+ * @param value - The value to convert
11531
12015
  *
11532
- * @example
11533
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
11534
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
11535
- * //=> Thu Jul 10 2014 12:45:29.250
12016
+ * @returns The converted value
11536
12017
  */
11537
- function subMilliseconds(dirtyDate, dirtyAmount) {
11538
- requiredArgs(2, arguments);
11539
- var amount = toInteger(dirtyAmount);
11540
- return addMilliseconds(dirtyDate, -amount);
11541
- }
11542
-
11543
- var MILLISECONDS_IN_DAY = 86400000;
11544
- function getUTCDayOfYear(dirtyDate) {
11545
- requiredArgs(1, arguments);
11546
- var date = toDate(dirtyDate);
11547
- var timestamp = date.getTime();
11548
- date.setUTCMonth(0, 1);
11549
- date.setUTCHours(0, 0, 0, 0);
11550
- var startOfYearTimestamp = date.getTime();
11551
- var difference = timestamp - startOfYearTimestamp;
11552
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
11553
- }
11554
-
11555
- function startOfUTCISOWeek(dirtyDate) {
11556
- requiredArgs(1, arguments);
11557
- var weekStartsOn = 1;
11558
- var date = toDate(dirtyDate);
11559
- var day = date.getUTCDay();
11560
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
11561
- date.setUTCDate(date.getUTCDate() - diff);
11562
- date.setUTCHours(0, 0, 0, 0);
11563
- return date;
11564
- }
11565
-
11566
- function getUTCISOWeekYear(dirtyDate) {
11567
- requiredArgs(1, arguments);
11568
- var date = toDate(dirtyDate);
11569
- var year = date.getUTCFullYear();
11570
- var fourthOfJanuaryOfNextYear = new Date(0);
11571
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
11572
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
11573
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
11574
- var fourthOfJanuaryOfThisYear = new Date(0);
11575
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
11576
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
11577
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
11578
- if (date.getTime() >= startOfNextYear.getTime()) {
11579
- return year + 1;
11580
- } else if (date.getTime() >= startOfThisYear.getTime()) {
11581
- return year;
11582
- } else {
11583
- return year - 1;
11584
- }
11585
- }
11586
12018
 
11587
- function startOfUTCISOWeekYear(dirtyDate) {
11588
- requiredArgs(1, arguments);
11589
- var year = getUTCISOWeekYear(dirtyDate);
11590
- var fourthOfJanuary = new Date(0);
11591
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
11592
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
11593
- var date = startOfUTCISOWeek(fourthOfJanuary);
11594
- return date;
11595
- }
12019
+ /**
12020
+ * The map of localized values for each width.
12021
+ */
11596
12022
 
11597
- var MILLISECONDS_IN_WEEK$1 = 604800000;
11598
- function getUTCISOWeek(dirtyDate) {
11599
- requiredArgs(1, arguments);
11600
- var date = toDate(dirtyDate);
11601
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
12023
+ /**
12024
+ * The index type of the locale unit value. It types conversion of units of
12025
+ * values that don't start at 0 (i.e. quarters).
12026
+ */
12027
+
12028
+ /**
12029
+ * Converts the unit value to the tuple of values.
12030
+ */
11602
12031
 
11603
- // Round the number of days to the nearest integer
11604
- // because the number of milliseconds in a week is not constant
11605
- // (e.g. it's different in the week of the daylight saving time clock shift)
11606
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
12032
+ /**
12033
+ * The tuple of localized era values. The first element represents BC,
12034
+ * the second element represents AD.
12035
+ */
12036
+
12037
+ /**
12038
+ * The tuple of localized quarter values. The first element represents Q1.
12039
+ */
12040
+
12041
+ /**
12042
+ * The tuple of localized day values. The first element represents Sunday.
12043
+ */
12044
+
12045
+ /**
12046
+ * The tuple of localized month values. The first element represents January.
12047
+ */
12048
+
12049
+ function buildLocalizeFn(args) {
12050
+ return function (value, options) {
12051
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
12052
+ var valuesArray;
12053
+ if (context === "formatting" && args.formattingValues) {
12054
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
12055
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
12056
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
12057
+ } else {
12058
+ var _defaultWidth = args.defaultWidth;
12059
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
12060
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
12061
+ }
12062
+ var index = args.argumentCallback ? args.argumentCallback(value) : value;
12063
+
12064
+ // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
12065
+ return valuesArray[index];
12066
+ };
11607
12067
  }
11608
12068
 
11609
- var defaultOptions = {};
11610
- function getDefaultOptions() {
11611
- return defaultOptions;
12069
+ var eraValues = {
12070
+ narrow: ["B", "A"],
12071
+ abbreviated: ["BC", "AD"],
12072
+ wide: ["Before Christ", "Anno Domini"]
12073
+ };
12074
+ var quarterValues = {
12075
+ narrow: ["1", "2", "3", "4"],
12076
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
12077
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
12078
+ };
12079
+
12080
+ // Note: in English, the names of days of the week and months are capitalized.
12081
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
12082
+ // Generally, formatted dates should look like they are in the middle of a sentence,
12083
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
12084
+ var monthValues = {
12085
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
12086
+ abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
12087
+ wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
12088
+ };
12089
+ var dayValues = {
12090
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
12091
+ "short": ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
12092
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
12093
+ wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
12094
+ };
12095
+ var dayPeriodValues = {
12096
+ narrow: {
12097
+ am: "a",
12098
+ pm: "p",
12099
+ midnight: "mi",
12100
+ noon: "n",
12101
+ morning: "morning",
12102
+ afternoon: "afternoon",
12103
+ evening: "evening",
12104
+ night: "night"
12105
+ },
12106
+ abbreviated: {
12107
+ am: "AM",
12108
+ pm: "PM",
12109
+ midnight: "midnight",
12110
+ noon: "noon",
12111
+ morning: "morning",
12112
+ afternoon: "afternoon",
12113
+ evening: "evening",
12114
+ night: "night"
12115
+ },
12116
+ wide: {
12117
+ am: "a.m.",
12118
+ pm: "p.m.",
12119
+ midnight: "midnight",
12120
+ noon: "noon",
12121
+ morning: "morning",
12122
+ afternoon: "afternoon",
12123
+ evening: "evening",
12124
+ night: "night"
12125
+ }
12126
+ };
12127
+ var formattingDayPeriodValues = {
12128
+ narrow: {
12129
+ am: "a",
12130
+ pm: "p",
12131
+ midnight: "mi",
12132
+ noon: "n",
12133
+ morning: "in the morning",
12134
+ afternoon: "in the afternoon",
12135
+ evening: "in the evening",
12136
+ night: "at night"
12137
+ },
12138
+ abbreviated: {
12139
+ am: "AM",
12140
+ pm: "PM",
12141
+ midnight: "midnight",
12142
+ noon: "noon",
12143
+ morning: "in the morning",
12144
+ afternoon: "in the afternoon",
12145
+ evening: "in the evening",
12146
+ night: "at night"
12147
+ },
12148
+ wide: {
12149
+ am: "a.m.",
12150
+ pm: "p.m.",
12151
+ midnight: "midnight",
12152
+ noon: "noon",
12153
+ morning: "in the morning",
12154
+ afternoon: "in the afternoon",
12155
+ evening: "in the evening",
12156
+ night: "at night"
12157
+ }
12158
+ };
12159
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
12160
+ var number = Number(dirtyNumber);
12161
+
12162
+ // If ordinal numbers depend on context, for example,
12163
+ // if they are different for different grammatical genders,
12164
+ // use `options.unit`.
12165
+ //
12166
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
12167
+ // 'day', 'hour', 'minute', 'second'.
12168
+
12169
+ var rem100 = number % 100;
12170
+ if (rem100 > 20 || rem100 < 10) {
12171
+ switch (rem100 % 10) {
12172
+ case 1:
12173
+ return number + "st";
12174
+ case 2:
12175
+ return number + "nd";
12176
+ case 3:
12177
+ return number + "rd";
12178
+ }
12179
+ }
12180
+ return number + "th";
12181
+ };
12182
+ var localize = {
12183
+ ordinalNumber: ordinalNumber,
12184
+ era: buildLocalizeFn({
12185
+ values: eraValues,
12186
+ defaultWidth: "wide"
12187
+ }),
12188
+ quarter: buildLocalizeFn({
12189
+ values: quarterValues,
12190
+ defaultWidth: "wide",
12191
+ argumentCallback: function argumentCallback(quarter) {
12192
+ return quarter - 1;
12193
+ }
12194
+ }),
12195
+ month: buildLocalizeFn({
12196
+ values: monthValues,
12197
+ defaultWidth: "wide"
12198
+ }),
12199
+ day: buildLocalizeFn({
12200
+ values: dayValues,
12201
+ defaultWidth: "wide"
12202
+ }),
12203
+ dayPeriod: buildLocalizeFn({
12204
+ values: dayPeriodValues,
12205
+ defaultWidth: "wide",
12206
+ formattingValues: formattingDayPeriodValues,
12207
+ defaultFormattingWidth: "wide"
12208
+ })
12209
+ };
12210
+
12211
+ function buildMatchFn(args) {
12212
+ return function (string) {
12213
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12214
+ var width = options.width;
12215
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
12216
+ var matchResult = string.match(matchPattern);
12217
+ if (!matchResult) {
12218
+ return null;
12219
+ }
12220
+ var matchedString = matchResult[0];
12221
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
12222
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
12223
+ return pattern.test(matchedString);
12224
+ }) :
12225
+ // [TODO] -- I challenge you to fix the type
12226
+ findKey(parsePatterns, function (pattern) {
12227
+ return pattern.test(matchedString);
12228
+ });
12229
+ var value;
12230
+ value = args.valueCallback ? args.valueCallback(key) : key;
12231
+ value = options.valueCallback ?
12232
+ // [TODO] -- I challenge you to fix the type
12233
+ options.valueCallback(value) : value;
12234
+ var rest = string.slice(matchedString.length);
12235
+ return {
12236
+ value: value,
12237
+ rest: rest
12238
+ };
12239
+ };
11612
12240
  }
11613
- function setDefaultOptions$1(newOptions) {
11614
- defaultOptions = newOptions;
12241
+ function findKey(object, predicate) {
12242
+ for (var key in object) {
12243
+ if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
12244
+ return key;
12245
+ }
12246
+ }
12247
+ return undefined;
12248
+ }
12249
+ function findIndex(array, predicate) {
12250
+ for (var key = 0; key < array.length; key++) {
12251
+ if (predicate(array[key])) {
12252
+ return key;
12253
+ }
12254
+ }
12255
+ return undefined;
11615
12256
  }
11616
12257
 
11617
- function startOfUTCWeek(dirtyDate, options) {
11618
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11619
- requiredArgs(1, arguments);
11620
- var defaultOptions = getDefaultOptions();
11621
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
12258
+ function buildMatchPatternFn(args) {
12259
+ return function (string) {
12260
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12261
+ var matchResult = string.match(args.matchPattern);
12262
+ if (!matchResult) return null;
12263
+ var matchedString = matchResult[0];
12264
+ var parseResult = string.match(args.parsePattern);
12265
+ if (!parseResult) return null;
12266
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
12267
+
12268
+ // [TODO] I challenge you to fix the type
12269
+ value = options.valueCallback ? options.valueCallback(value) : value;
12270
+ var rest = string.slice(matchedString.length);
12271
+ return {
12272
+ value: value,
12273
+ rest: rest
12274
+ };
12275
+ };
12276
+ }
12277
+
12278
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
12279
+ var parseOrdinalNumberPattern = /\d+/i;
12280
+ var matchEraPatterns = {
12281
+ narrow: /^(b|a)/i,
12282
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
12283
+ wide: /^(before christ|before common era|anno domini|common era)/i
12284
+ };
12285
+ var parseEraPatterns = {
12286
+ any: [/^b/i, /^(a|c)/i]
12287
+ };
12288
+ var matchQuarterPatterns = {
12289
+ narrow: /^[1234]/i,
12290
+ abbreviated: /^q[1234]/i,
12291
+ wide: /^[1234](th|st|nd|rd)? quarter/i
12292
+ };
12293
+ var parseQuarterPatterns = {
12294
+ any: [/1/i, /2/i, /3/i, /4/i]
12295
+ };
12296
+ var matchMonthPatterns = {
12297
+ narrow: /^[jfmasond]/i,
12298
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
12299
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
12300
+ };
12301
+ var parseMonthPatterns = {
12302
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
12303
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
12304
+ };
12305
+ var matchDayPatterns = {
12306
+ narrow: /^[smtwf]/i,
12307
+ "short": /^(su|mo|tu|we|th|fr|sa)/i,
12308
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
12309
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
12310
+ };
12311
+ var parseDayPatterns = {
12312
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
12313
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
12314
+ };
12315
+ var matchDayPeriodPatterns = {
12316
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
12317
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
12318
+ };
12319
+ var parseDayPeriodPatterns = {
12320
+ any: {
12321
+ am: /^a/i,
12322
+ pm: /^p/i,
12323
+ midnight: /^mi/i,
12324
+ noon: /^no/i,
12325
+ morning: /morning/i,
12326
+ afternoon: /afternoon/i,
12327
+ evening: /evening/i,
12328
+ night: /night/i
12329
+ }
12330
+ };
12331
+ var match = {
12332
+ ordinalNumber: buildMatchPatternFn({
12333
+ matchPattern: matchOrdinalNumberPattern,
12334
+ parsePattern: parseOrdinalNumberPattern,
12335
+ valueCallback: function valueCallback(value) {
12336
+ return parseInt(value, 10);
12337
+ }
12338
+ }),
12339
+ era: buildMatchFn({
12340
+ matchPatterns: matchEraPatterns,
12341
+ defaultMatchWidth: "wide",
12342
+ parsePatterns: parseEraPatterns,
12343
+ defaultParseWidth: "any"
12344
+ }),
12345
+ quarter: buildMatchFn({
12346
+ matchPatterns: matchQuarterPatterns,
12347
+ defaultMatchWidth: "wide",
12348
+ parsePatterns: parseQuarterPatterns,
12349
+ defaultParseWidth: "any",
12350
+ valueCallback: function valueCallback(index) {
12351
+ return index + 1;
12352
+ }
12353
+ }),
12354
+ month: buildMatchFn({
12355
+ matchPatterns: matchMonthPatterns,
12356
+ defaultMatchWidth: "wide",
12357
+ parsePatterns: parseMonthPatterns,
12358
+ defaultParseWidth: "any"
12359
+ }),
12360
+ day: buildMatchFn({
12361
+ matchPatterns: matchDayPatterns,
12362
+ defaultMatchWidth: "wide",
12363
+ parsePatterns: parseDayPatterns,
12364
+ defaultParseWidth: "any"
12365
+ }),
12366
+ dayPeriod: buildMatchFn({
12367
+ matchPatterns: matchDayPeriodPatterns,
12368
+ defaultMatchWidth: "any",
12369
+ parsePatterns: parseDayPeriodPatterns,
12370
+ defaultParseWidth: "any"
12371
+ })
12372
+ };
11622
12373
 
11623
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11624
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11625
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
12374
+ /**
12375
+ * @category Locales
12376
+ * @summary English locale (United States).
12377
+ * @language English
12378
+ * @iso-639-2 eng
12379
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
12380
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
12381
+ */
12382
+ var enUS = {
12383
+ code: "en-US",
12384
+ formatDistance: formatDistance$1,
12385
+ formatLong: formatLong$2,
12386
+ formatRelative: formatRelative,
12387
+ localize: localize,
12388
+ match: match,
12389
+ options: {
12390
+ weekStartsOn: 0 /* Sunday */,
12391
+ firstWeekContainsDate: 1
11626
12392
  }
11627
- var date = toDate(dirtyDate);
11628
- var day = date.getUTCDay();
11629
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
11630
- date.setUTCDate(date.getUTCDate() - diff);
11631
- date.setUTCHours(0, 0, 0, 0);
11632
- return date;
12393
+ };
12394
+
12395
+ /**
12396
+ * The {@link getDayOfYear} function options.
12397
+ */
12398
+
12399
+ /**
12400
+ * @name getDayOfYear
12401
+ * @category Day Helpers
12402
+ * @summary Get the day of the year of the given date.
12403
+ *
12404
+ * @description
12405
+ * Get the day of the year of the given date.
12406
+ *
12407
+ * @param date - The given date
12408
+ * @param options - The options
12409
+ *
12410
+ * @returns The day of year
12411
+ *
12412
+ * @example
12413
+ * // Which day of the year is 2 July 2014?
12414
+ * const result = getDayOfYear(new Date(2014, 6, 2))
12415
+ * //=> 183
12416
+ */
12417
+ function getDayOfYear(date, options) {
12418
+ var _date = toDate(date, void 0 );
12419
+ var diff = differenceInCalendarDays(_date, startOfYear(_date));
12420
+ var dayOfYear = diff + 1;
12421
+ return dayOfYear;
12422
+ }
12423
+
12424
+ /**
12425
+ * The {@link getISOWeek} function options.
12426
+ */
12427
+
12428
+ /**
12429
+ * @name getISOWeek
12430
+ * @category ISO Week Helpers
12431
+ * @summary Get the ISO week of the given date.
12432
+ *
12433
+ * @description
12434
+ * Get the ISO week of the given date.
12435
+ *
12436
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
12437
+ *
12438
+ * @param date - The given date
12439
+ * @param options - The options
12440
+ *
12441
+ * @returns The ISO week
12442
+ *
12443
+ * @example
12444
+ * // Which week of the ISO-week numbering year is 2 January 2005?
12445
+ * const result = getISOWeek(new Date(2005, 0, 2))
12446
+ * //=> 53
12447
+ */
12448
+ function getISOWeek(date, options) {
12449
+ var _date = toDate(date, void 0 );
12450
+ var diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
12451
+
12452
+ // Round the number of weeks to the nearest integer because the number of
12453
+ // milliseconds in a week is not constant (e.g. it's different in the week of
12454
+ // the daylight saving time clock shift).
12455
+ return Math.round(diff / millisecondsInWeek) + 1;
11633
12456
  }
11634
12457
 
11635
- function getUTCWeekYear(dirtyDate, options) {
11636
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11637
- requiredArgs(1, arguments);
11638
- var date = toDate(dirtyDate);
11639
- var year = date.getUTCFullYear();
12458
+ /**
12459
+ * The {@link getWeekYear} function options.
12460
+ */
12461
+
12462
+ /**
12463
+ * @name getWeekYear
12464
+ * @category Week-Numbering Year Helpers
12465
+ * @summary Get the local week-numbering year of the given date.
12466
+ *
12467
+ * @description
12468
+ * Get the local week-numbering year of the given date.
12469
+ * The exact calculation depends on the values of
12470
+ * `options.weekStartsOn` (which is the index of the first day of the week)
12471
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
12472
+ * the first week of the week-numbering year)
12473
+ *
12474
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
12475
+ *
12476
+ * @param date - The given date
12477
+ * @param options - An object with options.
12478
+ *
12479
+ * @returns The local week-numbering year
12480
+ *
12481
+ * @example
12482
+ * // Which week numbering year is 26 December 2004 with the default settings?
12483
+ * const result = getWeekYear(new Date(2004, 11, 26))
12484
+ * //=> 2005
12485
+ *
12486
+ * @example
12487
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
12488
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
12489
+ * //=> 2004
12490
+ *
12491
+ * @example
12492
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
12493
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
12494
+ * //=> 2004
12495
+ */
12496
+ function getWeekYear(date, options) {
12497
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _defaultOptions$local;
12498
+ var _date = toDate(date, options === null || options === void 0 ? void 0 : options["in"]);
12499
+ var year = _date.getFullYear();
11640
12500
  var defaultOptions = getDefaultOptions();
11641
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
11642
-
11643
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11644
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11645
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11646
- }
11647
- var firstWeekOfNextYear = new Date(0);
11648
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
11649
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
11650
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
11651
- var firstWeekOfThisYear = new Date(0);
11652
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
11653
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
11654
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
11655
- if (date.getTime() >= startOfNextYear.getTime()) {
12501
+ var firstWeekContainsDate = (_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 || (_defaultOptions$local = _defaultOptions$local.options) === null || _defaultOptions$local === void 0 ? void 0 : _defaultOptions$local.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1;
12502
+ var firstWeekOfNextYear = constructFrom((options === null || options === void 0 ? void 0 : options["in"]) || date, 0);
12503
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
12504
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
12505
+ var startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
12506
+ var firstWeekOfThisYear = constructFrom((options === null || options === void 0 ? void 0 : options["in"]) || date, 0);
12507
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
12508
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
12509
+ var startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
12510
+ if (+_date >= +startOfNextYear) {
11656
12511
  return year + 1;
11657
- } else if (date.getTime() >= startOfThisYear.getTime()) {
12512
+ } else if (+_date >= +startOfThisYear) {
11658
12513
  return year;
11659
12514
  } else {
11660
12515
  return year - 1;
11661
12516
  }
11662
12517
  }
11663
12518
 
11664
- function startOfUTCWeekYear(dirtyDate, options) {
11665
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
11666
- requiredArgs(1, arguments);
12519
+ /**
12520
+ * The {@link startOfWeekYear} function options.
12521
+ */
12522
+
12523
+ /**
12524
+ * @name startOfWeekYear
12525
+ * @category Week-Numbering Year Helpers
12526
+ * @summary Return the start of a local week-numbering year for the given date.
12527
+ *
12528
+ * @description
12529
+ * Return the start of a local week-numbering year.
12530
+ * The exact calculation depends on the values of
12531
+ * `options.weekStartsOn` (which is the index of the first day of the week)
12532
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
12533
+ * the first week of the week-numbering year)
12534
+ *
12535
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
12536
+ *
12537
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
12538
+ * @typeParam ResultDate - The result `Date` type.
12539
+ *
12540
+ * @param date - The original date
12541
+ * @param options - An object with options
12542
+ *
12543
+ * @returns The start of a week-numbering year
12544
+ *
12545
+ * @example
12546
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
12547
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
12548
+ * //=> Sun Dec 26 2004 00:00:00
12549
+ *
12550
+ * @example
12551
+ * // The start of a week-numbering year for 2 July 2005
12552
+ * // if Monday is the first day of week
12553
+ * // and 4 January is always in the first week of the year:
12554
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
12555
+ * weekStartsOn: 1,
12556
+ * firstWeekContainsDate: 4
12557
+ * })
12558
+ * //=> Mon Jan 03 2005 00:00:00
12559
+ */
12560
+ function startOfWeekYear(date, options) {
12561
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _defaultOptions$local;
11667
12562
  var defaultOptions = getDefaultOptions();
11668
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
11669
- var year = getUTCWeekYear(dirtyDate, options);
11670
- var firstWeek = new Date(0);
11671
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
11672
- firstWeek.setUTCHours(0, 0, 0, 0);
11673
- var date = startOfUTCWeek(firstWeek, options);
11674
- return date;
12563
+ var firstWeekContainsDate = (_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 || (_options$locale = options.locale) === null || _options$locale === void 0 || (_options$locale = _options$locale.options) === null || _options$locale === void 0 ? void 0 : _options$locale.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 || (_defaultOptions$local = _defaultOptions$local.options) === null || _defaultOptions$local === void 0 ? void 0 : _defaultOptions$local.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1;
12564
+ var year = getWeekYear(date, options);
12565
+ var firstWeek = constructFrom((options === null || options === void 0 ? void 0 : options["in"]) || date, 0);
12566
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
12567
+ firstWeek.setHours(0, 0, 0, 0);
12568
+ var _date = startOfWeek(firstWeek, options);
12569
+ return _date;
11675
12570
  }
11676
12571
 
11677
- var MILLISECONDS_IN_WEEK = 604800000;
11678
- function getUTCWeek(dirtyDate, options) {
11679
- requiredArgs(1, arguments);
11680
- var date = toDate(dirtyDate);
11681
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
12572
+ /**
12573
+ * The {@link getWeek} function options.
12574
+ */
11682
12575
 
11683
- // Round the number of days to the nearest integer
11684
- // because the number of milliseconds in a week is not constant
11685
- // (e.g. it's different in the week of the daylight saving time clock shift)
11686
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
12576
+ /**
12577
+ * @name getWeek
12578
+ * @category Week Helpers
12579
+ * @summary Get the local week index of the given date.
12580
+ *
12581
+ * @description
12582
+ * Get the local week index of the given date.
12583
+ * The exact calculation depends on the values of
12584
+ * `options.weekStartsOn` (which is the index of the first day of the week)
12585
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
12586
+ * the first week of the week-numbering year)
12587
+ *
12588
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
12589
+ *
12590
+ * @param date - The given date
12591
+ * @param options - An object with options
12592
+ *
12593
+ * @returns The week
12594
+ *
12595
+ * @example
12596
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
12597
+ * const result = getWeek(new Date(2005, 0, 2))
12598
+ * //=> 2
12599
+ *
12600
+ * @example
12601
+ * // Which week of the local week numbering year is 2 January 2005,
12602
+ * // if Monday is the first day of the week,
12603
+ * // and the first week of the year always contains 4 January?
12604
+ * const result = getWeek(new Date(2005, 0, 2), {
12605
+ * weekStartsOn: 1,
12606
+ * firstWeekContainsDate: 4
12607
+ * })
12608
+ * //=> 53
12609
+ */
12610
+ function getWeek(date, options) {
12611
+ var _date = toDate(date, options === null || options === void 0 ? void 0 : options["in"]);
12612
+ var diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
12613
+
12614
+ // Round the number of weeks to the nearest integer because the number of
12615
+ // milliseconds in a week is not constant (e.g. it's different in the week of
12616
+ // the daylight saving time clock shift).
12617
+ return Math.round(diff / millisecondsInWeek) + 1;
11687
12618
  }
11688
12619
 
11689
12620
  function addLeadingZeros(number, targetLength) {
11690
- var sign = number < 0 ? '-' : '';
11691
- var output = Math.abs(number).toString();
11692
- while (output.length < targetLength) {
11693
- output = '0' + output;
11694
- }
12621
+ var sign = number < 0 ? "-" : "";
12622
+ var output = Math.abs(number).toString().padStart(targetLength, "0");
11695
12623
  return sign + output;
11696
12624
  }
11697
12625
 
@@ -11707,7 +12635,8 @@ function addLeadingZeros(number, targetLength) {
11707
12635
  *
11708
12636
  * Letters marked by * are not implemented but reserved by Unicode standard.
11709
12637
  */
11710
- var formatters$1 = {
12638
+
12639
+ var lightFormatters = {
11711
12640
  // Year
11712
12641
  y: function y(date, token) {
11713
12642
  // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
@@ -11719,71 +12648,72 @@ var formatters$1 = {
11719
12648
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
11720
12649
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
11721
12650
 
11722
- var signedYear = date.getUTCFullYear();
12651
+ var signedYear = date.getFullYear();
11723
12652
  // Returns 1 for 1 BC (which is year 0 in JavaScript)
11724
12653
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
11725
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
12654
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
11726
12655
  },
11727
12656
  // Month
11728
12657
  M: function M(date, token) {
11729
- var month = date.getUTCMonth();
11730
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
12658
+ var month = date.getMonth();
12659
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
11731
12660
  },
11732
12661
  // Day of the month
11733
12662
  d: function d(date, token) {
11734
- return addLeadingZeros(date.getUTCDate(), token.length);
12663
+ return addLeadingZeros(date.getDate(), token.length);
11735
12664
  },
11736
12665
  // AM or PM
11737
12666
  a: function a(date, token) {
11738
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
12667
+ var dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
11739
12668
  switch (token) {
11740
- case 'a':
11741
- case 'aa':
12669
+ case "a":
12670
+ case "aa":
11742
12671
  return dayPeriodEnumValue.toUpperCase();
11743
- case 'aaa':
12672
+ case "aaa":
11744
12673
  return dayPeriodEnumValue;
11745
- case 'aaaaa':
12674
+ case "aaaaa":
11746
12675
  return dayPeriodEnumValue[0];
11747
- case 'aaaa':
12676
+ case "aaaa":
11748
12677
  default:
11749
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
12678
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
11750
12679
  }
11751
12680
  },
11752
12681
  // Hour [1-12]
11753
12682
  h: function h(date, token) {
11754
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
12683
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
11755
12684
  },
11756
12685
  // Hour [0-23]
11757
12686
  H: function H(date, token) {
11758
- return addLeadingZeros(date.getUTCHours(), token.length);
12687
+ return addLeadingZeros(date.getHours(), token.length);
11759
12688
  },
11760
12689
  // Minute
11761
12690
  m: function m(date, token) {
11762
- return addLeadingZeros(date.getUTCMinutes(), token.length);
12691
+ return addLeadingZeros(date.getMinutes(), token.length);
11763
12692
  },
11764
12693
  // Second
11765
12694
  s: function s(date, token) {
11766
- return addLeadingZeros(date.getUTCSeconds(), token.length);
12695
+ return addLeadingZeros(date.getSeconds(), token.length);
11767
12696
  },
11768
12697
  // Fraction of second
11769
12698
  S: function S(date, token) {
11770
12699
  var numberOfDigits = token.length;
11771
- var milliseconds = date.getUTCMilliseconds();
11772
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
12700
+ var milliseconds = date.getMilliseconds();
12701
+ var fractionalSeconds = Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3));
11773
12702
  return addLeadingZeros(fractionalSeconds, token.length);
11774
12703
  }
11775
12704
  };
11776
12705
 
11777
12706
  var dayPeriodEnum = {
11778
- am: 'am',
11779
- pm: 'pm',
11780
- midnight: 'midnight',
11781
- noon: 'noon',
11782
- morning: 'morning',
11783
- afternoon: 'afternoon',
11784
- evening: 'evening',
11785
- night: 'night'
12707
+ am: "am",
12708
+ pm: "pm",
12709
+ midnight: "midnight",
12710
+ noon: "noon",
12711
+ morning: "morning",
12712
+ afternoon: "afternoon",
12713
+ evening: "evening",
12714
+ night: "night"
11786
12715
  };
12716
+
11787
12717
  /*
11788
12718
  * | | Unit | | Unit |
11789
12719
  * |-----|--------------------------------|-----|--------------------------------|
@@ -11833,57 +12763,57 @@ var dayPeriodEnum = {
11833
12763
  var formatters = {
11834
12764
  // Era
11835
12765
  G: function G(date, token, localize) {
11836
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
12766
+ var era = date.getFullYear() > 0 ? 1 : 0;
11837
12767
  switch (token) {
11838
12768
  // AD, BC
11839
- case 'G':
11840
- case 'GG':
11841
- case 'GGG':
12769
+ case "G":
12770
+ case "GG":
12771
+ case "GGG":
11842
12772
  return localize.era(era, {
11843
- width: 'abbreviated'
12773
+ width: "abbreviated"
11844
12774
  });
11845
12775
  // A, B
11846
- case 'GGGGG':
12776
+ case "GGGGG":
11847
12777
  return localize.era(era, {
11848
- width: 'narrow'
12778
+ width: "narrow"
11849
12779
  });
11850
12780
  // Anno Domini, Before Christ
11851
- case 'GGGG':
12781
+ case "GGGG":
11852
12782
  default:
11853
12783
  return localize.era(era, {
11854
- width: 'wide'
12784
+ width: "wide"
11855
12785
  });
11856
12786
  }
11857
12787
  },
11858
12788
  // Year
11859
12789
  y: function y(date, token, localize) {
11860
12790
  // Ordinal number
11861
- if (token === 'yo') {
11862
- var signedYear = date.getUTCFullYear();
12791
+ if (token === "yo") {
12792
+ var signedYear = date.getFullYear();
11863
12793
  // Returns 1 for 1 BC (which is year 0 in JavaScript)
11864
12794
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
11865
12795
  return localize.ordinalNumber(year, {
11866
- unit: 'year'
12796
+ unit: "year"
11867
12797
  });
11868
12798
  }
11869
- return formatters$1.y(date, token);
12799
+ return lightFormatters.y(date, token);
11870
12800
  },
11871
12801
  // Local week-numbering year
11872
12802
  Y: function Y(date, token, localize, options) {
11873
- var signedWeekYear = getUTCWeekYear(date, options);
12803
+ var signedWeekYear = getWeekYear(date, options);
11874
12804
  // Returns 1 for 1 BC (which is year 0 in JavaScript)
11875
12805
  var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
11876
12806
 
11877
12807
  // Two digit year
11878
- if (token === 'YY') {
12808
+ if (token === "YY") {
11879
12809
  var twoDigitYear = weekYear % 100;
11880
12810
  return addLeadingZeros(twoDigitYear, 2);
11881
12811
  }
11882
12812
 
11883
12813
  // Ordinal number
11884
- if (token === 'Yo') {
12814
+ if (token === "Yo") {
11885
12815
  return localize.ordinalNumber(weekYear, {
11886
- unit: 'year'
12816
+ unit: "year"
11887
12817
  });
11888
12818
  }
11889
12819
 
@@ -11892,7 +12822,7 @@ var formatters = {
11892
12822
  },
11893
12823
  // ISO week-numbering year
11894
12824
  R: function R(date, token) {
11895
- var isoWeekYear = getUTCISOWeekYear(date);
12825
+ var isoWeekYear = getISOWeekYear(date);
11896
12826
 
11897
12827
  // Padding
11898
12828
  return addLeadingZeros(isoWeekYear, token.length);
@@ -11907,417 +12837,417 @@ var formatters = {
11907
12837
  // Also `yy` always returns the last two digits of a year,
11908
12838
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
11909
12839
  u: function u(date, token) {
11910
- var year = date.getUTCFullYear();
12840
+ var year = date.getFullYear();
11911
12841
  return addLeadingZeros(year, token.length);
11912
12842
  },
11913
12843
  // Quarter
11914
12844
  Q: function Q(date, token, localize) {
11915
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
12845
+ var quarter = Math.ceil((date.getMonth() + 1) / 3);
11916
12846
  switch (token) {
11917
12847
  // 1, 2, 3, 4
11918
- case 'Q':
12848
+ case "Q":
11919
12849
  return String(quarter);
11920
12850
  // 01, 02, 03, 04
11921
- case 'QQ':
12851
+ case "QQ":
11922
12852
  return addLeadingZeros(quarter, 2);
11923
12853
  // 1st, 2nd, 3rd, 4th
11924
- case 'Qo':
12854
+ case "Qo":
11925
12855
  return localize.ordinalNumber(quarter, {
11926
- unit: 'quarter'
12856
+ unit: "quarter"
11927
12857
  });
11928
12858
  // Q1, Q2, Q3, Q4
11929
- case 'QQQ':
12859
+ case "QQQ":
11930
12860
  return localize.quarter(quarter, {
11931
- width: 'abbreviated',
11932
- context: 'formatting'
12861
+ width: "abbreviated",
12862
+ context: "formatting"
11933
12863
  });
11934
12864
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
11935
- case 'QQQQQ':
12865
+ case "QQQQQ":
11936
12866
  return localize.quarter(quarter, {
11937
- width: 'narrow',
11938
- context: 'formatting'
12867
+ width: "narrow",
12868
+ context: "formatting"
11939
12869
  });
11940
12870
  // 1st quarter, 2nd quarter, ...
11941
- case 'QQQQ':
12871
+ case "QQQQ":
11942
12872
  default:
11943
12873
  return localize.quarter(quarter, {
11944
- width: 'wide',
11945
- context: 'formatting'
12874
+ width: "wide",
12875
+ context: "formatting"
11946
12876
  });
11947
12877
  }
11948
12878
  },
11949
12879
  // Stand-alone quarter
11950
12880
  q: function q(date, token, localize) {
11951
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
12881
+ var quarter = Math.ceil((date.getMonth() + 1) / 3);
11952
12882
  switch (token) {
11953
12883
  // 1, 2, 3, 4
11954
- case 'q':
12884
+ case "q":
11955
12885
  return String(quarter);
11956
12886
  // 01, 02, 03, 04
11957
- case 'qq':
12887
+ case "qq":
11958
12888
  return addLeadingZeros(quarter, 2);
11959
12889
  // 1st, 2nd, 3rd, 4th
11960
- case 'qo':
12890
+ case "qo":
11961
12891
  return localize.ordinalNumber(quarter, {
11962
- unit: 'quarter'
12892
+ unit: "quarter"
11963
12893
  });
11964
12894
  // Q1, Q2, Q3, Q4
11965
- case 'qqq':
12895
+ case "qqq":
11966
12896
  return localize.quarter(quarter, {
11967
- width: 'abbreviated',
11968
- context: 'standalone'
12897
+ width: "abbreviated",
12898
+ context: "standalone"
11969
12899
  });
11970
12900
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
11971
- case 'qqqqq':
12901
+ case "qqqqq":
11972
12902
  return localize.quarter(quarter, {
11973
- width: 'narrow',
11974
- context: 'standalone'
12903
+ width: "narrow",
12904
+ context: "standalone"
11975
12905
  });
11976
12906
  // 1st quarter, 2nd quarter, ...
11977
- case 'qqqq':
12907
+ case "qqqq":
11978
12908
  default:
11979
12909
  return localize.quarter(quarter, {
11980
- width: 'wide',
11981
- context: 'standalone'
12910
+ width: "wide",
12911
+ context: "standalone"
11982
12912
  });
11983
12913
  }
11984
12914
  },
11985
12915
  // Month
11986
12916
  M: function M(date, token, localize) {
11987
- var month = date.getUTCMonth();
12917
+ var month = date.getMonth();
11988
12918
  switch (token) {
11989
- case 'M':
11990
- case 'MM':
11991
- return formatters$1.M(date, token);
12919
+ case "M":
12920
+ case "MM":
12921
+ return lightFormatters.M(date, token);
11992
12922
  // 1st, 2nd, ..., 12th
11993
- case 'Mo':
12923
+ case "Mo":
11994
12924
  return localize.ordinalNumber(month + 1, {
11995
- unit: 'month'
12925
+ unit: "month"
11996
12926
  });
11997
12927
  // Jan, Feb, ..., Dec
11998
- case 'MMM':
12928
+ case "MMM":
11999
12929
  return localize.month(month, {
12000
- width: 'abbreviated',
12001
- context: 'formatting'
12930
+ width: "abbreviated",
12931
+ context: "formatting"
12002
12932
  });
12003
12933
  // J, F, ..., D
12004
- case 'MMMMM':
12934
+ case "MMMMM":
12005
12935
  return localize.month(month, {
12006
- width: 'narrow',
12007
- context: 'formatting'
12936
+ width: "narrow",
12937
+ context: "formatting"
12008
12938
  });
12009
12939
  // January, February, ..., December
12010
- case 'MMMM':
12940
+ case "MMMM":
12011
12941
  default:
12012
12942
  return localize.month(month, {
12013
- width: 'wide',
12014
- context: 'formatting'
12943
+ width: "wide",
12944
+ context: "formatting"
12015
12945
  });
12016
12946
  }
12017
12947
  },
12018
12948
  // Stand-alone month
12019
12949
  L: function L(date, token, localize) {
12020
- var month = date.getUTCMonth();
12950
+ var month = date.getMonth();
12021
12951
  switch (token) {
12022
12952
  // 1, 2, ..., 12
12023
- case 'L':
12953
+ case "L":
12024
12954
  return String(month + 1);
12025
12955
  // 01, 02, ..., 12
12026
- case 'LL':
12956
+ case "LL":
12027
12957
  return addLeadingZeros(month + 1, 2);
12028
12958
  // 1st, 2nd, ..., 12th
12029
- case 'Lo':
12959
+ case "Lo":
12030
12960
  return localize.ordinalNumber(month + 1, {
12031
- unit: 'month'
12961
+ unit: "month"
12032
12962
  });
12033
12963
  // Jan, Feb, ..., Dec
12034
- case 'LLL':
12964
+ case "LLL":
12035
12965
  return localize.month(month, {
12036
- width: 'abbreviated',
12037
- context: 'standalone'
12966
+ width: "abbreviated",
12967
+ context: "standalone"
12038
12968
  });
12039
12969
  // J, F, ..., D
12040
- case 'LLLLL':
12970
+ case "LLLLL":
12041
12971
  return localize.month(month, {
12042
- width: 'narrow',
12043
- context: 'standalone'
12972
+ width: "narrow",
12973
+ context: "standalone"
12044
12974
  });
12045
12975
  // January, February, ..., December
12046
- case 'LLLL':
12976
+ case "LLLL":
12047
12977
  default:
12048
12978
  return localize.month(month, {
12049
- width: 'wide',
12050
- context: 'standalone'
12979
+ width: "wide",
12980
+ context: "standalone"
12051
12981
  });
12052
12982
  }
12053
12983
  },
12054
12984
  // Local week of year
12055
12985
  w: function w(date, token, localize, options) {
12056
- var week = getUTCWeek(date, options);
12057
- if (token === 'wo') {
12986
+ var week = getWeek(date, options);
12987
+ if (token === "wo") {
12058
12988
  return localize.ordinalNumber(week, {
12059
- unit: 'week'
12989
+ unit: "week"
12060
12990
  });
12061
12991
  }
12062
12992
  return addLeadingZeros(week, token.length);
12063
12993
  },
12064
12994
  // ISO week of year
12065
12995
  I: function I(date, token, localize) {
12066
- var isoWeek = getUTCISOWeek(date);
12067
- if (token === 'Io') {
12996
+ var isoWeek = getISOWeek(date);
12997
+ if (token === "Io") {
12068
12998
  return localize.ordinalNumber(isoWeek, {
12069
- unit: 'week'
12999
+ unit: "week"
12070
13000
  });
12071
13001
  }
12072
13002
  return addLeadingZeros(isoWeek, token.length);
12073
13003
  },
12074
13004
  // Day of the month
12075
13005
  d: function d(date, token, localize) {
12076
- if (token === 'do') {
12077
- return localize.ordinalNumber(date.getUTCDate(), {
12078
- unit: 'date'
13006
+ if (token === "do") {
13007
+ return localize.ordinalNumber(date.getDate(), {
13008
+ unit: "date"
12079
13009
  });
12080
13010
  }
12081
- return formatters$1.d(date, token);
13011
+ return lightFormatters.d(date, token);
12082
13012
  },
12083
13013
  // Day of year
12084
13014
  D: function D(date, token, localize) {
12085
- var dayOfYear = getUTCDayOfYear(date);
12086
- if (token === 'Do') {
13015
+ var dayOfYear = getDayOfYear(date);
13016
+ if (token === "Do") {
12087
13017
  return localize.ordinalNumber(dayOfYear, {
12088
- unit: 'dayOfYear'
13018
+ unit: "dayOfYear"
12089
13019
  });
12090
13020
  }
12091
13021
  return addLeadingZeros(dayOfYear, token.length);
12092
13022
  },
12093
13023
  // Day of week
12094
13024
  E: function E(date, token, localize) {
12095
- var dayOfWeek = date.getUTCDay();
13025
+ var dayOfWeek = date.getDay();
12096
13026
  switch (token) {
12097
13027
  // Tue
12098
- case 'E':
12099
- case 'EE':
12100
- case 'EEE':
13028
+ case "E":
13029
+ case "EE":
13030
+ case "EEE":
12101
13031
  return localize.day(dayOfWeek, {
12102
- width: 'abbreviated',
12103
- context: 'formatting'
13032
+ width: "abbreviated",
13033
+ context: "formatting"
12104
13034
  });
12105
13035
  // T
12106
- case 'EEEEE':
13036
+ case "EEEEE":
12107
13037
  return localize.day(dayOfWeek, {
12108
- width: 'narrow',
12109
- context: 'formatting'
13038
+ width: "narrow",
13039
+ context: "formatting"
12110
13040
  });
12111
13041
  // Tu
12112
- case 'EEEEEE':
13042
+ case "EEEEEE":
12113
13043
  return localize.day(dayOfWeek, {
12114
- width: 'short',
12115
- context: 'formatting'
13044
+ width: "short",
13045
+ context: "formatting"
12116
13046
  });
12117
13047
  // Tuesday
12118
- case 'EEEE':
13048
+ case "EEEE":
12119
13049
  default:
12120
13050
  return localize.day(dayOfWeek, {
12121
- width: 'wide',
12122
- context: 'formatting'
13051
+ width: "wide",
13052
+ context: "formatting"
12123
13053
  });
12124
13054
  }
12125
13055
  },
12126
13056
  // Local day of week
12127
13057
  e: function e(date, token, localize, options) {
12128
- var dayOfWeek = date.getUTCDay();
13058
+ var dayOfWeek = date.getDay();
12129
13059
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
12130
13060
  switch (token) {
12131
13061
  // Numerical value (Nth day of week with current locale or weekStartsOn)
12132
- case 'e':
13062
+ case "e":
12133
13063
  return String(localDayOfWeek);
12134
13064
  // Padded numerical value
12135
- case 'ee':
13065
+ case "ee":
12136
13066
  return addLeadingZeros(localDayOfWeek, 2);
12137
13067
  // 1st, 2nd, ..., 7th
12138
- case 'eo':
13068
+ case "eo":
12139
13069
  return localize.ordinalNumber(localDayOfWeek, {
12140
- unit: 'day'
13070
+ unit: "day"
12141
13071
  });
12142
- case 'eee':
13072
+ case "eee":
12143
13073
  return localize.day(dayOfWeek, {
12144
- width: 'abbreviated',
12145
- context: 'formatting'
13074
+ width: "abbreviated",
13075
+ context: "formatting"
12146
13076
  });
12147
13077
  // T
12148
- case 'eeeee':
13078
+ case "eeeee":
12149
13079
  return localize.day(dayOfWeek, {
12150
- width: 'narrow',
12151
- context: 'formatting'
13080
+ width: "narrow",
13081
+ context: "formatting"
12152
13082
  });
12153
13083
  // Tu
12154
- case 'eeeeee':
13084
+ case "eeeeee":
12155
13085
  return localize.day(dayOfWeek, {
12156
- width: 'short',
12157
- context: 'formatting'
13086
+ width: "short",
13087
+ context: "formatting"
12158
13088
  });
12159
13089
  // Tuesday
12160
- case 'eeee':
13090
+ case "eeee":
12161
13091
  default:
12162
13092
  return localize.day(dayOfWeek, {
12163
- width: 'wide',
12164
- context: 'formatting'
13093
+ width: "wide",
13094
+ context: "formatting"
12165
13095
  });
12166
13096
  }
12167
13097
  },
12168
13098
  // Stand-alone local day of week
12169
13099
  c: function c(date, token, localize, options) {
12170
- var dayOfWeek = date.getUTCDay();
13100
+ var dayOfWeek = date.getDay();
12171
13101
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
12172
13102
  switch (token) {
12173
13103
  // Numerical value (same as in `e`)
12174
- case 'c':
13104
+ case "c":
12175
13105
  return String(localDayOfWeek);
12176
13106
  // Padded numerical value
12177
- case 'cc':
13107
+ case "cc":
12178
13108
  return addLeadingZeros(localDayOfWeek, token.length);
12179
13109
  // 1st, 2nd, ..., 7th
12180
- case 'co':
13110
+ case "co":
12181
13111
  return localize.ordinalNumber(localDayOfWeek, {
12182
- unit: 'day'
13112
+ unit: "day"
12183
13113
  });
12184
- case 'ccc':
13114
+ case "ccc":
12185
13115
  return localize.day(dayOfWeek, {
12186
- width: 'abbreviated',
12187
- context: 'standalone'
13116
+ width: "abbreviated",
13117
+ context: "standalone"
12188
13118
  });
12189
13119
  // T
12190
- case 'ccccc':
13120
+ case "ccccc":
12191
13121
  return localize.day(dayOfWeek, {
12192
- width: 'narrow',
12193
- context: 'standalone'
13122
+ width: "narrow",
13123
+ context: "standalone"
12194
13124
  });
12195
13125
  // Tu
12196
- case 'cccccc':
13126
+ case "cccccc":
12197
13127
  return localize.day(dayOfWeek, {
12198
- width: 'short',
12199
- context: 'standalone'
13128
+ width: "short",
13129
+ context: "standalone"
12200
13130
  });
12201
13131
  // Tuesday
12202
- case 'cccc':
13132
+ case "cccc":
12203
13133
  default:
12204
13134
  return localize.day(dayOfWeek, {
12205
- width: 'wide',
12206
- context: 'standalone'
13135
+ width: "wide",
13136
+ context: "standalone"
12207
13137
  });
12208
13138
  }
12209
13139
  },
12210
13140
  // ISO day of week
12211
13141
  i: function i(date, token, localize) {
12212
- var dayOfWeek = date.getUTCDay();
13142
+ var dayOfWeek = date.getDay();
12213
13143
  var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
12214
13144
  switch (token) {
12215
13145
  // 2
12216
- case 'i':
13146
+ case "i":
12217
13147
  return String(isoDayOfWeek);
12218
13148
  // 02
12219
- case 'ii':
13149
+ case "ii":
12220
13150
  return addLeadingZeros(isoDayOfWeek, token.length);
12221
13151
  // 2nd
12222
- case 'io':
13152
+ case "io":
12223
13153
  return localize.ordinalNumber(isoDayOfWeek, {
12224
- unit: 'day'
13154
+ unit: "day"
12225
13155
  });
12226
13156
  // Tue
12227
- case 'iii':
13157
+ case "iii":
12228
13158
  return localize.day(dayOfWeek, {
12229
- width: 'abbreviated',
12230
- context: 'formatting'
13159
+ width: "abbreviated",
13160
+ context: "formatting"
12231
13161
  });
12232
13162
  // T
12233
- case 'iiiii':
13163
+ case "iiiii":
12234
13164
  return localize.day(dayOfWeek, {
12235
- width: 'narrow',
12236
- context: 'formatting'
13165
+ width: "narrow",
13166
+ context: "formatting"
12237
13167
  });
12238
13168
  // Tu
12239
- case 'iiiiii':
13169
+ case "iiiiii":
12240
13170
  return localize.day(dayOfWeek, {
12241
- width: 'short',
12242
- context: 'formatting'
13171
+ width: "short",
13172
+ context: "formatting"
12243
13173
  });
12244
13174
  // Tuesday
12245
- case 'iiii':
13175
+ case "iiii":
12246
13176
  default:
12247
13177
  return localize.day(dayOfWeek, {
12248
- width: 'wide',
12249
- context: 'formatting'
13178
+ width: "wide",
13179
+ context: "formatting"
12250
13180
  });
12251
13181
  }
12252
13182
  },
12253
13183
  // AM or PM
12254
13184
  a: function a(date, token, localize) {
12255
- var hours = date.getUTCHours();
12256
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
13185
+ var hours = date.getHours();
13186
+ var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
12257
13187
  switch (token) {
12258
- case 'a':
12259
- case 'aa':
13188
+ case "a":
13189
+ case "aa":
12260
13190
  return localize.dayPeriod(dayPeriodEnumValue, {
12261
- width: 'abbreviated',
12262
- context: 'formatting'
13191
+ width: "abbreviated",
13192
+ context: "formatting"
12263
13193
  });
12264
- case 'aaa':
13194
+ case "aaa":
12265
13195
  return localize.dayPeriod(dayPeriodEnumValue, {
12266
- width: 'abbreviated',
12267
- context: 'formatting'
13196
+ width: "abbreviated",
13197
+ context: "formatting"
12268
13198
  }).toLowerCase();
12269
- case 'aaaaa':
13199
+ case "aaaaa":
12270
13200
  return localize.dayPeriod(dayPeriodEnumValue, {
12271
- width: 'narrow',
12272
- context: 'formatting'
13201
+ width: "narrow",
13202
+ context: "formatting"
12273
13203
  });
12274
- case 'aaaa':
13204
+ case "aaaa":
12275
13205
  default:
12276
13206
  return localize.dayPeriod(dayPeriodEnumValue, {
12277
- width: 'wide',
12278
- context: 'formatting'
13207
+ width: "wide",
13208
+ context: "formatting"
12279
13209
  });
12280
13210
  }
12281
13211
  },
12282
13212
  // AM, PM, midnight, noon
12283
13213
  b: function b(date, token, localize) {
12284
- var hours = date.getUTCHours();
13214
+ var hours = date.getHours();
12285
13215
  var dayPeriodEnumValue;
12286
13216
  if (hours === 12) {
12287
13217
  dayPeriodEnumValue = dayPeriodEnum.noon;
12288
13218
  } else if (hours === 0) {
12289
13219
  dayPeriodEnumValue = dayPeriodEnum.midnight;
12290
13220
  } else {
12291
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
13221
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
12292
13222
  }
12293
13223
  switch (token) {
12294
- case 'b':
12295
- case 'bb':
13224
+ case "b":
13225
+ case "bb":
12296
13226
  return localize.dayPeriod(dayPeriodEnumValue, {
12297
- width: 'abbreviated',
12298
- context: 'formatting'
13227
+ width: "abbreviated",
13228
+ context: "formatting"
12299
13229
  });
12300
- case 'bbb':
13230
+ case "bbb":
12301
13231
  return localize.dayPeriod(dayPeriodEnumValue, {
12302
- width: 'abbreviated',
12303
- context: 'formatting'
13232
+ width: "abbreviated",
13233
+ context: "formatting"
12304
13234
  }).toLowerCase();
12305
- case 'bbbbb':
13235
+ case "bbbbb":
12306
13236
  return localize.dayPeriod(dayPeriodEnumValue, {
12307
- width: 'narrow',
12308
- context: 'formatting'
13237
+ width: "narrow",
13238
+ context: "formatting"
12309
13239
  });
12310
- case 'bbbb':
13240
+ case "bbbb":
12311
13241
  default:
12312
13242
  return localize.dayPeriod(dayPeriodEnumValue, {
12313
- width: 'wide',
12314
- context: 'formatting'
13243
+ width: "wide",
13244
+ context: "formatting"
12315
13245
  });
12316
13246
  }
12317
13247
  },
12318
13248
  // in the morning, in the afternoon, in the evening, at night
12319
13249
  B: function B(date, token, localize) {
12320
- var hours = date.getUTCHours();
13250
+ var hours = date.getHours();
12321
13251
  var dayPeriodEnumValue;
12322
13252
  if (hours >= 17) {
12323
13253
  dayPeriodEnumValue = dayPeriodEnum.evening;
@@ -12329,255 +13259,248 @@ var formatters = {
12329
13259
  dayPeriodEnumValue = dayPeriodEnum.night;
12330
13260
  }
12331
13261
  switch (token) {
12332
- case 'B':
12333
- case 'BB':
12334
- case 'BBB':
13262
+ case "B":
13263
+ case "BB":
13264
+ case "BBB":
12335
13265
  return localize.dayPeriod(dayPeriodEnumValue, {
12336
- width: 'abbreviated',
12337
- context: 'formatting'
13266
+ width: "abbreviated",
13267
+ context: "formatting"
12338
13268
  });
12339
- case 'BBBBB':
13269
+ case "BBBBB":
12340
13270
  return localize.dayPeriod(dayPeriodEnumValue, {
12341
- width: 'narrow',
12342
- context: 'formatting'
13271
+ width: "narrow",
13272
+ context: "formatting"
12343
13273
  });
12344
- case 'BBBB':
13274
+ case "BBBB":
12345
13275
  default:
12346
13276
  return localize.dayPeriod(dayPeriodEnumValue, {
12347
- width: 'wide',
12348
- context: 'formatting'
13277
+ width: "wide",
13278
+ context: "formatting"
12349
13279
  });
12350
13280
  }
12351
13281
  },
12352
13282
  // Hour [1-12]
12353
13283
  h: function h(date, token, localize) {
12354
- if (token === 'ho') {
12355
- var hours = date.getUTCHours() % 12;
13284
+ if (token === "ho") {
13285
+ var hours = date.getHours() % 12;
12356
13286
  if (hours === 0) hours = 12;
12357
13287
  return localize.ordinalNumber(hours, {
12358
- unit: 'hour'
13288
+ unit: "hour"
12359
13289
  });
12360
13290
  }
12361
- return formatters$1.h(date, token);
13291
+ return lightFormatters.h(date, token);
12362
13292
  },
12363
13293
  // Hour [0-23]
12364
13294
  H: function H(date, token, localize) {
12365
- if (token === 'Ho') {
12366
- return localize.ordinalNumber(date.getUTCHours(), {
12367
- unit: 'hour'
13295
+ if (token === "Ho") {
13296
+ return localize.ordinalNumber(date.getHours(), {
13297
+ unit: "hour"
12368
13298
  });
12369
13299
  }
12370
- return formatters$1.H(date, token);
13300
+ return lightFormatters.H(date, token);
12371
13301
  },
12372
13302
  // Hour [0-11]
12373
13303
  K: function K(date, token, localize) {
12374
- var hours = date.getUTCHours() % 12;
12375
- if (token === 'Ko') {
13304
+ var hours = date.getHours() % 12;
13305
+ if (token === "Ko") {
12376
13306
  return localize.ordinalNumber(hours, {
12377
- unit: 'hour'
13307
+ unit: "hour"
12378
13308
  });
12379
13309
  }
12380
13310
  return addLeadingZeros(hours, token.length);
12381
13311
  },
12382
13312
  // Hour [1-24]
12383
13313
  k: function k(date, token, localize) {
12384
- var hours = date.getUTCHours();
13314
+ var hours = date.getHours();
12385
13315
  if (hours === 0) hours = 24;
12386
- if (token === 'ko') {
13316
+ if (token === "ko") {
12387
13317
  return localize.ordinalNumber(hours, {
12388
- unit: 'hour'
13318
+ unit: "hour"
12389
13319
  });
12390
13320
  }
12391
13321
  return addLeadingZeros(hours, token.length);
12392
13322
  },
12393
13323
  // Minute
12394
13324
  m: function m(date, token, localize) {
12395
- if (token === 'mo') {
12396
- return localize.ordinalNumber(date.getUTCMinutes(), {
12397
- unit: 'minute'
13325
+ if (token === "mo") {
13326
+ return localize.ordinalNumber(date.getMinutes(), {
13327
+ unit: "minute"
12398
13328
  });
12399
13329
  }
12400
- return formatters$1.m(date, token);
13330
+ return lightFormatters.m(date, token);
12401
13331
  },
12402
13332
  // Second
12403
13333
  s: function s(date, token, localize) {
12404
- if (token === 'so') {
12405
- return localize.ordinalNumber(date.getUTCSeconds(), {
12406
- unit: 'second'
13334
+ if (token === "so") {
13335
+ return localize.ordinalNumber(date.getSeconds(), {
13336
+ unit: "second"
12407
13337
  });
12408
13338
  }
12409
- return formatters$1.s(date, token);
13339
+ return lightFormatters.s(date, token);
12410
13340
  },
12411
13341
  // Fraction of second
12412
13342
  S: function S(date, token) {
12413
- return formatters$1.S(date, token);
13343
+ return lightFormatters.S(date, token);
12414
13344
  },
12415
13345
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
12416
- X: function X(date, token, _localize, options) {
12417
- var originalDate = options._originalDate || date;
12418
- var timezoneOffset = originalDate.getTimezoneOffset();
13346
+ X: function X(date, token, _localize) {
13347
+ var timezoneOffset = date.getTimezoneOffset();
12419
13348
  if (timezoneOffset === 0) {
12420
- return 'Z';
13349
+ return "Z";
12421
13350
  }
12422
13351
  switch (token) {
12423
13352
  // Hours and optional minutes
12424
- case 'X':
13353
+ case "X":
12425
13354
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
12426
13355
 
12427
13356
  // Hours, minutes and optional seconds without `:` delimiter
12428
13357
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12429
13358
  // so this token always has the same output as `XX`
12430
- case 'XXXX':
12431
- case 'XX':
13359
+ case "XXXX":
13360
+ case "XX":
12432
13361
  // Hours and minutes without `:` delimiter
12433
13362
  return formatTimezone(timezoneOffset);
12434
13363
 
12435
13364
  // Hours, minutes and optional seconds with `:` delimiter
12436
13365
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12437
13366
  // so this token always has the same output as `XXX`
12438
- case 'XXXXX':
12439
- case 'XXX': // Hours and minutes with `:` delimiter
13367
+ case "XXXXX":
13368
+ case "XXX": // Hours and minutes with `:` delimiter
12440
13369
  default:
12441
- return formatTimezone(timezoneOffset, ':');
13370
+ return formatTimezone(timezoneOffset, ":");
12442
13371
  }
12443
13372
  },
12444
13373
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
12445
- x: function x(date, token, _localize, options) {
12446
- var originalDate = options._originalDate || date;
12447
- var timezoneOffset = originalDate.getTimezoneOffset();
13374
+ x: function x(date, token, _localize) {
13375
+ var timezoneOffset = date.getTimezoneOffset();
12448
13376
  switch (token) {
12449
13377
  // Hours and optional minutes
12450
- case 'x':
13378
+ case "x":
12451
13379
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
12452
13380
 
12453
13381
  // Hours, minutes and optional seconds without `:` delimiter
12454
13382
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12455
13383
  // so this token always has the same output as `xx`
12456
- case 'xxxx':
12457
- case 'xx':
13384
+ case "xxxx":
13385
+ case "xx":
12458
13386
  // Hours and minutes without `:` delimiter
12459
13387
  return formatTimezone(timezoneOffset);
12460
13388
 
12461
13389
  // Hours, minutes and optional seconds with `:` delimiter
12462
13390
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
12463
13391
  // so this token always has the same output as `xxx`
12464
- case 'xxxxx':
12465
- case 'xxx': // Hours and minutes with `:` delimiter
13392
+ case "xxxxx":
13393
+ case "xxx": // Hours and minutes with `:` delimiter
12466
13394
  default:
12467
- return formatTimezone(timezoneOffset, ':');
13395
+ return formatTimezone(timezoneOffset, ":");
12468
13396
  }
12469
13397
  },
12470
13398
  // Timezone (GMT)
12471
- O: function O(date, token, _localize, options) {
12472
- var originalDate = options._originalDate || date;
12473
- var timezoneOffset = originalDate.getTimezoneOffset();
13399
+ O: function O(date, token, _localize) {
13400
+ var timezoneOffset = date.getTimezoneOffset();
12474
13401
  switch (token) {
12475
13402
  // Short
12476
- case 'O':
12477
- case 'OO':
12478
- case 'OOO':
12479
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
13403
+ case "O":
13404
+ case "OO":
13405
+ case "OOO":
13406
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
12480
13407
  // Long
12481
- case 'OOOO':
13408
+ case "OOOO":
12482
13409
  default:
12483
- return 'GMT' + formatTimezone(timezoneOffset, ':');
13410
+ return "GMT" + formatTimezone(timezoneOffset, ":");
12484
13411
  }
12485
13412
  },
12486
13413
  // Timezone (specific non-location)
12487
- z: function z(date, token, _localize, options) {
12488
- var originalDate = options._originalDate || date;
12489
- var timezoneOffset = originalDate.getTimezoneOffset();
13414
+ z: function z(date, token, _localize) {
13415
+ var timezoneOffset = date.getTimezoneOffset();
12490
13416
  switch (token) {
12491
13417
  // Short
12492
- case 'z':
12493
- case 'zz':
12494
- case 'zzz':
12495
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
13418
+ case "z":
13419
+ case "zz":
13420
+ case "zzz":
13421
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
12496
13422
  // Long
12497
- case 'zzzz':
13423
+ case "zzzz":
12498
13424
  default:
12499
- return 'GMT' + formatTimezone(timezoneOffset, ':');
13425
+ return "GMT" + formatTimezone(timezoneOffset, ":");
12500
13426
  }
12501
13427
  },
12502
13428
  // Seconds timestamp
12503
- t: function t(date, token, _localize, options) {
12504
- var originalDate = options._originalDate || date;
12505
- var timestamp = Math.floor(originalDate.getTime() / 1000);
13429
+ t: function t(date, token, _localize) {
13430
+ var timestamp = Math.trunc(+date / 1000);
12506
13431
  return addLeadingZeros(timestamp, token.length);
12507
13432
  },
12508
13433
  // Milliseconds timestamp
12509
- T: function T(date, token, _localize, options) {
12510
- var originalDate = options._originalDate || date;
12511
- var timestamp = originalDate.getTime();
12512
- return addLeadingZeros(timestamp, token.length);
13434
+ T: function T(date, token, _localize) {
13435
+ return addLeadingZeros(+date, token.length);
12513
13436
  }
12514
13437
  };
12515
- function formatTimezoneShort(offset, dirtyDelimiter) {
12516
- var sign = offset > 0 ? '-' : '+';
13438
+ function formatTimezoneShort(offset) {
13439
+ var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
13440
+ var sign = offset > 0 ? "-" : "+";
12517
13441
  var absOffset = Math.abs(offset);
12518
- var hours = Math.floor(absOffset / 60);
13442
+ var hours = Math.trunc(absOffset / 60);
12519
13443
  var minutes = absOffset % 60;
12520
13444
  if (minutes === 0) {
12521
13445
  return sign + String(hours);
12522
13446
  }
12523
- var delimiter = dirtyDelimiter;
12524
13447
  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
12525
13448
  }
12526
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
13449
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
12527
13450
  if (offset % 60 === 0) {
12528
- var sign = offset > 0 ? '-' : '+';
13451
+ var sign = offset > 0 ? "-" : "+";
12529
13452
  return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
12530
13453
  }
12531
- return formatTimezone(offset, dirtyDelimiter);
13454
+ return formatTimezone(offset, delimiter);
12532
13455
  }
12533
- function formatTimezone(offset, dirtyDelimiter) {
12534
- var delimiter = dirtyDelimiter || '';
12535
- var sign = offset > 0 ? '-' : '+';
13456
+ function formatTimezone(offset) {
13457
+ var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
13458
+ var sign = offset > 0 ? "-" : "+";
12536
13459
  var absOffset = Math.abs(offset);
12537
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
13460
+ var hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
12538
13461
  var minutes = addLeadingZeros(absOffset % 60, 2);
12539
13462
  return sign + hours + delimiter + minutes;
12540
13463
  }
12541
13464
 
12542
13465
  var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
12543
13466
  switch (pattern) {
12544
- case 'P':
13467
+ case "P":
12545
13468
  return formatLong.date({
12546
- width: 'short'
13469
+ width: "short"
12547
13470
  });
12548
- case 'PP':
13471
+ case "PP":
12549
13472
  return formatLong.date({
12550
- width: 'medium'
13473
+ width: "medium"
12551
13474
  });
12552
- case 'PPP':
13475
+ case "PPP":
12553
13476
  return formatLong.date({
12554
- width: 'long'
13477
+ width: "long"
12555
13478
  });
12556
- case 'PPPP':
13479
+ case "PPPP":
12557
13480
  default:
12558
13481
  return formatLong.date({
12559
- width: 'full'
13482
+ width: "full"
12560
13483
  });
12561
13484
  }
12562
13485
  };
12563
13486
  var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
12564
13487
  switch (pattern) {
12565
- case 'p':
13488
+ case "p":
12566
13489
  return formatLong.time({
12567
- width: 'short'
13490
+ width: "short"
12568
13491
  });
12569
- case 'pp':
13492
+ case "pp":
12570
13493
  return formatLong.time({
12571
- width: 'medium'
13494
+ width: "medium"
12572
13495
  });
12573
- case 'ppp':
13496
+ case "ppp":
12574
13497
  return formatLong.time({
12575
- width: 'long'
13498
+ width: "long"
12576
13499
  });
12577
- case 'pppp':
13500
+ case "pppp":
12578
13501
  default:
12579
13502
  return formatLong.time({
12580
- width: 'full'
13503
+ width: "full"
12581
13504
  });
12582
13505
  }
12583
13506
  };
@@ -12590,550 +13513,55 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
12590
13513
  }
12591
13514
  var dateTimeFormat;
12592
13515
  switch (datePattern) {
12593
- case 'P':
13516
+ case "P":
12594
13517
  dateTimeFormat = formatLong.dateTime({
12595
- width: 'short'
13518
+ width: "short"
12596
13519
  });
12597
13520
  break;
12598
- case 'PP':
13521
+ case "PP":
12599
13522
  dateTimeFormat = formatLong.dateTime({
12600
- width: 'medium'
13523
+ width: "medium"
12601
13524
  });
12602
13525
  break;
12603
- case 'PPP':
13526
+ case "PPP":
12604
13527
  dateTimeFormat = formatLong.dateTime({
12605
- width: 'long'
13528
+ width: "long"
12606
13529
  });
12607
13530
  break;
12608
- case 'PPPP':
13531
+ case "PPPP":
12609
13532
  default:
12610
13533
  dateTimeFormat = formatLong.dateTime({
12611
- width: 'full'
13534
+ width: "full"
12612
13535
  });
12613
13536
  break;
12614
13537
  }
12615
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
13538
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
12616
13539
  };
12617
13540
  var longFormatters = {
12618
13541
  p: timeLongFormatter,
12619
13542
  P: dateTimeLongFormatter
12620
13543
  };
12621
13544
 
12622
- /**
12623
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
12624
- * They usually appear for dates that denote time before the timezones were introduced
12625
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
12626
- * and GMT+01:00:00 after that date)
12627
- *
12628
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
12629
- * which would lead to incorrect calculations.
12630
- *
12631
- * This function returns the timezone offset in milliseconds that takes seconds in account.
12632
- */
12633
- function getTimezoneOffsetInMilliseconds(date) {
12634
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
12635
- utcDate.setUTCFullYear(date.getFullYear());
12636
- return date.getTime() - utcDate.getTime();
12637
- }
12638
-
12639
- var protectedDayOfYearTokens = ['D', 'DD'];
12640
- var protectedWeekYearTokens = ['YY', 'YYYY'];
13545
+ var dayOfYearTokenRE = /^D+$/;
13546
+ var weekYearTokenRE = /^Y+$/;
13547
+ var throwTokens = ["D", "DD", "YY", "YYYY"];
12641
13548
  function isProtectedDayOfYearToken(token) {
12642
- return protectedDayOfYearTokens.indexOf(token) !== -1;
13549
+ return dayOfYearTokenRE.test(token);
12643
13550
  }
12644
13551
  function isProtectedWeekYearToken(token) {
12645
- return protectedWeekYearTokens.indexOf(token) !== -1;
12646
- }
12647
- function throwProtectedError(token, format, input) {
12648
- if (token === 'YYYY') {
12649
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12650
- } else if (token === 'YY') {
12651
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12652
- } else if (token === 'D') {
12653
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12654
- } else if (token === 'DD') {
12655
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
12656
- }
13552
+ return weekYearTokenRE.test(token);
12657
13553
  }
12658
-
12659
- var formatDistanceLocale$1 = {
12660
- lessThanXSeconds: {
12661
- one: 'less than a second',
12662
- other: 'less than {{count}} seconds'
12663
- },
12664
- xSeconds: {
12665
- one: '1 second',
12666
- other: '{{count}} seconds'
12667
- },
12668
- halfAMinute: 'half a minute',
12669
- lessThanXMinutes: {
12670
- one: 'less than a minute',
12671
- other: 'less than {{count}} minutes'
12672
- },
12673
- xMinutes: {
12674
- one: '1 minute',
12675
- other: '{{count}} minutes'
12676
- },
12677
- aboutXHours: {
12678
- one: 'about 1 hour',
12679
- other: 'about {{count}} hours'
12680
- },
12681
- xHours: {
12682
- one: '1 hour',
12683
- other: '{{count}} hours'
12684
- },
12685
- xDays: {
12686
- one: '1 day',
12687
- other: '{{count}} days'
12688
- },
12689
- aboutXWeeks: {
12690
- one: 'about 1 week',
12691
- other: 'about {{count}} weeks'
12692
- },
12693
- xWeeks: {
12694
- one: '1 week',
12695
- other: '{{count}} weeks'
12696
- },
12697
- aboutXMonths: {
12698
- one: 'about 1 month',
12699
- other: 'about {{count}} months'
12700
- },
12701
- xMonths: {
12702
- one: '1 month',
12703
- other: '{{count}} months'
12704
- },
12705
- aboutXYears: {
12706
- one: 'about 1 year',
12707
- other: 'about {{count}} years'
12708
- },
12709
- xYears: {
12710
- one: '1 year',
12711
- other: '{{count}} years'
12712
- },
12713
- overXYears: {
12714
- one: 'over 1 year',
12715
- other: 'over {{count}} years'
12716
- },
12717
- almostXYears: {
12718
- one: 'almost 1 year',
12719
- other: 'almost {{count}} years'
12720
- }
12721
- };
12722
- var formatDistance$1 = function formatDistance(token, count, options) {
12723
- var result;
12724
- var tokenValue = formatDistanceLocale$1[token];
12725
- if (typeof tokenValue === 'string') {
12726
- result = tokenValue;
12727
- } else if (count === 1) {
12728
- result = tokenValue.one;
12729
- } else {
12730
- result = tokenValue.other.replace('{{count}}', count.toString());
12731
- }
12732
- if (options !== null && options !== void 0 && options.addSuffix) {
12733
- if (options.comparison && options.comparison > 0) {
12734
- return 'in ' + result;
12735
- } else {
12736
- return result + ' ago';
12737
- }
12738
- }
12739
- return result;
12740
- };
12741
-
12742
- function buildFormatLongFn(args) {
12743
- return function () {
12744
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
12745
- // TODO: Remove String()
12746
- var width = options.width ? String(options.width) : args.defaultWidth;
12747
- var format = args.formats[width] || args.formats[args.defaultWidth];
12748
- return format;
12749
- };
13554
+ function warnOrThrowProtectedError(token, format, input) {
13555
+ var _message = message(token, format, input);
13556
+ console.warn(_message);
13557
+ if (throwTokens.includes(token)) throw new RangeError(_message);
12750
13558
  }
12751
-
12752
- var dateFormats$2 = {
12753
- full: 'EEEE, MMMM do, y',
12754
- "long": 'MMMM do, y',
12755
- medium: 'MMM d, y',
12756
- "short": 'MM/dd/yyyy'
12757
- };
12758
- var timeFormats$2 = {
12759
- full: 'h:mm:ss a zzzz',
12760
- "long": 'h:mm:ss a z',
12761
- medium: 'h:mm:ss a',
12762
- "short": 'h:mm a'
12763
- };
12764
- var dateTimeFormats$2 = {
12765
- full: "{{date}} 'at' {{time}}",
12766
- "long": "{{date}} 'at' {{time}}",
12767
- medium: '{{date}}, {{time}}',
12768
- "short": '{{date}}, {{time}}'
12769
- };
12770
- var formatLong$2 = {
12771
- date: buildFormatLongFn({
12772
- formats: dateFormats$2,
12773
- defaultWidth: 'full'
12774
- }),
12775
- time: buildFormatLongFn({
12776
- formats: timeFormats$2,
12777
- defaultWidth: 'full'
12778
- }),
12779
- dateTime: buildFormatLongFn({
12780
- formats: dateTimeFormats$2,
12781
- defaultWidth: 'full'
12782
- })
12783
- };
12784
-
12785
- var formatRelativeLocale = {
12786
- lastWeek: "'last' eeee 'at' p",
12787
- yesterday: "'yesterday at' p",
12788
- today: "'today at' p",
12789
- tomorrow: "'tomorrow at' p",
12790
- nextWeek: "eeee 'at' p",
12791
- other: 'P'
12792
- };
12793
- var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
12794
- return formatRelativeLocale[token];
12795
- };
12796
-
12797
- function buildLocalizeFn(args) {
12798
- return function (dirtyIndex, options) {
12799
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
12800
- var valuesArray;
12801
- if (context === 'formatting' && args.formattingValues) {
12802
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
12803
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
12804
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
12805
- } else {
12806
- var _defaultWidth = args.defaultWidth;
12807
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
12808
- valuesArray = args.values[_width] || args.values[_defaultWidth];
12809
- }
12810
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
12811
- // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
12812
- return valuesArray[index];
12813
- };
13559
+ function message(token, format, input) {
13560
+ var subject = token[0] === "Y" ? "years" : "days of the month";
13561
+ return "Use `".concat(token.toLowerCase(), "` instead of `").concat(token, "` (in `").concat(format, "`) for formatting ").concat(subject, " to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md");
12814
13562
  }
12815
13563
 
12816
- var eraValues = {
12817
- narrow: ['B', 'A'],
12818
- abbreviated: ['BC', 'AD'],
12819
- wide: ['Before Christ', 'Anno Domini']
12820
- };
12821
- var quarterValues = {
12822
- narrow: ['1', '2', '3', '4'],
12823
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
12824
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
12825
- };
12826
-
12827
- // Note: in English, the names of days of the week and months are capitalized.
12828
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
12829
- // Generally, formatted dates should look like they are in the middle of a sentence,
12830
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
12831
- var monthValues = {
12832
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
12833
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
12834
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
12835
- };
12836
- var dayValues = {
12837
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
12838
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
12839
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
12840
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
12841
- };
12842
- var dayPeriodValues = {
12843
- narrow: {
12844
- am: 'a',
12845
- pm: 'p',
12846
- midnight: 'mi',
12847
- noon: 'n',
12848
- morning: 'morning',
12849
- afternoon: 'afternoon',
12850
- evening: 'evening',
12851
- night: 'night'
12852
- },
12853
- abbreviated: {
12854
- am: 'AM',
12855
- pm: 'PM',
12856
- midnight: 'midnight',
12857
- noon: 'noon',
12858
- morning: 'morning',
12859
- afternoon: 'afternoon',
12860
- evening: 'evening',
12861
- night: 'night'
12862
- },
12863
- wide: {
12864
- am: 'a.m.',
12865
- pm: 'p.m.',
12866
- midnight: 'midnight',
12867
- noon: 'noon',
12868
- morning: 'morning',
12869
- afternoon: 'afternoon',
12870
- evening: 'evening',
12871
- night: 'night'
12872
- }
12873
- };
12874
- var formattingDayPeriodValues = {
12875
- narrow: {
12876
- am: 'a',
12877
- pm: 'p',
12878
- midnight: 'mi',
12879
- noon: 'n',
12880
- morning: 'in the morning',
12881
- afternoon: 'in the afternoon',
12882
- evening: 'in the evening',
12883
- night: 'at night'
12884
- },
12885
- abbreviated: {
12886
- am: 'AM',
12887
- pm: 'PM',
12888
- midnight: 'midnight',
12889
- noon: 'noon',
12890
- morning: 'in the morning',
12891
- afternoon: 'in the afternoon',
12892
- evening: 'in the evening',
12893
- night: 'at night'
12894
- },
12895
- wide: {
12896
- am: 'a.m.',
12897
- pm: 'p.m.',
12898
- midnight: 'midnight',
12899
- noon: 'noon',
12900
- morning: 'in the morning',
12901
- afternoon: 'in the afternoon',
12902
- evening: 'in the evening',
12903
- night: 'at night'
12904
- }
12905
- };
12906
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
12907
- var number = Number(dirtyNumber);
12908
-
12909
- // If ordinal numbers depend on context, for example,
12910
- // if they are different for different grammatical genders,
12911
- // use `options.unit`.
12912
- //
12913
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
12914
- // 'day', 'hour', 'minute', 'second'.
12915
-
12916
- var rem100 = number % 100;
12917
- if (rem100 > 20 || rem100 < 10) {
12918
- switch (rem100 % 10) {
12919
- case 1:
12920
- return number + 'st';
12921
- case 2:
12922
- return number + 'nd';
12923
- case 3:
12924
- return number + 'rd';
12925
- }
12926
- }
12927
- return number + 'th';
12928
- };
12929
- var localize = {
12930
- ordinalNumber: ordinalNumber,
12931
- era: buildLocalizeFn({
12932
- values: eraValues,
12933
- defaultWidth: 'wide'
12934
- }),
12935
- quarter: buildLocalizeFn({
12936
- values: quarterValues,
12937
- defaultWidth: 'wide',
12938
- argumentCallback: function argumentCallback(quarter) {
12939
- return quarter - 1;
12940
- }
12941
- }),
12942
- month: buildLocalizeFn({
12943
- values: monthValues,
12944
- defaultWidth: 'wide'
12945
- }),
12946
- day: buildLocalizeFn({
12947
- values: dayValues,
12948
- defaultWidth: 'wide'
12949
- }),
12950
- dayPeriod: buildLocalizeFn({
12951
- values: dayPeriodValues,
12952
- defaultWidth: 'wide',
12953
- formattingValues: formattingDayPeriodValues,
12954
- defaultFormattingWidth: 'wide'
12955
- })
12956
- };
12957
-
12958
- function buildMatchFn(args) {
12959
- return function (string) {
12960
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12961
- var width = options.width;
12962
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
12963
- var matchResult = string.match(matchPattern);
12964
- if (!matchResult) {
12965
- return null;
12966
- }
12967
- var matchedString = matchResult[0];
12968
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
12969
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
12970
- return pattern.test(matchedString);
12971
- }) : findKey(parsePatterns, function (pattern) {
12972
- return pattern.test(matchedString);
12973
- });
12974
- var value;
12975
- value = args.valueCallback ? args.valueCallback(key) : key;
12976
- value = options.valueCallback ? options.valueCallback(value) : value;
12977
- var rest = string.slice(matchedString.length);
12978
- return {
12979
- value: value,
12980
- rest: rest
12981
- };
12982
- };
12983
- }
12984
- function findKey(object, predicate) {
12985
- for (var key in object) {
12986
- if (object.hasOwnProperty(key) && predicate(object[key])) {
12987
- return key;
12988
- }
12989
- }
12990
- return undefined;
12991
- }
12992
- function findIndex(array, predicate) {
12993
- for (var key = 0; key < array.length; key++) {
12994
- if (predicate(array[key])) {
12995
- return key;
12996
- }
12997
- }
12998
- return undefined;
12999
- }
13000
-
13001
- function buildMatchPatternFn(args) {
13002
- return function (string) {
13003
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13004
- var matchResult = string.match(args.matchPattern);
13005
- if (!matchResult) return null;
13006
- var matchedString = matchResult[0];
13007
- var parseResult = string.match(args.parsePattern);
13008
- if (!parseResult) return null;
13009
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
13010
- value = options.valueCallback ? options.valueCallback(value) : value;
13011
- var rest = string.slice(matchedString.length);
13012
- return {
13013
- value: value,
13014
- rest: rest
13015
- };
13016
- };
13017
- }
13018
-
13019
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
13020
- var parseOrdinalNumberPattern = /\d+/i;
13021
- var matchEraPatterns = {
13022
- narrow: /^(b|a)/i,
13023
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
13024
- wide: /^(before christ|before common era|anno domini|common era)/i
13025
- };
13026
- var parseEraPatterns = {
13027
- any: [/^b/i, /^(a|c)/i]
13028
- };
13029
- var matchQuarterPatterns = {
13030
- narrow: /^[1234]/i,
13031
- abbreviated: /^q[1234]/i,
13032
- wide: /^[1234](th|st|nd|rd)? quarter/i
13033
- };
13034
- var parseQuarterPatterns = {
13035
- any: [/1/i, /2/i, /3/i, /4/i]
13036
- };
13037
- var matchMonthPatterns = {
13038
- narrow: /^[jfmasond]/i,
13039
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
13040
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
13041
- };
13042
- var parseMonthPatterns = {
13043
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
13044
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
13045
- };
13046
- var matchDayPatterns = {
13047
- narrow: /^[smtwf]/i,
13048
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
13049
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
13050
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
13051
- };
13052
- var parseDayPatterns = {
13053
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
13054
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
13055
- };
13056
- var matchDayPeriodPatterns = {
13057
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
13058
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
13059
- };
13060
- var parseDayPeriodPatterns = {
13061
- any: {
13062
- am: /^a/i,
13063
- pm: /^p/i,
13064
- midnight: /^mi/i,
13065
- noon: /^no/i,
13066
- morning: /morning/i,
13067
- afternoon: /afternoon/i,
13068
- evening: /evening/i,
13069
- night: /night/i
13070
- }
13071
- };
13072
- var match = {
13073
- ordinalNumber: buildMatchPatternFn({
13074
- matchPattern: matchOrdinalNumberPattern,
13075
- parsePattern: parseOrdinalNumberPattern,
13076
- valueCallback: function valueCallback(value) {
13077
- return parseInt(value, 10);
13078
- }
13079
- }),
13080
- era: buildMatchFn({
13081
- matchPatterns: matchEraPatterns,
13082
- defaultMatchWidth: 'wide',
13083
- parsePatterns: parseEraPatterns,
13084
- defaultParseWidth: 'any'
13085
- }),
13086
- quarter: buildMatchFn({
13087
- matchPatterns: matchQuarterPatterns,
13088
- defaultMatchWidth: 'wide',
13089
- parsePatterns: parseQuarterPatterns,
13090
- defaultParseWidth: 'any',
13091
- valueCallback: function valueCallback(index) {
13092
- return index + 1;
13093
- }
13094
- }),
13095
- month: buildMatchFn({
13096
- matchPatterns: matchMonthPatterns,
13097
- defaultMatchWidth: 'wide',
13098
- parsePatterns: parseMonthPatterns,
13099
- defaultParseWidth: 'any'
13100
- }),
13101
- day: buildMatchFn({
13102
- matchPatterns: matchDayPatterns,
13103
- defaultMatchWidth: 'wide',
13104
- parsePatterns: parseDayPatterns,
13105
- defaultParseWidth: 'any'
13106
- }),
13107
- dayPeriod: buildMatchFn({
13108
- matchPatterns: matchDayPeriodPatterns,
13109
- defaultMatchWidth: 'any',
13110
- parsePatterns: parseDayPeriodPatterns,
13111
- defaultParseWidth: 'any'
13112
- })
13113
- };
13114
-
13115
- /**
13116
- * @type {Locale}
13117
- * @category Locales
13118
- * @summary English locale (United States).
13119
- * @language English
13120
- * @iso-639-2 eng
13121
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
13122
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
13123
- */
13124
- var locale$5 = {
13125
- code: 'en-US',
13126
- formatDistance: formatDistance$1,
13127
- formatLong: formatLong$2,
13128
- formatRelative: formatRelative,
13129
- localize: localize,
13130
- match: match,
13131
- options: {
13132
- weekStartsOn: 0 /* Sunday */,
13133
- firstWeekContainsDate: 1
13134
- }
13135
- };
13136
-
13564
+ // This RegExp consists of three parts separated by `|`:
13137
13565
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
13138
13566
  // (one of the certain letters followed by `o`)
13139
13567
  // - (\w)\1* matches any sequences of the same letter
@@ -13153,8 +13581,13 @@ var escapedStringRegExp = /^'([^]*?)'?$/;
13153
13581
  var doubleQuoteRegExp = /''/g;
13154
13582
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
13155
13583
 
13584
+ /**
13585
+ * The {@link format} function options.
13586
+ */
13587
+
13156
13588
  /**
13157
13589
  * @name format
13590
+ * @alias formatDate
13158
13591
  * @category Common Helpers
13159
13592
  * @summary Format the date.
13160
13593
  *
@@ -13381,8 +13814,8 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
13381
13814
  *
13382
13815
  * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
13383
13816
  * except local week-numbering years are dependent on `options.weekStartsOn`
13384
- * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
13385
- * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
13817
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
13818
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
13386
13819
  *
13387
13820
  * 6. Specific non-location timezones are currently unavailable in `date-fns`,
13388
13821
  * so right now these tokens fall back to GMT timezones.
@@ -13403,28 +13836,20 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
13403
13836
  * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
13404
13837
  * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13405
13838
  *
13406
- * @param {Date|Number} date - the original date
13407
- * @param {String} format - the string of tokens
13408
- * @param {Object} [options] - an object with options.
13409
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
13410
- * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
13411
- * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
13412
- * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
13413
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13414
- * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
13415
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13416
- * @returns {String} the formatted date string
13417
- * @throws {TypeError} 2 arguments required
13418
- * @throws {RangeError} `date` must not be Invalid Date
13419
- * @throws {RangeError} `options.locale` must contain `localize` property
13420
- * @throws {RangeError} `options.locale` must contain `formatLong` property
13421
- * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
13422
- * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
13423
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13424
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13425
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13426
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13427
- * @throws {RangeError} format string contains an unescaped latin alphabet character
13839
+ * @param date - The original date
13840
+ * @param format - The string of tokens
13841
+ * @param options - An object with options
13842
+ *
13843
+ * @returns The formatted date string
13844
+ *
13845
+ * @throws `date` must not be Invalid Date
13846
+ * @throws `options.locale` must contain `localize` property
13847
+ * @throws `options.locale` must contain `formatLong` property
13848
+ * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13849
+ * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13850
+ * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13851
+ * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
13852
+ * @throws format string contains an unescaped latin alphabet character
13428
13853
  *
13429
13854
  * @example
13430
13855
  * // Represent 11 February 2014 in middle-endian format:
@@ -13444,79 +13869,71 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
13444
13869
  * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
13445
13870
  * //=> "3 o'clock"
13446
13871
  */
13447
-
13448
- function format$1(dirtyDate, dirtyFormatStr, options) {
13449
- var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
13450
- requiredArgs(2, arguments);
13451
- var formatStr = String(dirtyFormatStr);
13872
+ function format$2(date, formatStr, options) {
13873
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _defaultOptions$local, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _defaultOptions$local2;
13452
13874
  var defaultOptions = getDefaultOptions();
13453
- var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale$5;
13454
- var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
13455
-
13456
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
13457
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
13458
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
13459
- }
13460
- var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
13461
-
13462
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
13463
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
13464
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
13465
- }
13466
- if (!locale.localize) {
13467
- throw new RangeError('locale must contain localize property');
13468
- }
13469
- if (!locale.formatLong) {
13470
- throw new RangeError('locale must contain formatLong property');
13471
- }
13472
- var originalDate = toDate(dirtyDate);
13875
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : enUS;
13876
+ var firstWeekContainsDate = (_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 || (_options$locale2 = options.locale) === null || _options$locale2 === void 0 || (_options$locale2 = _options$locale2.options) === null || _options$locale2 === void 0 ? void 0 : _options$locale2.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 || (_defaultOptions$local = _defaultOptions$local.options) === null || _defaultOptions$local === void 0 ? void 0 : _defaultOptions$local.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1;
13877
+ var weekStartsOn = (_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 || (_options$locale3 = options.locale) === null || _options$locale3 === void 0 || (_options$locale3 = _options$locale3.options) === null || _options$locale3 === void 0 ? void 0 : _options$locale3.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local2 = defaultOptions.locale) === null || _defaultOptions$local2 === void 0 || (_defaultOptions$local2 = _defaultOptions$local2.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0;
13878
+ var originalDate = toDate(date, options === null || options === void 0 ? void 0 : options["in"]);
13473
13879
  if (!isValid(originalDate)) {
13474
- throw new RangeError('Invalid time value');
13880
+ throw new RangeError("Invalid time value");
13475
13881
  }
13476
-
13477
- // Convert the date in system timezone to the same date in UTC+00:00 timezone.
13478
- // This ensures that when UTC functions will be implemented, locales will be compatible with them.
13479
- // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
13480
- var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
13481
- var utcDate = subMilliseconds(originalDate, timezoneOffset);
13482
- var formatterOptions = {
13483
- firstWeekContainsDate: firstWeekContainsDate,
13484
- weekStartsOn: weekStartsOn,
13485
- locale: locale,
13486
- _originalDate: originalDate
13487
- };
13488
- var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
13882
+ var parts = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
13489
13883
  var firstCharacter = substring[0];
13490
- if (firstCharacter === 'p' || firstCharacter === 'P') {
13884
+ if (firstCharacter === "p" || firstCharacter === "P") {
13491
13885
  var longFormatter = longFormatters[firstCharacter];
13492
13886
  return longFormatter(substring, locale.formatLong);
13493
13887
  }
13494
13888
  return substring;
13495
- }).join('').match(formattingTokensRegExp).map(function (substring) {
13889
+ }).join("").match(formattingTokensRegExp).map(function (substring) {
13496
13890
  // Replace two single quote characters with one single quote character
13497
13891
  if (substring === "''") {
13498
- return "'";
13892
+ return {
13893
+ isToken: false,
13894
+ value: "'"
13895
+ };
13499
13896
  }
13500
13897
  var firstCharacter = substring[0];
13501
13898
  if (firstCharacter === "'") {
13502
- return cleanEscapedString(substring);
13899
+ return {
13900
+ isToken: false,
13901
+ value: cleanEscapedString(substring)
13902
+ };
13503
13903
  }
13504
- var formatter = formatters[firstCharacter];
13505
- if (formatter) {
13506
- if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
13507
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
13508
- }
13509
- if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
13510
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
13511
- }
13512
- return formatter(utcDate, substring, locale.localize, formatterOptions);
13904
+ if (formatters[firstCharacter]) {
13905
+ return {
13906
+ isToken: true,
13907
+ value: substring
13908
+ };
13513
13909
  }
13514
13910
  if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
13515
- throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
13911
+ throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
13516
13912
  }
13517
- return substring;
13518
- }).join('');
13519
- return result;
13913
+ return {
13914
+ isToken: false,
13915
+ value: substring
13916
+ };
13917
+ });
13918
+
13919
+ // invoke localize preprocessor (only for french locales at the moment)
13920
+ if (locale.localize.preprocessor) {
13921
+ parts = locale.localize.preprocessor(originalDate, parts);
13922
+ }
13923
+ var formatterOptions = {
13924
+ firstWeekContainsDate: firstWeekContainsDate,
13925
+ weekStartsOn: weekStartsOn,
13926
+ locale: locale
13927
+ };
13928
+ return parts.map(function (part) {
13929
+ if (!part.isToken) return part.value;
13930
+ var token = part.value;
13931
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token) || !(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
13932
+ warnOrThrowProtectedError(token, formatStr, String(date));
13933
+ }
13934
+ var formatter = formatters[token[0]];
13935
+ return formatter(originalDate, token, locale.localize, formatterOptions);
13936
+ }).join("");
13520
13937
  }
13521
13938
  function cleanEscapedString(input) {
13522
13939
  var matched = input.match(escapedStringRegExp);
@@ -13526,21 +13943,9 @@ function cleanEscapedString(input) {
13526
13943
  return matched[1].replace(doubleQuoteRegExp, "'");
13527
13944
  }
13528
13945
 
13529
- function convertToFP(fn, arity) {
13530
- var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
13531
- if (a.length >= arity) {
13532
- return fn.apply(null, a.slice(0, arity).reverse());
13533
- }
13534
- return function () {
13535
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
13536
- args[_key] = arguments[_key];
13537
- }
13538
- return convertToFP(fn, arity, a.concat(args));
13539
- };
13540
- }
13541
-
13542
13946
  // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
13543
- var formatTime = convertToFP(format$1, 2);
13947
+
13948
+ var format$1 = convertToFP(format$2, 2);
13544
13949
 
13545
13950
  var Wrapper = index$c(View)(function () {
13546
13951
  return {
@@ -14034,7 +14439,7 @@ var CalendarRange = function CalendarRange(_ref) {
14034
14439
  return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
14035
14440
  testID: testID
14036
14441
  }, /*#__PURE__*/React__default.createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default.createElement(ContentNavigator, {
14037
- value: !shouldShowMonthPicker ? formatTime('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
14442
+ value: !shouldShowMonthPicker ? format$1('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
14038
14443
  testID: "calendar-month-picker",
14039
14444
  onPress: function onPress() {
14040
14445
  onToggleMonthPicker === null || onToggleMonthPicker === void 0 || onToggleMonthPicker(!monthPickerVisible);
@@ -14050,7 +14455,7 @@ var CalendarRange = function CalendarRange(_ref) {
14050
14455
  textAlign: 'center',
14051
14456
  marginRight: theme.__hd__.calendar.space.headerMarginRight
14052
14457
  }
14053
- }, formatTime('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
14458
+ }, format$1('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
14054
14459
  icon: monthPickerVisible ? 'arrow-up' : 'arrow-down',
14055
14460
  size: "small"
14056
14461
  }))),
@@ -14170,7 +14575,7 @@ var Calendar = function Calendar(_ref) {
14170
14575
  return /*#__PURE__*/React__default.createElement(StyledContainer$7, {
14171
14576
  testID: testID
14172
14577
  }, /*#__PURE__*/React__default.createElement(StyledCalendarHeader, null, /*#__PURE__*/React__default.createElement(ContentNavigator, {
14173
- value: !shouldShowMonthPicker ? formatTime('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
14578
+ value: !shouldShowMonthPicker ? format$1('MMMM yyyy', visibleDate) : /*#__PURE__*/React__default.createElement(TouchableOpacity, {
14174
14579
  testID: "calendar-month-picker",
14175
14580
  onPress: function onPress() {
14176
14581
  onToggleMonthPicker === null || onToggleMonthPicker === void 0 || onToggleMonthPicker(!monthPickerVisible);
@@ -14186,7 +14591,7 @@ var Calendar = function Calendar(_ref) {
14186
14591
  textAlign: 'center',
14187
14592
  marginRight: theme.__hd__.calendar.space.headerMarginRight
14188
14593
  }
14189
- }, formatTime('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
14594
+ }, format$1('MMMM yyyy', visibleDate)), /*#__PURE__*/React__default.createElement(Icon, {
14190
14595
  icon: monthPickerVisible ? 'arrow-up' : 'arrow-down',
14191
14596
  size: "small"
14192
14597
  }))),
@@ -14711,7 +15116,7 @@ var StyledPageControlWrapper = index$c(View)(function (_ref7) {
14711
15116
  });
14712
15117
 
14713
15118
  function isCarouselImageProps(image) {
14714
- return _typeof$1(image) === 'object';
15119
+ return _typeof(image) === 'object';
14715
15120
  }
14716
15121
  var CarouselItem = function CarouselItem(_ref) {
14717
15122
  var width = _ref.width,
@@ -15435,7 +15840,7 @@ function intern_delete(_ref3, value) {
15435
15840
  return value;
15436
15841
  }
15437
15842
  function keyof(value) {
15438
- return value !== null && _typeof$1(value) === "object" ? value.valueOf() : value;
15843
+ return value !== null && _typeof(value) === "object" ? value.valueOf() : value;
15439
15844
  }
15440
15845
 
15441
15846
  var e10 = Math.sqrt(50),
@@ -15881,7 +16286,7 @@ function selection_data (value, key) {
15881
16286
  // cause the data to change while iterating by using a key function, but please
15882
16287
  // don’t; we’d rather avoid a gratuitous copy.)
15883
16288
  function arraylike(data) {
15884
- return _typeof$1(data) === "object" && "length" in data ? data // Array, TypedArray, NodeList, array-like
16289
+ return _typeof(data) === "object" && "length" in data ? data // Array, TypedArray, NodeList, array-like
15885
16290
  : Array.from(data); // Map, Set, iterable, string, or anything else
15886
16291
  }
15887
16292
 
@@ -16895,8 +17300,8 @@ function object (a, b) {
16895
17300
  var i = {},
16896
17301
  c = {},
16897
17302
  k;
16898
- if (a === null || _typeof$1(a) !== "object") a = {};
16899
- if (b === null || _typeof$1(b) !== "object") b = {};
17303
+ if (a === null || _typeof(a) !== "object") a = {};
17304
+ if (b === null || _typeof(b) !== "object") b = {};
16900
17305
  for (k in b) {
16901
17306
  if (k in a) {
16902
17307
  i[k] = interpolate$1(a[k], b[k]);
@@ -16979,7 +17384,7 @@ function interpolateString (a, b) {
16979
17384
  }
16980
17385
 
16981
17386
  function interpolate$1 (a, b) {
16982
- var t = _typeof$1(b),
17387
+ var t = _typeof(b),
16983
17388
  c;
16984
17389
  return b == null || t === "boolean" ? constant$1(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, interpolateRgb) : interpolateString : b instanceof color ? interpolateRgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b);
16985
17390
  }
@@ -17119,8 +17524,8 @@ var frame = 0,
17119
17524
  clockLast = 0,
17120
17525
  clockNow = 0,
17121
17526
  clockSkew = 0,
17122
- clock = (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) === "object" && performance.now ? performance : Date,
17123
- setFrame = (typeof window === "undefined" ? "undefined" : _typeof$1(window)) === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
17527
+ clock = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === "object" && performance.now ? performance : Date,
17528
+ setFrame = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
17124
17529
  setTimeout(f, 17);
17125
17530
  };
17126
17531
  function now() {
@@ -18447,7 +18852,7 @@ function formatLocale (locale) {
18447
18852
  };
18448
18853
  }
18449
18854
 
18450
- var locale$4;
18855
+ var locale$2;
18451
18856
  var format;
18452
18857
  var formatPrefix;
18453
18858
  defaultLocale({
@@ -18456,10 +18861,10 @@ defaultLocale({
18456
18861
  currency: ["$", ""]
18457
18862
  });
18458
18863
  function defaultLocale(definition) {
18459
- locale$4 = formatLocale(definition);
18460
- format = locale$4.format;
18461
- formatPrefix = locale$4.formatPrefix;
18462
- return locale$4;
18864
+ locale$2 = formatLocale(definition);
18865
+ format = locale$2.format;
18866
+ formatPrefix = locale$2.formatPrefix;
18867
+ return locale$2;
18463
18868
  }
18464
18869
 
18465
18870
  function precisionFixed (step) {
@@ -18822,7 +19227,7 @@ function withPath(shape) {
18822
19227
  }
18823
19228
 
18824
19229
  function array (x) {
18825
- return _typeof$1(x) === "object" && "length" in x ? x // Array, TypedArray, NodeList, array-like
19230
+ return _typeof(x) === "object" && "length" in x ? x // Array, TypedArray, NodeList, array-like
18826
19231
  : Array.from(x); // Map, Set, iterable, string, or anything else
18827
19232
  }
18828
19233
 
@@ -18962,7 +19367,7 @@ Basis.prototype = {
18962
19367
  this._y0 = this._y1, this._y1 = y;
18963
19368
  }
18964
19369
  };
18965
- function basis (context) {
19370
+ function curveBasis (context) {
18966
19371
  return new Basis(context);
18967
19372
  }
18968
19373
 
@@ -19521,7 +19926,7 @@ var Line = function Line(_ref) {
19521
19926
  return ((_xScale = xScale(labels[i])) !== null && _xScale !== void 0 ? _xScale : 0) + xScale.bandwidth() / 2;
19522
19927
  }).y(function (d) {
19523
19928
  return yScale(d !== null && d !== void 0 ? d : 0);
19524
- }).curve(basis);
19929
+ }).curve(curveBasis);
19525
19930
  }, [xScale, yScale, labels]);
19526
19931
  // Generate path data
19527
19932
  var pathData = useMemo(function () {
@@ -20839,18 +21244,18 @@ var useCalculateDate = function useCalculateDate(_ref) {
20839
21244
  }, [maxDate, minDate, value]);
20840
21245
  };
20841
21246
 
20842
- var locale$3 = {
21247
+ var locale$1 = {
20843
21248
  lang: 'en-AU',
20844
21249
  dateTimeFormats: {
20845
21250
  fullDate: 'dd/MM/yyyy'
20846
21251
  }
20847
21252
  };
20848
21253
 
20849
- var LocaleContext = /*#__PURE__*/createContext(locale$3);
21254
+ var LocaleContext = /*#__PURE__*/createContext(locale$1);
20850
21255
 
20851
21256
  var useLocale = function useLocale() {
20852
21257
  var context = useContext(LocaleContext);
20853
- if (!context) return locale$3;
21258
+ if (!context) return locale$1;
20854
21259
  return context;
20855
21260
  };
20856
21261
  var useDateTimeFormat = function useDateTimeFormat() {
@@ -20864,7 +21269,7 @@ var useDateTimeFormat = function useDateTimeFormat() {
20864
21269
  };
20865
21270
  };
20866
21271
 
20867
- var locale$2 = {
21272
+ var locale = {
20868
21273
  lang: 'en-CA',
20869
21274
  dateTimeFormats: {
20870
21275
  fullDate: 'MMM dd, yyyy'
@@ -20872,8 +21277,8 @@ var locale$2 = {
20872
21277
  };
20873
21278
 
20874
21279
  var locales = {
20875
- 'en-AU': locale$3,
20876
- 'en-CA': locale$2
21280
+ 'en-AU': locale$1,
21281
+ 'en-CA': locale
20877
21282
  };
20878
21283
 
20879
21284
  // Function to get the date format based on the displayFormat and locale,
@@ -20908,7 +21313,7 @@ var useFormatDate = function useFormatDate(_ref) {
20908
21313
  locale: locale,
20909
21314
  localizeDateTime: localizeDateTime
20910
21315
  });
20911
- var displayValue = value ? formatTime(format, value) : '';
21316
+ var displayValue = value ? format$1(format, value) : '';
20912
21317
  return {
20913
21318
  displayValue: displayValue,
20914
21319
  format: format
@@ -24426,11 +24831,7 @@ var Toast = {
24426
24831
  * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
24427
24832
  * arguments for all functions.
24428
24833
  *
24429
- * @param {Object} newOptions - an object with options.
24430
- * @param {Locale} [newOptions.locale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
24431
- * @param {0|1|2|3|4|5|6} [newOptions.weekStartsOn] - the index of the first day of the week (0 - Sunday)
24432
- * @param {1|2|3|4|5|6|7} [newOptions.firstWeekContainsDate] - the day of January, which is always in the first week of the year
24433
- * @throws {TypeError} 1 argument required
24834
+ * @param options - An object with options
24434
24835
  *
24435
24836
  * @example
24436
24837
  * // Set global locale:
@@ -24464,21 +24865,23 @@ var Toast = {
24464
24865
  * const result = startOfWeek(new Date(2014, 8, 2))
24465
24866
  * //=> Sun Aug 31 2014 00:00:00
24466
24867
  */
24467
- function setDefaultOptions(newOptions) {
24468
- requiredArgs(1, arguments);
24868
+ function setDefaultOptions(options) {
24469
24869
  var result = {};
24470
24870
  var defaultOptions = getDefaultOptions();
24471
24871
  for (var property in defaultOptions) {
24472
24872
  if (Object.prototype.hasOwnProperty.call(defaultOptions, property)) {
24873
+ // [TODO] I challenge you to fix the type
24473
24874
  result[property] = defaultOptions[property];
24474
24875
  }
24475
24876
  }
24476
- for (var _property in newOptions) {
24477
- if (Object.prototype.hasOwnProperty.call(newOptions, _property)) {
24478
- if (newOptions[_property] === undefined) {
24877
+ for (var _property in options) {
24878
+ if (Object.prototype.hasOwnProperty.call(options, _property)) {
24879
+ if (options[_property] === undefined) {
24880
+ // [TODO] I challenge you to fix the type
24479
24881
  delete result[_property];
24480
24882
  } else {
24481
- result[_property] = newOptions[_property];
24883
+ // [TODO] I challenge you to fix the type
24884
+ result[_property] = options[_property];
24482
24885
  }
24483
24886
  }
24484
24887
  }
@@ -24486,48 +24889,47 @@ function setDefaultOptions(newOptions) {
24486
24889
  }
24487
24890
 
24488
24891
  var dateFormats$1 = {
24489
- full: 'EEEE, d MMMM yyyy',
24490
- "long": 'd MMMM yyyy',
24491
- medium: 'd MMM yyyy',
24492
- "short": 'dd/MM/yyyy'
24892
+ full: "EEEE, d MMMM yyyy",
24893
+ "long": "d MMMM yyyy",
24894
+ medium: "d MMM yyyy",
24895
+ "short": "dd/MM/yyyy"
24493
24896
  };
24494
24897
  var timeFormats$1 = {
24495
- full: 'h:mm:ss a zzzz',
24496
- "long": 'h:mm:ss a z',
24497
- medium: 'h:mm:ss a',
24498
- "short": 'h:mm a'
24898
+ full: "h:mm:ss a zzzz",
24899
+ "long": "h:mm:ss a z",
24900
+ medium: "h:mm:ss a",
24901
+ "short": "h:mm a"
24499
24902
  };
24500
24903
  var dateTimeFormats$1 = {
24501
24904
  full: "{{date}} 'at' {{time}}",
24502
24905
  "long": "{{date}} 'at' {{time}}",
24503
- medium: '{{date}}, {{time}}',
24504
- "short": '{{date}}, {{time}}'
24906
+ medium: "{{date}}, {{time}}",
24907
+ "short": "{{date}}, {{time}}"
24505
24908
  };
24506
24909
  var formatLong$1 = {
24507
24910
  date: buildFormatLongFn({
24508
24911
  formats: dateFormats$1,
24509
- defaultWidth: 'full'
24912
+ defaultWidth: "full"
24510
24913
  }),
24511
24914
  time: buildFormatLongFn({
24512
24915
  formats: timeFormats$1,
24513
- defaultWidth: 'full'
24916
+ defaultWidth: "full"
24514
24917
  }),
24515
24918
  dateTime: buildFormatLongFn({
24516
24919
  formats: dateTimeFormats$1,
24517
- defaultWidth: 'full'
24920
+ defaultWidth: "full"
24518
24921
  })
24519
24922
  };
24520
24923
 
24521
24924
  /**
24522
- * @type {Locale}
24523
24925
  * @category Locales
24524
24926
  * @summary English locale (Australia).
24525
24927
  * @language English
24526
24928
  * @iso-639-2 eng
24527
- * @author Julien Malige [@JulienMalige]{@link https://github.com/JulienMalige}
24929
+ * @author Julien Malige [@JulienMalige](https://github.com/JulienMalige)
24528
24930
  */
24529
- var locale$1 = {
24530
- code: 'en-AU',
24931
+ var enAU = {
24932
+ code: "en-AU",
24531
24933
  formatDistance: formatDistance$1,
24532
24934
  formatLong: formatLong$1,
24533
24935
  formatRelative: formatRelative,
@@ -24541,131 +24943,130 @@ var locale$1 = {
24541
24943
 
24542
24944
  var formatDistanceLocale = {
24543
24945
  lessThanXSeconds: {
24544
- one: 'less than a second',
24545
- other: 'less than {{count}} seconds'
24946
+ one: "less than a second",
24947
+ other: "less than {{count}} seconds"
24546
24948
  },
24547
24949
  xSeconds: {
24548
- one: 'a second',
24549
- other: '{{count}} seconds'
24950
+ one: "a second",
24951
+ other: "{{count}} seconds"
24550
24952
  },
24551
- halfAMinute: 'half a minute',
24953
+ halfAMinute: "half a minute",
24552
24954
  lessThanXMinutes: {
24553
- one: 'less than a minute',
24554
- other: 'less than {{count}} minutes'
24955
+ one: "less than a minute",
24956
+ other: "less than {{count}} minutes"
24555
24957
  },
24556
24958
  xMinutes: {
24557
- one: 'a minute',
24558
- other: '{{count}} minutes'
24959
+ one: "a minute",
24960
+ other: "{{count}} minutes"
24559
24961
  },
24560
24962
  aboutXHours: {
24561
- one: 'about an hour',
24562
- other: 'about {{count}} hours'
24963
+ one: "about an hour",
24964
+ other: "about {{count}} hours"
24563
24965
  },
24564
24966
  xHours: {
24565
- one: 'an hour',
24566
- other: '{{count}} hours'
24967
+ one: "an hour",
24968
+ other: "{{count}} hours"
24567
24969
  },
24568
24970
  xDays: {
24569
- one: 'a day',
24570
- other: '{{count}} days'
24971
+ one: "a day",
24972
+ other: "{{count}} days"
24571
24973
  },
24572
24974
  aboutXWeeks: {
24573
- one: 'about a week',
24574
- other: 'about {{count}} weeks'
24975
+ one: "about a week",
24976
+ other: "about {{count}} weeks"
24575
24977
  },
24576
24978
  xWeeks: {
24577
- one: 'a week',
24578
- other: '{{count}} weeks'
24979
+ one: "a week",
24980
+ other: "{{count}} weeks"
24579
24981
  },
24580
24982
  aboutXMonths: {
24581
- one: 'about a month',
24582
- other: 'about {{count}} months'
24983
+ one: "about a month",
24984
+ other: "about {{count}} months"
24583
24985
  },
24584
24986
  xMonths: {
24585
- one: 'a month',
24586
- other: '{{count}} months'
24987
+ one: "a month",
24988
+ other: "{{count}} months"
24587
24989
  },
24588
24990
  aboutXYears: {
24589
- one: 'about a year',
24590
- other: 'about {{count}} years'
24991
+ one: "about a year",
24992
+ other: "about {{count}} years"
24591
24993
  },
24592
24994
  xYears: {
24593
- one: 'a year',
24594
- other: '{{count}} years'
24995
+ one: "a year",
24996
+ other: "{{count}} years"
24595
24997
  },
24596
24998
  overXYears: {
24597
- one: 'over a year',
24598
- other: 'over {{count}} years'
24999
+ one: "over a year",
25000
+ other: "over {{count}} years"
24599
25001
  },
24600
25002
  almostXYears: {
24601
- one: 'almost a year',
24602
- other: 'almost {{count}} years'
25003
+ one: "almost a year",
25004
+ other: "almost {{count}} years"
24603
25005
  }
24604
25006
  };
24605
25007
  var formatDistance = function formatDistance(token, count, options) {
24606
25008
  var result;
24607
25009
  var tokenValue = formatDistanceLocale[token];
24608
- if (typeof tokenValue === 'string') {
25010
+ if (typeof tokenValue === "string") {
24609
25011
  result = tokenValue;
24610
25012
  } else if (count === 1) {
24611
25013
  result = tokenValue.one;
24612
25014
  } else {
24613
- result = tokenValue.other.replace('{{count}}', count.toString());
25015
+ result = tokenValue.other.replace("{{count}}", count.toString());
24614
25016
  }
24615
25017
  if (options !== null && options !== void 0 && options.addSuffix) {
24616
25018
  if (options.comparison && options.comparison > 0) {
24617
- return 'in ' + result;
25019
+ return "in " + result;
24618
25020
  } else {
24619
- return result + ' ago';
25021
+ return result + " ago";
24620
25022
  }
24621
25023
  }
24622
25024
  return result;
24623
25025
  };
24624
25026
 
24625
25027
  var dateFormats = {
24626
- full: 'EEEE, MMMM do, yyyy',
24627
- "long": 'MMMM do, yyyy',
24628
- medium: 'MMM d, yyyy',
24629
- "short": 'yyyy-MM-dd'
25028
+ full: "EEEE, MMMM do, yyyy",
25029
+ "long": "MMMM do, yyyy",
25030
+ medium: "MMM d, yyyy",
25031
+ "short": "yyyy-MM-dd"
24630
25032
  };
24631
25033
  var timeFormats = {
24632
- full: 'h:mm:ss a zzzz',
24633
- "long": 'h:mm:ss a z',
24634
- medium: 'h:mm:ss a',
24635
- "short": 'h:mm a'
25034
+ full: "h:mm:ss a zzzz",
25035
+ "long": "h:mm:ss a z",
25036
+ medium: "h:mm:ss a",
25037
+ "short": "h:mm a"
24636
25038
  };
24637
25039
  var dateTimeFormats = {
24638
25040
  full: "{{date}} 'at' {{time}}",
24639
25041
  "long": "{{date}} 'at' {{time}}",
24640
- medium: '{{date}}, {{time}}',
24641
- "short": '{{date}}, {{time}}'
25042
+ medium: "{{date}}, {{time}}",
25043
+ "short": "{{date}}, {{time}}"
24642
25044
  };
24643
25045
  var formatLong = {
24644
25046
  date: buildFormatLongFn({
24645
25047
  formats: dateFormats,
24646
- defaultWidth: 'full'
25048
+ defaultWidth: "full"
24647
25049
  }),
24648
25050
  time: buildFormatLongFn({
24649
25051
  formats: timeFormats,
24650
- defaultWidth: 'full'
25052
+ defaultWidth: "full"
24651
25053
  }),
24652
25054
  dateTime: buildFormatLongFn({
24653
25055
  formats: dateTimeFormats,
24654
- defaultWidth: 'full'
25056
+ defaultWidth: "full"
24655
25057
  })
24656
25058
  };
24657
25059
 
24658
25060
  /**
24659
- * @type {Locale}
24660
25061
  * @category Locales
24661
25062
  * @summary English locale (Canada).
24662
25063
  * @language English
24663
25064
  * @iso-639-2 eng
24664
- * @author Mark Owsiak [@markowsiak]{@link https://github.com/markowsiak}
24665
- * @author Marco Imperatore [@mimperatore]{@link https://github.com/mimperatore}
25065
+ * @author Mark Owsiak [@markowsiak](https://github.com/markowsiak)
25066
+ * @author Marco Imperatore [@mimperatore](https://github.com/mimperatore)
24666
25067
  */
24667
- var locale = {
24668
- code: 'en-CA',
25068
+ var enCA = {
25069
+ code: "en-CA",
24669
25070
  formatDistance: formatDistance,
24670
25071
  formatLong: formatLong,
24671
25072
  formatRelative: formatRelative,
@@ -24678,8 +25079,8 @@ var locale = {
24678
25079
  };
24679
25080
 
24680
25081
  var Locales = {
24681
- 'en-AU': locale$1,
24682
- 'en-CA': locale
25082
+ 'en-AU': enAU,
25083
+ 'en-CA': enCA
24683
25084
  };
24684
25085
  function getDateFnsLocale(locale) {
24685
25086
  var fallbackLocale = Locales['en-AU'];
@@ -24709,7 +25110,7 @@ var LocaleProvider = function LocaleProvider(props) {
24709
25110
  var HeroDesignProvider = function HeroDesignProvider(_ref) {
24710
25111
  var theme = _ref.theme,
24711
25112
  _ref$locale = _ref.locale,
24712
- locale = _ref$locale === void 0 ? locale$3 : _ref$locale,
25113
+ locale = _ref$locale === void 0 ? locale$1 : _ref$locale,
24713
25114
  children = _ref.children;
24714
25115
  return /*#__PURE__*/React__default.createElement(LocaleProvider, {
24715
25116
  locale: locale
@@ -26150,7 +26551,7 @@ var isOptionSelected = function isOptionSelected(value, option) {
26150
26551
  if (!value || !option || option.value === null || option.value === undefined) {
26151
26552
  return false;
26152
26553
  }
26153
- if (_typeof$1(option.value) !== 'object') {
26554
+ if (_typeof(option.value) !== 'object') {
26154
26555
  return value.includes(option.value);
26155
26556
  }
26156
26557
  return value.some(function (v) {
@@ -27883,7 +28284,7 @@ var TimePickerAndroid = function TimePickerAndroid(_ref) {
27883
28284
  open = _useState2[0],
27884
28285
  setOpen = _useState2[1];
27885
28286
  var is12Hour = displayFormat.includes('hh');
27886
- var displayValue = value ? formatTime(displayFormat, value) : '';
28287
+ var displayValue = value ? format$1(displayFormat, value) : '';
27887
28288
  var pickerInitValue = value || new Date();
27888
28289
  var InputComponent = TextInputComponent || TextInput;
27889
28290
  var onPress = useCallback(function () {
@@ -27956,7 +28357,7 @@ var TimePickerIOS = function TimePickerIOS(_ref) {
27956
28357
  open = _useState4[0],
27957
28358
  setOpen = _useState4[1];
27958
28359
  var is12Hour = displayFormat.includes('hh');
27959
- var displayValue = value ? formatTime(displayFormat, value) : '';
28360
+ var displayValue = value ? format$1(displayFormat, value) : '';
27960
28361
  var theme = useTheme();
27961
28362
  // Determine locale based on time format preference
27962
28363
  // For 12-hour format: use en-US locale to ensure 12-hour display regardless of device settings
@@ -28728,7 +29129,7 @@ function requireScheduler_production_min() {
28728
29129
  var c = a.sortIndex - b.sortIndex;
28729
29130
  return 0 !== c ? c : a.id - b.id;
28730
29131
  }
28731
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
29132
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
28732
29133
  var l = performance;
28733
29134
  exports.unstable_now = function () {
28734
29135
  return l.now();
@@ -28899,7 +29300,7 @@ function requireScheduler_production_min() {
28899
29300
  };
28900
29301
  exports.unstable_scheduleCallback = function (a, b, c) {
28901
29302
  var d = exports.unstable_now();
28902
- "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
29303
+ "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
28903
29304
  switch (a) {
28904
29305
  case 1:
28905
29306
  var e = -1;
@@ -28989,7 +29390,7 @@ function requireReactDom_production_min() {
28989
29390
  }
28990
29391
  function pa(a, b, c, d) {
28991
29392
  if (null !== c && 0 === c.type) return !1;
28992
- switch (_typeof$1(b)) {
29393
+ switch (_typeof(b)) {
28993
29394
  case "function":
28994
29395
  case "symbol":
28995
29396
  return !0;
@@ -29099,7 +29500,7 @@ function requireReactDom_production_min() {
29099
29500
  var Ia = Symbol["for"]("react.offscreen");
29100
29501
  var Ja = Symbol.iterator;
29101
29502
  function Ka(a) {
29102
- if (null === a || "object" !== _typeof$1(a)) return null;
29503
+ if (null === a || "object" !== _typeof(a)) return null;
29103
29504
  a = Ja && a[Ja] || a["@@iterator"];
29104
29505
  return "function" === typeof a ? a : null;
29105
29506
  }
@@ -29128,7 +29529,7 @@ function requireReactDom_production_min() {
29128
29529
  set: function set() {
29129
29530
  throw Error();
29130
29531
  }
29131
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
29532
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
29132
29533
  try {
29133
29534
  Reflect.construct(b, []);
29134
29535
  } catch (l) {
@@ -29210,7 +29611,7 @@ function requireReactDom_production_min() {
29210
29611
  case Fa:
29211
29612
  return "SuspenseList";
29212
29613
  }
29213
- if ("object" === _typeof$1(a)) switch (a.$$typeof) {
29614
+ if ("object" === _typeof(a)) switch (a.$$typeof) {
29214
29615
  case Ca:
29215
29616
  return (a.displayName || "Context") + ".Consumer";
29216
29617
  case Ba:
@@ -29282,7 +29683,7 @@ function requireReactDom_production_min() {
29282
29683
  return null;
29283
29684
  }
29284
29685
  function Sa(a) {
29285
- switch (_typeof$1(a)) {
29686
+ switch (_typeof(a)) {
29286
29687
  case "boolean":
29287
29688
  case "number":
29288
29689
  case "string":
@@ -29593,9 +29994,9 @@ function requireReactDom_production_min() {
29593
29994
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
29594
29995
  if (null != b.dangerouslySetInnerHTML) {
29595
29996
  if (null != b.children) throw Error(p(60));
29596
- if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
29997
+ if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
29597
29998
  }
29598
- if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
29999
+ if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
29599
30000
  }
29600
30001
  }
29601
30002
  function vb(a, b) {
@@ -29681,7 +30082,7 @@ function requireReactDom_production_min() {
29681
30082
  a = !1;
29682
30083
  }
29683
30084
  if (a) return null;
29684
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
30085
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
29685
30086
  return c;
29686
30087
  }
29687
30088
  var Lb = !1;
@@ -30595,7 +30996,7 @@ function requireReactDom_production_min() {
30595
30996
  }
30596
30997
  function he(a) {
30597
30998
  a = a.detail;
30598
- return "object" === _typeof$1(a) && "data" in a ? a.data : null;
30999
+ return "object" === _typeof(a) && "data" in a ? a.data : null;
30599
31000
  }
30600
31001
  var ie = !1;
30601
31002
  function je(a, b) {
@@ -30712,7 +31113,7 @@ function requireReactDom_production_min() {
30712
31113
  var He = "function" === typeof Object.is ? Object.is : Ge;
30713
31114
  function Ie(a, b) {
30714
31115
  if (He(a, b)) return !0;
30715
- if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
31116
+ if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
30716
31117
  var c = Object.keys(a),
30717
31118
  d = Object.keys(b);
30718
31119
  if (c.length !== d.length) return !1;
@@ -31239,7 +31640,7 @@ function requireReactDom_production_min() {
31239
31640
  var Cf = null,
31240
31641
  Df = null;
31241
31642
  function Ef(a, b) {
31242
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof$1(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
31643
+ return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
31243
31644
  }
31244
31645
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
31245
31646
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -31887,7 +32288,7 @@ function requireReactDom_production_min() {
31887
32288
  var d = !1,
31888
32289
  e = Vf;
31889
32290
  var f = b.contextType;
31890
- "object" === _typeof$1(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
32291
+ "object" === _typeof(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
31891
32292
  b = new b(c, f);
31892
32293
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
31893
32294
  b.updater = nh;
@@ -31909,7 +32310,7 @@ function requireReactDom_production_min() {
31909
32310
  e.refs = jh;
31910
32311
  ah(a);
31911
32312
  var f = b.contextType;
31912
- "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
32313
+ "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
31913
32314
  e.state = a.memoizedState;
31914
32315
  f = b.getDerivedStateFromProps;
31915
32316
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -31918,7 +32319,7 @@ function requireReactDom_production_min() {
31918
32319
  }
31919
32320
  function sh(a, b, c) {
31920
32321
  a = c.ref;
31921
- if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
32322
+ if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
31922
32323
  if (c._owner) {
31923
32324
  c = c._owner;
31924
32325
  if (c) {
@@ -31993,7 +32394,7 @@ function requireReactDom_production_min() {
31993
32394
  function k(a, b, c, d) {
31994
32395
  var f = c.type;
31995
32396
  if (f === ya) return m(a, b, c.props.children, d, c.key);
31996
- if (null !== b && (b.elementType === f || "object" === _typeof$1(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
32397
+ if (null !== b && (b.elementType === f || "object" === _typeof(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
31997
32398
  d = yh(c.type, c.key, c.props, null, a.mode, d);
31998
32399
  d.ref = sh(a, b, c);
31999
32400
  d["return"] = a;
@@ -32013,7 +32414,7 @@ function requireReactDom_production_min() {
32013
32414
  }
32014
32415
  function q(a, b, c) {
32015
32416
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
32016
- if ("object" === _typeof$1(b) && null !== b) {
32417
+ if ("object" === _typeof(b) && null !== b) {
32017
32418
  switch (b.$$typeof) {
32018
32419
  case va:
32019
32420
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -32031,7 +32432,7 @@ function requireReactDom_production_min() {
32031
32432
  function r(a, b, c, d) {
32032
32433
  var e = null !== b ? b.key : null;
32033
32434
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
32034
- if ("object" === _typeof$1(c) && null !== c) {
32435
+ if ("object" === _typeof(c) && null !== c) {
32035
32436
  switch (c.$$typeof) {
32036
32437
  case va:
32037
32438
  return c.key === e ? k(a, b, c, d) : null;
@@ -32047,7 +32448,7 @@ function requireReactDom_production_min() {
32047
32448
  }
32048
32449
  function y(a, b, c, d, e) {
32049
32450
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
32050
- if ("object" === _typeof$1(d) && null !== d) {
32451
+ if ("object" === _typeof(d) && null !== d) {
32051
32452
  switch (d.$$typeof) {
32052
32453
  case va:
32053
32454
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -32121,8 +32522,8 @@ function requireReactDom_production_min() {
32121
32522
  return l;
32122
32523
  }
32123
32524
  function J(a, d, f, h) {
32124
- "object" === _typeof$1(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
32125
- if ("object" === _typeof$1(f) && null !== f) {
32525
+ "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
32526
+ if ("object" === _typeof(f) && null !== f) {
32126
32527
  switch (f.$$typeof) {
32127
32528
  case va:
32128
32529
  a: {
@@ -32137,7 +32538,7 @@ function requireReactDom_production_min() {
32137
32538
  a = d;
32138
32539
  break a;
32139
32540
  }
32140
- } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
32541
+ } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
32141
32542
  c(a, l.sibling);
32142
32543
  d = e(l, f.props);
32143
32544
  d.ref = sh(a, l, f);
@@ -33022,7 +33423,7 @@ function requireReactDom_production_min() {
33022
33423
  g.props = h;
33023
33424
  var k = g.context,
33024
33425
  l = c.contextType;
33025
- "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
33426
+ "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
33026
33427
  var m = c.getDerivedStateFromProps,
33027
33428
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
33028
33429
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -33041,7 +33442,7 @@ function requireReactDom_production_min() {
33041
33442
  q = b.pendingProps;
33042
33443
  r = g.context;
33043
33444
  k = c.contextType;
33044
- "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
33445
+ "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
33045
33446
  var y = c.getDerivedStateFromProps;
33046
33447
  (m = "function" === typeof y || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q || r !== k) && qh(b, g, d, k);
33047
33448
  $g = !1;
@@ -34954,7 +35355,7 @@ function requireReactDom_production_min() {
34954
35355
  k = b;
34955
35356
  b = Z;
34956
35357
  h.flags |= 32768;
34957
- if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
35358
+ if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
34958
35359
  var l = k,
34959
35360
  m = h,
34960
35361
  q = m.tag;
@@ -35375,7 +35776,7 @@ function requireReactDom_production_min() {
35375
35776
  e = Xh(null, b, d, a, e, c);
35376
35777
  var f = bi();
35377
35778
  b.flags |= 1;
35378
- "object" === _typeof$1(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
35779
+ "object" === _typeof(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
35379
35780
  return b;
35380
35781
  case 16:
35381
35782
  d = b.elementType;
@@ -35616,7 +36017,7 @@ function requireReactDom_production_min() {
35616
36017
  case Ia:
35617
36018
  return qj(c, e, f, b);
35618
36019
  default:
35619
- if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
36020
+ if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
35620
36021
  case Ba:
35621
36022
  g = 10;
35622
36023
  break a;
@@ -35634,7 +36035,7 @@ function requireReactDom_production_min() {
35634
36035
  d = null;
35635
36036
  break a;
35636
36037
  }
35637
- throw Error(p(130, null == a ? a : _typeof$1(a), ""));
36038
+ throw Error(p(130, null == a ? a : _typeof(a), ""));
35638
36039
  }
35639
36040
  b = Bg(g, c, b, e);
35640
36041
  b.elementType = a;
@@ -36282,7 +36683,7 @@ function requireLib() {
36282
36683
  };
36283
36684
  },
36284
36685
  380: function _(e, t, r) {
36285
- var n = "object" == _typeof$1(r.g) && r.g && r.g.Object === Object && r.g;
36686
+ var n = "object" == _typeof(r.g) && r.g && r.g.Object === Object && r.g;
36286
36687
  e.exports = n;
36287
36688
  },
36288
36689
  903: function _(e, t, r) {
@@ -36310,7 +36711,7 @@ function requireLib() {
36310
36711
  },
36311
36712
  433: function _(e, t, r) {
36312
36713
  var n = r(380),
36313
- o = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
36714
+ o = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
36314
36715
  u = n || o || Function("return this")();
36315
36716
  e.exports = u;
36316
36717
  },
@@ -36379,20 +36780,20 @@ function requireLib() {
36379
36780
  },
36380
36781
  953: function _(e) {
36381
36782
  e.exports = function (e) {
36382
- var t = _typeof$1(e);
36783
+ var t = _typeof(e);
36383
36784
  return null != e && ("object" == t || "function" == t);
36384
36785
  };
36385
36786
  },
36386
36787
  934: function _(e) {
36387
36788
  e.exports = function (e) {
36388
- return null != e && "object" == _typeof$1(e);
36789
+ return null != e && "object" == _typeof(e);
36389
36790
  };
36390
36791
  },
36391
36792
  414: function _(e, t, r) {
36392
36793
  var n = r(148),
36393
36794
  o = r(934);
36394
36795
  e.exports = function (e) {
36395
- return "symbol" == _typeof$1(e) || o(e) && "[object Symbol]" == n(e);
36796
+ return "symbol" == _typeof(e) || o(e) && "[object Symbol]" == n(e);
36396
36797
  };
36397
36798
  },
36398
36799
  664: function _(e, t, r) {
@@ -36469,11 +36870,11 @@ function requireLib() {
36469
36870
  get: t[r]
36470
36871
  });
36471
36872
  }, o.g = function () {
36472
- if ("object" == (typeof globalThis === "undefined" ? "undefined" : _typeof$1(globalThis))) return globalThis;
36873
+ if ("object" == (typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis))) return globalThis;
36473
36874
  try {
36474
36875
  return this || new Function("return this")();
36475
36876
  } catch (e) {
36476
- if ("object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window))) return window;
36877
+ if ("object" == (typeof window === "undefined" ? "undefined" : _typeof(window))) return window;
36477
36878
  }
36478
36879
  }(), o.o = function (e, t) {
36479
36880
  return Object.prototype.hasOwnProperty.call(e, t);
@@ -36598,7 +36999,7 @@ function requireLib() {
36598
36999
  }
36599
37000
  var h = Object.prototype.constructor.toString();
36600
37001
  function v(e) {
36601
- if (!e || "object" != _typeof$1(e)) return !1;
37002
+ if (!e || "object" != _typeof(e)) return !1;
36602
37003
  var t = c(e);
36603
37004
  if (null === t) return !0;
36604
37005
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -36895,7 +37296,7 @@ function requireLib() {
36895
37296
  }
36896
37297
  return S(_o4, r), R(n, _o4);
36897
37298
  }
36898
- if (!e || "object" != _typeof$1(e)) {
37299
+ if (!e || "object" != _typeof(e)) {
36899
37300
  if (n = t(e), void 0 === n && (n = e), n === a && (n = void 0), _this.autoFreeze_ && E(n, !0), r) {
36900
37301
  var _t6 = [],
36901
37302
  _o5 = [];
@@ -37172,10 +37573,10 @@ function requireLib() {
37172
37573
  }
37173
37574
  };
37174
37575
  function se(e) {
37175
- return se = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
37176
- return _typeof$1(e);
37576
+ return se = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
37577
+ return _typeof(e);
37177
37578
  } : function (e) {
37178
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
37579
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
37179
37580
  }, se(e);
37180
37581
  }
37181
37582
  function le(e, t, r) {
@@ -41859,7 +42260,7 @@ function requireLib() {
41859
42260
  Jt = o(858),
41860
42261
  Zt = o.n(Jt);
41861
42262
  var Yt = function Yt(e) {
41862
- return "object" == _typeof$1(e) && null != e && 1 === e.nodeType;
42263
+ return "object" == _typeof(e) && null != e && 1 === e.nodeType;
41863
42264
  },
41864
42265
  Gt = function Gt(e, t) {
41865
42266
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;
@@ -42079,10 +42480,10 @@ function requireLib() {
42079
42480
  "undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && /Version\/(\d+)/.test(navigator.userAgent) && null !== (nr = navigator.userAgent.match(/Version\/(\d+)/)) && void 0 !== nr && nr[1] && parseInt(null === (or = navigator.userAgent.match(/Version\/(\d+)/)) || void 0 === or ? void 0 : or[1], 10);
42080
42481
  var Tr = (!Or || !xr) && !Ar && "undefined" != typeof globalThis && globalThis.InputEvent && "function" == typeof globalThis.InputEvent.prototype.getTargetRanges;
42081
42482
  function Mr(e) {
42082
- return Mr = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
42083
- return _typeof$1(e);
42483
+ return Mr = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
42484
+ return _typeof(e);
42084
42485
  } : function (e) {
42085
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
42486
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
42086
42487
  }, Mr(e);
42087
42488
  }
42088
42489
  function Rr(e, t, r) {
@@ -43155,10 +43556,10 @@ function requireLib() {
43155
43556
  return o;
43156
43557
  }
43157
43558
  function yo(e) {
43158
- return yo = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
43159
- return _typeof$1(e);
43559
+ return yo = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
43560
+ return _typeof(e);
43160
43561
  } : function (e) {
43161
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
43562
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
43162
43563
  }, yo(e);
43163
43564
  }
43164
43565
  function Bo(e, t, r) {
@@ -44907,7 +45308,7 @@ function requireLib() {
44907
45308
  };
44908
45309
  }(e);
44909
45310
  if (function (e) {
44910
- return "object" == _typeof$1(e) && "function" == typeof e.behavior;
45311
+ return "object" == _typeof(e) && "function" == typeof e.behavior;
44911
45312
  }(t)) return t.behavior(rr(e, t));
44912
45313
  var n = "boolean" == typeof t || null == t ? void 0 : t.behavior;
44913
45314
  var _iterator47 = _createForOfIteratorHelper(rr(e, function (e) {
@@ -45529,10 +45930,10 @@ function requireLib() {
45529
45930
  };
45530
45931
  };
45531
45932
  function Wu(e) {
45532
- return Wu = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
45533
- return _typeof$1(e);
45933
+ return Wu = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
45934
+ return _typeof(e);
45534
45935
  } : function (e) {
45535
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
45936
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
45536
45937
  }, Wu(e);
45537
45938
  }
45538
45939
  function Vu(e, t) {
@@ -45701,10 +46102,10 @@ function requireLib() {
45701
46102
  };
45702
46103
  };
45703
46104
  function ha(e) {
45704
- return ha = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
45705
- return _typeof$1(e);
46105
+ return ha = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
46106
+ return _typeof(e);
45706
46107
  } : function (e) {
45707
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
46108
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
45708
46109
  }, ha(e);
45709
46110
  }
45710
46111
  function va(e, t) {
@@ -45894,10 +46295,10 @@ function requireLib() {
45894
46295
  window.postMessage(o, "*"), null === (n = window.ReactNativeWebView) || void 0 === n || n.postMessage(JSON.stringify(o));
45895
46296
  };
45896
46297
  function Na(e) {
45897
- return Na = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
45898
- return _typeof$1(e);
46298
+ return Na = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
46299
+ return _typeof(e);
45899
46300
  } : function (e) {
45900
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
46301
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
45901
46302
  }, Na(e);
45902
46303
  }
45903
46304
  var _a = ["active"];
@@ -46288,10 +46689,10 @@ function requireLib() {
46288
46689
  r.style.display = "block", r.style.top = "calc(".concat(u.top, "px + ").concat(s, ")"), f > d ? (r.style.left = "".concat(l, "px"), r.style.right = "unset", r.style.maxWidth = "".concat(Math.min(f, a.width), "px")) : (r.style.left = "unset", r.style.right = "".concat(c, "px"), r.style.maxWidth = "".concat(Math.min(d, a.width), "px"));
46289
46690
  };
46290
46691
  function bi(e) {
46291
- return bi = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
46292
- return _typeof$1(e);
46692
+ return bi = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
46693
+ return _typeof(e);
46293
46694
  } : function (e) {
46294
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
46695
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
46295
46696
  }, bi(e);
46296
46697
  }
46297
46698
  function Ei(e, t) {
@@ -46700,10 +47101,10 @@ function requireLib() {
46700
47101
  });
46701
47102
  };
46702
47103
  function Hi(e) {
46703
- return Hi = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
46704
- return _typeof$1(e);
47104
+ return Hi = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
47105
+ return _typeof(e);
46705
47106
  } : function (e) {
46706
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
47107
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
46707
47108
  }, Hi(e);
46708
47109
  }
46709
47110
  function Ui(e, t) {
@@ -47279,10 +47680,10 @@ function requireLib() {
47279
47680
  });
47280
47681
  var Ts = ks;
47281
47682
  function Ms(e) {
47282
- return Ms = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
47283
- return _typeof$1(e);
47683
+ return Ms = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
47684
+ return _typeof(e);
47284
47685
  } : function (e) {
47285
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
47686
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
47286
47687
  }, Ms(e);
47287
47688
  }
47288
47689
  function Rs() {