react-working-days-calendar 1.0.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/README.md +317 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +2549 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/react-working-days-calendar.css +2 -0
- package/package.json +84 -0
package/README.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# react-working-days-calendar
|
|
2
|
+
|
|
3
|
+
A fully-featured, timezone-aware working days calendar component for React. Supports event pills, multi-date selection, overflow dialogs, custom renderers, and a mini-calendar date picker โ all with zero UI framework dependencies.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/react-working-days-calendar)
|
|
6
|
+
[](https://github.com/YathuPiraba/working-days-calendar/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install react-working-days-calendar date-fns date-fns-tz
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> **Peer dependencies:** `react >= 17`, `react-dom >= 17`
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import WorkingCalendar from "react-working-days-calendar";
|
|
24
|
+
import "react-working-days-calendar/dist/react-working-days-calendar.css";
|
|
25
|
+
|
|
26
|
+
const events = [
|
|
27
|
+
{
|
|
28
|
+
id: "evt-005",
|
|
29
|
+
// UTC datetime โ tooltip will show "UTC+0" badge
|
|
30
|
+
date: dt(8, "15:00"),
|
|
31
|
+
timezone: "UTC",
|
|
32
|
+
label: "Budget review",
|
|
33
|
+
color: "#E67E22",
|
|
34
|
+
priority: 3,
|
|
35
|
+
data: {
|
|
36
|
+
quarter: "Q2",
|
|
37
|
+
presenter: "Finance team",
|
|
38
|
+
room: "Board room A",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export default function App() {
|
|
44
|
+
return (
|
|
45
|
+
<WorkingCalendar
|
|
46
|
+
legend="Team Calendar"
|
|
47
|
+
events={events}
|
|
48
|
+
onDateClick={(date) => console.log("Clicked:", date)}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- ๐
**Monthly grid view** with week number badges
|
|
59
|
+
- ๐จ **Colored event pills** with auto-contrast foreground text
|
|
60
|
+
- ๐ **Timezone-aware** โ per-event or global IANA timezone support (`date-fns-tz`)
|
|
61
|
+
- ๐ **Event overflow dialog** โ see all events when a cell has more than 2
|
|
62
|
+
- ๐ฑ๏ธ **Hover tooltips** with custom data fields
|
|
63
|
+
- โ
**Multi-date selection** mode with badge counter
|
|
64
|
+
- ๐ **Mini calendar picker** for fast month/year navigation
|
|
65
|
+
- ๐ **Dynamic legend strip** auto-generated from visible events
|
|
66
|
+
- ๐ซ **Disabled dates** support (single or array)
|
|
67
|
+
- ๐ **Custom renderers** for pills and tooltips
|
|
68
|
+
- ๐ฑ **Responsive** โ adapts day headers from full name to single letter
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Props
|
|
73
|
+
|
|
74
|
+
### `WorkingCalendarProps`
|
|
75
|
+
|
|
76
|
+
| Prop | Type | Default | Description |
|
|
77
|
+
| --------------------- | --------------------------------------- | ------- | --------------------------------------------------- |
|
|
78
|
+
| `legend` | `string` | โ | Label shown top-left of the header |
|
|
79
|
+
| `events` | `CalendarEvent[]` | `[]` | Events to display in the grid |
|
|
80
|
+
| `onDateClick` | `(date: string) => void` | โ | Fired when clicking the `+` icon on a cell |
|
|
81
|
+
| `onEventClick` | `(event: CalendarEvent) => void` | โ | Fired when an event pill is clicked |
|
|
82
|
+
| `onMultiSelectDates` | `(dates: string[]) => void` | โ | Fired when Add is clicked in multi-select mode |
|
|
83
|
+
| `onMonthYearChange` | `(month: number, year: number) => void` | โ | Fired on any month navigation (month is 1-indexed) |
|
|
84
|
+
| `multiSelect` | `boolean` | `false` | Enable multi-date selection mode |
|
|
85
|
+
| `multiSelectAddLabel` | `string` | `"Add"` | Label on the Add button in multi-select mode |
|
|
86
|
+
| `disableDate` | `string \| Date \| number` | โ | Single date to disable |
|
|
87
|
+
| `disabledDates` | `Array<string \| Date \| number>` | `[]` | Array of dates to disable |
|
|
88
|
+
| `calendarTimezone` | `string` | local | IANA timezone for events without their own timezone |
|
|
89
|
+
| `hideLegend` | `boolean` | `false` | Hide the legend strip even when events exist |
|
|
90
|
+
| `renderEvent` | `(event, ctx) => ReactNode` | โ | Custom pill renderer |
|
|
91
|
+
| `renderTooltip` | `(event) => ReactNode` | โ | Custom tooltip / overflow detail renderer |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## `CalendarEvent` Shape
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
interface CalendarEvent {
|
|
99
|
+
id: string;
|
|
100
|
+
date: string | Date | number; // 'yyyy-MM-dd' | 'MM/dd/yyyy' | 'dd-MM-yyyy' | ISO | timestamp
|
|
101
|
+
label: string;
|
|
102
|
+
color?: string; // Any valid CSS color: hex, hsl(), rgb(), var(--token)
|
|
103
|
+
priority?: number; // Higher = rendered first. Default: 0
|
|
104
|
+
timezone?: string; // IANA string, e.g. "America/New_York"
|
|
105
|
+
data?: Record<string, unknown>; // Passed through to renderEvent / renderTooltip
|
|
106
|
+
onClick?: (event: CalendarEvent) => void;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Date Formats Supported
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
date: "2026-03-21"; // yyyy-MM-dd โ
|
|
116
|
+
date: "03/21/2026"; // MM/dd/yyyy โ
|
|
117
|
+
date: "21-03-2026"; // dd-MM-yyyy โ
|
|
118
|
+
date: new Date(2026, 2, 21); // JS Date โ
|
|
119
|
+
date: 1742515200000; // timestamp โ
|
|
120
|
+
date: "2026-03-21T09:00:00+05:30"; // ISO + offset โ
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Timezone Support
|
|
126
|
+
|
|
127
|
+
Events are placed on the calendar day they occur in a specific timezone, regardless of the viewer's local clock.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
const events = [
|
|
131
|
+
{
|
|
132
|
+
id: "ny-standup",
|
|
133
|
+
date: "2026-03-21T09:00:00-05:00",
|
|
134
|
+
timezone: "America/New_York",
|
|
135
|
+
label: "NY Standup",
|
|
136
|
+
color: "#3B8BD4",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "colombo-call",
|
|
140
|
+
date: "2026-03-21T08:30:00+05:30",
|
|
141
|
+
timezone: "Asia/Colombo",
|
|
142
|
+
label: "Colombo Call",
|
|
143
|
+
color: "#9B59B6",
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
// Or set a global timezone for all events that don't specify their own
|
|
148
|
+
<WorkingCalendar calendarTimezone="Asia/Colombo" events={events} />;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Custom Renderers
|
|
154
|
+
|
|
155
|
+
### Custom Event Pill
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
<WorkingCalendar
|
|
159
|
+
events={events}
|
|
160
|
+
renderEvent={(event, ctx) => (
|
|
161
|
+
<div
|
|
162
|
+
style={{
|
|
163
|
+
background: event.color,
|
|
164
|
+
padding: "2px 6px",
|
|
165
|
+
borderRadius: 4,
|
|
166
|
+
color: "#fff",
|
|
167
|
+
fontSize: 12,
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
๐ {event.label}
|
|
171
|
+
</div>
|
|
172
|
+
)}
|
|
173
|
+
/>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Custom Tooltip / Detail Panel
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
<WorkingCalendar
|
|
180
|
+
events={events}
|
|
181
|
+
renderTooltip={(event) => (
|
|
182
|
+
<div>
|
|
183
|
+
<strong>{event.label}</strong>
|
|
184
|
+
<p>Owner: {event.data?.owner as string}</p>
|
|
185
|
+
<p>Time: {event.data?.time as string}</p>
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
/>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Multi-Select Mode
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
<WorkingCalendar
|
|
197
|
+
multiSelect
|
|
198
|
+
multiSelectAddLabel="Schedule"
|
|
199
|
+
onMultiSelectDates={(dates) => {
|
|
200
|
+
// dates: ['2026-03-10', '2026-03-14', ...]
|
|
201
|
+
console.log("Selected dates:", dates);
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Disabled Dates
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
<WorkingCalendar
|
|
212
|
+
disabledDates={["2026-03-25", new Date(2026, 2, 26)]}
|
|
213
|
+
disableDate="2026-03-20"
|
|
214
|
+
/>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Fetch Events on Month Change
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
const [events, setEvents] = useState([]);
|
|
223
|
+
|
|
224
|
+
<WorkingCalendar
|
|
225
|
+
events={events}
|
|
226
|
+
onMonthYearChange={(month, year) => {
|
|
227
|
+
fetchEventsFromAPI(month, year).then(setEvents);
|
|
228
|
+
}}
|
|
229
|
+
/>;
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## TypeScript
|
|
235
|
+
|
|
236
|
+
All types are exported:
|
|
237
|
+
|
|
238
|
+
```ts
|
|
239
|
+
import type {
|
|
240
|
+
CalendarEvent,
|
|
241
|
+
WorkingCalendarProps,
|
|
242
|
+
EventRenderContext,
|
|
243
|
+
} from "react-working-days-calendar";
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## CSS Customization
|
|
249
|
+
|
|
250
|
+
The component uses CSS custom properties. Override them in your global stylesheet to theme the calendar:
|
|
251
|
+
|
|
252
|
+
```css
|
|
253
|
+
:root {
|
|
254
|
+
--wc-today-bg: #ede9fe; /* Today cell highlight */
|
|
255
|
+
--wc-today-color: #5b21b6; /* Today circle color */
|
|
256
|
+
--wc-weekend-bg: #f9fafb; /* Weekend column background */
|
|
257
|
+
--wc-disabled-bg: #f3f4f6; /* Disabled date background */
|
|
258
|
+
--wc-border: #e5e7eb; /* Grid border color */
|
|
259
|
+
--wc-header-bg: #ffffff; /* Header background */
|
|
260
|
+
--wc-selected-bg: #ede9fe; /* Multi-select selected cell */
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Local Development
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
git clone https://github.com/YathuPiraba/working-days-calendar.git
|
|
270
|
+
cd working-days-calendar
|
|
271
|
+
npm install
|
|
272
|
+
|
|
273
|
+
# Run the demo app
|
|
274
|
+
npm run dev
|
|
275
|
+
|
|
276
|
+
# Build the library for publishing
|
|
277
|
+
npm run build:lib
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Publishing a New Version
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# 1. Install the new dev dep (first time only)
|
|
286
|
+
npm install --save-dev vite-plugin-dts
|
|
287
|
+
|
|
288
|
+
# 2. Bump version in package.json
|
|
289
|
+
npm version patch # or: minor | major
|
|
290
|
+
|
|
291
|
+
# 3. Build + publish to npm
|
|
292
|
+
npm publish --access public
|
|
293
|
+
|
|
294
|
+
# 4. Push the version tag to GitHub
|
|
295
|
+
git push --follow-tags
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Changelog
|
|
301
|
+
|
|
302
|
+
### 1.0.0
|
|
303
|
+
|
|
304
|
+
- Initial release
|
|
305
|
+
- Monthly grid with event pills, overflow dialog, tooltips
|
|
306
|
+
- Timezone-aware event placement via `date-fns-tz`
|
|
307
|
+
- Multi-date selection mode
|
|
308
|
+
- Mini calendar picker
|
|
309
|
+
- Custom `renderEvent` and `renderTooltip` slots
|
|
310
|
+
- Dynamic legend strip
|
|
311
|
+
- Disabled dates support
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## License
|
|
316
|
+
|
|
317
|
+
MIT ยฉ [YathuPiraba](https://github.com/YathuPiraba)
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
|
package/dist/icons.svg
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<symbol id="bluesky-icon" viewBox="0 0 16 17">
|
|
3
|
+
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
|
|
4
|
+
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
|
|
5
|
+
</symbol>
|
|
6
|
+
<symbol id="discord-icon" viewBox="0 0 20 19">
|
|
7
|
+
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
|
|
8
|
+
</symbol>
|
|
9
|
+
<symbol id="documentation-icon" viewBox="0 0 21 20">
|
|
10
|
+
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
|
|
11
|
+
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
|
|
12
|
+
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
|
|
13
|
+
</symbol>
|
|
14
|
+
<symbol id="github-icon" viewBox="0 0 19 19">
|
|
15
|
+
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
|
|
16
|
+
</symbol>
|
|
17
|
+
<symbol id="social-icon" viewBox="0 0 20 20">
|
|
18
|
+
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
|
|
19
|
+
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
|
|
20
|
+
</symbol>
|
|
21
|
+
<symbol id="x-icon" viewBox="0 0 19 19">
|
|
22
|
+
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
|
|
23
|
+
</symbol>
|
|
24
|
+
</svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`react`),t=require(`react/jsx-runtime`);var n=365.2425,r=6048e5,i=864e5,a=6e4,o=36e5,s=3600*24;s*7,s*n/12*3;var c=Symbol.for(`constructDateFrom`);function l(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&c in e?e[c](t):e instanceof Date?new e.constructor(t):new Date(t)}function u(e,t){return l(t||e,e)}function d(e,t,n){let r=u(e,n?.in);if(isNaN(t))return l(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=l(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function f(e,t){let n=u(e,t?.in).getDay();return n===0||n===6}var p={};function m(){return p}function h(e,t){let n=m(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=u(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function g(e,t){return h(e,{...t,weekStartsOn:1})}function _(e,t){let n=u(e,t?.in),r=n.getFullYear(),i=l(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=g(i),o=l(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=g(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function v(e){let t=u(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function y(e,...t){let n=l.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function b(e,t){let n=u(e,t?.in);return n.setHours(0,0,0,0),n}function x(e,t,n){let[r,a]=y(n?.in,e,t),o=b(r),s=b(a),c=+o-v(o),l=+s-v(s);return Math.round((c-l)/i)}function S(e,t){let n=_(e,t),r=l(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),g(r)}function ee(e){return l(e,Date.now())}function C(e,t,n){let[r,i]=y(n?.in,e,t);return+b(r)==+b(i)}function te(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function w(e){return!(!te(e)&&typeof e!=`number`||isNaN(+u(e)))}function ne(e,t){let n=u(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function T(e,t){let[n,r]=y(e,t.start,t.end);return{start:n,end:r}}function re(e,t){let{start:n,end:r}=T(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(l(n,o)),o.setDate(o.getDate()+s),o.setHours(0,0,0,0);return i?c.reverse():c}function ie(e,t){let n=u(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function E(e,t){let n=u(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ae(e,t){let n=m(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=u(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}var oe={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},D=(e,t,n)=>{let r,i=oe[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function O(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var k={date:O({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:O({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:O({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},se={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},A=(e,t,n,r)=>se[e];function j(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var ce={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:j({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:j({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:j({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:j({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:j({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function M(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ue(s,e=>e.test(o)):le(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function le(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ue(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function de(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var fe={code:`en-US`,formatDistance:D,formatLong:k,formatRelative:A,localize:ce,match:{ordinalNumber:de({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:M({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:M({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:M({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:M({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:M({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function pe(e,t){let n=u(e,t?.in);return x(n,E(n))+1}function N(e,t){let n=u(e,t?.in),i=g(n)-+S(n);return Math.round(i/r)+1}function P(e,t){let n=u(e,t?.in),r=n.getFullYear(),i=m(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=l(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=h(o,t),c=l(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let d=h(c,t);return+n>=+s?r+1:+n>=+d?r:r-1}function F(e,t){let n=m(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=P(e,t),a=l(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),h(a,t)}function me(e,t){let n=u(e,t?.in),i=h(n,t)-+F(n,t);return Math.round(i/r)+1}function I(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var L={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return I(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):I(n+1,2)},d(e,t){return I(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return I(e.getHours()%12||12,t.length)},H(e,t){return I(e.getHours(),t.length)},m(e,t){return I(e.getMinutes(),t.length)},s(e,t){return I(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return I(Math.trunc(r*10**(n-3)),t.length)}},R={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},he={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return L.y(e,t)},Y:function(e,t,n,r){let i=P(e,r),a=i>0?i:1-i;return t===`YY`?I(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):I(a,t.length)},R:function(e,t){return I(_(e),t.length)},u:function(e,t){return I(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return I(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return I(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return L.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return I(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=me(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):I(i,t.length)},I:function(e,t,n){let r=N(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):I(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):L.d(e,t)},D:function(e,t,n){let r=pe(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):I(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return I(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return I(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return I(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?R.noon:r===0?R.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?R.evening:r>=12?R.afternoon:r>=4?R.morning:R.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return L.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):L.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):I(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):I(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):L.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):L.s(e,t)},S:function(e,t){return L.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return _e(r);case`XXXX`:case`XX`:return z(r);default:return z(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return _e(r);case`xxxx`:case`xx`:return z(r);default:return z(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+ge(r,`:`);default:return`GMT`+z(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+ge(r,`:`);default:return`GMT`+z(r,`:`)}},t:function(e,t,n){return I(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return I(+e,t.length)}};function ge(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+I(a,2)}function _e(e,t){return e%60==0?(e>0?`-`:`+`)+I(Math.abs(e)/60,2):z(e,t)}function z(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=I(Math.trunc(r/60),2),a=I(r%60,2);return n+i+t+a}var ve=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},ye=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},be={p:ye,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return ve(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,ve(r,t)).replace(`{{time}}`,ye(i,t))}},xe=/^D+$/,Se=/^Y+$/,Ce=[`D`,`DD`,`YY`,`YYYY`];function we(e){return xe.test(e)}function Te(e){return Se.test(e)}function Ee(e,t,n){let r=De(e,t,n);if(console.warn(r),Ce.includes(e))throw RangeError(r)}function De(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Oe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ke=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ae=/^'([^]*?)'?$/,je=/''/g,Me=/[a-zA-Z]/;function B(e,t,n){let r=m(),i=n?.locale??r.locale??fe,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=u(e,n?.in);if(!w(s))throw RangeError(`Invalid time value`);let c=t.match(ke).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=be[t];return n(e,i.formatLong)}return e}).join(``).match(Oe).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Ne(e)};if(he[t])return{isToken:!0,value:e};if(t.match(Me))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Te(a)||!n?.useAdditionalDayOfYearTokens&&we(a))&&Ee(a,t,String(e));let o=he[a[0]];return o(s,a,i.localize,l)}).join(``)}function Ne(e){let t=e.match(Ae);return t?t[1].replace(je,`'`):e}function Pe(e,t){return u(e,t?.in).getDay()}function Fe(){return Object.assign({},m())}function Ie(e,t){return C(l(t?.in||e,e),ee(t?.in||e))}function Le(e,t){let n=()=>l(t?.in,NaN),r=t?.additionalDigits??2,i=Ve(e),a;if(i.date){let e=He(i.date,r);a=Ue(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=We(i.time),isNaN(s)))return n();if(i.timezone){if(c=Ge(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=u(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return u(o+s+c,t?.in)}var V={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Re=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ze=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Be=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ve(e){let t={},n=e.split(V.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],V.timeZoneDelimiter.test(t.date)&&(t.date=e.split(V.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=V.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function He(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function Ue(e,t){if(t===null)return new Date(NaN);let n=e.match(Re);if(!n)return new Date(NaN);let r=!!n[4],i=H(n[1]),a=H(n[2])-1,o=H(n[3]),s=H(n[4]),c=H(n[5])-1;if(r)return Ze(t,s,c)?Ke(t,s,c):new Date(NaN);{let e=new Date(0);return!Ye(t,a,o)||!Xe(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function H(e){return e?parseInt(e):1}function We(e){let t=e.match(ze);if(!t)return NaN;let n=U(t[1]),r=U(t[2]),i=U(t[3]);return Qe(n,r,i)?n*o+r*a+i*1e3:NaN}function U(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Ge(e){if(e===`Z`)return 0;let t=e.match(Be);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return $e(r,i)?n*(r*o+i*a):NaN}function Ke(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var qe=[31,null,31,30,31,30,31,31,30,31,30,31];function Je(e){return e%400==0||e%4==0&&e%100!=0}function Ye(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(qe[t]||(Je(e)?29:28))}function Xe(e,t){return t>=1&&t<=(Je(e)?366:365)}function Ze(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Qe(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function $e(e,t){return t>=0&&t<=59}function et(e,t,n){let r=Fe(),i=rt(e,n.timeZone,n.locale??r.locale);return`formatToParts`in i?tt(i,t):nt(i,t)}function tt(e,t){let n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if(n[e].type===`timeZoneName`)return n[e].value}function nt(e,t){let n=e.format(t).replace(/\u200E/g,``),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):``}function rt(e,t,n){return new Intl.DateTimeFormat(n?[n.code,`en-US`]:void 0,{timeZone:t,timeZoneName:e})}function it(e,t){let n=ut(t);return`formatToParts`in n?ot(n,e):st(n,e)}var at={year:0,month:1,day:2,hour:3,minute:4,second:5};function ot(e,t){try{let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let t=at[n[e].type];t!==void 0&&(r[t]=parseInt(n[e].value,10))}return r}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function st(e,t){let n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}var W={},ct=new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:`America/New_York`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).format(new Date(`2014-06-25T04:00:00.123Z`)),lt=ct===`06/25/2014, 00:00:00`||ct===`โ06โ/โ25โ/โ2014โ โ00โ:โ00โ:โ00`;function ut(e){return W[e]||(W[e]=lt?new Intl.DateTimeFormat(`en-US`,{hourCycle:`h23`,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`numeric`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})),W[e]}function dt(e,t,n,r,i,a,o){let s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,i,a,o),s}var ft=36e5,pt=6e4,G={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function K(e,t,n){if(!e)return 0;let r=G.timezoneZ.exec(e);if(r)return 0;let i,a;if(r=G.timezoneHH.exec(e),r)return i=parseInt(r[1],10),gt(i)?-(i*ft):NaN;if(r=G.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);let e=parseInt(r[3],10);return gt(i,e)?(a=Math.abs(i)*ft+e*pt,r[1]===`+`?-a:a):NaN}if(vt(e)){t=new Date(t||Date.now());let r=q(n?t:mt(t),e);return-(n?r:ht(t,r,e))}return NaN}function mt(e){return dt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function q(e,t){let n=it(e,t),r=dt(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),i=e.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function ht(e,t,n){let r=e.getTime()-t,i=q(new Date(r),n);if(t===i)return t;r-=i-t;let a=q(new Date(r),n);return i===a?i:Math.max(i,a)}function gt(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}var _t={};function vt(e){if(_t[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),_t[e]=!0,!0}catch{return!1}}var yt=60*1e3,bt={X:function(e,t,n){let r=J(n.timeZone,e);if(r===0)return`Z`;switch(t){case`X`:return xt(r);case`XXXX`:case`XX`:return X(r);default:return X(r,`:`)}},x:function(e,t,n){let r=J(n.timeZone,e);switch(t){case`x`:return xt(r);case`xxxx`:case`xx`:return X(r);default:return X(r,`:`)}},O:function(e,t,n){let r=J(n.timeZone,e);switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+St(r,`:`);default:return`GMT`+X(r,`:`)}},z:function(e,t,n){switch(t){case`z`:case`zz`:case`zzz`:return et(`short`,e,n);default:return et(`long`,e,n)}}};function J(e,t){let n=e?K(e,t,!0)/yt:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw RangeError(`Invalid time zone specified: `+e);return n}function Y(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString();for(;r.length<t;)r=`0`+r;return n+r}function X(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Y(Math.floor(r/60),2),a=Y(Math.floor(r%60),2);return n+i+t+a}function xt(e,t){return e%60==0?(e>0?`-`:`+`)+Y(Math.abs(e)/60,2):X(e,t)}function St(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.floor(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Y(a,2)}function Ct(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-+t}var wt=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Tt=36e5,Et=6e4,Dt=2,Z={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:wt};function Ot(e,t={}){if(arguments.length<1)throw TypeError(`1 argument required, but only `+arguments.length+` present`);if(e===null)return new Date(NaN);let n=t.additionalDigits==null?Dt:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw RangeError(`additionalDigits must be 0, 1 or 2`);if(e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`)return new Date(e.getTime());if(typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`)return new Date(e);if(Object.prototype.toString.call(e)!==`[object String]`)return new Date(NaN);let r=kt(e),{year:i,restDateString:a}=At(r.date,n),o=jt(a,i);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){let e=o.getTime(),n=0,i;if(r.time&&(n=Mt(r.time),n===null||isNaN(n)))return new Date(NaN);if(r.timeZone||t.timeZone){if(i=K(r.timeZone||t.timeZone,new Date(e+n)),isNaN(i))return new Date(NaN)}else i=Ct(new Date(e+n)),i=Ct(new Date(e+n+i));return new Date(e+n+i)}else return new Date(NaN)}function kt(e){let t={},n=Z.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=Z.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){let e=Z.timeZone.exec(r);e?(t.time=r.replace(e[1],``),t.timeZone=e[1].trim()):t.time=r}return t}function At(e,t){if(e){let n=Z.YYY[t],r=Z.YYYYY[t],i=Z.YYYY.exec(e)||r.exec(e);if(i){let t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=Z.YY.exec(e)||n.exec(e),i){let t=i[1];return{year:parseInt(t,10)*100,restDateString:e.slice(t.length)}}}return{year:null}}function jt(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=Z.MM.exec(e);if(a)return n=new Date(0),r=parseInt(a[1],10)-1,Lt(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(a=Z.DDD.exec(e),a){n=new Date(0);let e=parseInt(a[1],10);return Rt(t,e)?(n.setUTCFullYear(t,0,e),n):new Date(NaN)}if(a=Z.MMDD.exec(e),a){n=new Date(0),r=parseInt(a[1],10)-1;let e=parseInt(a[2],10);return Lt(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(a=Z.Www.exec(e),a)return i=parseInt(a[1],10)-1,zt(i)?Nt(t,i):new Date(NaN);if(a=Z.WwwD.exec(e),a){i=parseInt(a[1],10)-1;let e=parseInt(a[2],10)-1;return zt(i,e)?Nt(t,i,e):new Date(NaN)}return null}function Mt(e){let t,n,r=Z.HH.exec(e);if(r)return t=parseFloat(r[1].replace(`,`,`.`)),Bt(t)?t%24*Tt:NaN;if(r=Z.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(`,`,`.`)),Bt(t,n)?t%24*Tt+n*Et:NaN;if(r=Z.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);let e=parseFloat(r[3].replace(`,`,`.`));return Bt(t,n,e)?t%24*Tt+n*Et+e*1e3:NaN}return null}function Nt(e,t,n){t||=0,n||=0;let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Pt=[31,28,31,30,31,30,31,31,30,31,30,31],Ft=[31,29,31,30,31,30,31,31,30,31,30,31];function It(e){return e%400==0||e%4==0&&e%100!=0}function Lt(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;let r=It(e);if(r&&n>Ft[t]||!r&&n>Pt[t])return!1}return!0}function Rt(e,t){if(t<1)return!1;let n=It(e);return!(n&&t>366||!n&&t>365)}function zt(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Bt(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}var Vt=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ht(e,t,n={}){t=String(t);let r=t.match(Vt);if(r){let i=Ot(n.originalDate||e,n);t=r.reduce(function(e,t){if(t[0]===`'`)return e;let r=e.indexOf(t),a=e[r-1]===`'`,o=e.replace(t,`'`+bt[t[0]](i,t,n)+`'`);return a?o.substring(0,r-1)+o.substring(r+1):o},t)}return B(e,t,n)}function Ut(e,t,n){e=Ot(e,n);let r=K(t,e,!0),i=new Date(e.getTime()-r),a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}function Wt(e,t,n,r){return r={...r,timeZone:t,originalDate:e},Ht(Ut(e,t,{timeZone:r.timeZone}),n,r)}var Q=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return`UTC`}})();function Gt(e){try{if(e instanceof Date)return w(e)?e:null;if(typeof e==`number`){let t=new Date(e);return w(t)?t:null}if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let t=Le(e);return w(t)?t:null}if(/^\d{4}-\d{2}-\d{2}T/.test(e)){let t=Le(e);return w(t)?t:null}if(/^\d{2}\/\d{2}\/\d{4}$/.test(e)){let[t,n,r]=e.split(`/`),i=new Date(`${r}-${t}-${n}`);return w(i)?i:null}if(/^\d{2}-\d{2}-\d{4}$/.test(e)){let[t,n,r]=e.split(`-`),i=new Date(`${r}-${n}-${t}`);return w(i)?i:null}let t=new Date(e);return w(t)?t:null}catch{return null}}function Kt(e,t=Q){let n=Gt(e);if(!n)return null;try{return B(Ut(n,t),`yyyy-MM-dd`)}catch{return w(n)?B(n,`yyyy-MM-dd`):null}}function qt(e,t,n){let r=Gt(e);if(!r)return null;try{return Wt(r,t,n)}catch{return null}}function Jt(e,t=new Date){try{let n=Wt(t,e,`xxx`),r=n[0]===`-`?`โ`:`+`,[i,a]=n.slice(1).split(`:`),o=parseInt(i,10),s=parseInt(a,10),c=s===0?`UTC${r}${o}`:`UTC${r}${o}:${a}`;return e===`UTC`||e.startsWith(`UTC+`)||e.startsWith(`UTC-`)||o===0&&s===0?``:c}catch{return``}}function $(e,t){return e??t??Q}function Yt(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.id!=`string`||t.id.trim()===``||!(typeof t.date==`string`||t.date instanceof Date||typeof t.date==`number`)||typeof t.label!=`string`||t.color!==void 0&&typeof t.color!=`string`||t.data!==void 0&&(typeof t.data!=`object`||Array.isArray(t.data))||t.priority!==void 0&&typeof t.priority!=`number`||t.onClick!==void 0&&typeof t.onClick!=`function`)}function Xt(e){let t=[],n=[];for(let r of e)Yt(r)?t.push(r):n.push(r);return{valid:t,invalid:n}}var Zt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Qt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function $t(e){try{let t=document.createElement(`canvas`);t.width=t.height=1;let n=t.getContext(`2d`);if(!n)return`#ffffff`;n.fillStyle=e,n.fillRect(0,0,1,1);let[r,i,a]=n.getImageData(0,0,1,1).data;return(.299*r+.587*i+.114*a)/255>.55?`#1a1a1a`:`#ffffff`}catch{return`#ffffff`}}function en(e){try{return new Date(e+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}catch{return e}}function tn({currentMonth:n,currentYear:r,onSelect:i,onClose:a,anchorRef:o}){let[s,c]=(0,e.useState)(String(n+1).padStart(2,`0`)),[l,u]=(0,e.useState)(String(r)),[d,f]=(0,e.useState)(n),[p,m]=(0,e.useState)(r),h=(0,e.useRef)(null),g=(0,e.useRef)(null),_=(0,e.useRef)(null),v=Array.from({length:101},(e,t)=>r-50+t);(0,e.useEffect)(()=>{h.current&&h.current.querySelector(`.selected`)?.scrollIntoView({block:`center`}),g.current&&g.current.querySelector(`.selected`)?.scrollIntoView({block:`center`})},[]),(0,e.useEffect)(()=>{let e=e=>{_.current&&!_.current.contains(e.target)&&o.current&&!o.current.contains(e.target)&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a,o]);let y=e=>{c(e);let t=parseInt(e,10);!isNaN(t)&&t>=1&&t<=12&&f(t-1)},b=e=>{u(e);let t=parseInt(e,10);!isNaN(t)&&e.length>=4&&(m(v.includes(t)?t:r),m(t))},x=e=>{f(e),c(String(e+1).padStart(2,`0`))},S=e=>{m(e),u(String(e))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:`mini-cal-overlay`}),(0,t.jsxs)(`div`,{className:`mini-cal-popup`,ref:_,children:[(0,t.jsxs)(`div`,{className:`mini-cal-inputs`,children:[(0,t.jsxs)(`div`,{className:`mini-cal-input-group`,children:[(0,t.jsx)(`label`,{children:`Month (1โ12)`}),(0,t.jsx)(`input`,{type:`number`,min:1,max:12,value:s,onChange:e=>y(e.target.value)})]}),(0,t.jsxs)(`div`,{className:`mini-cal-input-group`,children:[(0,t.jsx)(`label`,{children:`Year (any)`}),(0,t.jsx)(`input`,{type:`number`,value:l,onChange:e=>b(e.target.value)})]})]}),(0,t.jsx)(`div`,{className:`mini-cal-divider`,children:`Scroll`}),(0,t.jsxs)(`div`,{className:`mini-cal-scrollers`,children:[(0,t.jsxs)(`div`,{className:`mini-cal-scroll-col`,children:[(0,t.jsx)(`h4`,{children:`Month`}),(0,t.jsx)(`div`,{className:`mini-cal-scroll-list`,ref:h,children:Qt.map((e,n)=>(0,t.jsx)(`div`,{className:`mini-cal-scroll-item${d===n?` selected`:``}`,onClick:()=>x(n),children:e},e))})]}),(0,t.jsxs)(`div`,{className:`mini-cal-scroll-col`,children:[(0,t.jsx)(`h4`,{children:`Year`}),(0,t.jsx)(`div`,{className:`mini-cal-scroll-list`,ref:g,children:v.map(e=>(0,t.jsx)(`div`,{className:`mini-cal-scroll-item${p===e?` selected`:``}`,onClick:()=>S(e),children:e},e))})]})]}),(0,t.jsxs)(`button`,{className:`mini-cal-go`,onClick:()=>{let e=parseInt(l,10);i(d,isNaN(e)?p:e),a()},children:[`Go to `,Qt[d].slice(0,3),` `,parseInt(l,10)||p]})]})]})}function nn({event:e,onEventClick:n,calendarTimezone:r,eventActionLabel:i=`Open event`}){let a=e.color??`#6366f1`,o=$(e.timezone,r),s=o!==Q||e.timezone,c=s?Jt(o):null,l=typeof e.date==`string`&&e.date.includes(`T`)?qt(e.date,o,`MMM d, yyyy ยท h:mm a`):null;return(0,t.jsxs)(`div`,{className:`wc-od-detail`,children:[(0,t.jsx)(`div`,{className:`wc-od-detail-accent`,style:{background:a}}),(0,t.jsxs)(`div`,{className:`wc-od-detail-body`,children:[(0,t.jsxs)(`div`,{className:`wc-od-detail-title-row`,children:[(0,t.jsx)(`span`,{className:`wc-od-detail-dot`,style:{background:a}}),(0,t.jsx)(`h3`,{className:`wc-od-detail-title`,children:e.label})]}),s&&(0,t.jsxs)(`div`,{className:`wc-od-tz-badge`,children:[(0,t.jsx)(`span`,{className:`wc-od-tz-name`,children:o}),c&&(0,t.jsx)(`span`,{className:`wc-od-tz-offset`,children:c})]}),l&&(0,t.jsx)(`div`,{className:`wc-od-time`,children:l}),e.data&&Object.keys(e.data).length>0?(0,t.jsx)(`dl`,{className:`wc-od-detail-data`,children:Object.entries(e.data).map(([e,n])=>(0,t.jsxs)(`div`,{className:`wc-od-detail-row`,children:[(0,t.jsx)(`dt`,{className:`wc-od-detail-key`,children:e}),(0,t.jsx)(`dd`,{className:`wc-od-detail-val`,children:typeof n==`object`?JSON.stringify(n):String(n)})]},e))}):(0,t.jsx)(`p`,{className:`wc-od-detail-empty`,children:`No additional details`}),n&&(0,t.jsx)(`button`,{className:`wc-od-detail-action`,style:{borderColor:a,color:a},onClick:()=>n(e),children:i})]})]})}function rn({dateKey:n,events:r,anchorRef:i,onClose:a,onEventClick:o,renderTooltip:s,calendarTimezone:c,eventActionLabel:l}){let[u,d]=(0,e.useState)(r[0]?.id??``),[f,p]=(0,e.useState)({}),m=(0,e.useRef)(null),h=r.find(e=>e.id===u)??r[0];(0,e.useEffect)(()=>{if(!i.current||!m.current)return;let e=i.current.getBoundingClientRect(),t=m.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,a=e.bottom+8,o=e.left;a+t.height>r-16&&(a=e.top-t.height-8),o+t.width>n-16&&(o=n-t.width-16),o<8&&(o=8),p({top:a,left:o})},[i]),(0,e.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a()},t=e=>{m.current&&!m.current.contains(e.target)&&a()};return document.addEventListener(`keydown`,e),document.addEventListener(`mousedown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`mousedown`,t)}},[a]);let g=e=>{d(e.id)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:`wc-od-backdrop`,onClick:a}),(0,t.jsxs)(`div`,{ref:m,className:`wc-od-book`,style:f,role:`dialog`,"aria-modal":`true`,"aria-label":`Events for ${n}`,children:[(0,t.jsxs)(`div`,{className:`wc-od-spine`,children:[(0,t.jsxs)(`div`,{className:`wc-od-spine-header`,children:[(0,t.jsx)(`span`,{className:`wc-od-date-label`,children:en(n)}),(0,t.jsxs)(`span`,{className:`wc-od-count`,children:[r.length,` events`]})]}),(0,t.jsx)(`ul`,{className:`wc-od-list`,role:`listbox`,"aria-label":`Event list`,children:r.map(e=>{let n=e.color??`#6366f1`,r=e.id===u;return(0,t.jsxs)(`li`,{role:`option`,"aria-selected":r,className:`wc-od-list-item${r?` active`:``}`,onMouseEnter:()=>g(e),children:[(0,t.jsx)(`span`,{className:`wc-od-bullet`,style:{background:n}}),(0,t.jsx)(`span`,{className:`wc-od-item-label`,children:e.label}),r&&(0,t.jsx)(`span`,{className:`wc-od-item-arrow`,"aria-hidden":`true`,children:`โบ`})]},e.id)})})]}),(0,t.jsx)(`div`,{className:`wc-od-crease`,"aria-hidden":`true`}),(0,t.jsx)(`div`,{className:`wc-od-page`,children:h?s?(0,t.jsx)(`div`,{className:`wc-od-custom-detail`,children:s(h)}):(0,t.jsx)(nn,{event:h,onEventClick:o,calendarTimezone:c,eventActionLabel:l}):(0,t.jsx)(`div`,{className:`wc-od-empty`,children:`No event selected`})},h?.id),(0,t.jsx)(`button`,{className:`wc-od-close`,onClick:a,"aria-label":`Close dialog`,children:`ร`})]})]})}function an({event:n,trackIndex:r,dateKey:i,renderEvent:a,renderTooltip:o,onEventClick:s,calendarTimezone:c}){let[l,u]=(0,e.useState)(!1),[d,f]=(0,e.useState)({}),p=(0,e.useRef)(null),m=(0,e.useRef)(null),h=n.color??`#6366f1`,g=(0,e.useMemo)(()=>$t(h),[h]),_=(0,e.useCallback)(()=>u(!0),[]),v=(0,e.useCallback)(()=>u(!1),[]);(0,e.useEffect)(()=>{if(!l||!p.current||!m.current)return;let e=p.current.getBoundingClientRect(),t=m.current.offsetHeight,n=m.current.offsetWidth,r=window.innerWidth,i=window.innerHeight-e.bottom<t+12?e.top-t-6:e.bottom+6,a=e.left;a+n>r-12&&(a=r-n-12),a<8&&(a=8),f({position:`fixed`,top:i,left:a,zIndex:9999})},[l]);let y=a?a(n,{dateKey:i,trackIndex:r,tooltipOpen:l}):(0,t.jsx)(`div`,{className:`wc-event-pill`,style:{background:h,color:g},children:(0,t.jsx)(`span`,{className:`wc-event-label`,children:n.label})}),b=o?o(n):(0,t.jsx)(on,{event:n,calendarTimezone:c});return(0,t.jsxs)(`div`,{ref:p,className:`wc-event-track`,onMouseEnter:_,onMouseLeave:v,onClick:(0,e.useCallback)(e=>{e.stopPropagation(),s?.(n),n.onClick?.(n)},[n,s]),children:[y,l&&(0,t.jsx)(`div`,{ref:m,className:`wc-tooltip`,style:d,role:`tooltip`,children:b})]})}function on({event:e,calendarTimezone:n}){let r=e.color??`#6366f1`,i=$(e.timezone,n),a=i!==Q||e.timezone,o=a?Jt(i):null,s=typeof e.date==`string`&&e.date.includes(`T`)?qt(e.date,i,`MMM d, yyyy ยท h:mm a`):null;return(0,t.jsxs)(`div`,{className:`wc-tooltip-inner`,children:[(0,t.jsxs)(`div`,{className:`wc-tooltip-header`,children:[(0,t.jsx)(`span`,{className:`wc-tooltip-dot`,style:{background:r}}),(0,t.jsx)(`span`,{className:`wc-tooltip-title`,children:e.label})]}),a&&(0,t.jsxs)(`div`,{className:`wc-tooltip-tz`,children:[(0,t.jsx)(`span`,{className:`wc-tooltip-tz-name`,title:i,children:i}),o&&(0,t.jsx)(`span`,{className:`wc-tooltip-tz-offset`,children:o})]}),s&&(0,t.jsx)(`div`,{className:`wc-tooltip-time`,children:s}),e.data&&Object.keys(e.data).length>0&&(0,t.jsx)(`dl`,{className:`wc-tooltip-data`,children:Object.entries(e.data).map(([e,n])=>(0,t.jsxs)(`div`,{className:`wc-tooltip-row`,children:[(0,t.jsx)(`dt`,{className:`wc-tooltip-key`,children:e}),(0,t.jsx)(`dd`,{className:`wc-tooltip-val`,children:typeof n==`object`?JSON.stringify(n):String(n)})]},e))})]})}function sn({events:n}){let r=(0,e.useMemo)(()=>{let e=new Set,t=[];for(let r of n){let n=r.color??`#6366f1`,i=`${n}::${r.label}`;e.has(i)||(e.add(i),t.push({color:n,label:r.label}))}return t},[n]);return r.length===0?null:(0,t.jsx)(`div`,{className:`wc-legend`,children:r.map(({color:e,label:n})=>(0,t.jsxs)(`div`,{className:`wc-legend-item`,children:[(0,t.jsx)(`span`,{className:`wc-legend-dot`,style:{background:e}}),(0,t.jsx)(`span`,{className:`wc-legend-label`,children:n})]},`${e}::${n}`))})}function cn({dayKey:n,hiddenCount:r,allCellEvents:i,onOpen:a}){let o=(0,e.useRef)(null);return(0,t.jsxs)(`button`,{ref:o,className:`wc-overflow-chip`,onClick:e=>{e.stopPropagation(),a(o)},"aria-label":`${r} more events`,children:[`+`,r,` more`]})}function ln({legend:n,disableDate:r,disabledDates:i=[],multiSelect:a=!1,onMultiSelectDates:o,onDateClick:s,events:c=[],renderEvent:l,renderTooltip:u,onEventClick:p,hideLegend:m=!1,calendarTimezone:g,multiSelectAddLabel:_=`Add`,onMonthYearChange:v}){let y=new Date,[b,x]=(0,e.useState)(new Date(y.getFullYear(),y.getMonth(),1)),[S,ee]=(0,e.useState)(!1),[C,te]=(0,e.useState)(new Set),w=(0,e.useRef)(null),T=(0,e.useCallback)(e=>{x(e),v?.(e.getMonth()+1,e.getFullYear())},[v]),E=(0,e.useMemo)(()=>{let{valid:e,invalid:t}=Xt(c);return t.length,e},[c]),oe=(0,e.useMemo)(()=>{let e=new Map;for(let t of E){let n=$(t.timezone,g),r=Kt(t.date,n);r&&(e.has(r)||e.set(r,[]),e.get(r).push(t))}for(let[t,n]of e)e.set(t,[...n].sort((e,t)=>(t.priority??0)-(e.priority??0)));return e},[E]),D=(0,e.useMemo)(()=>{let e=[...i];r!==void 0&&e.push(r);let t=g??Q;return new Set(e.map(e=>Kt(e,t)).filter(e=>e!==null))},[r,i,g]),O=ie(b),k=ne(b),se=re({start:h(O,{weekStartsOn:0}),end:ae(k,{weekStartsOn:0})}),A=[];for(let e=0;e<se.length;e+=7)A.push(se.slice(e,e+7));let j=()=>T(d(b,-1)),ce=()=>T(d(b,1)),M=()=>T(new Date(y.getFullYear(),y.getMonth(),1)),le=(e,t)=>T(new Date(t,e,1)),ue=e=>e<O||e>k,de=e=>{let t=B(e,`yyyy-MM-dd`);D.has(t)||te(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},fe=()=>{let e=Array.from(C).filter(e=>!D.has(e)).sort();o?.(e)},pe=()=>te(new Set),[N,P]=(0,e.useState)(null),F=(0,e.useMemo)(()=>{let e=B(O,`yyyy-MM-dd`),t=B(k,`yyyy-MM-dd`);return E.filter(n=>{let r=$(n.timezone,g),i=Kt(n.date,r);return i?i>=e&&i<=t:!1})},[E,O,k,g]),I=!m&&F.length>0;return(0,t.jsxs)(`div`,{className:`wc-wrapper`,children:[(0,t.jsxs)(`div`,{className:`wc-header-bar`,children:[(0,t.jsx)(`span`,{className:`wc-title`,children:n??``}),(0,t.jsxs)(`div`,{className:`wc-nav`,children:[(0,t.jsx)(`button`,{className:`wc-nav-btn`,onClick:j,"aria-label":`Previous month`,children:`โน`}),(0,t.jsxs)(`div`,{style:{position:`relative`},children:[(0,t.jsxs)(`button`,{ref:w,className:`wc-month-btn${S?` active`:``}`,onClick:()=>ee(e=>!e),"aria-expanded":S,children:[B(b,`MMMM yyyy`),(0,t.jsx)(`svg`,{width:`10`,height:`6`,viewBox:`0 0 10 6`,fill:`none`,children:(0,t.jsx)(`path`,{d:`M1 1l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),S&&(0,t.jsx)(tn,{currentMonth:b.getMonth(),currentYear:b.getFullYear(),onSelect:le,onClose:()=>ee(!1),anchorRef:w})]}),(0,t.jsx)(`button`,{className:`wc-nav-btn`,onClick:ce,"aria-label":`Next month`,children:`โบ`})]}),(0,t.jsxs)(`div`,{className:`wc-header-actions`,children:[(0,t.jsx)(`button`,{className:`wc-today-btn`,onClick:M,children:`Today`}),a&&(0,t.jsxs)(t.Fragment,{children:[C.size>0&&(0,t.jsxs)(`button`,{className:`wc-clear-btn`,onClick:pe,children:[`Clear (`,C.size,`)`]}),(0,t.jsxs)(`button`,{className:`wc-header-add-btn`,disabled:C.size===0,onClick:fe,children:[(0,t.jsx)(`span`,{className:`wc-header-add-icon`,children:`+`}),_,C.size>0&&(0,t.jsx)(`span`,{className:`wc-add-badge`,children:C.size})]})]})]})]}),(0,t.jsxs)(`div`,{className:`wc-calendar`,children:[(0,t.jsx)(`div`,{className:`wc-day-headers`,children:Zt.map((e,n)=>(0,t.jsxs)(`div`,{className:`wc-day-header${n===0||n===6?` weekend`:``}`,children:[(0,t.jsx)(`span`,{className:`wc-day-full`,children:e}),(0,t.jsx)(`span`,{className:`wc-day-short`,children:e.charAt(0)})]},e))}),(0,t.jsx)(`div`,{className:`wc-grid`,children:A.map((e,n)=>e.map(e=>{let r=ue(e),i=f(e),o=Ie(e),c=n===A.length-1,d=me(e),m=Pe(e)===0,h=B(e,`yyyy-MM-dd`),_=!r&&D.has(h),v=a&&C.has(h),y=r?[]:oe.get(h)??[],b=y.length>0,x=y.slice(0,2),S=y.slice(2);return(0,t.jsxs)(`div`,{className:[`wc-cell`,r?`outside`:``,i&&!r?`weekend-cell`:``,o?`today`:``,c?`last-row`:``,_?`disabled`:``,a&&!r&&!_?`selectable`:``,v?`selected`:``,b?`has-events`:``].filter(Boolean).join(` `),onClick:()=>{a&&!r&&!_&&de(e)},children:[(0,t.jsxs)(`div`,{className:`wc-cell-top`,children:[(0,t.jsx)(`span`,{className:`wc-day-num`,children:B(e,`d`)}),!a&&!r&&!_&&s&&(0,t.jsx)(`button`,{className:`wc-add-btn${b?` wc-edit-btn`:``}`,"aria-label":b?`Edit events on ${B(e,`PPP`)}`:`Add event on ${B(e,`PPP`)}`,onClick:e=>{e.stopPropagation(),s(h)},children:b?(0,t.jsx)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,t.jsx)(`path`,{d:`M8.5 1.5a1.414 1.414 0 0 1 2 2L3.5 10.5l-3 .5.5-3L8.5 1.5z`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`})}):`+`}),v&&(0,t.jsx)(`span`,{className:`wc-check-tick`,"aria-hidden":`true`,children:`โ`})]}),x.length>0&&(0,t.jsx)(`div`,{className:`wc-events`,children:x.map((e,n)=>(0,t.jsx)(an,{event:e,trackIndex:n,dateKey:h,renderEvent:l,renderTooltip:u,onEventClick:p,calendarTimezone:g},e.id))}),S.length>0&&(0,t.jsx)(cn,{dayKey:h,hiddenCount:S.length,allCellEvents:y,onOpen:e=>P({dateKey:h,events:y,anchorRef:e})}),_&&(0,t.jsx)(`span`,{className:`wc-disabled-line`,"aria-hidden":`true`}),m&&!r&&(0,t.jsxs)(`span`,{className:`wc-week-badge`,children:[`W`,d]})]},e.toISOString())}))})]}),I&&(0,t.jsx)(sn,{events:F}),N&&(0,t.jsx)(rn,{dateKey:N.dateKey,events:N.events,anchorRef:N.anchorRef,onClose:()=>P(null),onEventClick:p,renderTooltip:u,calendarTimezone:g})]})}exports.WorkingCalendar=ln,exports.default=ln;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|