@burdenoff/microfe-calendar 2026.1124.3 → 2026.1124.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/generated/wspace-operations.d.ts +342 -69
  2. package/dist/generated/wspace-operations.js +73 -31
  3. package/dist/generated/wspace-operations.js.map +1 -1
  4. package/dist/generated/wspace-types.d.ts +405 -6
  5. package/dist/translations/en.d.ts +22 -4
  6. package/dist/v2/CalendarPageV2.js +45 -41
  7. package/dist/v2/CalendarPageV2.js.map +1 -1
  8. package/dist/v2/CalendarRoutesV2.js +64 -64
  9. package/dist/v2/CalendarRoutesV2.js.map +1 -1
  10. package/dist/v2/data/errors.d.ts +5 -0
  11. package/dist/v2/data/errors.js +6 -2
  12. package/dist/v2/data/errors.js.map +1 -1
  13. package/dist/v2/data/normalize.d.ts +31 -3
  14. package/dist/v2/data/normalize.js +57 -13
  15. package/dist/v2/data/normalize.js.map +1 -1
  16. package/dist/v2/data/seriesDateLookup.d.ts +9 -0
  17. package/dist/v2/data/seriesDateLookup.js +12 -0
  18. package/dist/v2/data/seriesDateLookup.js.map +1 -0
  19. package/dist/v2/data/useEventActions.d.ts +9 -3
  20. package/dist/v2/data/useEventActions.js +239 -186
  21. package/dist/v2/data/useEventActions.js.map +1 -1
  22. package/dist/v2/data/useEventForPeek.js +63 -21
  23. package/dist/v2/data/useEventForPeek.js.map +1 -1
  24. package/dist/v2/data/useEventsInRangeV2.d.ts +40 -2
  25. package/dist/v2/data/useEventsInRangeV2.js +76 -47
  26. package/dist/v2/data/useEventsInRangeV2.js.map +1 -1
  27. package/dist/v2/day/DayPanel.js +1 -1
  28. package/dist/v2/day/DayPanel.js.map +1 -1
  29. package/dist/v2/event/EventDialog.d.ts +13 -3
  30. package/dist/v2/event/EventDialog.js +189 -166
  31. package/dist/v2/event/EventDialog.js.map +1 -1
  32. package/dist/v2/event/EventDialogs.js +57 -50
  33. package/dist/v2/event/EventDialogs.js.map +1 -1
  34. package/dist/v2/event/EventMoreTab.js +8 -7
  35. package/dist/v2/event/EventMoreTab.js.map +1 -1
  36. package/dist/v2/event/EventPlaceTab.js +2 -2
  37. package/dist/v2/event/EventPlaceTab.js.map +1 -1
  38. package/dist/v2/event/FindTimeDialog.js +1 -1
  39. package/dist/v2/event/FindTimeDialog.js.map +1 -1
  40. package/dist/v2/event/RepeatField.js +10 -7
  41. package/dist/v2/event/RepeatField.js.map +1 -1
  42. package/dist/v2/event/dialogLogic.d.ts +10 -0
  43. package/dist/v2/event/dialogLogic.js +25 -22
  44. package/dist/v2/event/dialogLogic.js.map +1 -1
  45. package/dist/v2/event/dialogModel.d.ts +3 -0
  46. package/dist/v2/event/dialogModel.js.map +1 -1
  47. package/dist/v2/event/eventForm.d.ts +26 -0
  48. package/dist/v2/event/eventForm.js +145 -92
  49. package/dist/v2/event/eventForm.js.map +1 -1
  50. package/dist/v2/event/findTimeSource.js +44 -44
  51. package/dist/v2/event/findTimeSource.js.map +1 -1
  52. package/dist/v2/event/rrule.js.map +1 -1
  53. package/dist/v2/event/savePlan.d.ts +125 -15
  54. package/dist/v2/event/savePlan.js +162 -68
  55. package/dist/v2/event/savePlan.js.map +1 -1
  56. package/dist/v2/event/useEventData.d.ts +7 -2
  57. package/dist/v2/event/useEventData.js +107 -80
  58. package/dist/v2/event/useEventData.js.map +1 -1
  59. package/dist/v2/event/useEventDialogModel.d.ts +16 -3
  60. package/dist/v2/event/useEventDialogModel.js +82 -67
  61. package/dist/v2/event/useEventDialogModel.js.map +1 -1
  62. package/dist/v2/event/useEventSave.d.ts +20 -4
  63. package/dist/v2/event/useEventSave.js +181 -90
  64. package/dist/v2/event/useEventSave.js.map +1 -1
  65. package/dist/v2/events/eventLook.js +16 -16
  66. package/dist/v2/events/eventLook.js.map +1 -1
  67. package/dist/v2/events/eventModel.d.ts +17 -4
  68. package/dist/v2/events/eventModel.js +46 -34
  69. package/dist/v2/events/eventModel.js.map +1 -1
  70. package/dist/v2/events/localChanges.d.ts +4 -1
  71. package/dist/v2/events/localChanges.js +4 -2
  72. package/dist/v2/events/localChanges.js.map +1 -1
  73. package/dist/v2/page/CalendarPageContext.d.ts +2 -2
  74. package/dist/v2/page/CalendarPageContext.js.map +1 -1
  75. package/dist/v2/page/useCalendarPageModel.js +141 -139
  76. package/dist/v2/page/useCalendarPageModel.js.map +1 -1
  77. package/dist/v2/page/viewState.d.ts +9 -1
  78. package/dist/v2/page/viewState.js +5 -3
  79. package/dist/v2/page/viewState.js.map +1 -1
  80. package/dist/v2/peek/PeekEvent.js +210 -204
  81. package/dist/v2/peek/PeekEvent.js.map +1 -1
  82. package/dist/v2/rail/useMonthEventDates.js +1 -1
  83. package/dist/v2/rail/useMonthEventDates.js.map +1 -1
  84. package/dist/v2/states/CalendarStates.d.ts +15 -0
  85. package/dist/v2/states/CalendarStates.js +42 -11
  86. package/dist/v2/states/CalendarStates.js.map +1 -1
  87. package/dist/v2/types.d.ts +30 -2
  88. package/package.json +1 -1
@@ -2,50 +2,52 @@ import { technicalDetails as e } from "../data/errors.js";
2
2
  import { useCalendarPage as t } from "../page/CalendarPageContext.js";
3
3
  import { TITLE_INPUT_ID as n, issueTarget as r } from "./dialogLogic.js";
4
4
  import { EventDetailsTab as i } from "./EventDetailsTab.js";
5
- import { EventMoreTab as a } from "./EventMoreTab.js";
6
- import { EventPeopleTab as o, GUEST_INPUT_SELECTOR as s } from "./EventPeopleTab.js";
7
- import { EventPlaceTab as c } from "./EventPlaceTab.js";
8
- import { useEventDialogModel as l } from "./useEventDialogModel.js";
9
- import { useEventSave as u } from "./useEventSave.js";
10
- import { useState as d } from "react";
11
- import { CalendarDays as f, ChevronDown as p, FileText as m, Loader2 as h, Lock as g, MapPin as _, SlidersHorizontal as v, Users as y } from "lucide-react";
12
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
13
- import { Button as S, DropdownMenu as C, DropdownMenuContent as w, DropdownMenuRadioGroup as T, DropdownMenuRadioItem as E, DropdownMenuTrigger as D, IconTile as O, Notice as k, ShowTechnicalDetails as A, Spinner as j, TabbedDialog as M, TabbedDialogContent as N, TabbedDialogFooter as P, TabbedDialogHeader as F, TabbedDialogTabs as I, useConfirm as L } from "@burdenoff/fe-libs/ui";
14
- import { cn as R } from "@burdenoff/fe-libs/utils";
5
+ import { detachedForm as a } from "./eventForm.js";
6
+ import { EventMoreTab as o } from "./EventMoreTab.js";
7
+ import { EventPeopleTab as s, GUEST_INPUT_SELECTOR as c } from "./EventPeopleTab.js";
8
+ import { EventPlaceTab as l } from "./EventPlaceTab.js";
9
+ import { canChangeLater as u, isFirstDate as d } from "./savePlan.js";
10
+ import { useEventDialogModel as f } from "./useEventDialogModel.js";
11
+ import { useEventSave as p } from "./useEventSave.js";
12
+ import { useState as m } from "react";
13
+ import { CalendarDays as h, ChevronDown as g, FileText as _, Loader2 as v, Lock as y, MapPin as b, SlidersHorizontal as x, Users as S } from "lucide-react";
14
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
15
+ import { Button as T, DropdownMenu as E, DropdownMenuContent as D, DropdownMenuRadioGroup as O, DropdownMenuRadioItem as k, DropdownMenuTrigger as A, IconTile as j, Notice as M, ShowTechnicalDetails as N, Spinner as P, TabbedDialog as F, TabbedDialogContent as I, TabbedDialogFooter as L, TabbedDialogHeader as R, TabbedDialogTabs as z, useConfirm as B } from "@burdenoff/fe-libs/ui";
16
+ import { cn as V } from "@burdenoff/fe-libs/utils";
15
17
  // src/v2/event/EventDialog.tsx
16
- var z = {
17
- details: m,
18
- people: y,
19
- place: _,
20
- more: v
18
+ var H = {
19
+ details: _,
20
+ people: S,
21
+ place: b,
22
+ more: x
21
23
  };
22
- function B({ session: e, edited: t, onChange: n, onClose: r, onFindTime: i }) {
23
- return e ? /* @__PURE__ */ b(W, {
24
+ function U({ session: e, edited: t, onChange: n, onClose: r, onFindTime: i }) {
25
+ return e ? /* @__PURE__ */ C(q, {
24
26
  session: e,
25
27
  edited: t,
26
28
  onChange: n,
27
29
  onClose: r,
28
30
  onFindTime: i
29
- }) : /* @__PURE__ */ b(H, {
31
+ }) : /* @__PURE__ */ C(G, {
30
32
  edited: t,
31
33
  onClose: r
32
34
  });
33
35
  }
34
- function V({ heading: e, description: n, locked: r, onOpenChange: i, onOpenAutoFocus: a, children: o }) {
36
+ function W({ heading: e, description: n, locked: r, onOpenChange: i, onOpenAutoFocus: a, children: o }) {
35
37
  let { tr: s } = t();
36
- return /* @__PURE__ */ b(M, {
38
+ return /* @__PURE__ */ C(F, {
37
39
  open: !0,
38
40
  onOpenChange: i,
39
- children: /* @__PURE__ */ x(N, {
41
+ children: /* @__PURE__ */ w(I, {
40
42
  size: "form",
41
43
  className: "sm:max-w-[640px]",
42
44
  "aria-describedby": void 0,
43
45
  onOpenAutoFocus: a,
44
- children: [/* @__PURE__ */ b(F, {
45
- icon: /* @__PURE__ */ b(O, {
46
+ children: [/* @__PURE__ */ C(R, {
47
+ icon: /* @__PURE__ */ C(j, {
46
48
  size: "sm",
47
49
  "aria-hidden": "true",
48
- children: b(r ? g : f, {})
50
+ children: C(r ? y : h, {})
49
51
  }),
50
52
  title: e,
51
53
  description: n,
@@ -54,49 +56,49 @@ function V({ heading: e, description: n, locked: r, onOpenChange: i, onOpenAutoF
54
56
  })
55
57
  });
56
58
  }
57
- function H({ edited: n, onClose: r }) {
58
- let { tr: i } = t(), a = /* @__PURE__ */ x("div", {
59
+ function G({ edited: n, onClose: r }) {
60
+ let { tr: i } = t(), a = /* @__PURE__ */ w("div", {
59
61
  className: "flex items-center gap-2 text-sm text-text-secondary",
60
- children: [/* @__PURE__ */ b(j, { size: "sm" }), i("calendar.v2.openingEvent", "Opening the event…")]
62
+ children: [/* @__PURE__ */ C(P, { size: "sm" }), i("calendar.v2.openingEvent", "Opening the event…")]
61
63
  });
62
- return n.status === "missing" ? a = /* @__PURE__ */ x("div", {
64
+ return n.status === "missing" ? a = /* @__PURE__ */ w("div", {
63
65
  className: "flex max-w-sm flex-col gap-2",
64
- children: [/* @__PURE__ */ b("b", {
66
+ children: [/* @__PURE__ */ C("b", {
65
67
  className: "text-base text-text-primary",
66
68
  children: i("calendar.v2.peekMissing", "This event isn’t available")
67
- }), /* @__PURE__ */ b("p", {
69
+ }), /* @__PURE__ */ C("p", {
68
70
  className: "text-sm text-text-secondary",
69
71
  children: i("calendar.v2.actionGone", "It may have been deleted or moved by someone else.")
70
72
  })]
71
- }) : n.status === "error" && (a = /* @__PURE__ */ x("div", {
73
+ }) : n.status === "error" && (a = /* @__PURE__ */ w("div", {
72
74
  className: "flex max-w-sm flex-col items-center gap-3",
73
75
  children: [
74
- /* @__PURE__ */ b("b", {
76
+ /* @__PURE__ */ C("b", {
75
77
  className: "text-base text-text-primary",
76
78
  children: i("calendar.v2.peekFailed", "Couldn’t open the event")
77
79
  }),
78
- /* @__PURE__ */ b("p", {
80
+ /* @__PURE__ */ C("p", {
79
81
  className: "text-sm text-text-secondary",
80
82
  children: i("calendar.v2.peekFailedBody", "The calendar service didn’t answer. Nothing was changed.")
81
83
  }),
82
- /* @__PURE__ */ b(S, {
84
+ /* @__PURE__ */ C(T, {
83
85
  type: "button",
84
86
  variant: "outline",
85
87
  onClick: n.retry,
86
88
  children: i("calendar.v2.tryAgain", "Try again")
87
89
  }),
88
- /* @__PURE__ */ b(A, {
90
+ /* @__PURE__ */ C(N, {
89
91
  copyable: !0,
90
92
  children: e(n.error)
91
93
  })
92
94
  ]
93
- })), /* @__PURE__ */ x(V, {
95
+ })), /* @__PURE__ */ w(W, {
94
96
  heading: i("calendar.v2.evEditTitle", "Edit event"),
95
97
  onOpenChange: (e) => e ? void 0 : r(),
96
- children: [/* @__PURE__ */ b("div", {
98
+ children: [/* @__PURE__ */ C("div", {
97
99
  className: "grid min-h-0 flex-1 place-items-center p-6 text-center",
98
100
  children: a
99
- }), /* @__PURE__ */ b(P, { children: /* @__PURE__ */ b(S, {
101
+ }), /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(T, {
100
102
  type: "button",
101
103
  variant: "outline",
102
104
  onClick: r,
@@ -104,181 +106,201 @@ function H({ edited: n, onClose: r }) {
104
106
  }) })]
105
107
  });
106
108
  }
107
- function U(e, t) {
109
+ function K(e, t) {
108
110
  requestAnimationFrame(() => {
109
111
  let n = (e instanceof HTMLElement ? e : document).querySelector(t);
110
112
  n instanceof HTMLElement && n.focus();
111
113
  });
112
114
  }
113
- function W({ session: e, edited: f, onChange: p, onClose: m, onFindTime: h }) {
114
- let _ = t(), { tr: v, format: y, timeZone: C } = _, w = L(), [T, E] = d(!1), [D, O] = d(!1), [A, j] = d(!1), M = l({
115
+ function q({ session: e, edited: h, onChange: g, onClose: _, onFindTime: v }) {
116
+ let b = t(), { tr: x, format: S, timeZone: E } = b, D = B(), [O, k] = m(!1), [A, j] = m(!1), [N, P] = m(!1), F = f({
115
117
  session: e,
116
- edited: f,
117
- onChange: p,
118
- onFindTime: h,
119
- onGuestsPending: j,
120
- showIssues: T
121
- }), { model: N, event: F, readOnly: R } = M, B = u({
122
- tr: v,
123
- format: y,
124
- durationWords: _.durationWords,
125
- timeZone: C,
126
- calendarName: (e) => _.calendarsById.get(e)?.name ?? null,
127
- roomName: (e) => N.rooms.rooms.find((t) => t.id === e)?.name ?? null,
128
- guestName: N.guestName
129
- }), H = async () => {
130
- D || (R || !M.dirty || await w({
131
- title: v("calendar.v2.evDiscardTitle", "Discard your changes?"),
132
- description: v("calendar.v2.evDiscardBody", "What you changed in this event isn’t saved."),
118
+ edited: h,
119
+ onChange: g,
120
+ onFindTime: v,
121
+ onGuestsPending: P,
122
+ showIssues: O
123
+ }), { model: I, event: R, row: V, readOnly: U } = F, G = p({
124
+ tr: x,
125
+ format: S,
126
+ durationWords: b.durationWords,
127
+ timeZone: E,
128
+ calendarName: (e) => b.calendarsById.get(e)?.name ?? null,
129
+ roomName: (e) => I.rooms.rooms.find((t) => t.id === e)?.name ?? null,
130
+ guestName: I.guestName,
131
+ me: b.me
132
+ }), q = async () => {
133
+ A || (U || !F.dirty || await D({
134
+ title: x("calendar.v2.evDiscardTitle", "Discard your changes?"),
135
+ description: x("calendar.v2.evDiscardBody", "What you changed in this event isn’t saved."),
133
136
  tone: "danger",
134
- confirmLabel: v("calendar.v2.evDiscard", "Discard"),
135
- cancelLabel: v("calendar.v2.evKeepEditing", "Keep editing")
136
- })) && m();
137
- }, W = async () => {
138
- if (D || R || M.readBack || A) return;
139
- E(!0);
140
- let t = r(N.issues);
141
- if (t || !M.calendarId) t && p((e) => ({
137
+ confirmLabel: x("calendar.v2.evDiscard", "Discard"),
138
+ cancelLabel: x("calendar.v2.evKeepEditing", "Keep editing")
139
+ })) && _();
140
+ }, Q = async () => {
141
+ if (A || U || F.readBack || N) return;
142
+ k(!0);
143
+ let t = r(I.issues);
144
+ if (t || !F.calendarId) t && g((e) => ({
142
145
  ...e,
143
146
  tab: t.tab
144
- })), t?.field && U(null, `#${t.field}`);
145
- else if (!M.toSave) m();
147
+ })), t?.field && K(null, `#${t.field}`);
148
+ else if (!F.toSave) _();
146
149
  else {
147
- O(!0);
150
+ j(!0);
148
151
  try {
149
152
  let t = {
150
- ...N.form,
151
- calendarId: M.calendarId
152
- }, n = await B({
153
+ ...I.form,
154
+ calendarId: F.calendarId
155
+ }, n = await G({
153
156
  form: t,
154
- event: F,
155
- scope: e.scope
157
+ initial: F.baseline,
158
+ event: R,
159
+ row: V,
160
+ scope: e.scope,
161
+ carry: e.carry
156
162
  });
157
- n.kind === "saved" && m(), n.kind === "partial" && p((e) => ({
158
- ...e,
159
- eventId: n.eventId
160
- }));
163
+ if (n.kind === "saved" && _(), n.kind === "partial") {
164
+ let t = n.madeNew && F.seriesDate && e.scope === "this";
165
+ g((e) => ({
166
+ ...e,
167
+ eventId: n.eventId,
168
+ instanceDate: n.instanceDate,
169
+ form: n.madeNew ? a(t ? {
170
+ ...e.form,
171
+ repeat: { kind: "none" }
172
+ } : e.form) : e.form,
173
+ partlySaved: !0,
174
+ carry: n.carry
175
+ }));
176
+ }
161
177
  } finally {
162
- O(!1);
178
+ j(!1);
163
179
  }
164
180
  }
165
- }, Y = [
181
+ }, $ = [
166
182
  {
167
183
  value: "details",
168
- label: v("calendar.v2.evDetails", "Details"),
169
- icon: z.details
184
+ label: x("calendar.v2.evDetails", "Details"),
185
+ icon: H.details
170
186
  },
171
187
  {
172
188
  value: "people",
173
- label: v("calendar.v2.evPeopleTab", "People"),
174
- icon: z.people
189
+ label: x("calendar.v2.evPeopleTab", "People"),
190
+ icon: H.people
175
191
  },
176
192
  {
177
193
  value: "place",
178
- label: v("calendar.v2.evPlace", "Place"),
179
- icon: z.place
194
+ label: x("calendar.v2.evPlace", "Place"),
195
+ icon: H.place
180
196
  },
181
197
  {
182
198
  value: "more",
183
- label: v("calendar.v2.evMore", "More"),
184
- icon: z.more
199
+ label: x("calendar.v2.evMore", "More"),
200
+ icon: H.more
185
201
  }
186
- ], X = {
202
+ ], ee = {
187
203
  details: `#${n}`,
188
- people: s
204
+ people: c
189
205
  };
190
- return /* @__PURE__ */ x(V, {
191
- heading: M.heading,
192
- description: M.description,
193
- locked: R,
194
- onOpenChange: (e) => e ? void 0 : void H(),
206
+ return /* @__PURE__ */ w(W, {
207
+ heading: F.heading,
208
+ description: F.description,
209
+ locked: U,
210
+ onOpenChange: (e) => e ? void 0 : void q(),
195
211
  onOpenAutoFocus: (t) => {
196
- let n = R ? void 0 : X[e.tab];
197
- n && (t.preventDefault(), U(t.currentTarget, n));
212
+ let n = U ? void 0 : ee[e.tab];
213
+ n && (t.preventDefault(), K(t.currentTarget, n));
198
214
  },
199
- children: [/* @__PURE__ */ b(I, {
200
- tabs: Y,
215
+ children: [/* @__PURE__ */ C(z, {
216
+ tabs: $,
201
217
  value: e.tab,
202
- onValueChange: (e) => p((t) => ({
218
+ onValueChange: (e) => g((t) => ({
203
219
  ...t,
204
220
  tab: e
205
221
  })),
206
- "aria-label": v("calendar.v2.evSections", "Event sections"),
207
- renderPanel: (e) => /* @__PURE__ */ x("fieldset", {
208
- disabled: D,
222
+ "aria-label": x("calendar.v2.evSections", "Event sections"),
223
+ renderPanel: (e) => /* @__PURE__ */ w("fieldset", {
224
+ disabled: A,
209
225
  className: "m-0 flex min-w-0 flex-col gap-4 border-0 p-0",
210
226
  children: [
211
- M.lock ? /* @__PURE__ */ b(k, {
227
+ F.lock ? /* @__PURE__ */ C(M, {
212
228
  tone: "lock",
213
- icon: g,
214
- children: M.lock
229
+ icon: y,
230
+ children: F.lock
215
231
  }) : null,
216
- M.readBack ? /* @__PURE__ */ b(K, {
217
- readBack: M.readBack,
218
- edited: f
232
+ F.readBack ? /* @__PURE__ */ C(Y, {
233
+ readBack: F.readBack,
234
+ edited: h
219
235
  }) : null,
220
- e === "details" ? /* @__PURE__ */ b(i, { model: N }) : null,
221
- e === "people" ? /* @__PURE__ */ b(o, { model: N }) : null,
222
- e === "place" ? /* @__PURE__ */ b(c, { model: N }) : null,
223
- e === "more" ? /* @__PURE__ */ b(a, { model: N }) : null
236
+ e === "details" ? /* @__PURE__ */ C(i, { model: I }) : null,
237
+ e === "people" ? /* @__PURE__ */ C(s, { model: I }) : null,
238
+ e === "place" ? /* @__PURE__ */ C(l, { model: I }) : null,
239
+ e === "more" ? /* @__PURE__ */ C(o, { model: I }) : null
224
240
  ]
225
241
  })
226
- }), /* @__PURE__ */ x(P, {
242
+ }), /* @__PURE__ */ w(L, {
227
243
  className: "gap-2",
228
244
  children: [
229
- /* @__PURE__ */ b(G, { note: A && !R ? {
245
+ /* @__PURE__ */ C(J, { note: N && !U ? {
230
246
  tone: "info",
231
- text: v("calendar.v2.evAddingTeam", "Adding the team’s people…")
232
- } : M.note }),
233
- F?.isRecurring && !R ? /* @__PURE__ */ b(J, {
247
+ text: x("calendar.v2.evAddingTeam", "Adding the team’s people…")
248
+ } : F.note }),
249
+ F.seriesDate && R && V && !U ? /* @__PURE__ */ C(Z, {
234
250
  scope: e.scope,
235
- disabled: D,
236
- onScope: (e) => p((t) => ({
251
+ disabled: A,
252
+ firstDate: d(R, V),
253
+ laterAllowed: u(R, V),
254
+ onScope: (e) => g((t) => ({
237
255
  ...t,
238
- scope: e
256
+ scope: e,
257
+ form: e === "this" ? {
258
+ ...t.form,
259
+ repeat: F.baseline.repeat
260
+ } : t.form
239
261
  }))
240
262
  }) : null,
241
- /* @__PURE__ */ b(S, {
263
+ /* @__PURE__ */ C(T, {
242
264
  type: "button",
243
265
  variant: "outline",
244
- onClick: () => void H(),
245
- disabled: D,
246
- children: R ? v("calendar.v2.close", "Close") : v("calendar.v2.evCancel", "Cancel")
266
+ onClick: () => void q(),
267
+ disabled: A,
268
+ children: U ? x("calendar.v2.close", "Close") : x("calendar.v2.evCancel", "Cancel")
247
269
  }),
248
- R ? null : /* @__PURE__ */ b(q, {
249
- saving: D,
250
- waiting: M.readBack !== null || A,
270
+ U ? null : /* @__PURE__ */ C(X, {
271
+ saving: A,
272
+ waiting: F.readBack !== null || N,
251
273
  editing: e.eventId !== null,
252
- onSave: () => void W()
274
+ onSave: () => void Q()
253
275
  })
254
276
  ]
255
277
  })]
256
278
  });
257
279
  }
258
- function G({ note: e }) {
259
- if (!e) return /* @__PURE__ */ b("span", { className: "flex-1" });
280
+ function J({ note: e }) {
281
+ if (!e) return /* @__PURE__ */ C("span", { className: "flex-1" });
260
282
  let t = {
261
283
  bad: "font-medium text-status-error-text",
262
284
  warn: "font-medium text-status-warning-text",
263
285
  info: "text-text-secondary"
264
286
  }[e.tone];
265
- return /* @__PURE__ */ b("span", {
266
- className: R("min-w-0 flex-1 truncate text-xs max-sm:basis-full", t),
287
+ return /* @__PURE__ */ C("span", {
288
+ className: V("min-w-0 flex-1 truncate text-xs max-sm:basis-full", t),
267
289
  role: e.tone === "bad" ? "alert" : void 0,
268
290
  children: e.text
269
291
  });
270
292
  }
271
- function K({ readBack: e, edited: n }) {
293
+ function Y({ readBack: e, edited: n }) {
272
294
  let { tr: r } = t();
273
- if (e === "missing") return /* @__PURE__ */ b(k, {
295
+ if (e === "missing") return /* @__PURE__ */ C(M, {
274
296
  tone: "bad",
275
297
  children: r("calendar.v2.evSavedGone", "This event isn’t available any more. It may have been deleted by someone else.")
276
298
  });
277
299
  if (e !== "failed") return null;
278
300
  let i = n.status === "ready" || n.status === "error" ? n.retry : null;
279
- return /* @__PURE__ */ b(k, {
301
+ return /* @__PURE__ */ C(M, {
280
302
  tone: "bad",
281
- action: i ? /* @__PURE__ */ b(S, {
303
+ action: i ? /* @__PURE__ */ C(T, {
282
304
  type: "button",
283
305
  variant: "outline",
284
306
  size: "sm",
@@ -288,78 +310,79 @@ function K({ readBack: e, edited: n }) {
288
310
  children: r("calendar.v2.evSavedUnread", "Couldn’t read the event back from the calendar service, so saving waits. Try again.")
289
311
  });
290
312
  }
291
- function q({ saving: e, waiting: n, editing: r, onSave: i }) {
313
+ function X({ saving: e, waiting: n, editing: r, onSave: i }) {
292
314
  let { tr: a } = t(), o = a("calendar.v2.evCreate", "Create event");
293
- return r && (o = a("calendar.v2.evSaveChanges", "Save changes")), e && (o = a("calendar.v2.evSaving", "Saving…")), /* @__PURE__ */ x(S, {
315
+ return r && (o = a("calendar.v2.evSaveChanges", "Save changes")), e && (o = a("calendar.v2.evSaving", "Saving…")), /* @__PURE__ */ w(T, {
294
316
  type: "button",
295
317
  onClick: i,
296
318
  disabled: e || n,
297
319
  "aria-busy": e || void 0,
298
- children: [e ? /* @__PURE__ */ b(h, {
320
+ children: [e ? /* @__PURE__ */ C(v, {
299
321
  className: "motion-safe:animate-spin",
300
322
  "aria-hidden": "true"
301
323
  }) : null, o]
302
324
  });
303
325
  }
304
- function J({ scope: e, disabled: n, onScope: r }) {
305
- let { tr: i } = t(), a = {
306
- later: i("calendar.v2.evScopeLater", "This and later events"),
307
- all: i("calendar.v2.evScopeAll", "Every event in the series")
326
+ function Z({ scope: e, disabled: n, firstDate: r, laterAllowed: i, onScope: a }) {
327
+ let { tr: o } = t(), s = {
328
+ this: o("calendar.v2.evScopeThis", "This event"),
329
+ later: o("calendar.v2.evScopeLater", "This and later events"),
330
+ all: o("calendar.v2.evScopeAll", "Every event in the series")
308
331
  };
309
- return /* @__PURE__ */ x(C, { children: [/* @__PURE__ */ b(D, {
332
+ return /* @__PURE__ */ w(E, { children: [/* @__PURE__ */ C(A, {
310
333
  asChild: !0,
311
- children: /* @__PURE__ */ x(S, {
334
+ children: /* @__PURE__ */ w(T, {
312
335
  type: "button",
313
336
  variant: "ghost",
314
337
  size: "sm",
315
338
  disabled: n,
316
339
  children: [
317
- /* @__PURE__ */ b("span", {
340
+ /* @__PURE__ */ C("span", {
318
341
  className: "text-text-secondary",
319
- children: i("calendar.v2.evChange", "Change:")
342
+ children: o("calendar.v2.evChange", "Change:")
320
343
  }),
321
- a[e],
322
- /* @__PURE__ */ b(p, { "aria-hidden": "true" })
344
+ s[e],
345
+ /* @__PURE__ */ C(g, { "aria-hidden": "true" })
323
346
  ]
324
347
  })
325
- }), /* @__PURE__ */ b(w, {
348
+ }), /* @__PURE__ */ C(D, {
326
349
  align: "end",
327
350
  className: "w-72",
328
- children: /* @__PURE__ */ x(T, {
351
+ children: /* @__PURE__ */ w(O, {
329
352
  value: e,
330
353
  onValueChange: (e) => {
331
- (e === "later" || e === "all") && r(e);
354
+ (e === "this" || e === "all" || e === "later" && i) && a(e);
332
355
  },
333
356
  children: [
334
- /* @__PURE__ */ b(E, {
357
+ /* @__PURE__ */ C(k, {
335
358
  value: "this",
336
- disabled: !0,
337
- children: /* @__PURE__ */ x("span", {
359
+ children: /* @__PURE__ */ w("span", {
338
360
  className: "flex flex-col",
339
- children: [i("calendar.v2.evScopeThis", "This event"), /* @__PURE__ */ b("span", {
361
+ children: [s.this, /* @__PURE__ */ C("span", {
340
362
  className: "text-xs text-text-secondary",
341
- children: i("calendar.v2.evScopeThisSoon", "Coming once the calendar shows every date of a series.")
363
+ children: o("calendar.v2.evScopeThisNote", "Only this date. The rest of the series stays as it is.")
342
364
  })]
343
365
  })
344
366
  }),
345
- /* @__PURE__ */ b(E, {
367
+ /* @__PURE__ */ C(k, {
346
368
  value: "later",
347
- children: /* @__PURE__ */ x("span", {
369
+ disabled: !i,
370
+ children: /* @__PURE__ */ w("span", {
348
371
  className: "flex flex-col",
349
- children: [a.later, /* @__PURE__ */ b("span", {
372
+ children: [s.later, r || !i ? /* @__PURE__ */ C("span", {
350
373
  className: "text-xs text-text-secondary",
351
- children: i("calendar.v2.evScopeLaterNote", "The same as every event here: a series opens at its first date.")
352
- })]
374
+ children: r ? o("calendar.v2.evScopeLaterFirst", "This is the series’ first date, so every event changes.") : o("calendar.v2.evScopeLaterCount", "Not for a series that ends after a number of times yet. Change this event or every event.")
375
+ }) : null]
353
376
  })
354
377
  }),
355
- /* @__PURE__ */ b(E, {
378
+ /* @__PURE__ */ C(k, {
356
379
  value: "all",
357
- children: a.all
380
+ children: s.all
358
381
  })
359
382
  ]
360
383
  })
361
384
  })] });
362
385
  }
363
- export { B as EventDialog };
386
+ export { U as EventDialog };
364
387
 
365
388
  //# sourceMappingURL=EventDialog.js.map