@arbidocs/blocks 0.4.127 → 0.4.129
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 +21 -7
- package/dist/{StreamedArtifactEditor-EEYAXJ4H.cjs → StreamedArtifactEditor-TQAND4H5.cjs} +6 -5
- package/dist/StreamedArtifactEditor-TQAND4H5.cjs.map +1 -0
- package/dist/{StreamedArtifactEditor-TDATDYD2.js → StreamedArtifactEditor-XQNANTWM.js} +4 -3
- package/dist/StreamedArtifactEditor-XQNANTWM.js.map +1 -0
- package/dist/agents/index.cjs +213 -213
- package/dist/agents/index.js +2 -2
- package/dist/artifacts/ArtifactCodeView.d.ts +6 -0
- package/dist/artifacts/ArtifactPreview.d.ts +22 -0
- package/dist/artifacts/index.cjs +50 -21
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +2 -1
- package/dist/artifacts/sandbox-policy.d.ts +34 -0
- package/dist/artifacts/sandboxDocument.d.ts +7 -0
- package/dist/calendar/index.cjs +156 -243
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.js +8 -151
- package/dist/calendar/index.js.map +1 -1
- package/dist/chat/index.cjs +90 -73
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/index.js +3 -2
- package/dist/chat/open-document.d.ts +66 -0
- package/dist/{chunk-INW76PEL.cjs → chunk-2YV7FBLO.cjs} +175 -2
- package/dist/chunk-2YV7FBLO.cjs.map +1 -0
- package/dist/{chunk-DZI7WOUD.cjs → chunk-3BJLNKOB.cjs} +6 -2
- package/dist/chunk-3BJLNKOB.cjs.map +1 -0
- package/dist/{chunk-KELGOCJA.js → chunk-65S53MZK.js} +174 -5
- package/dist/chunk-65S53MZK.js.map +1 -0
- package/dist/{chunk-T6I6ZCBE.js → chunk-6BTCDKCK.js} +6 -3
- package/dist/chunk-6BTCDKCK.js.map +1 -0
- package/dist/{chunk-ZLRQ5K77.cjs → chunk-7423V6RM.cjs} +6 -3
- package/dist/chunk-7423V6RM.cjs.map +1 -0
- package/dist/{chunk-6Z72CXZR.js → chunk-CJBN5HIS.js} +6 -2
- package/dist/chunk-CJBN5HIS.js.map +1 -0
- package/dist/{chunk-XFKF3WRN.cjs → chunk-DZYAAL4H.cjs} +2 -2
- package/dist/{chunk-XFKF3WRN.cjs.map → chunk-DZYAAL4H.cjs.map} +1 -1
- package/dist/chunk-GYCQ3FNL.js +60 -0
- package/dist/chunk-GYCQ3FNL.js.map +1 -0
- package/dist/{chunk-UUXKB3WQ.js → chunk-H2KQ6OSU.js} +2 -2
- package/dist/{chunk-UUXKB3WQ.js.map → chunk-H2KQ6OSU.js.map} +1 -1
- package/dist/{chunk-T2CVFK2I.js → chunk-HSFLEVZY.js} +3 -3
- package/dist/{chunk-T2CVFK2I.js.map → chunk-HSFLEVZY.js.map} +1 -1
- package/dist/{chunk-MCPRNDOJ.cjs → chunk-JLTXVW25.cjs} +3 -3
- package/dist/{chunk-MCPRNDOJ.cjs.map → chunk-JLTXVW25.cjs.map} +1 -1
- package/dist/chunk-NS4JD2VR.js +22 -0
- package/dist/chunk-NS4JD2VR.js.map +1 -0
- package/dist/chunk-SWQX6CTT.cjs +65 -0
- package/dist/chunk-SWQX6CTT.cjs.map +1 -0
- package/dist/chunk-TGJNPKST.js +153 -0
- package/dist/chunk-TGJNPKST.js.map +1 -0
- package/dist/chunk-TGWTLNXW.cjs +177 -0
- package/dist/chunk-TGWTLNXW.cjs.map +1 -0
- package/dist/chunk-VG24E4JJ.cjs +26 -0
- package/dist/chunk-VG24E4JJ.cjs.map +1 -0
- package/dist/components/DroppableContainer.d.ts +6 -0
- package/dist/components/GridRowNavigator.d.ts +29 -0
- package/dist/components/LoadingIndicator.d.ts +21 -0
- package/dist/components/RowNavigatorControls.d.ts +29 -0
- package/dist/components/SharedCell.d.ts +27 -0
- package/dist/connect/docx.cjs +4 -3
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.js +3 -2
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +22 -20
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +12 -10
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/mail/types.d.ts +2 -6
- package/dist/facts/index.cjs +5 -23
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.d.ts +0 -1
- package/dist/facts/index.js +6 -22
- package/dist/facts/index.js.map +1 -1
- package/dist/index.cjs +616 -417
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +189 -11
- package/dist/index.js.map +1 -1
- package/dist/sandboxDocument-JLEETIWW.js +71 -0
- package/dist/sandboxDocument-JLEETIWW.js.map +1 -0
- package/dist/sandboxDocument-WQUNODSC.cjs +76 -0
- package/dist/sandboxDocument-WQUNODSC.cjs.map +1 -0
- package/dist/settings/DraggableHeader.d.ts +10 -0
- package/dist/settings/FilterChip.d.ts +15 -0
- package/dist/settings/MessageJsonTree.d.ts +7 -0
- package/dist/settings/index.cjs +248 -5
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +3 -0
- package/dist/settings/index.js +247 -7
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/message-schema-hints.d.ts +19 -0
- package/dist/studio/index.cjs +3 -2
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +2 -1
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +9 -9
- package/dist/workflow-canvas/index.js +2 -2
- package/dist/workspaces/index.cjs +39 -0
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +1 -0
- package/dist/workspaces/index.js +36 -1
- package/dist/workspaces/index.js.map +1 -1
- package/dist/workspaces/workspace-type.d.ts +29 -0
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +6 -5
- package/src/docx/README.md +7 -3
- package/dist/StreamedArtifactEditor-EEYAXJ4H.cjs.map +0 -1
- package/dist/StreamedArtifactEditor-TDATDYD2.js.map +0 -1
- package/dist/chunk-6Z72CXZR.js.map +0 -1
- package/dist/chunk-DZI7WOUD.cjs.map +0 -1
- package/dist/chunk-INW76PEL.cjs.map +0 -1
- package/dist/chunk-KELGOCJA.js.map +0 -1
- package/dist/chunk-T6I6ZCBE.js.map +0 -1
- package/dist/chunk-ZLRQ5K77.cjs.map +0 -1
- package/dist/facts/timezone.d.ts +0 -4
package/dist/calendar/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var chunkTGWTLNXW_cjs = require('../chunk-TGWTLNXW.cjs');
|
|
4
5
|
require('../chunk-DES3K4SD.cjs');
|
|
5
6
|
var react = require('react');
|
|
6
7
|
var FullCalendar = require('@fullcalendar/react');
|
|
@@ -12,9 +13,9 @@ var multiMonthPlugin = require('@fullcalendar/multimonth');
|
|
|
12
13
|
var lucideReact = require('lucide-react');
|
|
13
14
|
var ui = require('@arbidocs/react/ui');
|
|
14
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
15
|
-
var temporalPolyfill = require('temporal-polyfill');
|
|
16
16
|
var core = require('@fullcalendar/core');
|
|
17
17
|
var internal = require('@fullcalendar/core/internal');
|
|
18
|
+
var temporalPolyfill = require('temporal-polyfill');
|
|
18
19
|
|
|
19
20
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
21
|
|
|
@@ -316,160 +317,15 @@ function ColorSwatches({
|
|
|
316
317
|
))
|
|
317
318
|
] });
|
|
318
319
|
}
|
|
319
|
-
var pad2 = (n) => String(n).padStart(2, "0");
|
|
320
|
-
var pad4 = (n) => String(n).padStart(4, "0");
|
|
321
|
-
function isValidTimeZone(zone) {
|
|
322
|
-
if (!zone) return false;
|
|
323
|
-
try {
|
|
324
|
-
temporalPolyfill.Temporal.Now.instant().toZonedDateTimeISO(zone);
|
|
325
|
-
return true;
|
|
326
|
-
} catch {
|
|
327
|
-
return false;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
function safeZone(zone, fallback = "UTC") {
|
|
331
|
-
if (isValidTimeZone(zone)) return zone;
|
|
332
|
-
return isValidTimeZone(fallback) ? fallback : "UTC";
|
|
333
|
-
}
|
|
334
|
-
function toPlainDateTime(wall) {
|
|
335
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(wall) ? temporalPolyfill.Temporal.PlainDate.from(wall).toPlainDateTime() : temporalPolyfill.Temporal.PlainDateTime.from(wall);
|
|
336
|
-
}
|
|
337
|
-
function wallToUtc(wall, zone) {
|
|
338
|
-
const zdt = toPlainDateTime(wall).toZonedDateTime(safeZone(zone), {
|
|
339
|
-
disambiguation: "compatible"
|
|
340
|
-
});
|
|
341
|
-
return zdt.toInstant().toString();
|
|
342
|
-
}
|
|
343
|
-
function wallToEpochMs(wall, zone) {
|
|
344
|
-
return toPlainDateTime(wall).toZonedDateTime(safeZone(zone), { disambiguation: "compatible" }).epochMilliseconds;
|
|
345
|
-
}
|
|
346
|
-
function instantOf(utc) {
|
|
347
|
-
if (typeof utc === "number") return temporalPolyfill.Temporal.Instant.fromEpochMilliseconds(utc);
|
|
348
|
-
if (utc instanceof Date) return temporalPolyfill.Temporal.Instant.fromEpochMilliseconds(utc.getTime());
|
|
349
|
-
return temporalPolyfill.Temporal.Instant.from(utc);
|
|
350
|
-
}
|
|
351
|
-
function zoned(utc, zone) {
|
|
352
|
-
return instantOf(utc).toZonedDateTimeISO(safeZone(zone));
|
|
353
|
-
}
|
|
354
|
-
function utcToWall(utc, zone) {
|
|
355
|
-
const z = zoned(utc, zone);
|
|
356
|
-
return `${pad4(z.year)}-${pad2(z.month)}-${pad2(z.day)}T${pad2(z.hour)}:${pad2(z.minute)}`;
|
|
357
|
-
}
|
|
358
|
-
function utcToDate(utc, zone) {
|
|
359
|
-
const z = zoned(utc, zone);
|
|
360
|
-
return `${pad4(z.year)}-${pad2(z.month)}-${pad2(z.day)}`;
|
|
361
|
-
}
|
|
362
|
-
function utcToTime(utc, zone) {
|
|
363
|
-
const z = zoned(utc, zone);
|
|
364
|
-
return `${pad2(z.hour)}:${pad2(z.minute)}`;
|
|
365
|
-
}
|
|
366
|
-
function convertWall(wall, fromZone, toZone) {
|
|
367
|
-
return utcToWall(wallToUtc(wall, fromZone), toZone);
|
|
368
|
-
}
|
|
369
|
-
function todayInZone(zone, now = Date.now()) {
|
|
370
|
-
return utcToDate(now, zone);
|
|
371
|
-
}
|
|
372
|
-
function addDays(date, days) {
|
|
373
|
-
return temporalPolyfill.Temporal.PlainDate.from(date).add({ days }).toString();
|
|
374
|
-
}
|
|
375
|
-
function addMonths(date, months) {
|
|
376
|
-
return temporalPolyfill.Temporal.PlainDate.from(date).add({ months }).toString();
|
|
377
|
-
}
|
|
378
|
-
function diffDays(a, b) {
|
|
379
|
-
return temporalPolyfill.Temporal.PlainDate.from(a).until(temporalPolyfill.Temporal.PlainDate.from(b), { largestUnit: "days" }).days;
|
|
380
|
-
}
|
|
381
|
-
function dayOfWeekSun0(date) {
|
|
382
|
-
return temporalPolyfill.Temporal.PlainDate.from(date).dayOfWeek % 7;
|
|
383
|
-
}
|
|
384
|
-
function startOfWeek(date, weekStart) {
|
|
385
|
-
const back = (dayOfWeekSun0(date) - weekStart + 7) % 7;
|
|
386
|
-
return addDays(date, -back);
|
|
387
|
-
}
|
|
388
|
-
function isoWeekNumber(date) {
|
|
389
|
-
return temporalPolyfill.Temporal.PlainDate.from(date).weekOfYear ?? 1;
|
|
390
|
-
}
|
|
391
|
-
function zoneOffsetMinutes(zone, at = Date.now()) {
|
|
392
|
-
return Math.round(zoned(at, zone).offsetNanoseconds / 6e10);
|
|
393
|
-
}
|
|
394
|
-
function zoneOffsetLabel(zone, at = Date.now()) {
|
|
395
|
-
const total = zoneOffsetMinutes(zone, at);
|
|
396
|
-
if (total === 0) return "GMT";
|
|
397
|
-
const sign = total > 0 ? "+" : "-";
|
|
398
|
-
const abs = Math.abs(total);
|
|
399
|
-
const h = Math.floor(abs / 60);
|
|
400
|
-
const m = abs % 60;
|
|
401
|
-
return `GMT${sign}${h}${m ? `:${pad2(m)}` : ""}`;
|
|
402
|
-
}
|
|
403
|
-
function zoneCity(zone) {
|
|
404
|
-
const last = zone.split("/").pop() ?? zone;
|
|
405
|
-
return last.replace(/_/g, " ");
|
|
406
|
-
}
|
|
407
|
-
function listTimeZones() {
|
|
408
|
-
try {
|
|
409
|
-
const fn = Intl.supportedValuesOf;
|
|
410
|
-
const zones = fn ? fn("timeZone") : [];
|
|
411
|
-
if (zones.length) return zones.includes("UTC") ? zones : ["UTC", ...zones];
|
|
412
|
-
} catch {
|
|
413
|
-
}
|
|
414
|
-
return [
|
|
415
|
-
"UTC",
|
|
416
|
-
"Europe/London",
|
|
417
|
-
"Europe/Paris",
|
|
418
|
-
"Europe/Berlin",
|
|
419
|
-
"America/New_York",
|
|
420
|
-
"America/Chicago",
|
|
421
|
-
"America/Denver",
|
|
422
|
-
"America/Los_Angeles",
|
|
423
|
-
"Asia/Tokyo",
|
|
424
|
-
"Asia/Singapore",
|
|
425
|
-
"Australia/Sydney"
|
|
426
|
-
];
|
|
427
|
-
}
|
|
428
|
-
function detectTimeZone() {
|
|
429
|
-
try {
|
|
430
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
431
|
-
} catch {
|
|
432
|
-
return "UTC";
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
function formatInZone(utc, zone, options, locale) {
|
|
436
|
-
const ms = instantOf(utc).epochMilliseconds;
|
|
437
|
-
return new Intl.DateTimeFormat(locale, { ...options, timeZone: safeZone(zone) }).format(ms);
|
|
438
|
-
}
|
|
439
|
-
function formatPlainDate(date, options, locale) {
|
|
440
|
-
return new Intl.DateTimeFormat(locale, { ...options, timeZone: "UTC" }).format(
|
|
441
|
-
Date.parse(`${date}T12:00:00Z`)
|
|
442
|
-
);
|
|
443
|
-
}
|
|
444
|
-
function epochToWallArray(ms, zone) {
|
|
445
|
-
const z = temporalPolyfill.Temporal.Instant.fromEpochMilliseconds(ms).toZonedDateTimeISO(zone);
|
|
446
|
-
return [z.year, z.month - 1, z.day, z.hour, z.minute, z.second, z.millisecond];
|
|
447
|
-
}
|
|
448
|
-
function wallArrayOffset(a, zone) {
|
|
449
|
-
const norm = new Date(
|
|
450
|
-
Date.UTC(a[0], a[1] ?? 0, a[2] ?? 1, a[3] ?? 0, a[4] ?? 0, a[5] ?? 0, a[6] ?? 0)
|
|
451
|
-
);
|
|
452
|
-
const pdt = new temporalPolyfill.Temporal.PlainDateTime(
|
|
453
|
-
norm.getUTCFullYear(),
|
|
454
|
-
norm.getUTCMonth() + 1,
|
|
455
|
-
norm.getUTCDate(),
|
|
456
|
-
norm.getUTCHours(),
|
|
457
|
-
norm.getUTCMinutes(),
|
|
458
|
-
norm.getUTCSeconds(),
|
|
459
|
-
norm.getUTCMilliseconds()
|
|
460
|
-
);
|
|
461
|
-
const zdt = pdt.toZonedDateTime(zone, { disambiguation: "compatible" });
|
|
462
|
-
return Math.round(zdt.offsetNanoseconds / 6e10);
|
|
463
|
-
}
|
|
464
320
|
var temporalZonePlugin = null;
|
|
465
321
|
function getTemporalTimeZonePlugin() {
|
|
466
322
|
if (!temporalZonePlugin) {
|
|
467
323
|
class TemporalNamedTimeZone extends internal.NamedTimeZoneImpl {
|
|
468
324
|
offsetForArray(a) {
|
|
469
|
-
return wallArrayOffset(a, this.timeZoneName);
|
|
325
|
+
return chunkTGWTLNXW_cjs.wallArrayOffset(a, this.timeZoneName);
|
|
470
326
|
}
|
|
471
327
|
timestampToArray(ms) {
|
|
472
|
-
return epochToWallArray(ms, this.timeZoneName);
|
|
328
|
+
return chunkTGWTLNXW_cjs.epochToWallArray(ms, this.timeZoneName);
|
|
473
329
|
}
|
|
474
330
|
}
|
|
475
331
|
temporalZonePlugin = core.createPlugin({
|
|
@@ -555,9 +411,9 @@ function toEventInput(e, zone) {
|
|
|
555
411
|
extendedProps: { grid: e }
|
|
556
412
|
};
|
|
557
413
|
if (e.allDay) {
|
|
558
|
-
const start = e.startDate ?? utcToDate(e.startUtc, zone);
|
|
559
|
-
const end = e.endDate ?? (e.endUtc ? utcToDate(e.endUtc, zone) : addDays(start, 1));
|
|
560
|
-
return { ...base, allDay: true, start, end: end > start ? end : addDays(start, 1) };
|
|
414
|
+
const start = e.startDate ?? chunkTGWTLNXW_cjs.utcToDate(e.startUtc, zone);
|
|
415
|
+
const end = e.endDate ?? (e.endUtc ? chunkTGWTLNXW_cjs.utcToDate(e.endUtc, zone) : chunkTGWTLNXW_cjs.addDays(start, 1));
|
|
416
|
+
return { ...base, allDay: true, start, end: end > start ? end : chunkTGWTLNXW_cjs.addDays(start, 1) };
|
|
561
417
|
}
|
|
562
418
|
return { ...base, allDay: false, start: e.startUtc, end: e.endUtc };
|
|
563
419
|
}
|
|
@@ -663,8 +519,8 @@ function CalendarGrid({
|
|
|
663
519
|
keyboardShortcuts = true
|
|
664
520
|
}) {
|
|
665
521
|
const labels = react.useMemo(() => mergeLabels(labelOverrides), [labelOverrides]);
|
|
666
|
-
const zone = safeZone(timeZone);
|
|
667
|
-
const secondZone = secondaryTimeZone && secondaryTimeZone !== zone && isValidTimeZone(secondaryTimeZone) ? secondaryTimeZone : "";
|
|
522
|
+
const zone = chunkTGWTLNXW_cjs.safeZone(timeZone);
|
|
523
|
+
const secondZone = secondaryTimeZone && secondaryTimeZone !== zone && chunkTGWTLNXW_cjs.isValidTimeZone(secondaryTimeZone) ? secondaryTimeZone : "";
|
|
668
524
|
const rootRef = react.useRef(null);
|
|
669
525
|
const calRef = react.useRef(null);
|
|
670
526
|
const [narrow, setNarrow] = react.useState(false);
|
|
@@ -707,7 +563,7 @@ function CalendarGrid({
|
|
|
707
563
|
a.changeView(fcView, date);
|
|
708
564
|
return;
|
|
709
565
|
}
|
|
710
|
-
if (utcToDate(a.getDate(), zone) !== date) a.gotoDate(date);
|
|
566
|
+
if (chunkTGWTLNXW_cjs.utcToDate(a.getDate(), zone) !== date) a.gotoDate(date);
|
|
711
567
|
}, [api, effective, date, zone]);
|
|
712
568
|
const fcEvents = react.useMemo(() => events.map((e) => toEventInput(e, zone)), [events, zone]);
|
|
713
569
|
const changeView = react.useCallback(
|
|
@@ -724,7 +580,7 @@ function CalendarGrid({
|
|
|
724
580
|
if (!a) return;
|
|
725
581
|
if (dir === "prev") a.prev();
|
|
726
582
|
else if (dir === "next") a.next();
|
|
727
|
-
else a.gotoDate(utcToDate(Date.now(), zone));
|
|
583
|
+
else a.gotoDate(chunkTGWTLNXW_cjs.utcToDate(Date.now(), zone));
|
|
728
584
|
},
|
|
729
585
|
[api, zone]
|
|
730
586
|
);
|
|
@@ -758,7 +614,7 @@ function CalendarGrid({
|
|
|
758
614
|
const onDatesSet = react.useCallback(
|
|
759
615
|
(arg) => {
|
|
760
616
|
setTitle(arg.view.title);
|
|
761
|
-
const anchor = utcToDate(arg.view.calendar.getDate(), zone);
|
|
617
|
+
const anchor = chunkTGWTLNXW_cjs.utcToDate(arg.view.calendar.getDate(), zone);
|
|
762
618
|
const kind = VIEW_OF_FC[arg.view.type] ?? effective;
|
|
763
619
|
const key = `${kind}|${arg.start.toISOString()}|${arg.end.toISOString()}|${anchor}`;
|
|
764
620
|
if (key === lastRange.current) return;
|
|
@@ -799,7 +655,7 @@ function CalendarGrid({
|
|
|
799
655
|
const start = event.start;
|
|
800
656
|
if (event.allDay) {
|
|
801
657
|
const startDate = event.startStr.slice(0, 10);
|
|
802
|
-
const endDate = event.endStr ? event.endStr.slice(0, 10) : addDays(startDate, 1);
|
|
658
|
+
const endDate = event.endStr ? event.endStr.slice(0, 10) : chunkTGWTLNXW_cjs.addDays(startDate, 1);
|
|
803
659
|
const end2 = event.end ?? new Date(start.getTime() + 864e5);
|
|
804
660
|
cb.current.onEventChange({
|
|
805
661
|
instanceId: g.instanceId,
|
|
@@ -828,7 +684,7 @@ function CalendarGrid({
|
|
|
828
684
|
if (!secondZone) return arg.text;
|
|
829
685
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "arbi-cal-slot-labels", children: [
|
|
830
686
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-slot-secondary", children: (() => {
|
|
831
|
-
const t = convertWall(`${date}T${utcToTime(arg.date, zone)}`, zone, secondZone).slice(
|
|
687
|
+
const t = chunkTGWTLNXW_cjs.convertWall(`${date}T${chunkTGWTLNXW_cjs.utcToTime(arg.date, zone)}`, zone, secondZone).slice(
|
|
832
688
|
11,
|
|
833
689
|
16
|
|
834
690
|
);
|
|
@@ -843,8 +699,8 @@ function CalendarGrid({
|
|
|
843
699
|
(arg) => {
|
|
844
700
|
if (!secondZone) return arg.text;
|
|
845
701
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "arbi-cal-slot-labels arbi-cal-zone-labels", children: [
|
|
846
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-slot-secondary", title: secondZone, children: zoneOffsetLabel(secondZone) }),
|
|
847
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-slot-primary", title: zone, children: zoneOffsetLabel(zone) })
|
|
702
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-slot-secondary", title: secondZone, children: chunkTGWTLNXW_cjs.zoneOffsetLabel(secondZone) }),
|
|
703
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-slot-primary", title: zone, children: chunkTGWTLNXW_cjs.zoneOffsetLabel(zone) })
|
|
848
704
|
] });
|
|
849
705
|
},
|
|
850
706
|
[secondZone, zone]
|
|
@@ -854,8 +710,8 @@ function CalendarGrid({
|
|
|
854
710
|
const t = arg.view.type;
|
|
855
711
|
if (!t.startsWith("timeGrid") && t !== "arbiWorkWeek") return arg.text;
|
|
856
712
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("arbi-cal-dayhead", arg.isToday && "arbi-cal-dayhead-today"), children: [
|
|
857
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-dayhead-dow", children: formatInZone(arg.date, zone, { weekday: "short" }) }),
|
|
858
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-dayhead-num", children: formatInZone(arg.date, zone, { day: "numeric" }) })
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-dayhead-dow", children: chunkTGWTLNXW_cjs.formatInZone(arg.date, zone, { weekday: "short" }) }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "arbi-cal-dayhead-num", children: chunkTGWTLNXW_cjs.formatInZone(arg.date, zone, { day: "numeric" }) })
|
|
859
715
|
] });
|
|
860
716
|
},
|
|
861
717
|
[zone]
|
|
@@ -972,13 +828,13 @@ function CalendarGrid({
|
|
|
972
828
|
className: "hidden text-xs text-muted-foreground md:inline",
|
|
973
829
|
"data-testid": "calendar-zones",
|
|
974
830
|
children: [
|
|
975
|
-
zoneCity(zone),
|
|
831
|
+
chunkTGWTLNXW_cjs.zoneCity(zone),
|
|
976
832
|
" ",
|
|
977
|
-
zoneOffsetLabel(zone),
|
|
833
|
+
chunkTGWTLNXW_cjs.zoneOffsetLabel(zone),
|
|
978
834
|
" \xB7 ",
|
|
979
|
-
zoneCity(secondZone),
|
|
835
|
+
chunkTGWTLNXW_cjs.zoneCity(secondZone),
|
|
980
836
|
" ",
|
|
981
|
-
zoneOffsetLabel(secondZone)
|
|
837
|
+
chunkTGWTLNXW_cjs.zoneOffsetLabel(secondZone)
|
|
982
838
|
]
|
|
983
839
|
}
|
|
984
840
|
),
|
|
@@ -1106,13 +962,13 @@ function MiniMonth({
|
|
|
1106
962
|
if (view.for !== date) setView({ for: date, month: `${date.slice(0, 7)}-01` });
|
|
1107
963
|
const month = view.for === date ? view.month : `${date.slice(0, 7)}-01`;
|
|
1108
964
|
const setMonth = (m) => setView({ for: date, month: m });
|
|
1109
|
-
const today = todayInZone(timeZone);
|
|
965
|
+
const today = chunkTGWTLNXW_cjs.todayInZone(timeZone);
|
|
1110
966
|
const days = react.useMemo(() => {
|
|
1111
|
-
const first = startOfWeek(month, weekStart);
|
|
1112
|
-
return Array.from({ length: 42 }, (_, i) => addDays(first, i));
|
|
967
|
+
const first = chunkTGWTLNXW_cjs.startOfWeek(month, weekStart);
|
|
968
|
+
return Array.from({ length: 42 }, (_, i) => chunkTGWTLNXW_cjs.addDays(first, i));
|
|
1113
969
|
}, [month, weekStart]);
|
|
1114
|
-
const weekdays = days.slice(0, 7).map((d) => formatPlainDate(d, { weekday: "narrow" }));
|
|
1115
|
-
const monthTitle = formatPlainDate(month, { month: "long", year: "numeric" });
|
|
970
|
+
const weekdays = days.slice(0, 7).map((d) => chunkTGWTLNXW_cjs.formatPlainDate(d, { weekday: "narrow" }));
|
|
971
|
+
const monthTitle = chunkTGWTLNXW_cjs.formatPlainDate(month, { month: "long", year: "numeric" });
|
|
1116
972
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("select-none text-xs", className), "data-testid": "calendar-mini-month", children: [
|
|
1117
973
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 flex items-center justify-between px-1", children: [
|
|
1118
974
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", "aria-live": "polite", children: monthTitle }),
|
|
@@ -1123,7 +979,7 @@ function MiniMonth({
|
|
|
1123
979
|
type: "button",
|
|
1124
980
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1125
981
|
"aria-label": labels.previous,
|
|
1126
|
-
onClick: () => setMonth(addMonths(month, -1)),
|
|
982
|
+
onClick: () => setMonth(chunkTGWTLNXW_cjs.addMonths(month, -1)),
|
|
1127
983
|
"data-testid": "calendar-mini-prev",
|
|
1128
984
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
1129
985
|
}
|
|
@@ -1134,7 +990,7 @@ function MiniMonth({
|
|
|
1134
990
|
type: "button",
|
|
1135
991
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
1136
992
|
"aria-label": labels.next,
|
|
1137
|
-
onClick: () => setMonth(addMonths(month, 1)),
|
|
993
|
+
onClick: () => setMonth(chunkTGWTLNXW_cjs.addMonths(month, 1)),
|
|
1138
994
|
"data-testid": "calendar-mini-next",
|
|
1139
995
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
1140
996
|
}
|
|
@@ -1170,7 +1026,7 @@ function MiniMonth({
|
|
|
1170
1026
|
MiniDay,
|
|
1171
1027
|
{
|
|
1172
1028
|
d,
|
|
1173
|
-
weekCell: showWeekNumbers && i % 7 === 0 ? isoWeekNumber(d) : null,
|
|
1029
|
+
weekCell: showWeekNumbers && i % 7 === 0 ? chunkTGWTLNXW_cjs.isoWeekNumber(d) : null,
|
|
1174
1030
|
inMonth,
|
|
1175
1031
|
inRange,
|
|
1176
1032
|
selected,
|
|
@@ -1203,7 +1059,7 @@ function MiniDay({
|
|
|
1203
1059
|
role: "gridcell",
|
|
1204
1060
|
"aria-selected": selected,
|
|
1205
1061
|
"aria-current": isToday ? "date" : void 0,
|
|
1206
|
-
"aria-label": formatPlainDate(d, { dateStyle: "full" }),
|
|
1062
|
+
"aria-label": chunkTGWTLNXW_cjs.formatPlainDate(d, { dateStyle: "full" }),
|
|
1207
1063
|
onClick: () => onSelect(d),
|
|
1208
1064
|
"data-testid": `calendar-mini-day-${d}`,
|
|
1209
1065
|
className: ui.cn(
|
|
@@ -1455,12 +1311,12 @@ function CalendarList({
|
|
|
1455
1311
|
var isAllDayDraft = (d) => !!d.start.date;
|
|
1456
1312
|
var datePart = (spec) => spec.date ?? (spec.date_time ?? "").slice(0, 10);
|
|
1457
1313
|
var timePart = (spec) => (spec.date_time ?? "").slice(11, 16);
|
|
1458
|
-
var specZone = (spec, defaultZone) => safeZone(spec.time_zone, defaultZone);
|
|
1314
|
+
var specZone = (spec, defaultZone) => chunkTGWTLNXW_cjs.safeZone(spec.time_zone, defaultZone);
|
|
1459
1315
|
var specDate = datePart;
|
|
1460
1316
|
var specTime = timePart;
|
|
1461
1317
|
function specEpochMs(spec, defaultZone) {
|
|
1462
|
-
if (spec.date) return wallToEpochMs(spec.date, defaultZone);
|
|
1463
|
-
return wallToEpochMs(spec.date_time ?? "", specZone(spec, defaultZone));
|
|
1318
|
+
if (spec.date) return chunkTGWTLNXW_cjs.wallToEpochMs(spec.date, defaultZone);
|
|
1319
|
+
return chunkTGWTLNXW_cjs.wallToEpochMs(spec.date_time ?? "", specZone(spec, defaultZone));
|
|
1464
1320
|
}
|
|
1465
1321
|
function draftRangeUtc(d, defaultZone) {
|
|
1466
1322
|
return { startMs: specEpochMs(d.start, defaultZone), endMs: specEpochMs(d.end, defaultZone) };
|
|
@@ -1468,7 +1324,7 @@ function draftRangeUtc(d, defaultZone) {
|
|
|
1468
1324
|
function allDayInclusiveEnd(d) {
|
|
1469
1325
|
const start = d.start.date ?? "";
|
|
1470
1326
|
const end = d.end.date ?? start;
|
|
1471
|
-
const last = addDays(end, -1);
|
|
1327
|
+
const last = chunkTGWTLNXW_cjs.addDays(end, -1);
|
|
1472
1328
|
return last < start ? start : last;
|
|
1473
1329
|
}
|
|
1474
1330
|
function timedSpec(date, time, zone) {
|
|
@@ -1478,8 +1334,8 @@ function setDraftStart(d, change, defaultZone) {
|
|
|
1478
1334
|
if (isAllDayDraft(d)) {
|
|
1479
1335
|
const oldStart = d.start.date ?? change.date ?? "";
|
|
1480
1336
|
const start2 = change.date ?? oldStart;
|
|
1481
|
-
const days = Math.max(1, diffDays(oldStart, d.end.date ?? addDays(oldStart, 1)));
|
|
1482
|
-
return { ...d, start: { date: start2 }, end: { date: addDays(start2, days) } };
|
|
1337
|
+
const days = Math.max(1, chunkTGWTLNXW_cjs.diffDays(oldStart, d.end.date ?? chunkTGWTLNXW_cjs.addDays(oldStart, 1)));
|
|
1338
|
+
return { ...d, start: { date: start2 }, end: { date: chunkTGWTLNXW_cjs.addDays(start2, days) } };
|
|
1483
1339
|
}
|
|
1484
1340
|
const { startMs, endMs } = draftRangeUtc(d, defaultZone);
|
|
1485
1341
|
const duration = Math.max(0, endMs - startMs);
|
|
@@ -1491,7 +1347,7 @@ function setDraftStart(d, change, defaultZone) {
|
|
|
1491
1347
|
);
|
|
1492
1348
|
const newStartMs = specEpochMs(start, defaultZone);
|
|
1493
1349
|
const endZone = specZone(d.end, defaultZone);
|
|
1494
|
-
const endWall = utcToWall(newStartMs + duration, endZone);
|
|
1350
|
+
const endWall = chunkTGWTLNXW_cjs.utcToWall(newStartMs + duration, endZone);
|
|
1495
1351
|
return {
|
|
1496
1352
|
...d,
|
|
1497
1353
|
start,
|
|
@@ -1501,7 +1357,7 @@ function setDraftStart(d, change, defaultZone) {
|
|
|
1501
1357
|
function setDraftEnd(d, change) {
|
|
1502
1358
|
if (isAllDayDraft(d)) {
|
|
1503
1359
|
const last = change.date ?? allDayInclusiveEnd(d);
|
|
1504
|
-
return { ...d, end: { date: addDays(last, 1) } };
|
|
1360
|
+
return { ...d, end: { date: chunkTGWTLNXW_cjs.addDays(last, 1) } };
|
|
1505
1361
|
}
|
|
1506
1362
|
const zone = change.timeZone !== void 0 ? change.timeZone : d.end.time_zone ?? null;
|
|
1507
1363
|
return {
|
|
@@ -1514,35 +1370,35 @@ function setDraftAllDay(d, allDay, defaultZone, defaultStartTime = "09:00", defa
|
|
|
1514
1370
|
if (allDay) {
|
|
1515
1371
|
const start2 = datePart(d.start);
|
|
1516
1372
|
const endDay = datePart(d.end) || start2;
|
|
1517
|
-
const lastDay = timePart(d.end) === "00:00" && endDay > start2 ? addDays(endDay, -1) : endDay;
|
|
1373
|
+
const lastDay = timePart(d.end) === "00:00" && endDay > start2 ? chunkTGWTLNXW_cjs.addDays(endDay, -1) : endDay;
|
|
1518
1374
|
return {
|
|
1519
1375
|
...d,
|
|
1520
1376
|
start: { date: start2 },
|
|
1521
|
-
end: { date: addDays(lastDay < start2 ? start2 : lastDay, 1) }
|
|
1377
|
+
end: { date: chunkTGWTLNXW_cjs.addDays(lastDay < start2 ? start2 : lastDay, 1) }
|
|
1522
1378
|
};
|
|
1523
1379
|
}
|
|
1524
|
-
const zone = safeZone(defaultZone);
|
|
1380
|
+
const zone = chunkTGWTLNXW_cjs.safeZone(defaultZone);
|
|
1525
1381
|
const start = timedSpec(d.start.date ?? "", defaultStartTime, zone);
|
|
1526
1382
|
const startMs = specEpochMs(start, zone);
|
|
1527
1383
|
const end = {
|
|
1528
1384
|
date: null,
|
|
1529
|
-
date_time: utcToWall(startMs + defaultDurationMinutes * 6e4, zone),
|
|
1385
|
+
date_time: chunkTGWTLNXW_cjs.utcToWall(startMs + defaultDurationMinutes * 6e4, zone),
|
|
1530
1386
|
time_zone: zone
|
|
1531
1387
|
};
|
|
1532
1388
|
return { ...d, start, end };
|
|
1533
1389
|
}
|
|
1534
1390
|
function draftFromSlot(slot, timeZone, calendarId, title = "") {
|
|
1535
|
-
const zone = safeZone(timeZone);
|
|
1391
|
+
const zone = chunkTGWTLNXW_cjs.safeZone(timeZone);
|
|
1536
1392
|
if (slot.allDay) {
|
|
1537
|
-
const start = slot.startDate ?? utcToDate(slot.startUtc, zone);
|
|
1538
|
-
const end = slot.endDate ?? addDays(start, 1);
|
|
1393
|
+
const start = slot.startDate ?? chunkTGWTLNXW_cjs.utcToDate(slot.startUtc, zone);
|
|
1394
|
+
const end = slot.endDate ?? chunkTGWTLNXW_cjs.addDays(start, 1);
|
|
1539
1395
|
return { calendar_id: calendarId, title, start: { date: start }, end: { date: end } };
|
|
1540
1396
|
}
|
|
1541
1397
|
return {
|
|
1542
1398
|
calendar_id: calendarId,
|
|
1543
1399
|
title,
|
|
1544
|
-
start: { date: null, date_time: utcToWall(slot.startUtc, zone), time_zone: zone },
|
|
1545
|
-
end: { date: null, date_time: utcToWall(slot.endUtc, zone), time_zone: zone }
|
|
1400
|
+
start: { date: null, date_time: chunkTGWTLNXW_cjs.utcToWall(slot.startUtc, zone), time_zone: zone },
|
|
1401
|
+
end: { date: null, date_time: chunkTGWTLNXW_cjs.utcToWall(slot.endUtc, zone), time_zone: zone }
|
|
1546
1402
|
};
|
|
1547
1403
|
}
|
|
1548
1404
|
function validateDraft(d, defaultZone) {
|
|
@@ -1590,7 +1446,7 @@ function defaultRecurrenceForm(startDate, freq = "none") {
|
|
|
1590
1446
|
function untilValue(until, ctx) {
|
|
1591
1447
|
if (ctx.allDay) return until.replace(/-/g, "");
|
|
1592
1448
|
const zone = ctx.timeZone || "UTC";
|
|
1593
|
-
const utc = wallToUtc(`${until}T23:59:59`, zone);
|
|
1449
|
+
const utc = chunkTGWTLNXW_cjs.wallToUtc(`${until}T23:59:59`, zone);
|
|
1594
1450
|
const t = temporalPolyfill.Temporal.Instant.from(utc).toZonedDateTimeISO("UTC");
|
|
1595
1451
|
const p = (n, w = 2) => String(n).padStart(w, "0");
|
|
1596
1452
|
return `${p(t.year, 4)}${p(t.month)}${p(t.day)}T${p(t.hour)}${p(t.minute)}${p(t.second)}Z`;
|
|
@@ -2095,10 +1951,10 @@ function RecurrenceEditor({
|
|
|
2095
1951
|
|
|
2096
1952
|
// src/calendar/format.ts
|
|
2097
1953
|
function formatZoneLabel(zone, at = Date.now()) {
|
|
2098
|
-
return `${zoneCity(zone)} (${zoneOffsetLabel(zone, at)})`;
|
|
1954
|
+
return `${chunkTGWTLNXW_cjs.zoneCity(zone)} (${chunkTGWTLNXW_cjs.zoneOffsetLabel(zone, at)})`;
|
|
2099
1955
|
}
|
|
2100
1956
|
function formatEventWhen(e, zone, locale) {
|
|
2101
|
-
const z = safeZone(zone);
|
|
1957
|
+
const z = chunkTGWTLNXW_cjs.safeZone(zone);
|
|
2102
1958
|
const dayFmt = {
|
|
2103
1959
|
weekday: "short",
|
|
2104
1960
|
day: "numeric",
|
|
@@ -2106,16 +1962,16 @@ function formatEventWhen(e, zone, locale) {
|
|
|
2106
1962
|
year: "numeric"
|
|
2107
1963
|
};
|
|
2108
1964
|
if (e.all_day) {
|
|
2109
|
-
const start = e.start.date ?? utcToDate(e.start_utc, z);
|
|
2110
|
-
const endExcl = e.end.date ?? utcToDate(e.end_utc, z);
|
|
2111
|
-
const last = endExcl > start ? addDays(endExcl, -1) : start;
|
|
2112
|
-
const a2 = formatPlainDate(start, dayFmt, locale);
|
|
2113
|
-
return last === start ? a2 : `${a2} \u2013 ${formatPlainDate(last, dayFmt, locale)}`;
|
|
1965
|
+
const start = e.start.date ?? chunkTGWTLNXW_cjs.utcToDate(e.start_utc, z);
|
|
1966
|
+
const endExcl = e.end.date ?? chunkTGWTLNXW_cjs.utcToDate(e.end_utc, z);
|
|
1967
|
+
const last = endExcl > start ? chunkTGWTLNXW_cjs.addDays(endExcl, -1) : start;
|
|
1968
|
+
const a2 = chunkTGWTLNXW_cjs.formatPlainDate(start, dayFmt, locale);
|
|
1969
|
+
return last === start ? a2 : `${a2} \u2013 ${chunkTGWTLNXW_cjs.formatPlainDate(last, dayFmt, locale)}`;
|
|
2114
1970
|
}
|
|
2115
1971
|
const timeFmt = { hour: "numeric", minute: "2-digit" };
|
|
2116
|
-
const sameDay = utcToDate(e.start_utc, z) === utcToDate(e.end_utc, z);
|
|
2117
|
-
const a = `${formatInZone(e.start_utc, z, dayFmt, locale)} \xB7 ${formatInZone(e.start_utc, z, timeFmt, locale)}`;
|
|
2118
|
-
return sameDay ? `${a} \u2013 ${formatInZone(e.end_utc, z, timeFmt, locale)}` : `${a} \u2013 ${formatInZone(e.end_utc, z, dayFmt, locale)} \xB7 ${formatInZone(e.end_utc, z, timeFmt, locale)}`;
|
|
1972
|
+
const sameDay = chunkTGWTLNXW_cjs.utcToDate(e.start_utc, z) === chunkTGWTLNXW_cjs.utcToDate(e.end_utc, z);
|
|
1973
|
+
const a = `${chunkTGWTLNXW_cjs.formatInZone(e.start_utc, z, dayFmt, locale)} \xB7 ${chunkTGWTLNXW_cjs.formatInZone(e.start_utc, z, timeFmt, locale)}`;
|
|
1974
|
+
return sameDay ? `${a} \u2013 ${chunkTGWTLNXW_cjs.formatInZone(e.end_utc, z, timeFmt, locale)}` : `${a} \u2013 ${chunkTGWTLNXW_cjs.formatInZone(e.end_utc, z, dayFmt, locale)} \xB7 ${chunkTGWTLNXW_cjs.formatInZone(e.end_utc, z, timeFmt, locale)}`;
|
|
2119
1975
|
}
|
|
2120
1976
|
function TimeZonePicker({
|
|
2121
1977
|
value,
|
|
@@ -2133,15 +1989,15 @@ function TimeZonePicker({
|
|
|
2133
1989
|
const [open, setOpen] = react.useState(false);
|
|
2134
1990
|
const options = react.useMemo(() => {
|
|
2135
1991
|
const now = Date.now();
|
|
2136
|
-
const list = zones?.length ? zones : listTimeZones();
|
|
1992
|
+
const list = zones?.length ? zones : chunkTGWTLNXW_cjs.listTimeZones();
|
|
2137
1993
|
return list.map((z) => {
|
|
2138
1994
|
let offset = 0;
|
|
2139
1995
|
try {
|
|
2140
|
-
offset = zoneOffsetMinutes(z, now);
|
|
1996
|
+
offset = chunkTGWTLNXW_cjs.zoneOffsetMinutes(z, now);
|
|
2141
1997
|
} catch {
|
|
2142
1998
|
return null;
|
|
2143
1999
|
}
|
|
2144
|
-
return { zone: z, offset, label: zoneOffsetLabel(z, now), city: zoneCity(z) };
|
|
2000
|
+
return { zone: z, offset, label: chunkTGWTLNXW_cjs.zoneOffsetLabel(z, now), city: chunkTGWTLNXW_cjs.zoneCity(z) };
|
|
2145
2001
|
}).filter((o) => o !== null).sort((a, b) => a.offset - b.offset || a.zone.localeCompare(b.zone));
|
|
2146
2002
|
}, [zones, open]);
|
|
2147
2003
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open, onOpenChange: setOpen, children: [
|
|
@@ -3192,12 +3048,12 @@ function EventDetails({
|
|
|
3192
3048
|
className
|
|
3193
3049
|
}) {
|
|
3194
3050
|
const l = mergeLabels(labelOverrides);
|
|
3195
|
-
const zone = safeZone(timeZone);
|
|
3051
|
+
const zone = chunkTGWTLNXW_cjs.safeZone(timeZone);
|
|
3196
3052
|
const color = event.color || calendarColor || "#3b82f6";
|
|
3197
3053
|
const restricted = !!event.restricted;
|
|
3198
3054
|
const title = restricted ? l.busy : event.title?.trim() || l.noTitle;
|
|
3199
3055
|
const eventZone = event.start.time_zone;
|
|
3200
|
-
const otherZone = !event.all_day && eventZone && eventZone !== zone ? safeZone(eventZone, zone) : null;
|
|
3056
|
+
const otherZone = !event.all_day && eventZone && eventZone !== zone ? chunkTGWTLNXW_cjs.safeZone(eventZone, zone) : null;
|
|
3201
3057
|
const attendees = event.attendees ?? [];
|
|
3202
3058
|
const counts = attendees.reduce((acc, a) => {
|
|
3203
3059
|
const k = a.partstat ?? "needs_action";
|
|
@@ -3231,14 +3087,14 @@ function EventDetails({
|
|
|
3231
3087
|
),
|
|
3232
3088
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", "data-testid": "calendar-details-when", children: formatEventWhen(event, zone) }),
|
|
3233
3089
|
otherZone && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-muted-foreground", children: [
|
|
3234
|
-
formatInZone(event.start_utc, otherZone, { hour: "numeric", minute: "2-digit" }),
|
|
3090
|
+
chunkTGWTLNXW_cjs.formatInZone(event.start_utc, otherZone, { hour: "numeric", minute: "2-digit" }),
|
|
3235
3091
|
" \u2013",
|
|
3236
3092
|
" ",
|
|
3237
|
-
formatInZone(event.end_utc, otherZone, { hour: "numeric", minute: "2-digit" }),
|
|
3093
|
+
chunkTGWTLNXW_cjs.formatInZone(event.end_utc, otherZone, { hour: "numeric", minute: "2-digit" }),
|
|
3238
3094
|
" ",
|
|
3239
|
-
zoneCity(otherZone),
|
|
3095
|
+
chunkTGWTLNXW_cjs.zoneCity(otherZone),
|
|
3240
3096
|
" (",
|
|
3241
|
-
zoneOffsetLabel(otherZone, event.start_utc),
|
|
3097
|
+
chunkTGWTLNXW_cjs.zoneOffsetLabel(otherZone, event.start_utc),
|
|
3242
3098
|
")"
|
|
3243
3099
|
] })
|
|
3244
3100
|
] }),
|
|
@@ -3512,10 +3368,10 @@ function ScopeDialog({
|
|
|
3512
3368
|
}
|
|
3513
3369
|
|
|
3514
3370
|
// src/calendar/scheduling.ts
|
|
3515
|
-
var
|
|
3371
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
3516
3372
|
function dayWindow(date, zone, startHour = 7, endHour = 20) {
|
|
3517
|
-
const startMs = wallToEpochMs(`${date}T${
|
|
3518
|
-
const endMs = endHour >= 24 ? wallToEpochMs(`${date}T23:59`, zone) + 6e4 : wallToEpochMs(`${date}T${
|
|
3373
|
+
const startMs = chunkTGWTLNXW_cjs.wallToEpochMs(`${date}T${pad2(startHour)}:00`, zone);
|
|
3374
|
+
const endMs = endHour >= 24 ? chunkTGWTLNXW_cjs.wallToEpochMs(`${date}T23:59`, zone) + 6e4 : chunkTGWTLNXW_cjs.wallToEpochMs(`${date}T${pad2(endHour)}:00`, zone);
|
|
3519
3375
|
return { startMs, endMs };
|
|
3520
3376
|
}
|
|
3521
3377
|
function placeIntervals(intervals, win) {
|
|
@@ -3560,7 +3416,7 @@ function hourTicks(date, zone, startHour, endHour) {
|
|
|
3560
3416
|
const span = win.endMs - win.startMs;
|
|
3561
3417
|
const ticks = [];
|
|
3562
3418
|
for (let h = startHour; h < endHour; h++) {
|
|
3563
|
-
const ms = wallToEpochMs(`${date}T${
|
|
3419
|
+
const ms = chunkTGWTLNXW_cjs.wallToEpochMs(`${date}T${pad2(h)}:00`, zone);
|
|
3564
3420
|
ticks.push({ hour: h, leftPct: (ms - win.startMs) / span * 100 });
|
|
3565
3421
|
}
|
|
3566
3422
|
return ticks;
|
|
@@ -3582,11 +3438,11 @@ function SchedulingAssistant({
|
|
|
3582
3438
|
className
|
|
3583
3439
|
}) {
|
|
3584
3440
|
const l = mergeLabels(labelOverrides);
|
|
3585
|
-
const zone = safeZone(timeZone);
|
|
3441
|
+
const zone = chunkTGWTLNXW_cjs.safeZone(timeZone);
|
|
3586
3442
|
const win = dayWindow(date, zone, dayStartHour, dayEndHour);
|
|
3587
3443
|
const ticks = hourTicks(date, zone, dayStartHour, dayEndHour);
|
|
3588
3444
|
const sel = selection ? placeIntervals([selection], win)[0] : void 0;
|
|
3589
|
-
const time = (iso) => formatInZone(iso, zone, { hour: "numeric", minute: "2-digit" });
|
|
3445
|
+
const time = (iso) => chunkTGWTLNXW_cjs.formatInZone(iso, zone, { hour: "numeric", minute: "2-digit" });
|
|
3590
3446
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("space-y-2", className), "data-testid": "calendar-scheduling", children: [
|
|
3591
3447
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
3592
3448
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium", children: l.schedulingAssistant }),
|
|
@@ -3599,11 +3455,11 @@ function SchedulingAssistant({
|
|
|
3599
3455
|
size: "icon",
|
|
3600
3456
|
className: "h-7 w-7",
|
|
3601
3457
|
"aria-label": l.previous,
|
|
3602
|
-
onClick: () => onDateChange(addDays(date, -1)),
|
|
3458
|
+
onClick: () => onDateChange(chunkTGWTLNXW_cjs.addDays(date, -1)),
|
|
3603
3459
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
3604
3460
|
}
|
|
3605
3461
|
),
|
|
3606
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", "data-testid": "calendar-scheduling-date", children: formatPlainDate(date, { weekday: "short", day: "numeric", month: "short" }) }),
|
|
3462
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", "data-testid": "calendar-scheduling-date", children: chunkTGWTLNXW_cjs.formatPlainDate(date, { weekday: "short", day: "numeric", month: "short" }) }),
|
|
3607
3463
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3608
3464
|
ui.Button,
|
|
3609
3465
|
{
|
|
@@ -3612,7 +3468,7 @@ function SchedulingAssistant({
|
|
|
3612
3468
|
size: "icon",
|
|
3613
3469
|
className: "h-7 w-7",
|
|
3614
3470
|
"aria-label": l.next,
|
|
3615
|
-
onClick: () => onDateChange(addDays(date, 1)),
|
|
3471
|
+
onClick: () => onDateChange(chunkTGWTLNXW_cjs.addDays(date, 1)),
|
|
3616
3472
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
3617
3473
|
}
|
|
3618
3474
|
)
|
|
@@ -3728,7 +3584,7 @@ function SchedulingAssistant({
|
|
|
3728
3584
|
"data-testid": "calendar-suggestion",
|
|
3729
3585
|
children: [
|
|
3730
3586
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-medium", children: [
|
|
3731
|
-
formatInZone(s.startUtc, zone, {
|
|
3587
|
+
chunkTGWTLNXW_cjs.formatInZone(s.startUtc, zone, {
|
|
3732
3588
|
weekday: "short",
|
|
3733
3589
|
day: "numeric",
|
|
3734
3590
|
month: "short"
|
|
@@ -3853,8 +3709,8 @@ function RoomFinder({
|
|
|
3853
3709
|
)
|
|
3854
3710
|
] });
|
|
3855
3711
|
}
|
|
3856
|
-
var mondayFirstName = (day) => formatPlainDate(`2024-01-0${day + 1}`, { weekday: "long" });
|
|
3857
|
-
var sundayFirstName = (day) => formatPlainDate(day === 0 ? "2023-12-31" : `2024-01-0${day}`, { weekday: "long" });
|
|
3712
|
+
var mondayFirstName = (day) => chunkTGWTLNXW_cjs.formatPlainDate(`2024-01-0${day + 1}`, { weekday: "long" });
|
|
3713
|
+
var sundayFirstName = (day) => chunkTGWTLNXW_cjs.formatPlainDate(day === 0 ? "2023-12-31" : `2024-01-0${day}`, { weekday: "long" });
|
|
3858
3714
|
var VIEWS = ["day", "work_week", "week", "month", "agenda", "year"];
|
|
3859
3715
|
var DURATIONS = [15, 30, 45, 60, 90, 120];
|
|
3860
3716
|
var viewName = (v, l) => ({
|
|
@@ -4107,6 +3963,82 @@ function CalendarSettingsForm({
|
|
|
4107
3963
|
);
|
|
4108
3964
|
}
|
|
4109
3965
|
|
|
3966
|
+
Object.defineProperty(exports, "addDays", {
|
|
3967
|
+
enumerable: true,
|
|
3968
|
+
get: function () { return chunkTGWTLNXW_cjs.addDays; }
|
|
3969
|
+
});
|
|
3970
|
+
Object.defineProperty(exports, "addMonths", {
|
|
3971
|
+
enumerable: true,
|
|
3972
|
+
get: function () { return chunkTGWTLNXW_cjs.addMonths; }
|
|
3973
|
+
});
|
|
3974
|
+
Object.defineProperty(exports, "convertWall", {
|
|
3975
|
+
enumerable: true,
|
|
3976
|
+
get: function () { return chunkTGWTLNXW_cjs.convertWall; }
|
|
3977
|
+
});
|
|
3978
|
+
Object.defineProperty(exports, "detectTimeZone", {
|
|
3979
|
+
enumerable: true,
|
|
3980
|
+
get: function () { return chunkTGWTLNXW_cjs.detectTimeZone; }
|
|
3981
|
+
});
|
|
3982
|
+
Object.defineProperty(exports, "diffDays", {
|
|
3983
|
+
enumerable: true,
|
|
3984
|
+
get: function () { return chunkTGWTLNXW_cjs.diffDays; }
|
|
3985
|
+
});
|
|
3986
|
+
Object.defineProperty(exports, "formatInZone", {
|
|
3987
|
+
enumerable: true,
|
|
3988
|
+
get: function () { return chunkTGWTLNXW_cjs.formatInZone; }
|
|
3989
|
+
});
|
|
3990
|
+
Object.defineProperty(exports, "formatPlainDate", {
|
|
3991
|
+
enumerable: true,
|
|
3992
|
+
get: function () { return chunkTGWTLNXW_cjs.formatPlainDate; }
|
|
3993
|
+
});
|
|
3994
|
+
Object.defineProperty(exports, "isValidTimeZone", {
|
|
3995
|
+
enumerable: true,
|
|
3996
|
+
get: function () { return chunkTGWTLNXW_cjs.isValidTimeZone; }
|
|
3997
|
+
});
|
|
3998
|
+
Object.defineProperty(exports, "listTimeZones", {
|
|
3999
|
+
enumerable: true,
|
|
4000
|
+
get: function () { return chunkTGWTLNXW_cjs.listTimeZones; }
|
|
4001
|
+
});
|
|
4002
|
+
Object.defineProperty(exports, "safeZone", {
|
|
4003
|
+
enumerable: true,
|
|
4004
|
+
get: function () { return chunkTGWTLNXW_cjs.safeZone; }
|
|
4005
|
+
});
|
|
4006
|
+
Object.defineProperty(exports, "startOfWeek", {
|
|
4007
|
+
enumerable: true,
|
|
4008
|
+
get: function () { return chunkTGWTLNXW_cjs.startOfWeek; }
|
|
4009
|
+
});
|
|
4010
|
+
Object.defineProperty(exports, "todayInZone", {
|
|
4011
|
+
enumerable: true,
|
|
4012
|
+
get: function () { return chunkTGWTLNXW_cjs.todayInZone; }
|
|
4013
|
+
});
|
|
4014
|
+
Object.defineProperty(exports, "utcToDate", {
|
|
4015
|
+
enumerable: true,
|
|
4016
|
+
get: function () { return chunkTGWTLNXW_cjs.utcToDate; }
|
|
4017
|
+
});
|
|
4018
|
+
Object.defineProperty(exports, "utcToTime", {
|
|
4019
|
+
enumerable: true,
|
|
4020
|
+
get: function () { return chunkTGWTLNXW_cjs.utcToTime; }
|
|
4021
|
+
});
|
|
4022
|
+
Object.defineProperty(exports, "utcToWall", {
|
|
4023
|
+
enumerable: true,
|
|
4024
|
+
get: function () { return chunkTGWTLNXW_cjs.utcToWall; }
|
|
4025
|
+
});
|
|
4026
|
+
Object.defineProperty(exports, "wallToUtc", {
|
|
4027
|
+
enumerable: true,
|
|
4028
|
+
get: function () { return chunkTGWTLNXW_cjs.wallToUtc; }
|
|
4029
|
+
});
|
|
4030
|
+
Object.defineProperty(exports, "zoneCity", {
|
|
4031
|
+
enumerable: true,
|
|
4032
|
+
get: function () { return chunkTGWTLNXW_cjs.zoneCity; }
|
|
4033
|
+
});
|
|
4034
|
+
Object.defineProperty(exports, "zoneOffsetLabel", {
|
|
4035
|
+
enumerable: true,
|
|
4036
|
+
get: function () { return chunkTGWTLNXW_cjs.zoneOffsetLabel; }
|
|
4037
|
+
});
|
|
4038
|
+
Object.defineProperty(exports, "zoneOffsetMinutes", {
|
|
4039
|
+
enumerable: true,
|
|
4040
|
+
get: function () { return chunkTGWTLNXW_cjs.zoneOffsetMinutes; }
|
|
4041
|
+
});
|
|
4110
4042
|
exports.ARBI_WEBINAR_LABEL = ARBI_WEBINAR_LABEL;
|
|
4111
4043
|
exports.CALENDAR_COLORS = CALENDAR_COLORS;
|
|
4112
4044
|
exports.CALENDAR_DEFAULT_LABELS = CALENDAR_DEFAULT_LABELS;
|
|
@@ -4127,38 +4059,28 @@ exports.RoomFinder = RoomFinder;
|
|
|
4127
4059
|
exports.SchedulingAssistant = SchedulingAssistant;
|
|
4128
4060
|
exports.ScopeDialog = ScopeDialog;
|
|
4129
4061
|
exports.TimeZonePicker = TimeZonePicker;
|
|
4130
|
-
exports.addDays = addDays;
|
|
4131
|
-
exports.addMonths = addMonths;
|
|
4132
4062
|
exports.allDayInclusiveEnd = allDayInclusiveEnd;
|
|
4133
4063
|
exports.attendeeKey = attendeeKey;
|
|
4134
4064
|
exports.buildRRule = buildRRule;
|
|
4135
4065
|
exports.contrastText = contrastText;
|
|
4136
|
-
exports.convertWall = convertWall;
|
|
4137
4066
|
exports.dayWindow = dayWindow;
|
|
4138
4067
|
exports.defaultRecurrenceForm = defaultRecurrenceForm;
|
|
4139
4068
|
exports.describeRecurrence = describeRecurrence;
|
|
4140
|
-
exports.detectTimeZone = detectTimeZone;
|
|
4141
|
-
exports.diffDays = diffDays;
|
|
4142
4069
|
exports.draftFromSlot = draftFromSlot;
|
|
4143
4070
|
exports.draftRangeUtc = draftRangeUtc;
|
|
4144
4071
|
exports.effectiveCalendarView = effectiveCalendarView;
|
|
4145
4072
|
exports.eventStateClasses = eventStateClasses;
|
|
4146
4073
|
exports.formatEventWhen = formatEventWhen;
|
|
4147
|
-
exports.formatInZone = formatInZone;
|
|
4148
|
-
exports.formatPlainDate = formatPlainDate;
|
|
4149
4074
|
exports.formatReminder = formatReminder;
|
|
4150
4075
|
exports.formatZoneLabel = formatZoneLabel;
|
|
4151
4076
|
exports.getTemporalTimeZonePlugin = getTemporalTimeZonePlugin;
|
|
4152
4077
|
exports.hourTicks = hourTicks;
|
|
4153
4078
|
exports.isAllDayDraft = isAllDayDraft;
|
|
4154
|
-
exports.isValidTimeZone = isValidTimeZone;
|
|
4155
4079
|
exports.isWebinarConference = isWebinarConference;
|
|
4156
|
-
exports.listTimeZones = listTimeZones;
|
|
4157
4080
|
exports.outsideIntervals = outsideIntervals;
|
|
4158
4081
|
exports.parseRRule = parseRRule;
|
|
4159
4082
|
exports.placeIntervals = placeIntervals;
|
|
4160
4083
|
exports.reminderToMinutes = reminderToMinutes;
|
|
4161
|
-
exports.safeZone = safeZone;
|
|
4162
4084
|
exports.setDraftAllDay = setDraftAllDay;
|
|
4163
4085
|
exports.setDraftEnd = setDraftEnd;
|
|
4164
4086
|
exports.setDraftStart = setDraftStart;
|
|
@@ -4166,18 +4088,9 @@ exports.setPosOf = setPosOf;
|
|
|
4166
4088
|
exports.specDate = specDate;
|
|
4167
4089
|
exports.specTime = specTime;
|
|
4168
4090
|
exports.splitReminderMinutes = splitReminderMinutes;
|
|
4169
|
-
exports.startOfWeek = startOfWeek;
|
|
4170
4091
|
exports.toBusinessHours = toBusinessHours;
|
|
4171
|
-
exports.todayInZone = todayInZone;
|
|
4172
|
-
exports.utcToDate = utcToDate;
|
|
4173
|
-
exports.utcToTime = utcToTime;
|
|
4174
|
-
exports.utcToWall = utcToWall;
|
|
4175
4092
|
exports.validateDraft = validateDraft;
|
|
4176
|
-
exports.wallToUtc = wallToUtc;
|
|
4177
4093
|
exports.weekdayOf = weekdayOf;
|
|
4178
4094
|
exports.workWeekHiddenDays = workWeekHiddenDays;
|
|
4179
|
-
exports.zoneCity = zoneCity;
|
|
4180
|
-
exports.zoneOffsetLabel = zoneOffsetLabel;
|
|
4181
|
-
exports.zoneOffsetMinutes = zoneOffsetMinutes;
|
|
4182
4095
|
//# sourceMappingURL=index.cjs.map
|
|
4183
4096
|
//# sourceMappingURL=index.cjs.map
|