@ballistix.digital/react-components 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -577,6 +577,15 @@ function isOverflowElement(element) {
577
577
  function isTableElement(element) {
578
578
  return ['table', 'td', 'th'].includes(getNodeName(element));
579
579
  }
580
+ function isTopLayer(element) {
581
+ return [':popover-open', ':modal'].some(selector => {
582
+ try {
583
+ return element.matches(selector);
584
+ } catch (e) {
585
+ return false;
586
+ }
587
+ });
588
+ }
580
589
  function isContainingBlock(element) {
581
590
  const webkit = isWebKit();
582
591
  const css = getComputedStyle(element);
@@ -585,6 +594,9 @@ function isContainingBlock(element) {
585
594
  function getContainingBlock(element) {
586
595
  let currentNode = getParentNode(element);
587
596
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
597
+ if (isTopLayer(currentNode)) {
598
+ return null;
599
+ }
588
600
  if (isContainingBlock(currentNode)) {
589
601
  return currentNode;
590
602
  }
@@ -610,8 +622,8 @@ function getNodeScroll(element) {
610
622
  };
611
623
  }
612
624
  return {
613
- scrollLeft: element.pageXOffset,
614
- scrollTop: element.pageYOffset
625
+ scrollLeft: element.scrollX,
626
+ scrollTop: element.scrollY
615
627
  };
616
628
  }
617
629
  function getParentNode(node) {
@@ -719,7 +731,7 @@ function isJSDOM() {
719
731
  }
720
732
  function isMouseLikePointerType(pointerType, strict) {
721
733
  const values = ['mouse', 'pen'];
722
- if (!strict) {
734
+ {
723
735
  values.push('', undefined);
724
736
  }
725
737
  return values.includes(pointerType);
@@ -1176,10 +1188,12 @@ const flip$2 = function (options) {
1176
1188
  return {};
1177
1189
  }
1178
1190
  const side = getSide(placement);
1191
+ const initialSideAxis = getSideAxis(initialPlacement);
1179
1192
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
1180
1193
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1181
1194
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1182
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
1195
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
1196
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
1183
1197
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1184
1198
  }
1185
1199
  const placements = [initialPlacement, ...fallbackPlacements];
@@ -1217,8 +1231,15 @@ const flip$2 = function (options) {
1217
1231
  switch (fallbackStrategy) {
1218
1232
  case 'bestFit':
1219
1233
  {
1220
- var _overflowsData$map$so;
1221
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
1234
+ var _overflowsData$filter2;
1235
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
1236
+ if (hasFallbackAxisSideDirection) {
1237
+ const currentSideAxis = getSideAxis(d.placement);
1238
+ return currentSideAxis === initialSideAxis ||
1239
+ currentSideAxis === 'y';
1240
+ }
1241
+ return true;
1242
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
1222
1243
  if (placement) {
1223
1244
  resetPlacement = placement;
1224
1245
  }
@@ -1495,16 +1516,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
1495
1516
  y
1496
1517
  });
1497
1518
  }
1498
- const topLayerSelectors = [':popover-open', ':modal'];
1499
- function isTopLayer(element) {
1500
- return topLayerSelectors.some(selector => {
1501
- try {
1502
- return element.matches(selector);
1503
- } catch (e) {
1504
- return false;
1505
- }
1506
- });
1507
- }
1508
1519
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1509
1520
  let {
1510
1521
  elements,
@@ -2850,6 +2861,14 @@ const FloatingArrow = React.forwardRef(function FloatingArrow(props, ref) {
2850
2861
  }
2851
2862
  }
2852
2863
  const clipPathId = useId();
2864
+ const [isRTL, setIsRTL] = React.useState(false);
2865
+ index(() => {
2866
+ if (!floating) return;
2867
+ const isRTL = getComputedStyle(floating).direction === 'rtl';
2868
+ if (isRTL) {
2869
+ setIsRTL(true);
2870
+ }
2871
+ }, [floating]);
2853
2872
  if (!floating) {
2854
2873
  return null;
2855
2874
  }
@@ -2858,7 +2877,6 @@ const FloatingArrow = React.forwardRef(function FloatingArrow(props, ref) {
2858
2877
  const svgX = width / 2 * (tipRadius / -8 + 1);
2859
2878
  const svgY = height / 2 * tipRadius / 4;
2860
2879
  const [side, alignment] = placement.split('-');
2861
- const isRTL = platform.isRTL(floating);
2862
2880
  const isCustomShape = !!d;
2863
2881
  const isVerticalSide = side === 'top' || side === 'bottom';
2864
2882
  const yOffsetProp = staticOffset && alignment === 'end' ? 'bottom' : 'top';
@@ -2961,10 +2979,7 @@ function useHover(context, props) {
2961
2979
  onOpenChange,
2962
2980
  dataRef,
2963
2981
  events,
2964
- elements: {
2965
- domReference,
2966
- floating
2967
- }
2982
+ elements
2968
2983
  } = context;
2969
2984
  const {
2970
2985
  enabled = true,
@@ -2978,6 +2993,7 @@ function useHover(context, props) {
2978
2993
  const parentId = useFloatingParentNodeId();
2979
2994
  const handleCloseRef = useLatestRef(handleClose);
2980
2995
  const delayRef = useLatestRef(delay);
2996
+ const openRef = useLatestRef(open);
2981
2997
  const pointerTypeRef = React.useRef();
2982
2998
  const timeoutRef = React.useRef(-1);
2983
2999
  const handlerRef = React.useRef();
@@ -2991,9 +3007,7 @@ function useHover(context, props) {
2991
3007
  return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';
2992
3008
  }, [dataRef]);
2993
3009
  React.useEffect(() => {
2994
- if (!enabled) {
2995
- return;
2996
- }
3010
+ if (!enabled) return;
2997
3011
  function onOpenChange(_ref) {
2998
3012
  let {
2999
3013
  open
@@ -3010,20 +3024,20 @@ function useHover(context, props) {
3010
3024
  };
3011
3025
  }, [enabled, events]);
3012
3026
  React.useEffect(() => {
3013
- if (!enabled || !handleCloseRef.current || !open) {
3014
- return;
3015
- }
3027
+ if (!enabled) return;
3028
+ if (!handleCloseRef.current) return;
3029
+ if (!open) return;
3016
3030
  function onLeave(event) {
3017
3031
  if (isHoverOpen()) {
3018
3032
  onOpenChange(false, event, 'hover');
3019
3033
  }
3020
3034
  }
3021
- const html = getDocument(floating).documentElement;
3035
+ const html = getDocument(elements.floating).documentElement;
3022
3036
  html.addEventListener('mouseleave', onLeave);
3023
3037
  return () => {
3024
3038
  html.removeEventListener('mouseleave', onLeave);
3025
3039
  };
3026
- }, [floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
3040
+ }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);
3027
3041
  const closeWithDelay = React.useCallback(function (event, runElseBranch, reason) {
3028
3042
  if (runElseBranch === void 0) {
3029
3043
  runElseBranch = true;
@@ -3046,16 +3060,14 @@ function useHover(context, props) {
3046
3060
  });
3047
3061
  const clearPointerEvents = useEffectEvent(() => {
3048
3062
  if (performedPointerEventsMutationRef.current) {
3049
- const body = getDocument(floating).body;
3063
+ const body = getDocument(elements.floating).body;
3050
3064
  body.style.pointerEvents = '';
3051
3065
  body.removeAttribute(safePolygonIdentifier);
3052
3066
  performedPointerEventsMutationRef.current = false;
3053
3067
  }
3054
3068
  });
3055
3069
  React.useEffect(() => {
3056
- if (!enabled) {
3057
- return;
3058
- }
3070
+ if (!enabled) return;
3059
3071
  function isClickLikeOpenEvent() {
3060
3072
  return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;
3061
3073
  }
@@ -3068,7 +3080,9 @@ function useHover(context, props) {
3068
3080
  const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);
3069
3081
  if (openDelay) {
3070
3082
  timeoutRef.current = window.setTimeout(() => {
3071
- onOpenChange(true, event, 'hover');
3083
+ if (!openRef.current) {
3084
+ onOpenChange(true, event, 'hover');
3085
+ }
3072
3086
  }, openDelay);
3073
3087
  } else {
3074
3088
  onOpenChange(true, event, 'hover');
@@ -3077,7 +3091,7 @@ function useHover(context, props) {
3077
3091
  function onMouseLeave(event) {
3078
3092
  if (isClickLikeOpenEvent()) return;
3079
3093
  unbindMouseMoveRef.current();
3080
- const doc = getDocument(floating);
3094
+ const doc = getDocument(elements.floating);
3081
3095
  clearTimeout(restTimeoutRef.current);
3082
3096
  if (handleCloseRef.current && dataRef.current.floatingContext) {
3083
3097
  if (!open) {
@@ -3101,7 +3115,7 @@ function useHover(context, props) {
3101
3115
  };
3102
3116
  return;
3103
3117
  }
3104
- const shouldClose = pointerTypeRef.current === 'touch' ? !contains(floating, event.relatedTarget) : true;
3118
+ const shouldClose = pointerTypeRef.current === 'touch' ? !contains(elements.floating, event.relatedTarget) : true;
3105
3119
  if (shouldClose) {
3106
3120
  closeWithDelay(event);
3107
3121
  }
@@ -3121,50 +3135,51 @@ function useHover(context, props) {
3121
3135
  }
3122
3136
  })(event);
3123
3137
  }
3124
- if (isElement(domReference)) {
3125
- const ref = domReference;
3138
+ if (isElement(elements.domReference)) {
3139
+ var _elements$floating;
3140
+ const ref = elements.domReference;
3126
3141
  open && ref.addEventListener('mouseleave', onScrollMouseLeave);
3127
- floating == null || floating.addEventListener('mouseleave', onScrollMouseLeave);
3142
+ (_elements$floating = elements.floating) == null || _elements$floating.addEventListener('mouseleave', onScrollMouseLeave);
3128
3143
  move && ref.addEventListener('mousemove', onMouseEnter, {
3129
3144
  once: true
3130
3145
  });
3131
3146
  ref.addEventListener('mouseenter', onMouseEnter);
3132
3147
  ref.addEventListener('mouseleave', onMouseLeave);
3133
3148
  return () => {
3149
+ var _elements$floating2;
3134
3150
  open && ref.removeEventListener('mouseleave', onScrollMouseLeave);
3135
- floating == null || floating.removeEventListener('mouseleave', onScrollMouseLeave);
3151
+ (_elements$floating2 = elements.floating) == null || _elements$floating2.removeEventListener('mouseleave', onScrollMouseLeave);
3136
3152
  move && ref.removeEventListener('mousemove', onMouseEnter);
3137
3153
  ref.removeEventListener('mouseenter', onMouseEnter);
3138
3154
  ref.removeEventListener('mouseleave', onMouseLeave);
3139
3155
  };
3140
3156
  }
3141
- }, [domReference, floating, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, tree, delayRef, handleCloseRef, dataRef]);
3157
+ }, [elements, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef]);
3142
3158
  index(() => {
3143
3159
  var _handleCloseRef$curre;
3144
- if (!enabled) {
3145
- return;
3146
- }
3160
+ if (!enabled) return;
3147
3161
  if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {
3148
- const body = getDocument(floating).body;
3162
+ const body = getDocument(elements.floating).body;
3149
3163
  body.setAttribute(safePolygonIdentifier, '');
3150
3164
  body.style.pointerEvents = 'none';
3151
3165
  performedPointerEventsMutationRef.current = true;
3152
- if (isElement(domReference) && floating) {
3166
+ const floatingEl = elements.floating;
3167
+ if (isElement(elements.domReference) && floatingEl) {
3153
3168
  var _tree$nodesRef$curren;
3154
- const ref = domReference;
3169
+ const ref = elements.domReference;
3155
3170
  const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;
3156
3171
  if (parentFloating) {
3157
3172
  parentFloating.style.pointerEvents = '';
3158
3173
  }
3159
3174
  ref.style.pointerEvents = 'auto';
3160
- floating.style.pointerEvents = 'auto';
3175
+ floatingEl.style.pointerEvents = 'auto';
3161
3176
  return () => {
3162
3177
  ref.style.pointerEvents = '';
3163
- floating.style.pointerEvents = '';
3178
+ floatingEl.style.pointerEvents = '';
3164
3179
  };
3165
3180
  }
3166
3181
  }
3167
- }, [enabled, open, parentId, floating, domReference, tree, handleCloseRef, isHoverOpen]);
3182
+ }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);
3168
3183
  index(() => {
3169
3184
  if (!open) {
3170
3185
  pointerTypeRef.current = undefined;
@@ -3179,51 +3194,50 @@ function useHover(context, props) {
3179
3194
  clearTimeout(restTimeoutRef.current);
3180
3195
  clearPointerEvents();
3181
3196
  };
3182
- }, [enabled, domReference, cleanupMouseMoveHandler, clearPointerEvents]);
3183
- return React.useMemo(() => {
3184
- if (!enabled) {
3185
- return {};
3186
- }
3197
+ }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);
3198
+ const reference = React.useMemo(() => {
3187
3199
  function setPointerRef(event) {
3188
3200
  pointerTypeRef.current = event.pointerType;
3189
3201
  }
3190
3202
  return {
3191
- reference: {
3192
- onPointerDown: setPointerRef,
3193
- onPointerEnter: setPointerRef,
3194
- onMouseMove(event) {
3195
- const {
3196
- nativeEvent
3197
- } = event;
3198
- function handleMouseMove() {
3199
- if (!blockMouseMoveRef.current) {
3200
- onOpenChange(true, nativeEvent, 'hover');
3201
- }
3202
- }
3203
- if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
3204
- return;
3205
- }
3206
- if (open || restMs === 0) {
3207
- return;
3208
- }
3209
- clearTimeout(restTimeoutRef.current);
3210
- if (pointerTypeRef.current === 'touch') {
3211
- handleMouseMove();
3212
- } else {
3213
- restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);
3203
+ onPointerDown: setPointerRef,
3204
+ onPointerEnter: setPointerRef,
3205
+ onMouseMove(event) {
3206
+ const {
3207
+ nativeEvent
3208
+ } = event;
3209
+ function handleMouseMove() {
3210
+ if (!blockMouseMoveRef.current && !openRef.current) {
3211
+ onOpenChange(true, nativeEvent, 'hover');
3214
3212
  }
3215
3213
  }
3216
- },
3217
- floating: {
3218
- onMouseEnter() {
3219
- clearTimeout(timeoutRef.current);
3220
- },
3221
- onMouseLeave(event) {
3222
- closeWithDelay(event.nativeEvent, false);
3214
+ if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
3215
+ return;
3216
+ }
3217
+ if (open || restMs === 0) {
3218
+ return;
3219
+ }
3220
+ clearTimeout(restTimeoutRef.current);
3221
+ if (pointerTypeRef.current === 'touch') {
3222
+ handleMouseMove();
3223
+ } else {
3224
+ restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);
3223
3225
  }
3224
3226
  }
3225
3227
  };
3226
- }, [enabled, mouseOnly, open, restMs, onOpenChange, closeWithDelay]);
3228
+ }, [mouseOnly, onOpenChange, open, openRef, restMs]);
3229
+ const floating = React.useMemo(() => ({
3230
+ onMouseEnter() {
3231
+ clearTimeout(timeoutRef.current);
3232
+ },
3233
+ onMouseLeave(event) {
3234
+ closeWithDelay(event.nativeEvent, false);
3235
+ }
3236
+ }), [closeWithDelay]);
3237
+ return React.useMemo(() => enabled ? {
3238
+ reference,
3239
+ floating
3240
+ } : {}, [enabled, reference, floating]);
3227
3241
  }
3228
3242
  const NOOP = () => {};
3229
3243
  React.createContext({
@@ -3318,8 +3332,8 @@ React.forwardRef(function FloatingOverlay(props, ref) {
3318
3332
  const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;
3319
3333
  const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';
3320
3334
  const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
3321
- const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.pageXOffset;
3322
- const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.pageYOffset;
3335
+ const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;
3336
+ const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;
3323
3337
  bodyStyle.overflow = 'hidden';
3324
3338
  if (scrollbarWidth) {
3325
3339
  bodyStyle[paddingProp] = scrollbarWidth + "px";
@@ -3392,11 +3406,7 @@ function useDismiss(context, props) {
3392
3406
  const {
3393
3407
  open,
3394
3408
  onOpenChange,
3395
- elements: {
3396
- reference,
3397
- domReference,
3398
- floating
3399
- },
3409
+ elements,
3400
3410
  dataRef
3401
3411
  } = context;
3402
3412
  const {
@@ -3474,7 +3484,7 @@ function useDismiss(context, props) {
3474
3484
  }
3475
3485
  const target = getTarget(event);
3476
3486
  const inertSelector = "[" + createAttribute('inert') + "]";
3477
- const markers = getDocument(floating).querySelectorAll(inertSelector);
3487
+ const markers = getDocument(elements.floating).querySelectorAll(inertSelector);
3478
3488
  let targetRootAncestor = isElement(target) ? target : null;
3479
3489
  while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
3480
3490
  const nextParent = getParentNode(targetRootAncestor);
@@ -3484,7 +3494,7 @@ function useDismiss(context, props) {
3484
3494
  targetRootAncestor = nextParent;
3485
3495
  }
3486
3496
  if (markers.length && isElement(target) && !isRootElement(target) &&
3487
- !contains(target, floating) &&
3497
+ !contains(target, elements.floating) &&
3488
3498
  Array.from(markers).every(marker => !contains(targetRootAncestor, marker))) {
3489
3499
  return;
3490
3500
  }
@@ -3507,7 +3517,7 @@ function useDismiss(context, props) {
3507
3517
  var _node$context;
3508
3518
  return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);
3509
3519
  });
3510
- if (isEventTargetWithin(event, floating) || isEventTargetWithin(event, domReference) || targetIsInsideChildren) {
3520
+ if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {
3511
3521
  return;
3512
3522
  }
3513
3523
  const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];
@@ -3544,19 +3554,19 @@ function useDismiss(context, props) {
3544
3554
  function onScroll(event) {
3545
3555
  onOpenChange(false, event, 'ancestor-scroll');
3546
3556
  }
3547
- const doc = getDocument(floating);
3557
+ const doc = getDocument(elements.floating);
3548
3558
  escapeKey && doc.addEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);
3549
3559
  outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);
3550
3560
  let ancestors = [];
3551
3561
  if (ancestorScroll) {
3552
- if (isElement(domReference)) {
3553
- ancestors = getOverflowAncestors(domReference);
3562
+ if (isElement(elements.domReference)) {
3563
+ ancestors = getOverflowAncestors(elements.domReference);
3554
3564
  }
3555
- if (isElement(floating)) {
3556
- ancestors = ancestors.concat(getOverflowAncestors(floating));
3565
+ if (isElement(elements.floating)) {
3566
+ ancestors = ancestors.concat(getOverflowAncestors(elements.floating));
3557
3567
  }
3558
- if (!isElement(reference) && reference && reference.contextElement) {
3559
- ancestors = ancestors.concat(getOverflowAncestors(reference.contextElement));
3568
+ if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {
3569
+ ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));
3560
3570
  }
3561
3571
  }
3562
3572
  ancestors = ancestors.filter(ancestor => {
@@ -3575,37 +3585,34 @@ function useDismiss(context, props) {
3575
3585
  ancestor.removeEventListener('scroll', onScroll);
3576
3586
  });
3577
3587
  };
3578
- }, [dataRef, floating, domReference, reference, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
3588
+ }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);
3579
3589
  React.useEffect(() => {
3580
3590
  insideReactTreeRef.current = false;
3581
3591
  }, [outsidePress, outsidePressEvent]);
3582
- return React.useMemo(() => {
3583
- if (!enabled) {
3584
- return {};
3585
- }
3586
- return {
3587
- reference: {
3588
- onKeyDown: closeOnEscapeKeyDown,
3589
- [bubbleHandlerKeys[referencePressEvent]]: event => {
3590
- if (referencePress) {
3591
- onOpenChange(false, event.nativeEvent, 'reference-press');
3592
- }
3593
- }
3594
- },
3595
- floating: {
3596
- onKeyDown: closeOnEscapeKeyDown,
3597
- onMouseDown() {
3598
- endedOrStartedInsideRef.current = true;
3599
- },
3600
- onMouseUp() {
3601
- endedOrStartedInsideRef.current = true;
3602
- },
3603
- [captureHandlerKeys[outsidePressEvent]]: () => {
3604
- insideReactTreeRef.current = true;
3605
- }
3592
+ const reference = React.useMemo(() => ({
3593
+ onKeyDown: closeOnEscapeKeyDown,
3594
+ [bubbleHandlerKeys[referencePressEvent]]: event => {
3595
+ if (referencePress) {
3596
+ onOpenChange(false, event.nativeEvent, 'reference-press');
3606
3597
  }
3607
- };
3608
- }, [enabled, referencePress, outsidePressEvent, referencePressEvent, onOpenChange, closeOnEscapeKeyDown]);
3598
+ }
3599
+ }), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);
3600
+ const floating = React.useMemo(() => ({
3601
+ onKeyDown: closeOnEscapeKeyDown,
3602
+ onMouseDown() {
3603
+ endedOrStartedInsideRef.current = true;
3604
+ },
3605
+ onMouseUp() {
3606
+ endedOrStartedInsideRef.current = true;
3607
+ },
3608
+ [captureHandlerKeys[outsidePressEvent]]: () => {
3609
+ insideReactTreeRef.current = true;
3610
+ }
3611
+ }), [closeOnEscapeKeyDown, outsidePressEvent]);
3612
+ return React.useMemo(() => enabled ? {
3613
+ reference,
3614
+ floating
3615
+ } : {}, [enabled, reference, floating]);
3609
3616
  }
3610
3617
  function useFloatingRootContext(options) {
3611
3618
  const {
@@ -3747,9 +3754,7 @@ function useFocus(context, props) {
3747
3754
  onOpenChange,
3748
3755
  events,
3749
3756
  dataRef,
3750
- elements: {
3751
- domReference
3752
- }
3757
+ elements
3753
3758
  } = context;
3754
3759
  const {
3755
3760
  enabled = true,
@@ -3759,12 +3764,10 @@ function useFocus(context, props) {
3759
3764
  const timeoutRef = React.useRef();
3760
3765
  const keyboardModalityRef = React.useRef(true);
3761
3766
  React.useEffect(() => {
3762
- if (!enabled) {
3763
- return;
3764
- }
3765
- const win = getWindow(domReference);
3767
+ if (!enabled) return;
3768
+ const win = getWindow(elements.domReference);
3766
3769
  function onBlur() {
3767
- if (!open && isHTMLElement(domReference) && domReference === activeElement(getDocument(domReference))) {
3770
+ if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference))) {
3768
3771
  blockFocusRef.current = true;
3769
3772
  }
3770
3773
  }
@@ -3777,11 +3780,9 @@ function useFocus(context, props) {
3777
3780
  win.removeEventListener('blur', onBlur);
3778
3781
  win.removeEventListener('keydown', onKeyDown, true);
3779
3782
  };
3780
- }, [domReference, open, enabled]);
3783
+ }, [elements.domReference, open, enabled]);
3781
3784
  React.useEffect(() => {
3782
- if (!enabled) {
3783
- return;
3784
- }
3785
+ if (!enabled) return;
3785
3786
  function onOpenChange(_ref) {
3786
3787
  let {
3787
3788
  reason
@@ -3800,51 +3801,48 @@ function useFocus(context, props) {
3800
3801
  clearTimeout(timeoutRef.current);
3801
3802
  };
3802
3803
  }, []);
3803
- return React.useMemo(() => {
3804
- if (!enabled) {
3805
- return {};
3806
- }
3807
- return {
3808
- reference: {
3809
- onPointerDown(event) {
3810
- if (isVirtualPointerEvent(event.nativeEvent)) return;
3811
- keyboardModalityRef.current = false;
3812
- },
3813
- onMouseLeave() {
3814
- blockFocusRef.current = false;
3815
- },
3816
- onFocus(event) {
3817
- if (blockFocusRef.current) return;
3818
- const target = getTarget(event.nativeEvent);
3819
- if (visibleOnly && isElement(target)) {
3820
- try {
3821
- if (isSafari() && isMac()) throw Error();
3822
- if (!target.matches(':focus-visible')) return;
3823
- } catch (e) {
3824
- if (!keyboardModalityRef.current && !isTypeableElement(target)) {
3825
- return;
3826
- }
3827
- }
3804
+ const reference = React.useMemo(() => ({
3805
+ onPointerDown(event) {
3806
+ if (isVirtualPointerEvent(event.nativeEvent)) return;
3807
+ keyboardModalityRef.current = false;
3808
+ },
3809
+ onMouseLeave() {
3810
+ blockFocusRef.current = false;
3811
+ },
3812
+ onFocus(event) {
3813
+ if (blockFocusRef.current) return;
3814
+ const target = getTarget(event.nativeEvent);
3815
+ if (visibleOnly && isElement(target)) {
3816
+ try {
3817
+ if (isSafari() && isMac()) throw Error();
3818
+ if (!target.matches(':focus-visible')) return;
3819
+ } catch (e) {
3820
+ if (!keyboardModalityRef.current && !isTypeableElement(target)) {
3821
+ return;
3828
3822
  }
3829
- onOpenChange(true, event.nativeEvent, 'focus');
3830
- },
3831
- onBlur(event) {
3832
- blockFocusRef.current = false;
3833
- const relatedTarget = event.relatedTarget;
3834
- const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';
3835
- timeoutRef.current = window.setTimeout(() => {
3836
- var _dataRef$current$floa;
3837
- const activeEl = activeElement(domReference ? domReference.ownerDocument : document);
3838
- if (!relatedTarget && activeEl === domReference) return;
3839
- if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
3840
- return;
3841
- }
3842
- onOpenChange(false, event.nativeEvent, 'focus');
3843
- });
3844
3823
  }
3845
3824
  }
3846
- };
3847
- }, [enabled, visibleOnly, dataRef, domReference, onOpenChange]);
3825
+ onOpenChange(true, event.nativeEvent, 'focus');
3826
+ },
3827
+ onBlur(event) {
3828
+ blockFocusRef.current = false;
3829
+ const relatedTarget = event.relatedTarget;
3830
+ const nativeEvent = event.nativeEvent;
3831
+ const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';
3832
+ timeoutRef.current = window.setTimeout(() => {
3833
+ var _dataRef$current$floa;
3834
+ const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);
3835
+ if (!relatedTarget && activeEl === elements.domReference) return;
3836
+ if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {
3837
+ return;
3838
+ }
3839
+ onOpenChange(false, nativeEvent, 'focus');
3840
+ });
3841
+ }
3842
+ }), [dataRef, elements.domReference, onOpenChange, visibleOnly]);
3843
+ return React.useMemo(() => enabled ? {
3844
+ reference
3845
+ } : {}, [enabled, reference]);
3848
3846
  }
3849
3847
  const ACTIVE_KEY = 'active';
3850
3848
  const SELECTED_KEY = 'selected';
@@ -3907,13 +3905,15 @@ function useInteractions(propsList) {
3907
3905
  if (propsList === void 0) {
3908
3906
  propsList = [];
3909
3907
  }
3910
- const deps = propsList;
3908
+ const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);
3909
+ const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);
3910
+ const itemDeps = propsList.map(key => key == null ? void 0 : key.item);
3911
3911
  const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),
3912
- deps);
3912
+ referenceDeps);
3913
3913
  const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),
3914
- deps);
3914
+ floatingDeps);
3915
3915
  const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),
3916
- propsList.map(key => key == null ? void 0 : key.item));
3916
+ itemDeps);
3917
3917
  return React.useMemo(() => ({
3918
3918
  getReferenceProps,
3919
3919
  getFloatingProps,
@@ -3938,8 +3938,34 @@ function useRole(context, props) {
3938
3938
  const referenceId = useId();
3939
3939
  const parentId = useFloatingParentNodeId();
3940
3940
  const isNested = parentId != null;
3941
- return React.useMemo(() => {
3942
- if (!enabled) return {};
3941
+ const reference = React.useMemo(() => {
3942
+ if (ariaRole === 'tooltip' || role === 'label') {
3943
+ return {
3944
+ ["aria-" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined
3945
+ };
3946
+ }
3947
+ return {
3948
+ 'aria-expanded': open ? 'true' : 'false',
3949
+ 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,
3950
+ 'aria-controls': open ? floatingId : undefined,
3951
+ ...(ariaRole === 'listbox' && {
3952
+ role: 'combobox'
3953
+ }),
3954
+ ...(ariaRole === 'menu' && {
3955
+ id: referenceId
3956
+ }),
3957
+ ...(ariaRole === 'menu' && isNested && {
3958
+ role: 'menuitem'
3959
+ }),
3960
+ ...(role === 'select' && {
3961
+ 'aria-autocomplete': 'none'
3962
+ }),
3963
+ ...(role === 'combobox' && {
3964
+ 'aria-autocomplete': 'list'
3965
+ })
3966
+ };
3967
+ }, [ariaRole, floatingId, isNested, open, referenceId, role]);
3968
+ const floating = React.useMemo(() => {
3943
3969
  const floatingProps = {
3944
3970
  id: floatingId,
3945
3971
  ...(ariaRole && {
@@ -3947,71 +3973,49 @@ function useRole(context, props) {
3947
3973
  })
3948
3974
  };
3949
3975
  if (ariaRole === 'tooltip' || role === 'label') {
3950
- return {
3951
- reference: {
3952
- ["aria-" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined
3953
- },
3954
- floating: floatingProps
3955
- };
3976
+ return floatingProps;
3956
3977
  }
3957
3978
  return {
3958
- reference: {
3959
- 'aria-expanded': open ? 'true' : 'false',
3960
- 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,
3961
- 'aria-controls': open ? floatingId : undefined,
3962
- ...(ariaRole === 'listbox' && {
3963
- role: 'combobox'
3964
- }),
3965
- ...(ariaRole === 'menu' && {
3966
- id: referenceId
3967
- }),
3968
- ...(ariaRole === 'menu' && isNested && {
3969
- role: 'menuitem'
3970
- }),
3971
- ...(role === 'select' && {
3972
- 'aria-autocomplete': 'none'
3973
- }),
3974
- ...(role === 'combobox' && {
3975
- 'aria-autocomplete': 'list'
3976
- })
3977
- },
3978
- floating: {
3979
- ...floatingProps,
3980
- ...(ariaRole === 'menu' && {
3981
- 'aria-labelledby': referenceId
3982
- })
3983
- },
3984
- item(_ref) {
3985
- let {
3986
- active,
3987
- selected
3988
- } = _ref;
3989
- const commonProps = {
3990
- role: 'option',
3991
- ...(active && {
3992
- id: floatingId + "-option"
3993
- })
3979
+ ...floatingProps,
3980
+ ...(ariaRole === 'menu' && {
3981
+ 'aria-labelledby': referenceId
3982
+ })
3983
+ };
3984
+ }, [ariaRole, floatingId, referenceId, role]);
3985
+ const item = React.useCallback(_ref => {
3986
+ let {
3987
+ active,
3988
+ selected
3989
+ } = _ref;
3990
+ const commonProps = {
3991
+ role: 'option',
3992
+ ...(active && {
3993
+ id: floatingId + "-option"
3994
+ })
3995
+ };
3996
+ switch (role) {
3997
+ case 'select':
3998
+ return {
3999
+ ...commonProps,
4000
+ 'aria-selected': active && selected
3994
4001
  };
3995
- switch (role) {
3996
- case 'select':
3997
- return {
3998
- ...commonProps,
3999
- 'aria-selected': active && selected
4000
- };
4001
- case 'combobox':
4002
- {
4003
- return {
4004
- ...commonProps,
4005
- ...(active && {
4006
- 'aria-selected': true
4007
- })
4008
- };
4009
- }
4002
+ case 'combobox':
4003
+ {
4004
+ return {
4005
+ ...commonProps,
4006
+ ...(active && {
4007
+ 'aria-selected': true
4008
+ })
4009
+ };
4010
4010
  }
4011
- return {};
4012
- }
4013
- };
4014
- }, [enabled, role, ariaRole, open, floatingId, referenceId, isNested]);
4011
+ }
4012
+ return {};
4013
+ }, [floatingId, role]);
4014
+ return React.useMemo(() => enabled ? {
4015
+ reference,
4016
+ floating,
4017
+ item
4018
+ } : {}, [enabled, reference, floating, item]);
4015
4019
  }
4016
4020
 
4017
4021
  var TooltipElement = function (props) {
@@ -8707,23 +8711,25 @@ var moment$1 = {exports: {}};
8707
8711
  };
8708
8712
  }
8709
8713
  function isValid(m) {
8710
- if (m._isValid == null) {
8711
- var flags = getParsingFlags(m),
8712
- parsedParts = some.call(flags.parsedDateParts, function (i) {
8713
- return i != null;
8714
- }),
8715
- isNowValid =
8716
- !isNaN(m._d.getTime()) &&
8717
- flags.overflow < 0 &&
8718
- !flags.empty &&
8719
- !flags.invalidEra &&
8720
- !flags.invalidMonth &&
8721
- !flags.invalidWeekday &&
8722
- !flags.weekdayMismatch &&
8723
- !flags.nullInput &&
8724
- !flags.invalidFormat &&
8725
- !flags.userInvalidated &&
8726
- (!flags.meridiem || (flags.meridiem && parsedParts));
8714
+ var flags = null,
8715
+ parsedParts = false,
8716
+ isNowValid = m._d && !isNaN(m._d.getTime());
8717
+ if (isNowValid) {
8718
+ flags = getParsingFlags(m);
8719
+ parsedParts = some.call(flags.parsedDateParts, function (i) {
8720
+ return i != null;
8721
+ });
8722
+ isNowValid =
8723
+ flags.overflow < 0 &&
8724
+ !flags.empty &&
8725
+ !flags.invalidEra &&
8726
+ !flags.invalidMonth &&
8727
+ !flags.invalidWeekday &&
8728
+ !flags.weekdayMismatch &&
8729
+ !flags.nullInput &&
8730
+ !flags.invalidFormat &&
8731
+ !flags.userInvalidated &&
8732
+ (!flags.meridiem || (flags.meridiem && parsedParts));
8727
8733
  if (m._strict) {
8728
8734
  isNowValid =
8729
8735
  isNowValid &&
@@ -8731,11 +8737,11 @@ var moment$1 = {exports: {}};
8731
8737
  flags.unusedTokens.length === 0 &&
8732
8738
  flags.bigHour === undefined;
8733
8739
  }
8734
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
8735
- m._isValid = isNowValid;
8736
- } else {
8737
- return isNowValid;
8738
- }
8740
+ }
8741
+ if (Object.isFrozen == null || !Object.isFrozen(m)) {
8742
+ m._isValid = isNowValid;
8743
+ } else {
8744
+ return isNowValid;
8739
8745
  }
8740
8746
  return m._isValid;
8741
8747
  }
@@ -9116,11 +9122,56 @@ var moment$1 = {exports: {}};
9116
9122
  var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
9117
9123
  return isFunction(format) ? format(output) : format.replace(/%s/i, output);
9118
9124
  }
9119
- var aliases = {};
9120
- function addUnitAlias(unit, shorthand) {
9121
- var lowerCase = unit.toLowerCase();
9122
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
9123
- }
9125
+ var aliases = {
9126
+ D: 'date',
9127
+ dates: 'date',
9128
+ date: 'date',
9129
+ d: 'day',
9130
+ days: 'day',
9131
+ day: 'day',
9132
+ e: 'weekday',
9133
+ weekdays: 'weekday',
9134
+ weekday: 'weekday',
9135
+ E: 'isoWeekday',
9136
+ isoweekdays: 'isoWeekday',
9137
+ isoweekday: 'isoWeekday',
9138
+ DDD: 'dayOfYear',
9139
+ dayofyears: 'dayOfYear',
9140
+ dayofyear: 'dayOfYear',
9141
+ h: 'hour',
9142
+ hours: 'hour',
9143
+ hour: 'hour',
9144
+ ms: 'millisecond',
9145
+ milliseconds: 'millisecond',
9146
+ millisecond: 'millisecond',
9147
+ m: 'minute',
9148
+ minutes: 'minute',
9149
+ minute: 'minute',
9150
+ M: 'month',
9151
+ months: 'month',
9152
+ month: 'month',
9153
+ Q: 'quarter',
9154
+ quarters: 'quarter',
9155
+ quarter: 'quarter',
9156
+ s: 'second',
9157
+ seconds: 'second',
9158
+ second: 'second',
9159
+ gg: 'weekYear',
9160
+ weekyears: 'weekYear',
9161
+ weekyear: 'weekYear',
9162
+ GG: 'isoWeekYear',
9163
+ isoweekyears: 'isoWeekYear',
9164
+ isoweekyear: 'isoWeekYear',
9165
+ w: 'week',
9166
+ weeks: 'week',
9167
+ week: 'week',
9168
+ W: 'isoWeek',
9169
+ isoweeks: 'isoWeek',
9170
+ isoweek: 'isoWeek',
9171
+ y: 'year',
9172
+ years: 'year',
9173
+ year: 'year',
9174
+ };
9124
9175
  function normalizeUnits(units) {
9125
9176
  return typeof units === 'string'
9126
9177
  ? aliases[units] || aliases[units.toLowerCase()]
@@ -9140,10 +9191,24 @@ var moment$1 = {exports: {}};
9140
9191
  }
9141
9192
  return normalizedInput;
9142
9193
  }
9143
- var priorities = {};
9144
- function addUnitPriority(unit, priority) {
9145
- priorities[unit] = priority;
9146
- }
9194
+ var priorities = {
9195
+ date: 9,
9196
+ day: 11,
9197
+ weekday: 11,
9198
+ isoWeekday: 11,
9199
+ dayOfYear: 4,
9200
+ hour: 13,
9201
+ millisecond: 16,
9202
+ minute: 14,
9203
+ month: 8,
9204
+ quarter: 7,
9205
+ second: 15,
9206
+ weekYear: 1,
9207
+ isoWeekYear: 1,
9208
+ week: 5,
9209
+ isoWeek: 5,
9210
+ year: 1,
9211
+ };
9147
9212
  function getPrioritizedUnits(unitsObj) {
9148
9213
  var units = [],
9149
9214
  u;
@@ -9157,83 +9222,6 @@ var moment$1 = {exports: {}};
9157
9222
  });
9158
9223
  return units;
9159
9224
  }
9160
- function isLeapYear(year) {
9161
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
9162
- }
9163
- function absFloor(number) {
9164
- if (number < 0) {
9165
- return Math.ceil(number) || 0;
9166
- } else {
9167
- return Math.floor(number);
9168
- }
9169
- }
9170
- function toInt(argumentForCoercion) {
9171
- var coercedNumber = +argumentForCoercion,
9172
- value = 0;
9173
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
9174
- value = absFloor(coercedNumber);
9175
- }
9176
- return value;
9177
- }
9178
- function makeGetSet(unit, keepTime) {
9179
- return function (value) {
9180
- if (value != null) {
9181
- set$1(this, unit, value);
9182
- hooks.updateOffset(this, keepTime);
9183
- return this;
9184
- } else {
9185
- return get(this, unit);
9186
- }
9187
- };
9188
- }
9189
- function get(mom, unit) {
9190
- return mom.isValid()
9191
- ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
9192
- : NaN;
9193
- }
9194
- function set$1(mom, unit, value) {
9195
- if (mom.isValid() && !isNaN(value)) {
9196
- if (
9197
- unit === 'FullYear' &&
9198
- isLeapYear(mom.year()) &&
9199
- mom.month() === 1 &&
9200
- mom.date() === 29
9201
- ) {
9202
- value = toInt(value);
9203
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
9204
- value,
9205
- mom.month(),
9206
- daysInMonth(value, mom.month())
9207
- );
9208
- } else {
9209
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
9210
- }
9211
- }
9212
- }
9213
- function stringGet(units) {
9214
- units = normalizeUnits(units);
9215
- if (isFunction(this[units])) {
9216
- return this[units]();
9217
- }
9218
- return this;
9219
- }
9220
- function stringSet(units, value) {
9221
- if (typeof units === 'object') {
9222
- units = normalizeObjectUnits(units);
9223
- var prioritized = getPrioritizedUnits(units),
9224
- i,
9225
- prioritizedLen = prioritized.length;
9226
- for (i = 0; i < prioritizedLen; i++) {
9227
- this[prioritized[i].unit](units[prioritized[i].unit]);
9228
- }
9229
- } else {
9230
- units = normalizeUnits(units);
9231
- if (isFunction(this[units])) {
9232
- return this[units](value);
9233
- }
9234
- }
9235
- return this;
9236
- }
9237
9225
  var match1 = /\d/,
9238
9226
  match2 = /\d\d/,
9239
9227
  match3 = /\d{3}/,
@@ -9252,6 +9240,8 @@ var moment$1 = {exports: {}};
9252
9240
  matchTimestamp = /[+-]?\d+(\.\d{1,3})?/,
9253
9241
  matchWord =
9254
9242
  /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
9243
+ match1to2NoLeadingZero = /^[1-9]\d?/,
9244
+ match1to2HasZero = /^([1-9]\d|\d)/,
9255
9245
  regexes;
9256
9246
  regexes = {};
9257
9247
  function addRegexToken(token, regex, strictRegex) {
@@ -9282,6 +9272,21 @@ var moment$1 = {exports: {}};
9282
9272
  function regexEscape(s) {
9283
9273
  return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
9284
9274
  }
9275
+ function absFloor(number) {
9276
+ if (number < 0) {
9277
+ return Math.ceil(number) || 0;
9278
+ } else {
9279
+ return Math.floor(number);
9280
+ }
9281
+ }
9282
+ function toInt(argumentForCoercion) {
9283
+ var coercedNumber = +argumentForCoercion,
9284
+ value = 0;
9285
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
9286
+ value = absFloor(coercedNumber);
9287
+ }
9288
+ return value;
9289
+ }
9285
9290
  var tokens = {};
9286
9291
  function addParseToken(token, callback) {
9287
9292
  var i,
@@ -9311,6 +9316,9 @@ var moment$1 = {exports: {}};
9311
9316
  tokens[token](input, config._a, config, token);
9312
9317
  }
9313
9318
  }
9319
+ function isLeapYear(year) {
9320
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
9321
+ }
9314
9322
  var YEAR = 0,
9315
9323
  MONTH = 1,
9316
9324
  DATE = 2,
@@ -9320,6 +9328,137 @@ var moment$1 = {exports: {}};
9320
9328
  MILLISECOND = 6,
9321
9329
  WEEK = 7,
9322
9330
  WEEKDAY = 8;
9331
+ addFormatToken('Y', 0, 0, function () {
9332
+ var y = this.year();
9333
+ return y <= 9999 ? zeroFill(y, 4) : '+' + y;
9334
+ });
9335
+ addFormatToken(0, ['YY', 2], 0, function () {
9336
+ return this.year() % 100;
9337
+ });
9338
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
9339
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
9340
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
9341
+ addRegexToken('Y', matchSigned);
9342
+ addRegexToken('YY', match1to2, match2);
9343
+ addRegexToken('YYYY', match1to4, match4);
9344
+ addRegexToken('YYYYY', match1to6, match6);
9345
+ addRegexToken('YYYYYY', match1to6, match6);
9346
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
9347
+ addParseToken('YYYY', function (input, array) {
9348
+ array[YEAR] =
9349
+ input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
9350
+ });
9351
+ addParseToken('YY', function (input, array) {
9352
+ array[YEAR] = hooks.parseTwoDigitYear(input);
9353
+ });
9354
+ addParseToken('Y', function (input, array) {
9355
+ array[YEAR] = parseInt(input, 10);
9356
+ });
9357
+ function daysInYear(year) {
9358
+ return isLeapYear(year) ? 366 : 365;
9359
+ }
9360
+ hooks.parseTwoDigitYear = function (input) {
9361
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
9362
+ };
9363
+ var getSetYear = makeGetSet('FullYear', true);
9364
+ function getIsLeapYear() {
9365
+ return isLeapYear(this.year());
9366
+ }
9367
+ function makeGetSet(unit, keepTime) {
9368
+ return function (value) {
9369
+ if (value != null) {
9370
+ set$1(this, unit, value);
9371
+ hooks.updateOffset(this, keepTime);
9372
+ return this;
9373
+ } else {
9374
+ return get(this, unit);
9375
+ }
9376
+ };
9377
+ }
9378
+ function get(mom, unit) {
9379
+ if (!mom.isValid()) {
9380
+ return NaN;
9381
+ }
9382
+ var d = mom._d,
9383
+ isUTC = mom._isUTC;
9384
+ switch (unit) {
9385
+ case 'Milliseconds':
9386
+ return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
9387
+ case 'Seconds':
9388
+ return isUTC ? d.getUTCSeconds() : d.getSeconds();
9389
+ case 'Minutes':
9390
+ return isUTC ? d.getUTCMinutes() : d.getMinutes();
9391
+ case 'Hours':
9392
+ return isUTC ? d.getUTCHours() : d.getHours();
9393
+ case 'Date':
9394
+ return isUTC ? d.getUTCDate() : d.getDate();
9395
+ case 'Day':
9396
+ return isUTC ? d.getUTCDay() : d.getDay();
9397
+ case 'Month':
9398
+ return isUTC ? d.getUTCMonth() : d.getMonth();
9399
+ case 'FullYear':
9400
+ return isUTC ? d.getUTCFullYear() : d.getFullYear();
9401
+ default:
9402
+ return NaN;
9403
+ }
9404
+ }
9405
+ function set$1(mom, unit, value) {
9406
+ var d, isUTC, year, month, date;
9407
+ if (!mom.isValid() || isNaN(value)) {
9408
+ return;
9409
+ }
9410
+ d = mom._d;
9411
+ isUTC = mom._isUTC;
9412
+ switch (unit) {
9413
+ case 'Milliseconds':
9414
+ return void (isUTC
9415
+ ? d.setUTCMilliseconds(value)
9416
+ : d.setMilliseconds(value));
9417
+ case 'Seconds':
9418
+ return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
9419
+ case 'Minutes':
9420
+ return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
9421
+ case 'Hours':
9422
+ return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
9423
+ case 'Date':
9424
+ return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
9425
+ case 'FullYear':
9426
+ break;
9427
+ default:
9428
+ return;
9429
+ }
9430
+ year = value;
9431
+ month = mom.month();
9432
+ date = mom.date();
9433
+ date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
9434
+ void (isUTC
9435
+ ? d.setUTCFullYear(year, month, date)
9436
+ : d.setFullYear(year, month, date));
9437
+ }
9438
+ function stringGet(units) {
9439
+ units = normalizeUnits(units);
9440
+ if (isFunction(this[units])) {
9441
+ return this[units]();
9442
+ }
9443
+ return this;
9444
+ }
9445
+ function stringSet(units, value) {
9446
+ if (typeof units === 'object') {
9447
+ units = normalizeObjectUnits(units);
9448
+ var prioritized = getPrioritizedUnits(units),
9449
+ i,
9450
+ prioritizedLen = prioritized.length;
9451
+ for (i = 0; i < prioritizedLen; i++) {
9452
+ this[prioritized[i].unit](units[prioritized[i].unit]);
9453
+ }
9454
+ } else {
9455
+ units = normalizeUnits(units);
9456
+ if (isFunction(this[units])) {
9457
+ return this[units](value);
9458
+ }
9459
+ }
9460
+ return this;
9461
+ }
9323
9462
  function mod(n, x) {
9324
9463
  return ((n % x) + x) % x;
9325
9464
  }
@@ -9358,9 +9497,7 @@ var moment$1 = {exports: {}};
9358
9497
  addFormatToken('MMMM', 0, 0, function (format) {
9359
9498
  return this.localeData().months(this, format);
9360
9499
  });
9361
- addUnitAlias('month', 'M');
9362
- addUnitPriority('month', 8);
9363
- addRegexToken('M', match1to2);
9500
+ addRegexToken('M', match1to2, match1to2NoLeadingZero);
9364
9501
  addRegexToken('MM', match1to2, match2);
9365
9502
  addRegexToken('MMM', function (isStrict, locale) {
9366
9503
  return locale.monthsShortRegex(isStrict);
@@ -9503,7 +9640,6 @@ var moment$1 = {exports: {}};
9503
9640
  }
9504
9641
  }
9505
9642
  function setMonth(mom, value) {
9506
- var dayOfMonth;
9507
9643
  if (!mom.isValid()) {
9508
9644
  return mom;
9509
9645
  }
@@ -9517,8 +9653,12 @@ var moment$1 = {exports: {}};
9517
9653
  }
9518
9654
  }
9519
9655
  }
9520
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
9521
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
9656
+ var month = value,
9657
+ date = mom.date();
9658
+ date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
9659
+ void (mom._isUTC
9660
+ ? mom._d.setUTCMonth(month, date)
9661
+ : mom._d.setMonth(month, date));
9522
9662
  return mom;
9523
9663
  }
9524
9664
  function getSetMonth(value) {
@@ -9579,24 +9719,21 @@ var moment$1 = {exports: {}};
9579
9719
  longPieces = [],
9580
9720
  mixedPieces = [],
9581
9721
  i,
9582
- mom;
9722
+ mom,
9723
+ shortP,
9724
+ longP;
9583
9725
  for (i = 0; i < 12; i++) {
9584
9726
  mom = createUTC([2000, i]);
9585
- shortPieces.push(this.monthsShort(mom, ''));
9586
- longPieces.push(this.months(mom, ''));
9587
- mixedPieces.push(this.months(mom, ''));
9588
- mixedPieces.push(this.monthsShort(mom, ''));
9727
+ shortP = regexEscape(this.monthsShort(mom, ''));
9728
+ longP = regexEscape(this.months(mom, ''));
9729
+ shortPieces.push(shortP);
9730
+ longPieces.push(longP);
9731
+ mixedPieces.push(longP);
9732
+ mixedPieces.push(shortP);
9589
9733
  }
9590
9734
  shortPieces.sort(cmpLenRev);
9591
9735
  longPieces.sort(cmpLenRev);
9592
9736
  mixedPieces.sort(cmpLenRev);
9593
- for (i = 0; i < 12; i++) {
9594
- shortPieces[i] = regexEscape(shortPieces[i]);
9595
- longPieces[i] = regexEscape(longPieces[i]);
9596
- }
9597
- for (i = 0; i < 24; i++) {
9598
- mixedPieces[i] = regexEscape(mixedPieces[i]);
9599
- }
9600
9737
  this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
9601
9738
  this._monthsShortRegex = this._monthsRegex;
9602
9739
  this._monthsStrictRegex = new RegExp(
@@ -9608,44 +9745,6 @@ var moment$1 = {exports: {}};
9608
9745
  'i'
9609
9746
  );
9610
9747
  }
9611
- addFormatToken('Y', 0, 0, function () {
9612
- var y = this.year();
9613
- return y <= 9999 ? zeroFill(y, 4) : '+' + y;
9614
- });
9615
- addFormatToken(0, ['YY', 2], 0, function () {
9616
- return this.year() % 100;
9617
- });
9618
- addFormatToken(0, ['YYYY', 4], 0, 'year');
9619
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
9620
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
9621
- addUnitAlias('year', 'y');
9622
- addUnitPriority('year', 1);
9623
- addRegexToken('Y', matchSigned);
9624
- addRegexToken('YY', match1to2, match2);
9625
- addRegexToken('YYYY', match1to4, match4);
9626
- addRegexToken('YYYYY', match1to6, match6);
9627
- addRegexToken('YYYYYY', match1to6, match6);
9628
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
9629
- addParseToken('YYYY', function (input, array) {
9630
- array[YEAR] =
9631
- input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
9632
- });
9633
- addParseToken('YY', function (input, array) {
9634
- array[YEAR] = hooks.parseTwoDigitYear(input);
9635
- });
9636
- addParseToken('Y', function (input, array) {
9637
- array[YEAR] = parseInt(input, 10);
9638
- });
9639
- function daysInYear(year) {
9640
- return isLeapYear(year) ? 366 : 365;
9641
- }
9642
- hooks.parseTwoDigitYear = function (input) {
9643
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
9644
- };
9645
- var getSetYear = makeGetSet('FullYear', true);
9646
- function getIsLeapYear() {
9647
- return isLeapYear(this.year());
9648
- }
9649
9748
  function createDate(y, m, d, h, M, s, ms) {
9650
9749
  var date;
9651
9750
  if (y < 100 && y >= 0) {
@@ -9726,13 +9825,9 @@ var moment$1 = {exports: {}};
9726
9825
  }
9727
9826
  addFormatToken('w', ['ww', 2], 'wo', 'week');
9728
9827
  addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
9729
- addUnitAlias('week', 'w');
9730
- addUnitAlias('isoWeek', 'W');
9731
- addUnitPriority('week', 5);
9732
- addUnitPriority('isoWeek', 5);
9733
- addRegexToken('w', match1to2);
9828
+ addRegexToken('w', match1to2, match1to2NoLeadingZero);
9734
9829
  addRegexToken('ww', match1to2, match2);
9735
- addRegexToken('W', match1to2);
9830
+ addRegexToken('W', match1to2, match1to2NoLeadingZero);
9736
9831
  addRegexToken('WW', match1to2, match2);
9737
9832
  addWeekParseToken(
9738
9833
  ['w', 'ww', 'W', 'WW'],
@@ -9773,12 +9868,6 @@ var moment$1 = {exports: {}};
9773
9868
  });
9774
9869
  addFormatToken('e', 0, 0, 'weekday');
9775
9870
  addFormatToken('E', 0, 0, 'isoWeekday');
9776
- addUnitAlias('day', 'd');
9777
- addUnitAlias('weekday', 'e');
9778
- addUnitAlias('isoWeekday', 'E');
9779
- addUnitPriority('day', 11);
9780
- addUnitPriority('weekday', 11);
9781
- addUnitPriority('isoWeekday', 11);
9782
9871
  addRegexToken('d', match1to2);
9783
9872
  addRegexToken('e', match1to2);
9784
9873
  addRegexToken('E', match1to2);
@@ -9842,22 +9931,22 @@ var moment$1 = {exports: {}};
9842
9931
  return m === true
9843
9932
  ? shiftWeekdays(weekdays, this._week.dow)
9844
9933
  : m
9845
- ? weekdays[m.day()]
9846
- : weekdays;
9934
+ ? weekdays[m.day()]
9935
+ : weekdays;
9847
9936
  }
9848
9937
  function localeWeekdaysShort(m) {
9849
9938
  return m === true
9850
9939
  ? shiftWeekdays(this._weekdaysShort, this._week.dow)
9851
9940
  : m
9852
- ? this._weekdaysShort[m.day()]
9853
- : this._weekdaysShort;
9941
+ ? this._weekdaysShort[m.day()]
9942
+ : this._weekdaysShort;
9854
9943
  }
9855
9944
  function localeWeekdaysMin(m) {
9856
9945
  return m === true
9857
9946
  ? shiftWeekdays(this._weekdaysMin, this._week.dow)
9858
9947
  : m
9859
- ? this._weekdaysMin[m.day()]
9860
- : this._weekdaysMin;
9948
+ ? this._weekdaysMin[m.day()]
9949
+ : this._weekdaysMin;
9861
9950
  }
9862
9951
  function handleStrictParse$1(weekdayName, format, strict) {
9863
9952
  var i,
@@ -9993,7 +10082,7 @@ var moment$1 = {exports: {}};
9993
10082
  if (!this.isValid()) {
9994
10083
  return input != null ? this : NaN;
9995
10084
  }
9996
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
10085
+ var day = get(this, 'Day');
9997
10086
  if (input != null) {
9998
10087
  input = parseWeekday(input, this.localeData());
9999
10088
  return this.add(input - day, 'd');
@@ -10163,16 +10252,14 @@ var moment$1 = {exports: {}};
10163
10252
  }
10164
10253
  meridiem('a', true);
10165
10254
  meridiem('A', false);
10166
- addUnitAlias('hour', 'h');
10167
- addUnitPriority('hour', 13);
10168
10255
  function matchMeridiem(isStrict, locale) {
10169
10256
  return locale._meridiemParse;
10170
10257
  }
10171
10258
  addRegexToken('a', matchMeridiem);
10172
10259
  addRegexToken('A', matchMeridiem);
10173
- addRegexToken('H', match1to2);
10174
- addRegexToken('h', match1to2);
10175
- addRegexToken('k', match1to2);
10260
+ addRegexToken('H', match1to2, match1to2HasZero);
10261
+ addRegexToken('h', match1to2, match1to2NoLeadingZero);
10262
+ addRegexToken('k', match1to2, match1to2NoLeadingZero);
10176
10263
  addRegexToken('HH', match1to2, match2);
10177
10264
  addRegexToken('hh', match1to2, match2);
10178
10265
  addRegexToken('kk', match1to2, match2);
@@ -10292,7 +10379,7 @@ var moment$1 = {exports: {}};
10292
10379
  return globalLocale;
10293
10380
  }
10294
10381
  function isLocaleNameSane(name) {
10295
- return name.match('^[^/\\\\]*$') != null;
10382
+ return !!(name && name.match('^[^/\\\\]*$'));
10296
10383
  }
10297
10384
  function loadLocale(name) {
10298
10385
  var oldLocale = null,
@@ -10444,21 +10531,21 @@ var moment$1 = {exports: {}};
10444
10531
  a[MONTH] < 0 || a[MONTH] > 11
10445
10532
  ? MONTH
10446
10533
  : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
10447
- ? DATE
10448
- : a[HOUR] < 0 ||
10449
- a[HOUR] > 24 ||
10450
- (a[HOUR] === 24 &&
10451
- (a[MINUTE] !== 0 ||
10452
- a[SECOND] !== 0 ||
10453
- a[MILLISECOND] !== 0))
10454
- ? HOUR
10455
- : a[MINUTE] < 0 || a[MINUTE] > 59
10456
- ? MINUTE
10457
- : a[SECOND] < 0 || a[SECOND] > 59
10458
- ? SECOND
10459
- : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
10460
- ? MILLISECOND
10461
- : -1;
10534
+ ? DATE
10535
+ : a[HOUR] < 0 ||
10536
+ a[HOUR] > 24 ||
10537
+ (a[HOUR] === 24 &&
10538
+ (a[MINUTE] !== 0 ||
10539
+ a[SECOND] !== 0 ||
10540
+ a[MILLISECOND] !== 0))
10541
+ ? HOUR
10542
+ : a[MINUTE] < 0 || a[MINUTE] > 59
10543
+ ? MINUTE
10544
+ : a[SECOND] < 0 || a[SECOND] > 59
10545
+ ? SECOND
10546
+ : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
10547
+ ? MILLISECOND
10548
+ : -1;
10462
10549
  if (
10463
10550
  getParsingFlags(m)._overflowDayOfYear &&
10464
10551
  (overflow < YEAR || overflow > DATE)
@@ -11201,8 +11288,7 @@ var moment$1 = {exports: {}};
11201
11288
  i;
11202
11289
  for (i = 0; i < len; i++) {
11203
11290
  if (
11204
- (dontConvert && array1[i] !== array2[i]) ||
11205
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
11291
+ (toInt(array1[i]) !== toInt(array2[i]))
11206
11292
  ) {
11207
11293
  diffs++;
11208
11294
  }
@@ -11614,16 +11700,16 @@ var moment$1 = {exports: {}};
11614
11700
  return diff < -6
11615
11701
  ? 'sameElse'
11616
11702
  : diff < -1
11617
- ? 'lastWeek'
11618
- : diff < 0
11619
- ? 'lastDay'
11620
- : diff < 1
11621
- ? 'sameDay'
11622
- : diff < 2
11623
- ? 'nextDay'
11624
- : diff < 7
11625
- ? 'nextWeek'
11626
- : 'sameElse';
11703
+ ? 'lastWeek'
11704
+ : diff < 0
11705
+ ? 'lastDay'
11706
+ : diff < 1
11707
+ ? 'sameDay'
11708
+ : diff < 2
11709
+ ? 'nextDay'
11710
+ : diff < 7
11711
+ ? 'nextWeek'
11712
+ : 'sameElse';
11627
11713
  }
11628
11714
  function calendar$1(time, formats) {
11629
11715
  if (arguments.length === 1) {
@@ -12307,14 +12393,20 @@ var moment$1 = {exports: {}};
12307
12393
  mixedPieces = [],
12308
12394
  i,
12309
12395
  l,
12396
+ erasName,
12397
+ erasAbbr,
12398
+ erasNarrow,
12310
12399
  eras = this.eras();
12311
12400
  for (i = 0, l = eras.length; i < l; ++i) {
12312
- namePieces.push(regexEscape(eras[i].name));
12313
- abbrPieces.push(regexEscape(eras[i].abbr));
12314
- narrowPieces.push(regexEscape(eras[i].narrow));
12315
- mixedPieces.push(regexEscape(eras[i].name));
12316
- mixedPieces.push(regexEscape(eras[i].abbr));
12317
- mixedPieces.push(regexEscape(eras[i].narrow));
12401
+ erasName = regexEscape(eras[i].name);
12402
+ erasAbbr = regexEscape(eras[i].abbr);
12403
+ erasNarrow = regexEscape(eras[i].narrow);
12404
+ namePieces.push(erasName);
12405
+ abbrPieces.push(erasAbbr);
12406
+ narrowPieces.push(erasNarrow);
12407
+ mixedPieces.push(erasName);
12408
+ mixedPieces.push(erasAbbr);
12409
+ mixedPieces.push(erasNarrow);
12318
12410
  }
12319
12411
  this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
12320
12412
  this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
@@ -12337,10 +12429,6 @@ var moment$1 = {exports: {}};
12337
12429
  addWeekYearFormatToken('ggggg', 'weekYear');
12338
12430
  addWeekYearFormatToken('GGGG', 'isoWeekYear');
12339
12431
  addWeekYearFormatToken('GGGGG', 'isoWeekYear');
12340
- addUnitAlias('weekYear', 'gg');
12341
- addUnitAlias('isoWeekYear', 'GG');
12342
- addUnitPriority('weekYear', 1);
12343
- addUnitPriority('isoWeekYear', 1);
12344
12432
  addRegexToken('G', matchSigned);
12345
12433
  addRegexToken('g', matchSigned);
12346
12434
  addRegexToken('GG', match1to2, match2);
@@ -12363,7 +12451,7 @@ var moment$1 = {exports: {}};
12363
12451
  this,
12364
12452
  input,
12365
12453
  this.week(),
12366
- this.weekday(),
12454
+ this.weekday() + this.localeData()._week.dow,
12367
12455
  this.localeData()._week.dow,
12368
12456
  this.localeData()._week.doy
12369
12457
  );
@@ -12413,8 +12501,6 @@ var moment$1 = {exports: {}};
12413
12501
  return this;
12414
12502
  }
12415
12503
  addFormatToken('Q', 0, 'Qo', 'quarter');
12416
- addUnitAlias('quarter', 'Q');
12417
- addUnitPriority('quarter', 7);
12418
12504
  addRegexToken('Q', match1);
12419
12505
  addParseToken('Q', function (input, array) {
12420
12506
  array[MONTH] = (toInt(input) - 1) * 3;
@@ -12425,9 +12511,7 @@ var moment$1 = {exports: {}};
12425
12511
  : this.month((input - 1) * 3 + (this.month() % 3));
12426
12512
  }
12427
12513
  addFormatToken('D', ['DD', 2], 'Do', 'date');
12428
- addUnitAlias('date', 'D');
12429
- addUnitPriority('date', 9);
12430
- addRegexToken('D', match1to2);
12514
+ addRegexToken('D', match1to2, match1to2NoLeadingZero);
12431
12515
  addRegexToken('DD', match1to2, match2);
12432
12516
  addRegexToken('Do', function (isStrict, locale) {
12433
12517
  return isStrict
@@ -12440,8 +12524,6 @@ var moment$1 = {exports: {}};
12440
12524
  });
12441
12525
  var getSetDayOfMonth = makeGetSet('Date', true);
12442
12526
  addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
12443
- addUnitAlias('dayOfYear', 'DDD');
12444
- addUnitPriority('dayOfYear', 4);
12445
12527
  addRegexToken('DDD', match1to3);
12446
12528
  addRegexToken('DDDD', match3);
12447
12529
  addParseToken(['DDD', 'DDDD'], function (input, array, config) {
@@ -12455,16 +12537,12 @@ var moment$1 = {exports: {}};
12455
12537
  return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
12456
12538
  }
12457
12539
  addFormatToken('m', ['mm', 2], 0, 'minute');
12458
- addUnitAlias('minute', 'm');
12459
- addUnitPriority('minute', 14);
12460
- addRegexToken('m', match1to2);
12540
+ addRegexToken('m', match1to2, match1to2HasZero);
12461
12541
  addRegexToken('mm', match1to2, match2);
12462
12542
  addParseToken(['m', 'mm'], MINUTE);
12463
12543
  var getSetMinute = makeGetSet('Minutes', false);
12464
12544
  addFormatToken('s', ['ss', 2], 0, 'second');
12465
- addUnitAlias('second', 's');
12466
- addUnitPriority('second', 15);
12467
- addRegexToken('s', match1to2);
12545
+ addRegexToken('s', match1to2, match1to2HasZero);
12468
12546
  addRegexToken('ss', match1to2, match2);
12469
12547
  addParseToken(['s', 'ss'], SECOND);
12470
12548
  var getSetSecond = makeGetSet('Seconds', false);
@@ -12493,8 +12571,6 @@ var moment$1 = {exports: {}};
12493
12571
  addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
12494
12572
  return this.millisecond() * 1000000;
12495
12573
  });
12496
- addUnitAlias('millisecond', 'ms');
12497
- addUnitPriority('millisecond', 16);
12498
12574
  addRegexToken('S', match1to3, match1);
12499
12575
  addRegexToken('SS', match1to3, match2);
12500
12576
  addRegexToken('SSS', match1to3, match3);
@@ -12752,12 +12828,12 @@ var moment$1 = {exports: {}};
12752
12828
  toInt((number % 100) / 10) === 1
12753
12829
  ? 'th'
12754
12830
  : b === 1
12755
- ? 'st'
12756
- : b === 2
12757
- ? 'nd'
12758
- : b === 3
12759
- ? 'rd'
12760
- : 'th';
12831
+ ? 'st'
12832
+ : b === 2
12833
+ ? 'nd'
12834
+ : b === 3
12835
+ ? 'rd'
12836
+ : 'th';
12761
12837
  return number + output;
12762
12838
  },
12763
12839
  });
@@ -12886,17 +12962,6 @@ var moment$1 = {exports: {}};
12886
12962
  }
12887
12963
  }
12888
12964
  }
12889
- function valueOf$1() {
12890
- if (!this.isValid()) {
12891
- return NaN;
12892
- }
12893
- return (
12894
- this._milliseconds +
12895
- this._days * 864e5 +
12896
- (this._months % 12) * 2592e6 +
12897
- toInt(this._months / 12) * 31536e6
12898
- );
12899
- }
12900
12965
  function makeAs(alias) {
12901
12966
  return function () {
12902
12967
  return this.as(alias);
@@ -12910,7 +12975,8 @@ var moment$1 = {exports: {}};
12910
12975
  asWeeks = makeAs('w'),
12911
12976
  asMonths = makeAs('M'),
12912
12977
  asQuarters = makeAs('Q'),
12913
- asYears = makeAs('y');
12978
+ asYears = makeAs('y'),
12979
+ valueOf$1 = asMilliseconds;
12914
12980
  function clone$1() {
12915
12981
  return createDuration(this);
12916
12982
  }
@@ -13124,7 +13190,7 @@ var moment$1 = {exports: {}};
13124
13190
  addParseToken('x', function (input, array, config) {
13125
13191
  config._d = new Date(toInt(input));
13126
13192
  });
13127
- hooks.version = '2.29.4';
13193
+ hooks.version = '2.30.1';
13128
13194
  setHookCallback(createLocal);
13129
13195
  hooks.fn = proto;
13130
13196
  hooks.min = min;
@@ -13476,34 +13542,45 @@ var classnames$1 = {exports: {}};
13476
13542
  (function (module) {
13477
13543
  (function () {
13478
13544
  var hasOwn = {}.hasOwnProperty;
13479
- function classNames() {
13480
- var classes = [];
13545
+ function classNames () {
13546
+ var classes = '';
13481
13547
  for (var i = 0; i < arguments.length; i++) {
13482
13548
  var arg = arguments[i];
13483
- if (!arg) continue;
13484
- var argType = typeof arg;
13485
- if (argType === 'string' || argType === 'number') {
13486
- classes.push(arg);
13487
- } else if (Array.isArray(arg)) {
13488
- if (arg.length) {
13489
- var inner = classNames.apply(null, arg);
13490
- if (inner) {
13491
- classes.push(inner);
13492
- }
13493
- }
13494
- } else if (argType === 'object') {
13495
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
13496
- classes.push(arg.toString());
13497
- continue;
13498
- }
13499
- for (var key in arg) {
13500
- if (hasOwn.call(arg, key) && arg[key]) {
13501
- classes.push(key);
13502
- }
13503
- }
13549
+ if (arg) {
13550
+ classes = appendClass(classes, parseValue(arg));
13504
13551
  }
13505
13552
  }
13506
- return classes.join(' ');
13553
+ return classes;
13554
+ }
13555
+ function parseValue (arg) {
13556
+ if (typeof arg === 'string' || typeof arg === 'number') {
13557
+ return arg;
13558
+ }
13559
+ if (typeof arg !== 'object') {
13560
+ return '';
13561
+ }
13562
+ if (Array.isArray(arg)) {
13563
+ return classNames.apply(null, arg);
13564
+ }
13565
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
13566
+ return arg.toString();
13567
+ }
13568
+ var classes = '';
13569
+ for (var key in arg) {
13570
+ if (hasOwn.call(arg, key) && arg[key]) {
13571
+ classes = appendClass(classes, key);
13572
+ }
13573
+ }
13574
+ return classes;
13575
+ }
13576
+ function appendClass (value, newClass) {
13577
+ if (!newClass) {
13578
+ return value;
13579
+ }
13580
+ if (value) {
13581
+ return value + ' ' + newClass;
13582
+ }
13583
+ return value + newClass;
13507
13584
  }
13508
13585
  if (module.exports) {
13509
13586
  classNames.default = classNames;