@koide-labs/ui 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -3
- package/{src/-types.ts → dist/-types.d.ts} +1 -6
- package/dist/-types.js +1 -0
- package/dist/-utils.d.ts +19 -0
- package/dist/-utils.js +33 -0
- package/dist/Button-DrPFFzo7.js +31 -0
- package/dist/CompositeRoot-CVk5a-pR.js +233 -0
- package/dist/DirectionContext-C2o_MF_i.js +9 -0
- package/dist/FieldItemContext-DAvk99to.js +11 -0
- package/dist/FloatingPortal-tWyuKRSN.js +435 -0
- package/dist/FloatingPortalLite-DVyq6YhV.js +28 -0
- package/dist/InternalBackdrop-jYAiOJ8v.js +574 -0
- package/dist/LabelableContext-BMvjVwor.js +169 -0
- package/dist/ToolbarRootContext-CvvL0Tk1.js +9 -0
- package/dist/clamp-D0KDAQIz.js +6 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/accordion/index.d.ts +12 -0
- package/dist/components/accordion/index.js +699 -0
- package/dist/components/alert-dialog/index.d.ts +26 -0
- package/dist/components/alert-dialog/index.js +136 -0
- package/dist/components/anchor/index.d.ts +8 -0
- package/dist/components/anchor/index.js +38 -0
- package/dist/components/avatar/index.d.ts +21 -0
- package/dist/components/avatar/index.js +161 -0
- package/dist/components/badge/index.d.ts +16 -0
- package/dist/components/badge/index.js +40 -0
- package/dist/components/button/index.d.ts +24 -0
- package/dist/components/button/index.js +47 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +269 -0
- package/dist/components/code/index.d.ts +9 -0
- package/dist/components/code/index.js +10 -0
- package/dist/components/collapse/index.d.ts +11 -0
- package/dist/components/collapse/index.js +41 -0
- package/dist/components/command/index.d.ts +14 -0
- package/dist/components/command/index.js +1695 -0
- package/dist/components/context-menu/index.d.ts +42 -0
- package/dist/components/context-menu/index.js +1444 -0
- package/dist/components/dialog/index.d.ts +48 -0
- package/dist/components/dialog/index.js +138 -0
- package/dist/components/heading/index.d.ts +44 -0
- package/dist/components/heading/index.js +56 -0
- package/dist/components/icon/icon-names.d.ts +1 -0
- package/dist/components/icon/icon-names.js +1 -0
- package/dist/components/icon/index.d.ts +23 -0
- package/dist/components/icon/index.js +43 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/icon-button/index.js +45 -0
- package/dist/components/inline-code/index.d.ts +6 -0
- package/dist/components/inline-code/index.js +22 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +119 -0
- package/dist/components/meter/index.d.ts +18 -0
- package/dist/components/meter/index.js +165 -0
- package/dist/components/multiline-input/index.d.ts +6 -0
- package/dist/components/multiline-input/index.js +100 -0
- package/dist/components/number-input/index.d.ts +10 -0
- package/dist/components/number-input/index.js +1169 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +29 -0
- package/dist/components/pill/index.d.ts +13 -0
- package/dist/components/pill/index.js +38 -0
- package/dist/components/popover/index.d.ts +21 -0
- package/dist/components/popover/index.js +636 -0
- package/dist/components/preview-card/index.d.ts +17 -0
- package/dist/components/preview-card/index.js +402 -0
- package/dist/components/radio/index.d.ts +13 -0
- package/dist/components/radio/index.js +404 -0
- package/dist/components/search-bar/index.d.ts +12 -0
- package/dist/components/search-bar/index.js +48 -0
- package/dist/components/select/index.d.ts +16 -0
- package/dist/components/select/index.js +1263 -0
- package/dist/components/separator/index.d.ts +7 -0
- package/dist/components/separator/index.js +6 -0
- package/dist/components/slider/index.d.ts +5 -0
- package/dist/components/slider/index.js +902 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +14 -0
- package/dist/components/stacked-avatars/index.js +92 -0
- package/dist/components/status-banner/index.d.ts +17 -0
- package/dist/components/status-banner/index.js +69 -0
- package/dist/components/surface/index.d.ts +27 -0
- package/dist/components/surface/index.js +41 -0
- package/dist/components/switch/index.d.ts +5 -0
- package/dist/components/switch/index.js +196 -0
- package/dist/components/tabs/index.d.ts +18 -0
- package/dist/components/tabs/index.js +509 -0
- package/dist/components/text/index.d.ts +26 -0
- package/dist/components/text/index.js +51 -0
- package/dist/components/theme-provider/index.d.ts +2 -0
- package/dist/components/theme-provider/index.js +6 -0
- package/dist/components/theme-provider/theme-context.d.ts +9 -0
- package/dist/components/theme-provider/theme-context.js +13 -0
- package/dist/components/theme-provider/theme-provider.d.ts +17 -0
- package/dist/components/theme-provider/theme-provider.js +30 -0
- package/dist/components/timestamp/index.d.ts +23 -0
- package/dist/components/timestamp/index.js +1392 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +7 -0
- package/dist/components/toast/toast.d.ts +2 -0
- package/dist/components/toast/toast.js +878 -0
- package/dist/components/toast/use-toast-manager.d.ts +27 -0
- package/dist/components/toast/use-toast-manager.js +4 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +712 -0
- package/dist/components/tooltip/tooltip-arrow.d.ts +3 -0
- package/dist/components/tooltip/tooltip-arrow.js +6 -0
- package/dist/components/view/index.d.ts +30 -0
- package/dist/components/view/index.js +84 -0
- package/dist/components/visually-hidden/index.d.ts +1 -0
- package/dist/components/visually-hidden/index.js +4 -0
- package/dist/composite-Bx7Szd_T.js +208 -0
- package/dist/composite-C9L5QmZL.js +66 -0
- package/dist/createBaseUIEventDetails-D8M2Yl-a.js +59 -0
- package/dist/detectBrowser-I-s3yzIE.js +43 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.module-BeF-6XAo.js +415 -0
- package/dist/element-CZEOj04G.js +80 -0
- package/dist/event-CKoGyQEJ.js +30 -0
- package/dist/floating-ui.utils-C7pRWMZ_.js +128 -0
- package/dist/floating-ui.utils.dom-C7FS5id0.js +135 -0
- package/dist/formatErrorMessage-BqPuTBN-.js +7 -0
- package/dist/formatNumber-1UNwjeqf.js +25 -0
- package/dist/getDisabledMountTransitionStyles-YfHPge6T.js +1510 -0
- package/dist/index-BX1XbbRk.js +1206 -0
- package/dist/index-CeuccO-T.js +109 -0
- package/dist/index-DN9Bn1qm.js +29 -0
- package/dist/index-FMoPxlJ2.js +52 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +108 -0
- package/dist/index10.css +1 -0
- package/dist/index11.css +1 -0
- package/dist/index12.css +1 -0
- package/dist/index13.css +1 -0
- package/dist/index14.css +1 -0
- package/dist/index15.css +1 -0
- package/dist/index16.css +1 -0
- package/dist/index17.css +1 -0
- package/dist/index18.css +1 -0
- package/dist/index19.css +1 -0
- package/dist/index2.css +1 -0
- package/dist/index20.css +1 -0
- package/dist/index21.css +1 -0
- package/dist/index22.css +1 -0
- package/dist/index23.css +1 -0
- package/dist/index24.css +1 -0
- package/dist/index25.css +1 -0
- package/dist/index26.css +1 -0
- package/dist/index27.css +1 -0
- package/dist/index28.css +1 -0
- package/dist/index29.css +1 -0
- package/dist/index3.css +1 -0
- package/dist/index30.css +1 -0
- package/dist/index31.css +1 -0
- package/dist/index32.css +1 -0
- package/dist/index33.css +1 -0
- package/dist/index34.css +1 -0
- package/dist/index35.css +1 -0
- package/dist/index36.css +1 -0
- package/dist/index37.css +1 -0
- package/dist/index4.css +1 -0
- package/dist/index5.css +1 -0
- package/dist/index6.css +1 -0
- package/dist/index7.css +1 -0
- package/dist/index8.css +1 -0
- package/dist/index9.css +1 -0
- package/dist/inertValue-BCYGsdmf.js +7 -0
- package/dist/input.css +1 -0
- package/dist/input.module-DDQY_Ij6.js +7 -0
- package/dist/integrations/react-markdown/index.d.ts +5 -0
- package/dist/integrations/react-markdown/index.js +6895 -0
- package/dist/integrations/remix/index.d.ts +9 -0
- package/{src/integrations/remix.ts → dist/integrations/remix/index.js} +7 -4
- package/dist/integrations/tailwind.css +1 -0
- package/dist/integrations/twemoij/index.d.ts +3 -0
- package/dist/integrations/twemoij/index.js +18 -0
- package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
- package/dist/owner-rKN292Q9.js +6 -0
- package/dist/safePolygon-DWy1dGKJ.js +308 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/tokens.d.ts +400 -0
- package/{src/styles/tokens.ts → dist/styles/tokens.js} +54 -96
- package/dist/toast.css +1 -0
- package/dist/tooltip-arrow-C1qXdi5T.js +24 -0
- package/dist/tooltip-arrow.css +1 -0
- package/dist/transitions.css +1 -0
- package/dist/transitions.module-CWX8e5cx.js +1343 -0
- package/dist/use-toast-manager-Dq-44AuW.js +37 -0
- package/dist/useAnimationFrame-451ugS_6.js +68 -0
- package/dist/useBaseUiId-B7WyxtIE.js +7 -0
- package/dist/useButton-DfIwsdb8.js +127 -0
- package/dist/useCompositeListItem-OkcAim_1.js +148 -0
- package/dist/useControlled-Du4sJyMj.js +31 -0
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +264 -0
- package/dist/useId-C5kyn6tA.js +22 -0
- package/dist/useIsoLayoutEffect-CIDbvm3Q.js +6 -0
- package/dist/useLabelableId-Ci_jDvmv.js +29 -0
- package/dist/useOnMount-VRW6CK2u.js +8 -0
- package/dist/useOpenChangeComplete-Dse9kY9E.js +61 -0
- package/dist/usePopupAutoResize-CNR6Ekmx.js +85 -0
- package/dist/useRender-CLx7dR_1.js +7 -0
- package/dist/useRenderElement-DwToLA61.js +244 -0
- package/dist/useRole-oDBdbuwQ.js +77 -0
- package/dist/useStableCallback-CkTrVkNX.js +29 -0
- package/dist/useSyncedFloatingRootContext-Dorsv-jf.js +167 -0
- package/dist/useTimeout-CflX-kz3.js +32 -0
- package/dist/useTransitionStatus-CUfcuGAV.js +42 -0
- package/dist/useTypeahead-D85V2IUx.js +333 -0
- package/dist/useValueAsRef-HURLzret.js +19 -0
- package/dist/useValueChanged-DL757-yD.js +14 -0
- package/dist/valueToPercent-DaP9qN4u.js +6 -0
- package/dist/view.css +1 -0
- package/dist/view.module-DfDLgJE0.js +6 -0
- package/dist/visuallyHidden-CpJ-mhai.js +16 -0
- package/dist/warn-CKtX8MLJ.js +11 -0
- package/package.json +18 -2
- package/.husky/pre-commit +0 -1
- package/.storybook/main.ts +0 -25
- package/.storybook/preview-head.html +0 -6
- package/.storybook/preview.tsx +0 -48
- package/.storybook/vitest.setup.ts +0 -8
- package/eslint.config.mjs +0 -29
- package/lint-staged.config.js +0 -15
- package/pnpm-workspace.yaml +0 -2
- package/postcss.config.mjs +0 -7
- package/prettier.config.mjs +0 -24
- package/scripts/build-icon-types.ts +0 -38
- package/src/-utils.tsx +0 -64
- package/src/components/accordion/accordion.module.css +0 -44
- package/src/components/accordion/accordion.stories.tsx +0 -36
- package/src/components/accordion/index.tsx +0 -67
- package/src/components/alert-dialog/alert-dialog.module.css +0 -5
- package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -53
- package/src/components/alert-dialog/index.tsx +0 -138
- package/src/components/anchor/anchor.module.css +0 -18
- package/src/components/anchor/anchor.stories.tsx +0 -28
- package/src/components/anchor/index.tsx +0 -45
- package/src/components/avatar/avatar.module.css +0 -56
- package/src/components/avatar/avatar.stories.tsx +0 -61
- package/src/components/avatar/index.tsx +0 -82
- package/src/components/badge/badge.module.css +0 -35
- package/src/components/badge/badge.stories.tsx +0 -60
- package/src/components/badge/index.tsx +0 -71
- package/src/components/button/button.module.css +0 -42
- package/src/components/button/button.stories.tsx +0 -108
- package/src/components/button/index.tsx +0 -63
- package/src/components/checkbox/checkbox.module.css +0 -36
- package/src/components/checkbox/checkbox.stories.tsx +0 -21
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/code/code.module.css +0 -20
- package/src/components/code/code.stories.tsx +0 -42
- package/src/components/code/index.tsx +0 -73
- package/src/components/collapse/collapse.module.css +0 -27
- package/src/components/collapse/collapse.stories.tsx +0 -27
- package/src/components/collapse/index.tsx +0 -59
- package/src/components/command/command.module.css +0 -95
- package/src/components/command/command.stories.tsx +0 -38
- package/src/components/command/index.tsx +0 -108
- package/src/components/context-menu/context-menu.module.css +0 -36
- package/src/components/context-menu/context-menu.stories.tsx +0 -99
- package/src/components/context-menu/index.tsx +0 -242
- package/src/components/dialog/dialog.module.css +0 -71
- package/src/components/dialog/dialog.stories.tsx +0 -29
- package/src/components/dialog/index.tsx +0 -148
- package/src/components/heading/heading.module.css +0 -3
- package/src/components/heading/heading.stories.tsx +0 -52
- package/src/components/heading/index.tsx +0 -112
- package/src/components/icon/icon-names.ts +0 -3189
- package/src/components/icon/icon.module.css +0 -36
- package/src/components/icon/icon.stories.tsx +0 -40
- package/src/components/icon/index.tsx +0 -60
- package/src/components/icon-button/icon-button.module.css +0 -33
- package/src/components/icon-button/icon-button.stories.tsx +0 -59
- package/src/components/icon-button/index.tsx +0 -48
- package/src/components/inline-code/index.tsx +0 -29
- package/src/components/inline-code/inline-code.module.css +0 -13
- package/src/components/inline-code/inline-code.stories.tsx +0 -31
- package/src/components/input/index.tsx +0 -22
- package/src/components/input/input.module.css +0 -23
- package/src/components/input/input.stories.tsx +0 -52
- package/src/components/meter/index.tsx +0 -55
- package/src/components/meter/meter.module.css +0 -23
- package/src/components/meter/meter.stories.tsx +0 -31
- package/src/components/multiline-input/index.tsx +0 -58
- package/src/components/multiline-input/multiline-input.stories.tsx +0 -26
- package/src/components/number-input/index.tsx +0 -74
- package/src/components/number-input/number-input.module.css +0 -41
- package/src/components/number-input/number-input.stories.tsx +0 -24
- package/src/components/password-input/index.tsx +0 -24
- package/src/components/password-input/password-input.module.css +0 -10
- package/src/components/password-input/password-input.stories.tsx +0 -24
- package/src/components/pill/index.tsx +0 -45
- package/src/components/pill/pill.module.css +0 -22
- package/src/components/pill/pill.stories.tsx +0 -83
- package/src/components/popover/index.tsx +0 -94
- package/src/components/popover/popover.module.css +0 -8
- package/src/components/popover/popover.stories.tsx +0 -53
- package/src/components/preview-card/index.tsx +0 -68
- package/src/components/preview-card/preview-card.module.css +0 -5
- package/src/components/preview-card/preview-card.stories.tsx +0 -58
- package/src/components/radio/index.tsx +0 -67
- package/src/components/radio/radio-group.module.css +0 -5
- package/src/components/radio/radio.module.css +0 -36
- package/src/components/radio/radio.stories.tsx +0 -27
- package/src/components/search-bar/index.tsx +0 -60
- package/src/components/search-bar/search-bar.module.css +0 -29
- package/src/components/search-bar/search-bar.stories.tsx +0 -37
- package/src/components/select/index.tsx +0 -132
- package/src/components/select/select.module.css +0 -63
- package/src/components/select/select.stories.tsx +0 -49
- package/src/components/separator/index.tsx +0 -28
- package/src/components/separator/separator.module.css +0 -24
- package/src/components/separator/separator.stories.tsx +0 -40
- package/src/components/slider/index.tsx +0 -28
- package/src/components/slider/slider.module.css +0 -52
- package/src/components/slider/slider.stories.tsx +0 -53
- package/src/components/spinner/index.tsx +0 -14
- package/src/components/spinner/spinner.module.css +0 -13
- package/src/components/spinner/spinner.stories.tsx +0 -17
- package/src/components/stacked-avatars/index.tsx +0 -88
- package/src/components/stacked-avatars/stacked-avatars.module.css +0 -79
- package/src/components/stacked-avatars/stacked-avatars.stories.tsx +0 -48
- package/src/components/status-banner/index.tsx +0 -96
- package/src/components/status-banner/status-banner.module.css +0 -52
- package/src/components/status-banner/status-banner.stories.tsx +0 -44
- package/src/components/surface/index.tsx +0 -83
- package/src/components/surface/surface.module.css +0 -35
- package/src/components/surface/surface.stories.tsx +0 -84
- package/src/components/switch/index.tsx +0 -23
- package/src/components/switch/switch.module.css +0 -45
- package/src/components/switch/switch.stories.tsx +0 -48
- package/src/components/tabs/index.tsx +0 -126
- package/src/components/tabs/tabs.module.css +0 -134
- package/src/components/tabs/tabs.stories.tsx +0 -88
- package/src/components/text/index.tsx +0 -69
- package/src/components/text/text.module.css +0 -76
- package/src/components/text/text.stories.tsx +0 -107
- package/src/components/theme-provider/index.ts +0 -2
- package/src/components/theme-provider/theme-context.tsx +0 -18
- package/src/components/theme-provider/theme-provider.stories.tsx +0 -47
- package/src/components/theme-provider/theme-provider.tsx +0 -77
- package/src/components/timestamp/index.tsx +0 -131
- package/src/components/timestamp/timestamp.module.css +0 -8
- package/src/components/timestamp/timestamp.stories.tsx +0 -37
- package/src/components/toast/index.ts +0 -2
- package/src/components/toast/toast.module.css +0 -163
- package/src/components/toast/toast.stories.tsx +0 -53
- package/src/components/toast/toast.tsx +0 -104
- package/src/components/toast/use-toast-manager.ts +0 -63
- package/src/components/tooltip/index.tsx +0 -61
- package/src/components/tooltip/tooltip-arrow.tsx +0 -17
- package/src/components/tooltip/tooltip.module.css +0 -44
- package/src/components/tooltip/tooltip.stories.tsx +0 -76
- package/src/components/view/index.tsx +0 -137
- package/src/components/view/view.module.css +0 -11
- package/src/components/view/view.stories.tsx +0 -131
- package/src/components/view/view_colorway.module.css +0 -280
- package/src/components/view/view_interactive.module.css +0 -127
- package/src/components/view/view_loading.module.css +0 -58
- package/src/components/visually-hidden/index.ts +0 -1
- package/src/index.ts +0 -49
- package/src/integrations/react-markdown/index.tsx +0 -134
- package/src/integrations/react-markdown/react-markdown.module.css +0 -62
- package/src/integrations/react-markdown/react-markdown.stories.tsx +0 -31
- package/src/integrations/tailwind.css +0 -173
- package/src/integrations/twemoij/index.tsx +0 -13
- package/src/integrations/twemoij/twemoji.module.css +0 -7
- package/src/integrations/twemoij/twemoji.stories.tsx +0 -40
- package/src/stories/components/all-variants.tsx +0 -40
- package/src/stories/data.ts +0 -72
- package/src/stories/utils.ts +0 -20
- package/src/styles/core.css +0 -153
- package/src/styles/themes/dark.css +0 -86
- package/src/styles/themes/light.css +0 -86
- package/src/styles/transitions.module.css +0 -31
- package/stylelint.config.mjs +0 -29
- package/tsconfig.app.json +0 -35
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -103
- package/vitest.shims.d.ts +0 -1
|
@@ -0,0 +1,1392 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as B } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useState as V } from "react";
|
|
4
|
+
import { Text as J } from "../text/index.js";
|
|
5
|
+
import { Tooltip as $ } from "../tooltip/index.js";
|
|
6
|
+
import { View as z } from "../view/index.js";
|
|
7
|
+
import '../../index36.css';const U = {
|
|
8
|
+
lessThanXSeconds: {
|
|
9
|
+
one: "less than a second",
|
|
10
|
+
other: "less than {{count}} seconds"
|
|
11
|
+
},
|
|
12
|
+
xSeconds: {
|
|
13
|
+
one: "1 second",
|
|
14
|
+
other: "{{count}} seconds"
|
|
15
|
+
},
|
|
16
|
+
halfAMinute: "half a minute",
|
|
17
|
+
lessThanXMinutes: {
|
|
18
|
+
one: "less than a minute",
|
|
19
|
+
other: "less than {{count}} minutes"
|
|
20
|
+
},
|
|
21
|
+
xMinutes: {
|
|
22
|
+
one: "1 minute",
|
|
23
|
+
other: "{{count}} minutes"
|
|
24
|
+
},
|
|
25
|
+
aboutXHours: {
|
|
26
|
+
one: "about 1 hour",
|
|
27
|
+
other: "about {{count}} hours"
|
|
28
|
+
},
|
|
29
|
+
xHours: {
|
|
30
|
+
one: "1 hour",
|
|
31
|
+
other: "{{count}} hours"
|
|
32
|
+
},
|
|
33
|
+
xDays: {
|
|
34
|
+
one: "1 day",
|
|
35
|
+
other: "{{count}} days"
|
|
36
|
+
},
|
|
37
|
+
aboutXWeeks: {
|
|
38
|
+
one: "about 1 week",
|
|
39
|
+
other: "about {{count}} weeks"
|
|
40
|
+
},
|
|
41
|
+
xWeeks: {
|
|
42
|
+
one: "1 week",
|
|
43
|
+
other: "{{count}} weeks"
|
|
44
|
+
},
|
|
45
|
+
aboutXMonths: {
|
|
46
|
+
one: "about 1 month",
|
|
47
|
+
other: "about {{count}} months"
|
|
48
|
+
},
|
|
49
|
+
xMonths: {
|
|
50
|
+
one: "1 month",
|
|
51
|
+
other: "{{count}} months"
|
|
52
|
+
},
|
|
53
|
+
aboutXYears: {
|
|
54
|
+
one: "about 1 year",
|
|
55
|
+
other: "about {{count}} years"
|
|
56
|
+
},
|
|
57
|
+
xYears: {
|
|
58
|
+
one: "1 year",
|
|
59
|
+
other: "{{count}} years"
|
|
60
|
+
},
|
|
61
|
+
overXYears: {
|
|
62
|
+
one: "over 1 year",
|
|
63
|
+
other: "over {{count}} years"
|
|
64
|
+
},
|
|
65
|
+
almostXYears: {
|
|
66
|
+
one: "almost 1 year",
|
|
67
|
+
other: "almost {{count}} years"
|
|
68
|
+
}
|
|
69
|
+
}, K = (t, e, n) => {
|
|
70
|
+
let r;
|
|
71
|
+
const a = U[t];
|
|
72
|
+
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
73
|
+
};
|
|
74
|
+
function E(t) {
|
|
75
|
+
return (e = {}) => {
|
|
76
|
+
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
77
|
+
return t.formats[n] || t.formats[t.defaultWidth];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const Z = {
|
|
81
|
+
full: "EEEE, MMMM do, y",
|
|
82
|
+
long: "MMMM do, y",
|
|
83
|
+
medium: "MMM d, y",
|
|
84
|
+
short: "MM/dd/yyyy"
|
|
85
|
+
}, tt = {
|
|
86
|
+
full: "h:mm:ss a zzzz",
|
|
87
|
+
long: "h:mm:ss a z",
|
|
88
|
+
medium: "h:mm:ss a",
|
|
89
|
+
short: "h:mm a"
|
|
90
|
+
}, et = {
|
|
91
|
+
full: "{{date}} 'at' {{time}}",
|
|
92
|
+
long: "{{date}} 'at' {{time}}",
|
|
93
|
+
medium: "{{date}}, {{time}}",
|
|
94
|
+
short: "{{date}}, {{time}}"
|
|
95
|
+
}, nt = {
|
|
96
|
+
date: E({
|
|
97
|
+
formats: Z,
|
|
98
|
+
defaultWidth: "full"
|
|
99
|
+
}),
|
|
100
|
+
time: E({
|
|
101
|
+
formats: tt,
|
|
102
|
+
defaultWidth: "full"
|
|
103
|
+
}),
|
|
104
|
+
dateTime: E({
|
|
105
|
+
formats: et,
|
|
106
|
+
defaultWidth: "full"
|
|
107
|
+
})
|
|
108
|
+
}, rt = {
|
|
109
|
+
lastWeek: "'last' eeee 'at' p",
|
|
110
|
+
yesterday: "'yesterday at' p",
|
|
111
|
+
today: "'today at' p",
|
|
112
|
+
tomorrow: "'tomorrow at' p",
|
|
113
|
+
nextWeek: "eeee 'at' p",
|
|
114
|
+
other: "P"
|
|
115
|
+
}, at = (t, e, n, r) => rt[t];
|
|
116
|
+
function O(t) {
|
|
117
|
+
return (e, n) => {
|
|
118
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
119
|
+
let a;
|
|
120
|
+
if (r === "formatting" && t.formattingValues) {
|
|
121
|
+
const s = t.defaultFormattingWidth || t.defaultWidth, i = n?.width ? String(n.width) : s;
|
|
122
|
+
a = t.formattingValues[i] || t.formattingValues[s];
|
|
123
|
+
} else {
|
|
124
|
+
const s = t.defaultWidth, i = n?.width ? String(n.width) : t.defaultWidth;
|
|
125
|
+
a = t.values[i] || t.values[s];
|
|
126
|
+
}
|
|
127
|
+
const o = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
128
|
+
return a[o];
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const ot = {
|
|
132
|
+
narrow: ["B", "A"],
|
|
133
|
+
abbreviated: ["BC", "AD"],
|
|
134
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
135
|
+
}, it = {
|
|
136
|
+
narrow: ["1", "2", "3", "4"],
|
|
137
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
138
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
139
|
+
}, st = {
|
|
140
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
141
|
+
abbreviated: [
|
|
142
|
+
"Jan",
|
|
143
|
+
"Feb",
|
|
144
|
+
"Mar",
|
|
145
|
+
"Apr",
|
|
146
|
+
"May",
|
|
147
|
+
"Jun",
|
|
148
|
+
"Jul",
|
|
149
|
+
"Aug",
|
|
150
|
+
"Sep",
|
|
151
|
+
"Oct",
|
|
152
|
+
"Nov",
|
|
153
|
+
"Dec"
|
|
154
|
+
],
|
|
155
|
+
wide: [
|
|
156
|
+
"January",
|
|
157
|
+
"February",
|
|
158
|
+
"March",
|
|
159
|
+
"April",
|
|
160
|
+
"May",
|
|
161
|
+
"June",
|
|
162
|
+
"July",
|
|
163
|
+
"August",
|
|
164
|
+
"September",
|
|
165
|
+
"October",
|
|
166
|
+
"November",
|
|
167
|
+
"December"
|
|
168
|
+
]
|
|
169
|
+
}, ct = {
|
|
170
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
171
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
172
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
173
|
+
wide: [
|
|
174
|
+
"Sunday",
|
|
175
|
+
"Monday",
|
|
176
|
+
"Tuesday",
|
|
177
|
+
"Wednesday",
|
|
178
|
+
"Thursday",
|
|
179
|
+
"Friday",
|
|
180
|
+
"Saturday"
|
|
181
|
+
]
|
|
182
|
+
}, ut = {
|
|
183
|
+
narrow: {
|
|
184
|
+
am: "a",
|
|
185
|
+
pm: "p",
|
|
186
|
+
midnight: "mi",
|
|
187
|
+
noon: "n",
|
|
188
|
+
morning: "morning",
|
|
189
|
+
afternoon: "afternoon",
|
|
190
|
+
evening: "evening",
|
|
191
|
+
night: "night"
|
|
192
|
+
},
|
|
193
|
+
abbreviated: {
|
|
194
|
+
am: "AM",
|
|
195
|
+
pm: "PM",
|
|
196
|
+
midnight: "midnight",
|
|
197
|
+
noon: "noon",
|
|
198
|
+
morning: "morning",
|
|
199
|
+
afternoon: "afternoon",
|
|
200
|
+
evening: "evening",
|
|
201
|
+
night: "night"
|
|
202
|
+
},
|
|
203
|
+
wide: {
|
|
204
|
+
am: "a.m.",
|
|
205
|
+
pm: "p.m.",
|
|
206
|
+
midnight: "midnight",
|
|
207
|
+
noon: "noon",
|
|
208
|
+
morning: "morning",
|
|
209
|
+
afternoon: "afternoon",
|
|
210
|
+
evening: "evening",
|
|
211
|
+
night: "night"
|
|
212
|
+
}
|
|
213
|
+
}, dt = {
|
|
214
|
+
narrow: {
|
|
215
|
+
am: "a",
|
|
216
|
+
pm: "p",
|
|
217
|
+
midnight: "mi",
|
|
218
|
+
noon: "n",
|
|
219
|
+
morning: "in the morning",
|
|
220
|
+
afternoon: "in the afternoon",
|
|
221
|
+
evening: "in the evening",
|
|
222
|
+
night: "at night"
|
|
223
|
+
},
|
|
224
|
+
abbreviated: {
|
|
225
|
+
am: "AM",
|
|
226
|
+
pm: "PM",
|
|
227
|
+
midnight: "midnight",
|
|
228
|
+
noon: "noon",
|
|
229
|
+
morning: "in the morning",
|
|
230
|
+
afternoon: "in the afternoon",
|
|
231
|
+
evening: "in the evening",
|
|
232
|
+
night: "at night"
|
|
233
|
+
},
|
|
234
|
+
wide: {
|
|
235
|
+
am: "a.m.",
|
|
236
|
+
pm: "p.m.",
|
|
237
|
+
midnight: "midnight",
|
|
238
|
+
noon: "noon",
|
|
239
|
+
morning: "in the morning",
|
|
240
|
+
afternoon: "in the afternoon",
|
|
241
|
+
evening: "in the evening",
|
|
242
|
+
night: "at night"
|
|
243
|
+
}
|
|
244
|
+
}, ft = (t, e) => {
|
|
245
|
+
const n = Number(t), r = n % 100;
|
|
246
|
+
if (r > 20 || r < 10)
|
|
247
|
+
switch (r % 10) {
|
|
248
|
+
case 1:
|
|
249
|
+
return n + "st";
|
|
250
|
+
case 2:
|
|
251
|
+
return n + "nd";
|
|
252
|
+
case 3:
|
|
253
|
+
return n + "rd";
|
|
254
|
+
}
|
|
255
|
+
return n + "th";
|
|
256
|
+
}, ht = {
|
|
257
|
+
ordinalNumber: ft,
|
|
258
|
+
era: O({
|
|
259
|
+
values: ot,
|
|
260
|
+
defaultWidth: "wide"
|
|
261
|
+
}),
|
|
262
|
+
quarter: O({
|
|
263
|
+
values: it,
|
|
264
|
+
defaultWidth: "wide",
|
|
265
|
+
argumentCallback: (t) => t - 1
|
|
266
|
+
}),
|
|
267
|
+
month: O({
|
|
268
|
+
values: st,
|
|
269
|
+
defaultWidth: "wide"
|
|
270
|
+
}),
|
|
271
|
+
day: O({
|
|
272
|
+
values: ct,
|
|
273
|
+
defaultWidth: "wide"
|
|
274
|
+
}),
|
|
275
|
+
dayPeriod: O({
|
|
276
|
+
values: ut,
|
|
277
|
+
defaultWidth: "wide",
|
|
278
|
+
formattingValues: dt,
|
|
279
|
+
defaultFormattingWidth: "wide"
|
|
280
|
+
})
|
|
281
|
+
};
|
|
282
|
+
function P(t) {
|
|
283
|
+
return (e, n = {}) => {
|
|
284
|
+
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
|
|
285
|
+
if (!o)
|
|
286
|
+
return null;
|
|
287
|
+
const s = o[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(i) ? lt(i, (u) => u.test(s)) : (
|
|
288
|
+
// [TODO] -- I challenge you to fix the type
|
|
289
|
+
mt(i, (u) => u.test(s))
|
|
290
|
+
);
|
|
291
|
+
let m;
|
|
292
|
+
m = t.valueCallback ? t.valueCallback(f) : f, m = n.valueCallback ? (
|
|
293
|
+
// [TODO] -- I challenge you to fix the type
|
|
294
|
+
n.valueCallback(m)
|
|
295
|
+
) : m;
|
|
296
|
+
const d = e.slice(s.length);
|
|
297
|
+
return { value: m, rest: d };
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function mt(t, e) {
|
|
301
|
+
for (const n in t)
|
|
302
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
303
|
+
return n;
|
|
304
|
+
}
|
|
305
|
+
function lt(t, e) {
|
|
306
|
+
for (let n = 0; n < t.length; n++)
|
|
307
|
+
if (e(t[n]))
|
|
308
|
+
return n;
|
|
309
|
+
}
|
|
310
|
+
function gt(t) {
|
|
311
|
+
return (e, n = {}) => {
|
|
312
|
+
const r = e.match(t.matchPattern);
|
|
313
|
+
if (!r) return null;
|
|
314
|
+
const a = r[0], o = e.match(t.parsePattern);
|
|
315
|
+
if (!o) return null;
|
|
316
|
+
let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
|
|
317
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
318
|
+
const i = e.slice(a.length);
|
|
319
|
+
return { value: s, rest: i };
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const wt = /^(\d+)(th|st|nd|rd)?/i, yt = /\d+/i, bt = {
|
|
323
|
+
narrow: /^(b|a)/i,
|
|
324
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
325
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
326
|
+
}, Mt = {
|
|
327
|
+
any: [/^b/i, /^(a|c)/i]
|
|
328
|
+
}, Dt = {
|
|
329
|
+
narrow: /^[1234]/i,
|
|
330
|
+
abbreviated: /^q[1234]/i,
|
|
331
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
332
|
+
}, pt = {
|
|
333
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
334
|
+
}, Ot = {
|
|
335
|
+
narrow: /^[jfmasond]/i,
|
|
336
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
337
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
338
|
+
}, Pt = {
|
|
339
|
+
narrow: [
|
|
340
|
+
/^j/i,
|
|
341
|
+
/^f/i,
|
|
342
|
+
/^m/i,
|
|
343
|
+
/^a/i,
|
|
344
|
+
/^m/i,
|
|
345
|
+
/^j/i,
|
|
346
|
+
/^j/i,
|
|
347
|
+
/^a/i,
|
|
348
|
+
/^s/i,
|
|
349
|
+
/^o/i,
|
|
350
|
+
/^n/i,
|
|
351
|
+
/^d/i
|
|
352
|
+
],
|
|
353
|
+
any: [
|
|
354
|
+
/^ja/i,
|
|
355
|
+
/^f/i,
|
|
356
|
+
/^mar/i,
|
|
357
|
+
/^ap/i,
|
|
358
|
+
/^may/i,
|
|
359
|
+
/^jun/i,
|
|
360
|
+
/^jul/i,
|
|
361
|
+
/^au/i,
|
|
362
|
+
/^s/i,
|
|
363
|
+
/^o/i,
|
|
364
|
+
/^n/i,
|
|
365
|
+
/^d/i
|
|
366
|
+
]
|
|
367
|
+
}, xt = {
|
|
368
|
+
narrow: /^[smtwf]/i,
|
|
369
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
370
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
371
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
372
|
+
}, vt = {
|
|
373
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
374
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
375
|
+
}, kt = {
|
|
376
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
377
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
378
|
+
}, St = {
|
|
379
|
+
any: {
|
|
380
|
+
am: /^a/i,
|
|
381
|
+
pm: /^p/i,
|
|
382
|
+
midnight: /^mi/i,
|
|
383
|
+
noon: /^no/i,
|
|
384
|
+
morning: /morning/i,
|
|
385
|
+
afternoon: /afternoon/i,
|
|
386
|
+
evening: /evening/i,
|
|
387
|
+
night: /night/i
|
|
388
|
+
}
|
|
389
|
+
}, Wt = {
|
|
390
|
+
ordinalNumber: gt({
|
|
391
|
+
matchPattern: wt,
|
|
392
|
+
parsePattern: yt,
|
|
393
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
394
|
+
}),
|
|
395
|
+
era: P({
|
|
396
|
+
matchPatterns: bt,
|
|
397
|
+
defaultMatchWidth: "wide",
|
|
398
|
+
parsePatterns: Mt,
|
|
399
|
+
defaultParseWidth: "any"
|
|
400
|
+
}),
|
|
401
|
+
quarter: P({
|
|
402
|
+
matchPatterns: Dt,
|
|
403
|
+
defaultMatchWidth: "wide",
|
|
404
|
+
parsePatterns: pt,
|
|
405
|
+
defaultParseWidth: "any",
|
|
406
|
+
valueCallback: (t) => t + 1
|
|
407
|
+
}),
|
|
408
|
+
month: P({
|
|
409
|
+
matchPatterns: Ot,
|
|
410
|
+
defaultMatchWidth: "wide",
|
|
411
|
+
parsePatterns: Pt,
|
|
412
|
+
defaultParseWidth: "any"
|
|
413
|
+
}),
|
|
414
|
+
day: P({
|
|
415
|
+
matchPatterns: xt,
|
|
416
|
+
defaultMatchWidth: "wide",
|
|
417
|
+
parsePatterns: vt,
|
|
418
|
+
defaultParseWidth: "any"
|
|
419
|
+
}),
|
|
420
|
+
dayPeriod: P({
|
|
421
|
+
matchPatterns: kt,
|
|
422
|
+
defaultMatchWidth: "any",
|
|
423
|
+
parsePatterns: St,
|
|
424
|
+
defaultParseWidth: "any"
|
|
425
|
+
})
|
|
426
|
+
}, L = {
|
|
427
|
+
code: "en-US",
|
|
428
|
+
formatDistance: K,
|
|
429
|
+
formatLong: nt,
|
|
430
|
+
formatRelative: at,
|
|
431
|
+
localize: ht,
|
|
432
|
+
match: Wt,
|
|
433
|
+
options: {
|
|
434
|
+
weekStartsOn: 0,
|
|
435
|
+
firstWeekContainsDate: 1
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
let Tt = {};
|
|
439
|
+
function v() {
|
|
440
|
+
return Tt;
|
|
441
|
+
}
|
|
442
|
+
const Q = 6048e5, Yt = 864e5, k = 43200, _ = 1440, C = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
443
|
+
function g(t, e) {
|
|
444
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && C in t ? t[C](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
445
|
+
}
|
|
446
|
+
function l(t, e) {
|
|
447
|
+
return g(e || t, t);
|
|
448
|
+
}
|
|
449
|
+
function W(t) {
|
|
450
|
+
const e = l(t), n = new Date(
|
|
451
|
+
Date.UTC(
|
|
452
|
+
e.getFullYear(),
|
|
453
|
+
e.getMonth(),
|
|
454
|
+
e.getDate(),
|
|
455
|
+
e.getHours(),
|
|
456
|
+
e.getMinutes(),
|
|
457
|
+
e.getSeconds(),
|
|
458
|
+
e.getMilliseconds()
|
|
459
|
+
)
|
|
460
|
+
);
|
|
461
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
462
|
+
}
|
|
463
|
+
function Y(t, ...e) {
|
|
464
|
+
const n = g.bind(
|
|
465
|
+
null,
|
|
466
|
+
t || e.find((r) => typeof r == "object")
|
|
467
|
+
);
|
|
468
|
+
return e.map(n);
|
|
469
|
+
}
|
|
470
|
+
function N(t, e) {
|
|
471
|
+
const n = l(t, e?.in);
|
|
472
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
473
|
+
}
|
|
474
|
+
function Ft(t, e, n) {
|
|
475
|
+
const [r, a] = Y(
|
|
476
|
+
n?.in,
|
|
477
|
+
t,
|
|
478
|
+
e
|
|
479
|
+
), o = N(r), s = N(a), i = +o - W(o), f = +s - W(s);
|
|
480
|
+
return Math.round((i - f) / Yt);
|
|
481
|
+
}
|
|
482
|
+
function Et(t, e) {
|
|
483
|
+
const n = l(t, e?.in);
|
|
484
|
+
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
485
|
+
}
|
|
486
|
+
function _t(t, e) {
|
|
487
|
+
const n = l(t, e?.in);
|
|
488
|
+
return Ft(n, Et(n)) + 1;
|
|
489
|
+
}
|
|
490
|
+
function x(t, e) {
|
|
491
|
+
const n = v(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = l(t, e?.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
|
|
492
|
+
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
493
|
+
}
|
|
494
|
+
function T(t, e) {
|
|
495
|
+
return x(t, { ...e, weekStartsOn: 1 });
|
|
496
|
+
}
|
|
497
|
+
function j(t, e) {
|
|
498
|
+
const n = l(t, e?.in), r = n.getFullYear(), a = g(n, 0);
|
|
499
|
+
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
500
|
+
const o = T(a), s = g(n, 0);
|
|
501
|
+
s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
|
|
502
|
+
const i = T(s);
|
|
503
|
+
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1;
|
|
504
|
+
}
|
|
505
|
+
function Ct(t, e) {
|
|
506
|
+
const n = j(t, e), r = g(t, 0);
|
|
507
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), T(r);
|
|
508
|
+
}
|
|
509
|
+
function Nt(t, e) {
|
|
510
|
+
const n = l(t, e?.in), r = +T(n) - +Ct(n);
|
|
511
|
+
return Math.round(r / Q) + 1;
|
|
512
|
+
}
|
|
513
|
+
function G(t, e) {
|
|
514
|
+
const n = l(t, e?.in), r = n.getFullYear(), a = v(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = g(e?.in || t, 0);
|
|
515
|
+
s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
516
|
+
const i = x(s, e), f = g(e?.in || t, 0);
|
|
517
|
+
f.setFullYear(r, 0, o), f.setHours(0, 0, 0, 0);
|
|
518
|
+
const m = x(f, e);
|
|
519
|
+
return +n >= +i ? r + 1 : +n >= +m ? r : r - 1;
|
|
520
|
+
}
|
|
521
|
+
function qt(t, e) {
|
|
522
|
+
const n = v(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = G(t, e), o = g(e?.in || t, 0);
|
|
523
|
+
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), x(o, e);
|
|
524
|
+
}
|
|
525
|
+
function Xt(t, e) {
|
|
526
|
+
const n = l(t, e?.in), r = +x(n, e) - +qt(n, e);
|
|
527
|
+
return Math.round(r / Q) + 1;
|
|
528
|
+
}
|
|
529
|
+
function c(t, e) {
|
|
530
|
+
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
531
|
+
return n + r;
|
|
532
|
+
}
|
|
533
|
+
const y = {
|
|
534
|
+
// Year
|
|
535
|
+
y(t, e) {
|
|
536
|
+
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
537
|
+
return c(e === "yy" ? r % 100 : r, e.length);
|
|
538
|
+
},
|
|
539
|
+
// Month
|
|
540
|
+
M(t, e) {
|
|
541
|
+
const n = t.getMonth();
|
|
542
|
+
return e === "M" ? String(n + 1) : c(n + 1, 2);
|
|
543
|
+
},
|
|
544
|
+
// Day of the month
|
|
545
|
+
d(t, e) {
|
|
546
|
+
return c(t.getDate(), e.length);
|
|
547
|
+
},
|
|
548
|
+
// AM or PM
|
|
549
|
+
a(t, e) {
|
|
550
|
+
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
551
|
+
switch (e) {
|
|
552
|
+
case "a":
|
|
553
|
+
case "aa":
|
|
554
|
+
return n.toUpperCase();
|
|
555
|
+
case "aaa":
|
|
556
|
+
return n;
|
|
557
|
+
case "aaaaa":
|
|
558
|
+
return n[0];
|
|
559
|
+
default:
|
|
560
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
// Hour [1-12]
|
|
564
|
+
h(t, e) {
|
|
565
|
+
return c(t.getHours() % 12 || 12, e.length);
|
|
566
|
+
},
|
|
567
|
+
// Hour [0-23]
|
|
568
|
+
H(t, e) {
|
|
569
|
+
return c(t.getHours(), e.length);
|
|
570
|
+
},
|
|
571
|
+
// Minute
|
|
572
|
+
m(t, e) {
|
|
573
|
+
return c(t.getMinutes(), e.length);
|
|
574
|
+
},
|
|
575
|
+
// Second
|
|
576
|
+
s(t, e) {
|
|
577
|
+
return c(t.getSeconds(), e.length);
|
|
578
|
+
},
|
|
579
|
+
// Fraction of second
|
|
580
|
+
S(t, e) {
|
|
581
|
+
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
582
|
+
r * Math.pow(10, n - 3)
|
|
583
|
+
);
|
|
584
|
+
return c(a, e.length);
|
|
585
|
+
}
|
|
586
|
+
}, D = {
|
|
587
|
+
midnight: "midnight",
|
|
588
|
+
noon: "noon",
|
|
589
|
+
morning: "morning",
|
|
590
|
+
afternoon: "afternoon",
|
|
591
|
+
evening: "evening",
|
|
592
|
+
night: "night"
|
|
593
|
+
}, q = {
|
|
594
|
+
// Era
|
|
595
|
+
G: function(t, e, n) {
|
|
596
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
597
|
+
switch (e) {
|
|
598
|
+
// AD, BC
|
|
599
|
+
case "G":
|
|
600
|
+
case "GG":
|
|
601
|
+
case "GGG":
|
|
602
|
+
return n.era(r, { width: "abbreviated" });
|
|
603
|
+
// A, B
|
|
604
|
+
case "GGGGG":
|
|
605
|
+
return n.era(r, { width: "narrow" });
|
|
606
|
+
default:
|
|
607
|
+
return n.era(r, { width: "wide" });
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
// Year
|
|
611
|
+
y: function(t, e, n) {
|
|
612
|
+
if (e === "yo") {
|
|
613
|
+
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
614
|
+
return n.ordinalNumber(a, { unit: "year" });
|
|
615
|
+
}
|
|
616
|
+
return y.y(t, e);
|
|
617
|
+
},
|
|
618
|
+
// Local week-numbering year
|
|
619
|
+
Y: function(t, e, n, r) {
|
|
620
|
+
const a = G(t, r), o = a > 0 ? a : 1 - a;
|
|
621
|
+
if (e === "YY") {
|
|
622
|
+
const s = o % 100;
|
|
623
|
+
return c(s, 2);
|
|
624
|
+
}
|
|
625
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : c(o, e.length);
|
|
626
|
+
},
|
|
627
|
+
// ISO week-numbering year
|
|
628
|
+
R: function(t, e) {
|
|
629
|
+
const n = j(t);
|
|
630
|
+
return c(n, e.length);
|
|
631
|
+
},
|
|
632
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
633
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
634
|
+
// | Year | `y` | `u` |
|
|
635
|
+
// |------|-----|-----|
|
|
636
|
+
// | AC 1 | 1 | 1 |
|
|
637
|
+
// | BC 1 | 1 | 0 |
|
|
638
|
+
// | BC 2 | 2 | -1 |
|
|
639
|
+
// Also `yy` always returns the last two digits of a year,
|
|
640
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
641
|
+
u: function(t, e) {
|
|
642
|
+
const n = t.getFullYear();
|
|
643
|
+
return c(n, e.length);
|
|
644
|
+
},
|
|
645
|
+
// Quarter
|
|
646
|
+
Q: function(t, e, n) {
|
|
647
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
648
|
+
switch (e) {
|
|
649
|
+
// 1, 2, 3, 4
|
|
650
|
+
case "Q":
|
|
651
|
+
return String(r);
|
|
652
|
+
// 01, 02, 03, 04
|
|
653
|
+
case "QQ":
|
|
654
|
+
return c(r, 2);
|
|
655
|
+
// 1st, 2nd, 3rd, 4th
|
|
656
|
+
case "Qo":
|
|
657
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
658
|
+
// Q1, Q2, Q3, Q4
|
|
659
|
+
case "QQQ":
|
|
660
|
+
return n.quarter(r, {
|
|
661
|
+
width: "abbreviated",
|
|
662
|
+
context: "formatting"
|
|
663
|
+
});
|
|
664
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
665
|
+
case "QQQQQ":
|
|
666
|
+
return n.quarter(r, {
|
|
667
|
+
width: "narrow",
|
|
668
|
+
context: "formatting"
|
|
669
|
+
});
|
|
670
|
+
default:
|
|
671
|
+
return n.quarter(r, {
|
|
672
|
+
width: "wide",
|
|
673
|
+
context: "formatting"
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
// Stand-alone quarter
|
|
678
|
+
q: function(t, e, n) {
|
|
679
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
680
|
+
switch (e) {
|
|
681
|
+
// 1, 2, 3, 4
|
|
682
|
+
case "q":
|
|
683
|
+
return String(r);
|
|
684
|
+
// 01, 02, 03, 04
|
|
685
|
+
case "qq":
|
|
686
|
+
return c(r, 2);
|
|
687
|
+
// 1st, 2nd, 3rd, 4th
|
|
688
|
+
case "qo":
|
|
689
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
690
|
+
// Q1, Q2, Q3, Q4
|
|
691
|
+
case "qqq":
|
|
692
|
+
return n.quarter(r, {
|
|
693
|
+
width: "abbreviated",
|
|
694
|
+
context: "standalone"
|
|
695
|
+
});
|
|
696
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
697
|
+
case "qqqqq":
|
|
698
|
+
return n.quarter(r, {
|
|
699
|
+
width: "narrow",
|
|
700
|
+
context: "standalone"
|
|
701
|
+
});
|
|
702
|
+
default:
|
|
703
|
+
return n.quarter(r, {
|
|
704
|
+
width: "wide",
|
|
705
|
+
context: "standalone"
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
// Month
|
|
710
|
+
M: function(t, e, n) {
|
|
711
|
+
const r = t.getMonth();
|
|
712
|
+
switch (e) {
|
|
713
|
+
case "M":
|
|
714
|
+
case "MM":
|
|
715
|
+
return y.M(t, e);
|
|
716
|
+
// 1st, 2nd, ..., 12th
|
|
717
|
+
case "Mo":
|
|
718
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
719
|
+
// Jan, Feb, ..., Dec
|
|
720
|
+
case "MMM":
|
|
721
|
+
return n.month(r, {
|
|
722
|
+
width: "abbreviated",
|
|
723
|
+
context: "formatting"
|
|
724
|
+
});
|
|
725
|
+
// J, F, ..., D
|
|
726
|
+
case "MMMMM":
|
|
727
|
+
return n.month(r, {
|
|
728
|
+
width: "narrow",
|
|
729
|
+
context: "formatting"
|
|
730
|
+
});
|
|
731
|
+
default:
|
|
732
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
// Stand-alone month
|
|
736
|
+
L: function(t, e, n) {
|
|
737
|
+
const r = t.getMonth();
|
|
738
|
+
switch (e) {
|
|
739
|
+
// 1, 2, ..., 12
|
|
740
|
+
case "L":
|
|
741
|
+
return String(r + 1);
|
|
742
|
+
// 01, 02, ..., 12
|
|
743
|
+
case "LL":
|
|
744
|
+
return c(r + 1, 2);
|
|
745
|
+
// 1st, 2nd, ..., 12th
|
|
746
|
+
case "Lo":
|
|
747
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
748
|
+
// Jan, Feb, ..., Dec
|
|
749
|
+
case "LLL":
|
|
750
|
+
return n.month(r, {
|
|
751
|
+
width: "abbreviated",
|
|
752
|
+
context: "standalone"
|
|
753
|
+
});
|
|
754
|
+
// J, F, ..., D
|
|
755
|
+
case "LLLLL":
|
|
756
|
+
return n.month(r, {
|
|
757
|
+
width: "narrow",
|
|
758
|
+
context: "standalone"
|
|
759
|
+
});
|
|
760
|
+
default:
|
|
761
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
// Local week of year
|
|
765
|
+
w: function(t, e, n, r) {
|
|
766
|
+
const a = Xt(t, r);
|
|
767
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : c(a, e.length);
|
|
768
|
+
},
|
|
769
|
+
// ISO week of year
|
|
770
|
+
I: function(t, e, n) {
|
|
771
|
+
const r = Nt(t);
|
|
772
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : c(r, e.length);
|
|
773
|
+
},
|
|
774
|
+
// Day of the month
|
|
775
|
+
d: function(t, e, n) {
|
|
776
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : y.d(t, e);
|
|
777
|
+
},
|
|
778
|
+
// Day of year
|
|
779
|
+
D: function(t, e, n) {
|
|
780
|
+
const r = _t(t);
|
|
781
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : c(r, e.length);
|
|
782
|
+
},
|
|
783
|
+
// Day of week
|
|
784
|
+
E: function(t, e, n) {
|
|
785
|
+
const r = t.getDay();
|
|
786
|
+
switch (e) {
|
|
787
|
+
// Tue
|
|
788
|
+
case "E":
|
|
789
|
+
case "EE":
|
|
790
|
+
case "EEE":
|
|
791
|
+
return n.day(r, {
|
|
792
|
+
width: "abbreviated",
|
|
793
|
+
context: "formatting"
|
|
794
|
+
});
|
|
795
|
+
// T
|
|
796
|
+
case "EEEEE":
|
|
797
|
+
return n.day(r, {
|
|
798
|
+
width: "narrow",
|
|
799
|
+
context: "formatting"
|
|
800
|
+
});
|
|
801
|
+
// Tu
|
|
802
|
+
case "EEEEEE":
|
|
803
|
+
return n.day(r, {
|
|
804
|
+
width: "short",
|
|
805
|
+
context: "formatting"
|
|
806
|
+
});
|
|
807
|
+
default:
|
|
808
|
+
return n.day(r, {
|
|
809
|
+
width: "wide",
|
|
810
|
+
context: "formatting"
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
// Local day of week
|
|
815
|
+
e: function(t, e, n, r) {
|
|
816
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
817
|
+
switch (e) {
|
|
818
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
819
|
+
case "e":
|
|
820
|
+
return String(o);
|
|
821
|
+
// Padded numerical value
|
|
822
|
+
case "ee":
|
|
823
|
+
return c(o, 2);
|
|
824
|
+
// 1st, 2nd, ..., 7th
|
|
825
|
+
case "eo":
|
|
826
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
827
|
+
case "eee":
|
|
828
|
+
return n.day(a, {
|
|
829
|
+
width: "abbreviated",
|
|
830
|
+
context: "formatting"
|
|
831
|
+
});
|
|
832
|
+
// T
|
|
833
|
+
case "eeeee":
|
|
834
|
+
return n.day(a, {
|
|
835
|
+
width: "narrow",
|
|
836
|
+
context: "formatting"
|
|
837
|
+
});
|
|
838
|
+
// Tu
|
|
839
|
+
case "eeeeee":
|
|
840
|
+
return n.day(a, {
|
|
841
|
+
width: "short",
|
|
842
|
+
context: "formatting"
|
|
843
|
+
});
|
|
844
|
+
default:
|
|
845
|
+
return n.day(a, {
|
|
846
|
+
width: "wide",
|
|
847
|
+
context: "formatting"
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
// Stand-alone local day of week
|
|
852
|
+
c: function(t, e, n, r) {
|
|
853
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
854
|
+
switch (e) {
|
|
855
|
+
// Numerical value (same as in `e`)
|
|
856
|
+
case "c":
|
|
857
|
+
return String(o);
|
|
858
|
+
// Padded numerical value
|
|
859
|
+
case "cc":
|
|
860
|
+
return c(o, e.length);
|
|
861
|
+
// 1st, 2nd, ..., 7th
|
|
862
|
+
case "co":
|
|
863
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
864
|
+
case "ccc":
|
|
865
|
+
return n.day(a, {
|
|
866
|
+
width: "abbreviated",
|
|
867
|
+
context: "standalone"
|
|
868
|
+
});
|
|
869
|
+
// T
|
|
870
|
+
case "ccccc":
|
|
871
|
+
return n.day(a, {
|
|
872
|
+
width: "narrow",
|
|
873
|
+
context: "standalone"
|
|
874
|
+
});
|
|
875
|
+
// Tu
|
|
876
|
+
case "cccccc":
|
|
877
|
+
return n.day(a, {
|
|
878
|
+
width: "short",
|
|
879
|
+
context: "standalone"
|
|
880
|
+
});
|
|
881
|
+
default:
|
|
882
|
+
return n.day(a, {
|
|
883
|
+
width: "wide",
|
|
884
|
+
context: "standalone"
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
// ISO day of week
|
|
889
|
+
i: function(t, e, n) {
|
|
890
|
+
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
891
|
+
switch (e) {
|
|
892
|
+
// 2
|
|
893
|
+
case "i":
|
|
894
|
+
return String(a);
|
|
895
|
+
// 02
|
|
896
|
+
case "ii":
|
|
897
|
+
return c(a, e.length);
|
|
898
|
+
// 2nd
|
|
899
|
+
case "io":
|
|
900
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
901
|
+
// Tue
|
|
902
|
+
case "iii":
|
|
903
|
+
return n.day(r, {
|
|
904
|
+
width: "abbreviated",
|
|
905
|
+
context: "formatting"
|
|
906
|
+
});
|
|
907
|
+
// T
|
|
908
|
+
case "iiiii":
|
|
909
|
+
return n.day(r, {
|
|
910
|
+
width: "narrow",
|
|
911
|
+
context: "formatting"
|
|
912
|
+
});
|
|
913
|
+
// Tu
|
|
914
|
+
case "iiiiii":
|
|
915
|
+
return n.day(r, {
|
|
916
|
+
width: "short",
|
|
917
|
+
context: "formatting"
|
|
918
|
+
});
|
|
919
|
+
default:
|
|
920
|
+
return n.day(r, {
|
|
921
|
+
width: "wide",
|
|
922
|
+
context: "formatting"
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
// AM or PM
|
|
927
|
+
a: function(t, e, n) {
|
|
928
|
+
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
929
|
+
switch (e) {
|
|
930
|
+
case "a":
|
|
931
|
+
case "aa":
|
|
932
|
+
return n.dayPeriod(a, {
|
|
933
|
+
width: "abbreviated",
|
|
934
|
+
context: "formatting"
|
|
935
|
+
});
|
|
936
|
+
case "aaa":
|
|
937
|
+
return n.dayPeriod(a, {
|
|
938
|
+
width: "abbreviated",
|
|
939
|
+
context: "formatting"
|
|
940
|
+
}).toLowerCase();
|
|
941
|
+
case "aaaaa":
|
|
942
|
+
return n.dayPeriod(a, {
|
|
943
|
+
width: "narrow",
|
|
944
|
+
context: "formatting"
|
|
945
|
+
});
|
|
946
|
+
default:
|
|
947
|
+
return n.dayPeriod(a, {
|
|
948
|
+
width: "wide",
|
|
949
|
+
context: "formatting"
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
// AM, PM, midnight, noon
|
|
954
|
+
b: function(t, e, n) {
|
|
955
|
+
const r = t.getHours();
|
|
956
|
+
let a;
|
|
957
|
+
switch (r === 12 ? a = D.noon : r === 0 ? a = D.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
958
|
+
case "b":
|
|
959
|
+
case "bb":
|
|
960
|
+
return n.dayPeriod(a, {
|
|
961
|
+
width: "abbreviated",
|
|
962
|
+
context: "formatting"
|
|
963
|
+
});
|
|
964
|
+
case "bbb":
|
|
965
|
+
return n.dayPeriod(a, {
|
|
966
|
+
width: "abbreviated",
|
|
967
|
+
context: "formatting"
|
|
968
|
+
}).toLowerCase();
|
|
969
|
+
case "bbbbb":
|
|
970
|
+
return n.dayPeriod(a, {
|
|
971
|
+
width: "narrow",
|
|
972
|
+
context: "formatting"
|
|
973
|
+
});
|
|
974
|
+
default:
|
|
975
|
+
return n.dayPeriod(a, {
|
|
976
|
+
width: "wide",
|
|
977
|
+
context: "formatting"
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
982
|
+
B: function(t, e, n) {
|
|
983
|
+
const r = t.getHours();
|
|
984
|
+
let a;
|
|
985
|
+
switch (r >= 17 ? a = D.evening : r >= 12 ? a = D.afternoon : r >= 4 ? a = D.morning : a = D.night, e) {
|
|
986
|
+
case "B":
|
|
987
|
+
case "BB":
|
|
988
|
+
case "BBB":
|
|
989
|
+
return n.dayPeriod(a, {
|
|
990
|
+
width: "abbreviated",
|
|
991
|
+
context: "formatting"
|
|
992
|
+
});
|
|
993
|
+
case "BBBBB":
|
|
994
|
+
return n.dayPeriod(a, {
|
|
995
|
+
width: "narrow",
|
|
996
|
+
context: "formatting"
|
|
997
|
+
});
|
|
998
|
+
default:
|
|
999
|
+
return n.dayPeriod(a, {
|
|
1000
|
+
width: "wide",
|
|
1001
|
+
context: "formatting"
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
// Hour [1-12]
|
|
1006
|
+
h: function(t, e, n) {
|
|
1007
|
+
if (e === "ho") {
|
|
1008
|
+
let r = t.getHours() % 12;
|
|
1009
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1010
|
+
}
|
|
1011
|
+
return y.h(t, e);
|
|
1012
|
+
},
|
|
1013
|
+
// Hour [0-23]
|
|
1014
|
+
H: function(t, e, n) {
|
|
1015
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : y.H(t, e);
|
|
1016
|
+
},
|
|
1017
|
+
// Hour [0-11]
|
|
1018
|
+
K: function(t, e, n) {
|
|
1019
|
+
const r = t.getHours() % 12;
|
|
1020
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : c(r, e.length);
|
|
1021
|
+
},
|
|
1022
|
+
// Hour [1-24]
|
|
1023
|
+
k: function(t, e, n) {
|
|
1024
|
+
let r = t.getHours();
|
|
1025
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : c(r, e.length);
|
|
1026
|
+
},
|
|
1027
|
+
// Minute
|
|
1028
|
+
m: function(t, e, n) {
|
|
1029
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : y.m(t, e);
|
|
1030
|
+
},
|
|
1031
|
+
// Second
|
|
1032
|
+
s: function(t, e, n) {
|
|
1033
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : y.s(t, e);
|
|
1034
|
+
},
|
|
1035
|
+
// Fraction of second
|
|
1036
|
+
S: function(t, e) {
|
|
1037
|
+
return y.S(t, e);
|
|
1038
|
+
},
|
|
1039
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1040
|
+
X: function(t, e, n) {
|
|
1041
|
+
const r = t.getTimezoneOffset();
|
|
1042
|
+
if (r === 0)
|
|
1043
|
+
return "Z";
|
|
1044
|
+
switch (e) {
|
|
1045
|
+
// Hours and optional minutes
|
|
1046
|
+
case "X":
|
|
1047
|
+
return H(r);
|
|
1048
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1049
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1050
|
+
// so this token always has the same output as `XX`
|
|
1051
|
+
case "XXXX":
|
|
1052
|
+
case "XX":
|
|
1053
|
+
return b(r);
|
|
1054
|
+
// Hours and minutes with `:` delimiter
|
|
1055
|
+
default:
|
|
1056
|
+
return b(r, ":");
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1060
|
+
x: function(t, e, n) {
|
|
1061
|
+
const r = t.getTimezoneOffset();
|
|
1062
|
+
switch (e) {
|
|
1063
|
+
// Hours and optional minutes
|
|
1064
|
+
case "x":
|
|
1065
|
+
return H(r);
|
|
1066
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1067
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1068
|
+
// so this token always has the same output as `xx`
|
|
1069
|
+
case "xxxx":
|
|
1070
|
+
case "xx":
|
|
1071
|
+
return b(r);
|
|
1072
|
+
// Hours and minutes with `:` delimiter
|
|
1073
|
+
default:
|
|
1074
|
+
return b(r, ":");
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
// Timezone (GMT)
|
|
1078
|
+
O: function(t, e, n) {
|
|
1079
|
+
const r = t.getTimezoneOffset();
|
|
1080
|
+
switch (e) {
|
|
1081
|
+
// Short
|
|
1082
|
+
case "O":
|
|
1083
|
+
case "OO":
|
|
1084
|
+
case "OOO":
|
|
1085
|
+
return "GMT" + X(r, ":");
|
|
1086
|
+
default:
|
|
1087
|
+
return "GMT" + b(r, ":");
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
// Timezone (specific non-location)
|
|
1091
|
+
z: function(t, e, n) {
|
|
1092
|
+
const r = t.getTimezoneOffset();
|
|
1093
|
+
switch (e) {
|
|
1094
|
+
// Short
|
|
1095
|
+
case "z":
|
|
1096
|
+
case "zz":
|
|
1097
|
+
case "zzz":
|
|
1098
|
+
return "GMT" + X(r, ":");
|
|
1099
|
+
default:
|
|
1100
|
+
return "GMT" + b(r, ":");
|
|
1101
|
+
}
|
|
1102
|
+
},
|
|
1103
|
+
// Seconds timestamp
|
|
1104
|
+
t: function(t, e, n) {
|
|
1105
|
+
const r = Math.trunc(+t / 1e3);
|
|
1106
|
+
return c(r, e.length);
|
|
1107
|
+
},
|
|
1108
|
+
// Milliseconds timestamp
|
|
1109
|
+
T: function(t, e, n) {
|
|
1110
|
+
return c(+t, e.length);
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
function X(t, e = "") {
|
|
1114
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
|
|
1115
|
+
return o === 0 ? n + String(a) : n + String(a) + e + c(o, 2);
|
|
1116
|
+
}
|
|
1117
|
+
function H(t, e) {
|
|
1118
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + c(Math.abs(t) / 60, 2) : b(t, e);
|
|
1119
|
+
}
|
|
1120
|
+
function b(t, e = "") {
|
|
1121
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = c(Math.trunc(r / 60), 2), o = c(r % 60, 2);
|
|
1122
|
+
return n + a + e + o;
|
|
1123
|
+
}
|
|
1124
|
+
const A = (t, e) => {
|
|
1125
|
+
switch (t) {
|
|
1126
|
+
case "P":
|
|
1127
|
+
return e.date({ width: "short" });
|
|
1128
|
+
case "PP":
|
|
1129
|
+
return e.date({ width: "medium" });
|
|
1130
|
+
case "PPP":
|
|
1131
|
+
return e.date({ width: "long" });
|
|
1132
|
+
default:
|
|
1133
|
+
return e.date({ width: "full" });
|
|
1134
|
+
}
|
|
1135
|
+
}, R = (t, e) => {
|
|
1136
|
+
switch (t) {
|
|
1137
|
+
case "p":
|
|
1138
|
+
return e.time({ width: "short" });
|
|
1139
|
+
case "pp":
|
|
1140
|
+
return e.time({ width: "medium" });
|
|
1141
|
+
case "ppp":
|
|
1142
|
+
return e.time({ width: "long" });
|
|
1143
|
+
default:
|
|
1144
|
+
return e.time({ width: "full" });
|
|
1145
|
+
}
|
|
1146
|
+
}, Ht = (t, e) => {
|
|
1147
|
+
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1148
|
+
if (!a)
|
|
1149
|
+
return A(t, e);
|
|
1150
|
+
let o;
|
|
1151
|
+
switch (r) {
|
|
1152
|
+
case "P":
|
|
1153
|
+
o = e.dateTime({ width: "short" });
|
|
1154
|
+
break;
|
|
1155
|
+
case "PP":
|
|
1156
|
+
o = e.dateTime({ width: "medium" });
|
|
1157
|
+
break;
|
|
1158
|
+
case "PPP":
|
|
1159
|
+
o = e.dateTime({ width: "long" });
|
|
1160
|
+
break;
|
|
1161
|
+
default:
|
|
1162
|
+
o = e.dateTime({ width: "full" });
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
return o.replace("{{date}}", A(r, e)).replace("{{time}}", R(a, e));
|
|
1166
|
+
}, At = {
|
|
1167
|
+
p: R,
|
|
1168
|
+
P: Ht
|
|
1169
|
+
}, It = /^D+$/, Lt = /^Y+$/, Qt = ["D", "DD", "YY", "YYYY"];
|
|
1170
|
+
function jt(t) {
|
|
1171
|
+
return It.test(t);
|
|
1172
|
+
}
|
|
1173
|
+
function Gt(t) {
|
|
1174
|
+
return Lt.test(t);
|
|
1175
|
+
}
|
|
1176
|
+
function Rt(t, e, n) {
|
|
1177
|
+
const r = Bt(t, e, n);
|
|
1178
|
+
if (console.warn(r), Qt.includes(t)) throw new RangeError(r);
|
|
1179
|
+
}
|
|
1180
|
+
function Bt(t, e, n) {
|
|
1181
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1182
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1183
|
+
}
|
|
1184
|
+
function Vt(t) {
|
|
1185
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
1186
|
+
}
|
|
1187
|
+
function Jt(t) {
|
|
1188
|
+
return !(!Vt(t) && typeof t != "number" || isNaN(+l(t)));
|
|
1189
|
+
}
|
|
1190
|
+
const $t = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, zt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ut = /^'([^]*?)'?$/, Kt = /''/g, Zt = /[a-zA-Z]/;
|
|
1191
|
+
function te(t, e, n) {
|
|
1192
|
+
const r = v(), a = r.locale ?? L, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, i = l(t, n?.in);
|
|
1193
|
+
if (!Jt(i))
|
|
1194
|
+
throw new RangeError("Invalid time value");
|
|
1195
|
+
let f = e.match(zt).map((d) => {
|
|
1196
|
+
const u = d[0];
|
|
1197
|
+
if (u === "p" || u === "P") {
|
|
1198
|
+
const h = At[u];
|
|
1199
|
+
return h(d, a.formatLong);
|
|
1200
|
+
}
|
|
1201
|
+
return d;
|
|
1202
|
+
}).join("").match($t).map((d) => {
|
|
1203
|
+
if (d === "''")
|
|
1204
|
+
return { isToken: !1, value: "'" };
|
|
1205
|
+
const u = d[0];
|
|
1206
|
+
if (u === "'")
|
|
1207
|
+
return { isToken: !1, value: ee(d) };
|
|
1208
|
+
if (q[u])
|
|
1209
|
+
return { isToken: !0, value: d };
|
|
1210
|
+
if (u.match(Zt))
|
|
1211
|
+
throw new RangeError(
|
|
1212
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1213
|
+
);
|
|
1214
|
+
return { isToken: !1, value: d };
|
|
1215
|
+
});
|
|
1216
|
+
a.localize.preprocessor && (f = a.localize.preprocessor(i, f));
|
|
1217
|
+
const m = {
|
|
1218
|
+
firstWeekContainsDate: o,
|
|
1219
|
+
weekStartsOn: s,
|
|
1220
|
+
locale: a
|
|
1221
|
+
};
|
|
1222
|
+
return f.map((d) => {
|
|
1223
|
+
if (!d.isToken) return d.value;
|
|
1224
|
+
const u = d.value;
|
|
1225
|
+
(Gt(u) || jt(u)) && Rt(u, e, String(t));
|
|
1226
|
+
const h = q[u[0]];
|
|
1227
|
+
return h(i, u, a.localize, m);
|
|
1228
|
+
}).join("");
|
|
1229
|
+
}
|
|
1230
|
+
function ee(t) {
|
|
1231
|
+
const e = t.match(Ut);
|
|
1232
|
+
return e ? e[1].replace(Kt, "'") : t;
|
|
1233
|
+
}
|
|
1234
|
+
function ne(t) {
|
|
1235
|
+
return g(t, Date.now());
|
|
1236
|
+
}
|
|
1237
|
+
function S(t, e) {
|
|
1238
|
+
const n = +l(t) - +l(e);
|
|
1239
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
1240
|
+
}
|
|
1241
|
+
function re(t, e, n) {
|
|
1242
|
+
const [r, a] = Y(
|
|
1243
|
+
n?.in,
|
|
1244
|
+
t,
|
|
1245
|
+
e
|
|
1246
|
+
), o = r.getFullYear() - a.getFullYear(), s = r.getMonth() - a.getMonth();
|
|
1247
|
+
return o * 12 + s;
|
|
1248
|
+
}
|
|
1249
|
+
function ae(t, e) {
|
|
1250
|
+
const n = l(t, e?.in);
|
|
1251
|
+
return n.setHours(23, 59, 59, 999), n;
|
|
1252
|
+
}
|
|
1253
|
+
function oe(t, e) {
|
|
1254
|
+
const n = l(t, e?.in), r = n.getMonth();
|
|
1255
|
+
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
1256
|
+
}
|
|
1257
|
+
function ie(t, e) {
|
|
1258
|
+
const n = l(t, e?.in);
|
|
1259
|
+
return +ae(n, e) == +oe(n, e);
|
|
1260
|
+
}
|
|
1261
|
+
function se(t, e, n) {
|
|
1262
|
+
const [r, a, o] = Y(
|
|
1263
|
+
n?.in,
|
|
1264
|
+
t,
|
|
1265
|
+
t,
|
|
1266
|
+
e
|
|
1267
|
+
), s = S(a, o), i = Math.abs(
|
|
1268
|
+
re(a, o)
|
|
1269
|
+
);
|
|
1270
|
+
if (i < 1) return 0;
|
|
1271
|
+
a.getMonth() === 1 && a.getDate() > 27 && a.setDate(30), a.setMonth(a.getMonth() - s * i);
|
|
1272
|
+
let f = S(a, o) === -s;
|
|
1273
|
+
ie(r) && i === 1 && S(r, o) === 1 && (f = !1);
|
|
1274
|
+
const m = s * (i - +f);
|
|
1275
|
+
return m === 0 ? 0 : m;
|
|
1276
|
+
}
|
|
1277
|
+
function ce(t) {
|
|
1278
|
+
return (e) => {
|
|
1279
|
+
const r = (t ? Math[t] : Math.trunc)(e);
|
|
1280
|
+
return r === 0 ? 0 : r;
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
function ue(t, e) {
|
|
1284
|
+
return +l(t) - +l(e);
|
|
1285
|
+
}
|
|
1286
|
+
function de(t, e, n) {
|
|
1287
|
+
const r = ue(t, e) / 1e3;
|
|
1288
|
+
return ce(n?.roundingMethod)(r);
|
|
1289
|
+
}
|
|
1290
|
+
function fe(t, e, n) {
|
|
1291
|
+
const r = v(), a = n?.locale ?? r.locale ?? L, o = 2520, s = S(t, e);
|
|
1292
|
+
if (isNaN(s)) throw new RangeError("Invalid time value");
|
|
1293
|
+
const i = Object.assign({}, n, {
|
|
1294
|
+
addSuffix: n?.addSuffix,
|
|
1295
|
+
comparison: s
|
|
1296
|
+
}), [f, m] = Y(
|
|
1297
|
+
n?.in,
|
|
1298
|
+
...s > 0 ? [e, t] : [t, e]
|
|
1299
|
+
), d = de(m, f), u = (W(m) - W(f)) / 1e3, h = Math.round((d - u) / 60);
|
|
1300
|
+
let M;
|
|
1301
|
+
if (h < 2)
|
|
1302
|
+
return n?.includeSeconds ? d < 5 ? a.formatDistance("lessThanXSeconds", 5, i) : d < 10 ? a.formatDistance("lessThanXSeconds", 10, i) : d < 20 ? a.formatDistance("lessThanXSeconds", 20, i) : d < 40 ? a.formatDistance("halfAMinute", 0, i) : d < 60 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", 1, i) : h === 0 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", h, i);
|
|
1303
|
+
if (h < 45)
|
|
1304
|
+
return a.formatDistance("xMinutes", h, i);
|
|
1305
|
+
if (h < 90)
|
|
1306
|
+
return a.formatDistance("aboutXHours", 1, i);
|
|
1307
|
+
if (h < _) {
|
|
1308
|
+
const w = Math.round(h / 60);
|
|
1309
|
+
return a.formatDistance("aboutXHours", w, i);
|
|
1310
|
+
} else {
|
|
1311
|
+
if (h < o)
|
|
1312
|
+
return a.formatDistance("xDays", 1, i);
|
|
1313
|
+
if (h < k) {
|
|
1314
|
+
const w = Math.round(h / _);
|
|
1315
|
+
return a.formatDistance("xDays", w, i);
|
|
1316
|
+
} else if (h < k * 2)
|
|
1317
|
+
return M = Math.round(h / k), a.formatDistance("aboutXMonths", M, i);
|
|
1318
|
+
}
|
|
1319
|
+
if (M = se(m, f), M < 12) {
|
|
1320
|
+
const w = Math.round(h / k);
|
|
1321
|
+
return a.formatDistance("xMonths", w, i);
|
|
1322
|
+
} else {
|
|
1323
|
+
const w = M % 12, F = Math.trunc(M / 12);
|
|
1324
|
+
return w < 3 ? a.formatDistance("aboutXYears", F, i) : w < 9 ? a.formatDistance("overXYears", F, i) : a.formatDistance("almostXYears", F + 1, i);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
function he(t, e) {
|
|
1328
|
+
return fe(t, ne(t), e);
|
|
1329
|
+
}
|
|
1330
|
+
const me = "_timestamp_1hh8y_1", le = "_timestamp_interactive_1hh8y_5", I = {
|
|
1331
|
+
timestamp: me,
|
|
1332
|
+
timestamp_interactive: le
|
|
1333
|
+
}, ge = /* @__PURE__ */ new Date(0), ve = ({
|
|
1334
|
+
date: t,
|
|
1335
|
+
dateFormat: e = "relative",
|
|
1336
|
+
color: n,
|
|
1337
|
+
size: r,
|
|
1338
|
+
className: a
|
|
1339
|
+
}) => {
|
|
1340
|
+
const o = e === "switch", [s, i] = V(
|
|
1341
|
+
() => e === "absolute"
|
|
1342
|
+
), { triggerDate: f, contentDate: m } = we(t, s), d = /* @__PURE__ */ p(
|
|
1343
|
+
J,
|
|
1344
|
+
{
|
|
1345
|
+
color: n,
|
|
1346
|
+
size: r,
|
|
1347
|
+
className: B(I.timestamp, a),
|
|
1348
|
+
children: f
|
|
1349
|
+
}
|
|
1350
|
+
);
|
|
1351
|
+
return /* @__PURE__ */ p(
|
|
1352
|
+
$,
|
|
1353
|
+
{
|
|
1354
|
+
trigger: o ? /* @__PURE__ */ p(
|
|
1355
|
+
z,
|
|
1356
|
+
{
|
|
1357
|
+
render: /* @__PURE__ */ p("button", {}),
|
|
1358
|
+
className: I.timestamp_interactive,
|
|
1359
|
+
onClick: () => i((u) => !u),
|
|
1360
|
+
interactive: "no-fill",
|
|
1361
|
+
role: "switch",
|
|
1362
|
+
tabIndex: 0,
|
|
1363
|
+
"aria-checked": s,
|
|
1364
|
+
onKeyDown: (u) => {
|
|
1365
|
+
(u.code === "Space" || u.code === "Enter") && (u.preventDefault(), i((h) => !h));
|
|
1366
|
+
},
|
|
1367
|
+
children: d
|
|
1368
|
+
}
|
|
1369
|
+
) : /* @__PURE__ */ p("span", { children: d }),
|
|
1370
|
+
children: m
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
};
|
|
1374
|
+
function we(t, e) {
|
|
1375
|
+
const n = ye(t), r = be(t);
|
|
1376
|
+
let a = n, o = r;
|
|
1377
|
+
return e && (a = r, o = n), {
|
|
1378
|
+
contentDate: a,
|
|
1379
|
+
triggerDate: o
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
function ye(t) {
|
|
1383
|
+
return te(new Date(t), "h:mm bbb, MMM dd, yyyy");
|
|
1384
|
+
}
|
|
1385
|
+
function be(t) {
|
|
1386
|
+
const e = new Date(t);
|
|
1387
|
+
return e <= ge ? "a long time ago" : he(e, { addSuffix: !0 });
|
|
1388
|
+
}
|
|
1389
|
+
export {
|
|
1390
|
+
ge as A_LONG_TIME_AGO_DATE,
|
|
1391
|
+
ve as Timestamp
|
|
1392
|
+
};
|