@activecollab/components 2.0.576 → 2.0.578

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 (156) hide show
  1. package/dist/cjs/presentation/myWork/MyWorkTasks.js +83 -30
  2. package/dist/cjs/presentation/myWork/MyWorkTasks.js.map +1 -1
  3. package/dist/cjs/presentation/myWork/agendaGrid.js +1095 -0
  4. package/dist/cjs/presentation/myWork/agendaGrid.js.map +1 -0
  5. package/dist/cjs/presentation/reports/allReports.js +6 -0
  6. package/dist/cjs/presentation/reports/allReports.js.map +1 -1
  7. package/dist/cjs/presentation/reports/controls.js +6 -3
  8. package/dist/cjs/presentation/reports/controls.js.map +1 -1
  9. package/dist/cjs/presentation/reports/expenses.js +946 -0
  10. package/dist/cjs/presentation/reports/expenses.js.map +1 -0
  11. package/dist/cjs/presentation/shared/settings.js +6 -2
  12. package/dist/cjs/presentation/shared/settings.js.map +1 -1
  13. package/dist/cjs/presentation/shared/tokens.js +8 -1
  14. package/dist/cjs/presentation/shared/tokens.js.map +1 -1
  15. package/dist/cjs/presentation/timeboxes/AdjustmentList.js +31 -0
  16. package/dist/cjs/presentation/timeboxes/AdjustmentList.js.map +1 -0
  17. package/dist/cjs/presentation/timeboxes/AgendaDayView.js +1722 -0
  18. package/dist/cjs/presentation/timeboxes/AgendaDayView.js.map +1 -0
  19. package/dist/cjs/presentation/timeboxes/CapacityBar.js +54 -0
  20. package/dist/cjs/presentation/timeboxes/CapacityBar.js.map +1 -0
  21. package/dist/cjs/presentation/timeboxes/SimulationCard.js +47 -0
  22. package/dist/cjs/presentation/timeboxes/SimulationCard.js.map +1 -0
  23. package/dist/cjs/presentation/timeboxes/SimulationPanel.js +319 -0
  24. package/dist/cjs/presentation/timeboxes/SimulationPanel.js.map +1 -0
  25. package/dist/cjs/presentation/timeboxes/TimeRecordsSection.js +206 -0
  26. package/dist/cjs/presentation/timeboxes/TimeRecordsSection.js.map +1 -0
  27. package/dist/cjs/presentation/timeboxes/WorkloadView.js +887 -0
  28. package/dist/cjs/presentation/timeboxes/WorkloadView.js.map +1 -0
  29. package/dist/cjs/presentation/timeboxes/__tests__/timeboxes.test.js +699 -0
  30. package/dist/cjs/presentation/timeboxes/__tests__/timeboxes.test.js.map +1 -0
  31. package/dist/cjs/presentation/timeboxes/changes.js +293 -0
  32. package/dist/cjs/presentation/timeboxes/changes.js.map +1 -0
  33. package/dist/cjs/presentation/timeboxes/mockData.js +320 -0
  34. package/dist/cjs/presentation/timeboxes/mockData.js.map +1 -0
  35. package/dist/cjs/presentation/timeboxes/model.js +186 -0
  36. package/dist/cjs/presentation/timeboxes/model.js.map +1 -0
  37. package/dist/cjs/presentation/timeboxes/pillLook.js +72 -0
  38. package/dist/cjs/presentation/timeboxes/pillLook.js.map +1 -0
  39. package/dist/cjs/presentation/timeboxes/plan.js +181 -0
  40. package/dist/cjs/presentation/timeboxes/plan.js.map +1 -0
  41. package/dist/cjs/presentation/timeboxes/reducer.js +763 -0
  42. package/dist/cjs/presentation/timeboxes/reducer.js.map +1 -0
  43. package/dist/cjs/presentation/timeboxes/scheduler.js +147 -0
  44. package/dist/cjs/presentation/timeboxes/scheduler.js.map +1 -0
  45. package/dist/cjs/presentation/timeboxes/store.js +65 -0
  46. package/dist/cjs/presentation/timeboxes/store.js.map +1 -0
  47. package/dist/cjs/presentation/timeboxes/timeBlocks.js +1931 -0
  48. package/dist/cjs/presentation/timeboxes/timeBlocks.js.map +1 -0
  49. package/dist/cjs/presentation/timeboxes/timeboxSettings.js +369 -0
  50. package/dist/cjs/presentation/timeboxes/timeboxSettings.js.map +1 -0
  51. package/dist/cjs/presentation/timeboxes/tracked.js +189 -0
  52. package/dist/cjs/presentation/timeboxes/tracked.js.map +1 -0
  53. package/dist/esm/presentation/myWork/MyWorkTasks.d.ts +81 -1
  54. package/dist/esm/presentation/myWork/MyWorkTasks.d.ts.map +1 -1
  55. package/dist/esm/presentation/myWork/MyWorkTasks.js +76 -23
  56. package/dist/esm/presentation/myWork/MyWorkTasks.js.map +1 -1
  57. package/dist/esm/presentation/myWork/agendaGrid.d.ts +341 -0
  58. package/dist/esm/presentation/myWork/agendaGrid.d.ts.map +1 -0
  59. package/dist/esm/presentation/myWork/agendaGrid.js +1001 -0
  60. package/dist/esm/presentation/myWork/agendaGrid.js.map +1 -0
  61. package/dist/esm/presentation/reports/allReports.d.ts.map +1 -1
  62. package/dist/esm/presentation/reports/allReports.js +6 -0
  63. package/dist/esm/presentation/reports/allReports.js.map +1 -1
  64. package/dist/esm/presentation/reports/controls.d.ts +3 -1
  65. package/dist/esm/presentation/reports/controls.d.ts.map +1 -1
  66. package/dist/esm/presentation/reports/controls.js +6 -3
  67. package/dist/esm/presentation/reports/controls.js.map +1 -1
  68. package/dist/esm/presentation/reports/expenses.d.ts +62 -0
  69. package/dist/esm/presentation/reports/expenses.d.ts.map +1 -0
  70. package/dist/esm/presentation/reports/expenses.js +849 -0
  71. package/dist/esm/presentation/reports/expenses.js.map +1 -0
  72. package/dist/esm/presentation/shared/settings.d.ts +2 -0
  73. package/dist/esm/presentation/shared/settings.d.ts.map +1 -1
  74. package/dist/esm/presentation/shared/settings.js +5 -1
  75. package/dist/esm/presentation/shared/settings.js.map +1 -1
  76. package/dist/esm/presentation/shared/tokens.d.ts +6 -0
  77. package/dist/esm/presentation/shared/tokens.d.ts.map +1 -1
  78. package/dist/esm/presentation/shared/tokens.js +7 -0
  79. package/dist/esm/presentation/shared/tokens.js.map +1 -1
  80. package/dist/esm/presentation/timeboxes/AdjustmentList.d.ts +11 -0
  81. package/dist/esm/presentation/timeboxes/AdjustmentList.d.ts.map +1 -0
  82. package/dist/esm/presentation/timeboxes/AdjustmentList.js +22 -0
  83. package/dist/esm/presentation/timeboxes/AdjustmentList.js.map +1 -0
  84. package/dist/esm/presentation/timeboxes/AgendaDayView.d.ts +15 -0
  85. package/dist/esm/presentation/timeboxes/AgendaDayView.d.ts.map +1 -0
  86. package/dist/esm/presentation/timeboxes/AgendaDayView.js +1524 -0
  87. package/dist/esm/presentation/timeboxes/AgendaDayView.js.map +1 -0
  88. package/dist/esm/presentation/timeboxes/CapacityBar.d.ts +15 -0
  89. package/dist/esm/presentation/timeboxes/CapacityBar.d.ts.map +1 -0
  90. package/dist/esm/presentation/timeboxes/CapacityBar.js +48 -0
  91. package/dist/esm/presentation/timeboxes/CapacityBar.js.map +1 -0
  92. package/dist/esm/presentation/timeboxes/SimulationCard.d.ts +13 -0
  93. package/dist/esm/presentation/timeboxes/SimulationCard.d.ts.map +1 -0
  94. package/dist/esm/presentation/timeboxes/SimulationCard.js +41 -0
  95. package/dist/esm/presentation/timeboxes/SimulationCard.js.map +1 -0
  96. package/dist/esm/presentation/timeboxes/SimulationPanel.d.ts +18 -0
  97. package/dist/esm/presentation/timeboxes/SimulationPanel.d.ts.map +1 -0
  98. package/dist/esm/presentation/timeboxes/SimulationPanel.js +267 -0
  99. package/dist/esm/presentation/timeboxes/SimulationPanel.js.map +1 -0
  100. package/dist/esm/presentation/timeboxes/TimeRecordsSection.d.ts +14 -0
  101. package/dist/esm/presentation/timeboxes/TimeRecordsSection.d.ts.map +1 -0
  102. package/dist/esm/presentation/timeboxes/TimeRecordsSection.js +159 -0
  103. package/dist/esm/presentation/timeboxes/TimeRecordsSection.js.map +1 -0
  104. package/dist/esm/presentation/timeboxes/WorkloadView.d.ts +9 -0
  105. package/dist/esm/presentation/timeboxes/WorkloadView.d.ts.map +1 -0
  106. package/dist/esm/presentation/timeboxes/WorkloadView.js +761 -0
  107. package/dist/esm/presentation/timeboxes/WorkloadView.js.map +1 -0
  108. package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.d.ts +2 -0
  109. package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.d.ts.map +1 -0
  110. package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.js +640 -0
  111. package/dist/esm/presentation/timeboxes/__tests__/timeboxes.test.js.map +1 -0
  112. package/dist/esm/presentation/timeboxes/changes.d.ts +72 -0
  113. package/dist/esm/presentation/timeboxes/changes.d.ts.map +1 -0
  114. package/dist/esm/presentation/timeboxes/changes.js +224 -0
  115. package/dist/esm/presentation/timeboxes/changes.js.map +1 -0
  116. package/dist/esm/presentation/timeboxes/mockData.d.ts +16 -0
  117. package/dist/esm/presentation/timeboxes/mockData.d.ts.map +1 -0
  118. package/dist/esm/presentation/timeboxes/mockData.js +297 -0
  119. package/dist/esm/presentation/timeboxes/mockData.js.map +1 -0
  120. package/dist/esm/presentation/timeboxes/model.d.ts +136 -0
  121. package/dist/esm/presentation/timeboxes/model.d.ts.map +1 -0
  122. package/dist/esm/presentation/timeboxes/model.js +129 -0
  123. package/dist/esm/presentation/timeboxes/model.js.map +1 -0
  124. package/dist/esm/presentation/timeboxes/pillLook.d.ts +40 -0
  125. package/dist/esm/presentation/timeboxes/pillLook.d.ts.map +1 -0
  126. package/dist/esm/presentation/timeboxes/pillLook.js +65 -0
  127. package/dist/esm/presentation/timeboxes/pillLook.js.map +1 -0
  128. package/dist/esm/presentation/timeboxes/plan.d.ts +62 -0
  129. package/dist/esm/presentation/timeboxes/plan.d.ts.map +1 -0
  130. package/dist/esm/presentation/timeboxes/plan.js +116 -0
  131. package/dist/esm/presentation/timeboxes/plan.js.map +1 -0
  132. package/dist/esm/presentation/timeboxes/reducer.d.ts +203 -0
  133. package/dist/esm/presentation/timeboxes/reducer.d.ts.map +1 -0
  134. package/dist/esm/presentation/timeboxes/reducer.js +616 -0
  135. package/dist/esm/presentation/timeboxes/reducer.js.map +1 -0
  136. package/dist/esm/presentation/timeboxes/scheduler.d.ts +63 -0
  137. package/dist/esm/presentation/timeboxes/scheduler.d.ts.map +1 -0
  138. package/dist/esm/presentation/timeboxes/scheduler.js +120 -0
  139. package/dist/esm/presentation/timeboxes/scheduler.js.map +1 -0
  140. package/dist/esm/presentation/timeboxes/store.d.ts +23 -0
  141. package/dist/esm/presentation/timeboxes/store.d.ts.map +1 -0
  142. package/dist/esm/presentation/timeboxes/store.js +46 -0
  143. package/dist/esm/presentation/timeboxes/store.js.map +1 -0
  144. package/dist/esm/presentation/timeboxes/timeBlocks.d.ts +10 -0
  145. package/dist/esm/presentation/timeboxes/timeBlocks.d.ts.map +1 -0
  146. package/dist/esm/presentation/timeboxes/timeBlocks.js +1767 -0
  147. package/dist/esm/presentation/timeboxes/timeBlocks.js.map +1 -0
  148. package/dist/esm/presentation/timeboxes/timeboxSettings.d.ts +71 -0
  149. package/dist/esm/presentation/timeboxes/timeboxSettings.d.ts.map +1 -0
  150. package/dist/esm/presentation/timeboxes/timeboxSettings.js +302 -0
  151. package/dist/esm/presentation/timeboxes/timeboxSettings.js.map +1 -0
  152. package/dist/esm/presentation/timeboxes/tracked.d.ts +51 -0
  153. package/dist/esm/presentation/timeboxes/tracked.d.ts.map +1 -0
  154. package/dist/esm/presentation/timeboxes/tracked.js +136 -0
  155. package/dist/esm/presentation/timeboxes/tracked.js.map +1 -0
  156. package/package.json +1 -1
@@ -0,0 +1,1767 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import styled, { css } from "styled-components";
4
+ import { ALL_DAY_VISIBLE_LANES, MeetingServiceIcon, EventGlyph, SHORT_MONTHS, AgendaFilter, AgendaViewSwitch, DAY_GRID_MAX_WIDTH, DAY_GRID_MIN_WIDTH, DAY_GRID_WIDTH_STORAGE_KEY, DatedHeaders, LaneRow, MyCalendarOptionsMenu, MyWorkTabs, StyledHourGrid, StyledMyCalendarPaper, StyledDaySplit, StyledMyCalendarToolbar, StyledPill, TIME_GUTTER, clockToMinutes, formatTimeOfDay, isoToDayNumber, isWeekendDay, mondayOf, percentOf, periodLabelFor, placeSideBySide, toDate, useViewportFillHeight } from "../myWork/agendaGrid";
5
+ import { DayProjectList, MyWorkAddMenu, useMyWorkTasks } from "../myWork/MyWorkTasks";
6
+ import { FloatingControls, PageHeader, PresentationShell, StyledPanelResizer, TRANSITION, useResizableWidth } from "../shared";
7
+ import { CapacityBar } from "./CapacityBar";
8
+ import { MUTED_EVENT_FILL, PAPER_RING, PILL_LOOK, paletteFill, paletteOf, tentativeHatch } from "./pillLook";
9
+ import { Button } from "../../components/Button";
10
+ import { IconButton } from "../../components/IconButton";
11
+ import { AddCrossTinyIcon, CancelCrossIcon, CheckboxCircleBlankIcon, ArrowLeftIcon, ClockSmallIcon, ArrowRightIcon, PinSmallIcon, SparkIcon, TreeDotsIcon, WarningTriangleSmallIcon } from "../../components/Icons";
12
+ import { InfoBox } from "../../components/InfoBox";
13
+ import { Label } from "../../components/Label";
14
+ import { List, ListItem, ListSeparator } from "../../components/List";
15
+ import { Menu } from "../../components/Menu";
16
+ import { Toggle } from "../../components/Toggle";
17
+ import { Tooltip } from "../../components/Tooltip";
18
+ import { Body2, Caption1, Header3 } from "../../components/Typography";
19
+ import { Typography } from "../../components/Typography/Typography";
20
+
21
+ /**
22
+ * Time blocks — a concept for the My Work Agenda's week and day
23
+ * views: tasks with an estimate leave the All Day row and take time in the
24
+ * hour grid as time blocks.
25
+ *
26
+ * Three layers: the estimate (hours for the assignee), the daily allocation
27
+ * (the estimate split, or the estimate over the task's days), and the time
28
+ * blocks that say when on the day the work happens — pinned by the user, or
29
+ * suggested by the scheduler into free time (work window − timed events −
30
+ * pinned blocks), important first, then earlier due date, then My Work order.
31
+ *
32
+ * The scheduler's output is mock payload (`TIME_BLOCKS`, `DAY_SCHEDULES`);
33
+ * the story only draws it. Everything around the grid is the Agenda as
34
+ * `My work calendar` draws it (../myWork/agendaGrid).
35
+ *
36
+ * The pages below are stories of "Presentation/Timeboxes"
37
+ * (Timeboxes.stories.tsx), next to the simulation.
38
+ */
39
+
40
+ /* ================================================================== */
41
+ /* Mock data */
42
+ /* ================================================================== */
43
+
44
+ /** Thu 29 Oct 2026, 11:45 in the owner's timezone — below the pinned
45
+ block's text, so the now-line does not strike its name. */
46
+ const TODAY_DAY = isoToDayNumber("2026-10-29");
47
+ const NOW_MINUTES = 11 * 60 + 45;
48
+ const WEEK_DAYS = Array.from({
49
+ length: 7
50
+ }, (_, offset) => mondayOf(TODAY_DAY) + offset);
51
+ /** In the user's My Work project order. */
52
+ const PROJECTS = [{
53
+ id: 101,
54
+ name: "Website Redesign",
55
+ company: "ActiveCollab Inc.",
56
+ color: "#4C8CF5"
57
+ }, {
58
+ id: 102,
59
+ name: "Mobile App",
60
+ company: "ActiveCollab Inc.",
61
+ color: "#F28B30"
62
+ }, {
63
+ id: 103,
64
+ name: "Marketing Q4",
65
+ company: "Northwind Traders",
66
+ color: "#9D6BD8"
67
+ }, {
68
+ id: 104,
69
+ name: "Customer Onboarding",
70
+ company: "ActiveCollab Inc.",
71
+ color: "#2FB67C"
72
+ }];
73
+ /* The tasks of the brief keep their letter in a comment: A–D are Thursday's
74
+ reference example, F is Friday's unscheduled remainder. */
75
+ const TASKS = [/* A */{
76
+ id: 412,
77
+ project_id: 101,
78
+ name: "Review homepage wireframes",
79
+ is_important: false,
80
+ is_completed: false,
81
+ start_on: "2026-10-29",
82
+ due_on: "2026-10-29",
83
+ estimate: 1
84
+ }, /* B */{
85
+ id: 418,
86
+ project_id: 102,
87
+ name: "Write API pagination spec",
88
+ is_important: false,
89
+ is_completed: false,
90
+ start_on: "2026-10-29",
91
+ due_on: "2026-10-29",
92
+ estimate: 1.5
93
+ }, /* C */{
94
+ id: 431,
95
+ project_id: 103,
96
+ name: "Prepare Q4 campaign brief",
97
+ is_important: false,
98
+ is_completed: false,
99
+ start_on: "2026-10-29",
100
+ due_on: "2026-10-29",
101
+ estimate: 2
102
+ }, /* D — split 1.5h Wed, 1.5h Thu, 1h Fri */{
103
+ id: 437,
104
+ project_id: 104,
105
+ name: "Migrate onboarding emails",
106
+ is_important: false,
107
+ is_completed: false,
108
+ start_on: "2026-10-28",
109
+ due_on: "2026-10-30",
110
+ estimate: 4
111
+ }, {
112
+ id: 402,
113
+ project_id: 102,
114
+ name: "Fix login redirect loop",
115
+ is_important: false,
116
+ is_completed: false,
117
+ start_on: "2026-10-26",
118
+ due_on: "2026-10-26",
119
+ estimate: 1
120
+ }, {
121
+ id: 404,
122
+ project_id: 103,
123
+ name: "Update pricing page copy",
124
+ is_important: false,
125
+ is_completed: false,
126
+ start_on: "2026-10-26",
127
+ due_on: "2026-10-26",
128
+ estimate: 3
129
+ }, {
130
+ id: 425,
131
+ project_id: 101,
132
+ name: "QA checkout flow",
133
+ is_important: false,
134
+ is_completed: false,
135
+ start_on: "2026-10-27",
136
+ due_on: "2026-10-27",
137
+ estimate: 2
138
+ }, {
139
+ id: 428,
140
+ project_id: 102,
141
+ name: "Draft release notes",
142
+ is_important: false,
143
+ is_completed: false,
144
+ start_on: "2026-10-27",
145
+ due_on: "2026-10-27",
146
+ estimate: 2
147
+ }, {
148
+ id: 409,
149
+ project_id: 103,
150
+ name: "Export Q3 analytics",
151
+ is_important: false,
152
+ is_completed: true,
153
+ start_on: "2026-10-28",
154
+ due_on: "2026-10-28",
155
+ estimate: 1
156
+ }, {
157
+ id: 441,
158
+ project_id: 104,
159
+ name: "Review support macros",
160
+ is_important: false,
161
+ is_completed: false,
162
+ start_on: "2026-10-28",
163
+ due_on: "2026-10-28",
164
+ estimate: 2
165
+ }, {
166
+ id: 445,
167
+ project_id: 101,
168
+ name: "Review open pull requests",
169
+ is_important: false,
170
+ is_completed: false,
171
+ start_on: "2026-10-30",
172
+ due_on: "2026-10-30",
173
+ estimate: 1
174
+ }, {
175
+ id: 450,
176
+ project_id: 103,
177
+ name: "Prepare board deck",
178
+ is_important: true,
179
+ is_completed: false,
180
+ start_on: "2026-10-30",
181
+ due_on: "2026-10-30",
182
+ estimate: 4.5
183
+ }, /* F */{
184
+ id: 433,
185
+ project_id: 102,
186
+ name: "Localize settings screens",
187
+ is_important: false,
188
+ is_completed: false,
189
+ start_on: "2026-10-30",
190
+ due_on: "2026-10-30",
191
+ estimate: 2
192
+ }, /* No estimate: stays an all-day pill. */
193
+ {
194
+ id: 436,
195
+ project_id: 103,
196
+ name: "Collect customer testimonials",
197
+ is_important: false,
198
+ is_completed: false,
199
+ start_on: "2026-10-28",
200
+ due_on: "2026-10-30",
201
+ estimate: null
202
+ }];
203
+ const SUBTASKS = [{
204
+ id: 9120,
205
+ task_id: 412,
206
+ name: "Export icon set",
207
+ due_on: "2026-10-29",
208
+ is_completed: false
209
+ }];
210
+ const EVENTS = [{
211
+ id: 1401,
212
+ class: "CalendarEvent",
213
+ name: "Weekly kickoff",
214
+ calendar_id: 5,
215
+ calendar_name: "Team",
216
+ color: "#63A7DE",
217
+ starts_on: "2026-10-26",
218
+ ends_on: "2026-10-26",
219
+ starts_on_time: "09:00:00",
220
+ ends_on_time: "09:50:00",
221
+ repeat_event: "weekly",
222
+ is_participant: true,
223
+ meeting_url: "https://meet.google.com/kxp-wqbt-rjd"
224
+ }, {
225
+ id: 1402,
226
+ class: "CalendarEvent",
227
+ name: "Client call — Northwind",
228
+ calendar_id: 9,
229
+ calendar_name: "Work (Google)",
230
+ color: "#F56F72",
231
+ starts_on: "2026-10-27",
232
+ ends_on: "2026-10-27",
233
+ starts_on_time: "14:00:00",
234
+ ends_on_time: "14:30:00",
235
+ repeat_event: "dont",
236
+ is_participant: true,
237
+ meeting_url: "https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWQ4"
238
+ }, {
239
+ id: 1403,
240
+ class: "CalendarEvent",
241
+ name: "Lunch & learn",
242
+ calendar_id: 5,
243
+ calendar_name: "Team",
244
+ color: "#63A7DE",
245
+ starts_on: "2026-10-28",
246
+ ends_on: "2026-10-28",
247
+ starts_on_time: "12:00:00",
248
+ ends_on_time: "13:00:00",
249
+ repeat_event: "dont",
250
+ is_participant: true,
251
+ meeting_url: null
252
+ }, {
253
+ id: 1404,
254
+ class: "CalendarEvent",
255
+ name: "Sprint planning",
256
+ calendar_id: 5,
257
+ calendar_name: "Team",
258
+ color: "#63A7DE",
259
+ starts_on: "2026-10-29",
260
+ ends_on: "2026-10-29",
261
+ starts_on_time: "14:00:00",
262
+ ends_on_time: "15:00:00",
263
+ repeat_event: "dont",
264
+ is_participant: true,
265
+ meeting_url: "https://zoom.us/j/84213377610"
266
+ }, {
267
+ id: 1405,
268
+ class: "CalendarEvent",
269
+ name: "Retro",
270
+ calendar_id: 5,
271
+ calendar_name: "Team",
272
+ color: "#63A7DE",
273
+ starts_on: "2026-10-30",
274
+ ends_on: "2026-10-30",
275
+ starts_on_time: "14:00:00",
276
+ ends_on_time: "15:00:00",
277
+ repeat_event: "dont",
278
+ is_participant: true,
279
+ meeting_url: "https://meet.google.com/vbn-ksoe-ytu"
280
+ }];
281
+ const SETTINGS = {
282
+ workday_starts_at: "09:00",
283
+ daily_capacity: 8,
284
+ working_days: [1, 2, 3, 4, 5],
285
+ suggestion_min_gap: 15,
286
+ pause_starts_at: null,
287
+ pause_length: 0,
288
+ timezone: "Europe/Belgrade"
289
+ };
290
+ const TIME_BLOCKS = [
291
+ /* Monday: the 09:50–10:00 gap is under the 15-min minimum, so the
292
+ suggestion starts after the pinned block, at 11:00. */
293
+ {
294
+ id: 1,
295
+ task_id: 402,
296
+ type: "pinned",
297
+ day: "2026-10-26",
298
+ starts_at: "10:00",
299
+ ends_at: "11:00",
300
+ fragment: null,
301
+ fragments: null,
302
+ overlapping_event_ids: []
303
+ }, {
304
+ id: 2,
305
+ task_id: 404,
306
+ type: "suggested",
307
+ day: "2026-10-26",
308
+ starts_at: "11:00",
309
+ ends_at: "14:00",
310
+ fragment: 1,
311
+ fragments: 1,
312
+ overlapping_event_ids: []
313
+ }, /* Tuesday: the client call was added after the block was pinned. */
314
+ {
315
+ id: 3,
316
+ task_id: 428,
317
+ type: "suggested",
318
+ day: "2026-10-27",
319
+ starts_at: "09:00",
320
+ ends_at: "11:00",
321
+ fragment: 1,
322
+ fragments: 1,
323
+ overlapping_event_ids: []
324
+ }, {
325
+ id: 4,
326
+ task_id: 425,
327
+ type: "pinned",
328
+ day: "2026-10-27",
329
+ starts_at: "13:00",
330
+ ends_at: "15:00",
331
+ fragment: null,
332
+ fragments: null,
333
+ overlapping_event_ids: [1402]
334
+ }, /* Wednesday: a completed task's pinned block stays, faded. */
335
+ {
336
+ id: 5,
337
+ task_id: 409,
338
+ type: "pinned",
339
+ day: "2026-10-28",
340
+ starts_at: "09:00",
341
+ ends_at: "10:00",
342
+ fragment: null,
343
+ fragments: null,
344
+ overlapping_event_ids: []
345
+ }, {
346
+ id: 6,
347
+ task_id: 437,
348
+ type: "suggested",
349
+ day: "2026-10-28",
350
+ starts_at: "10:00",
351
+ ends_at: "11:30",
352
+ fragment: 1,
353
+ fragments: 1,
354
+ overlapping_event_ids: []
355
+ }, {
356
+ id: 7,
357
+ task_id: 441,
358
+ type: "suggested",
359
+ day: "2026-10-28",
360
+ starts_at: "11:30",
361
+ ends_at: "12:00",
362
+ fragment: 1,
363
+ fragments: 2,
364
+ overlapping_event_ids: []
365
+ }, {
366
+ id: 8,
367
+ task_id: 441,
368
+ type: "suggested",
369
+ day: "2026-10-28",
370
+ starts_at: "13:00",
371
+ ends_at: "14:30",
372
+ fragment: 2,
373
+ fragments: 2,
374
+ overlapping_event_ids: []
375
+ }, /* Thursday: the reference example. */
376
+ {
377
+ id: 9,
378
+ task_id: 431,
379
+ type: "suggested",
380
+ day: "2026-10-29",
381
+ starts_at: "09:00",
382
+ ends_at: "09:30",
383
+ fragment: 1,
384
+ fragments: 3,
385
+ overlapping_event_ids: []
386
+ }, {
387
+ id: 10,
388
+ task_id: 412,
389
+ type: "pinned",
390
+ day: "2026-10-29",
391
+ starts_at: "09:30",
392
+ ends_at: "10:30",
393
+ fragment: null,
394
+ fragments: null,
395
+ overlapping_event_ids: []
396
+ }, {
397
+ id: 11,
398
+ task_id: 431,
399
+ type: "suggested",
400
+ day: "2026-10-29",
401
+ starts_at: "10:30",
402
+ ends_at: "11:00",
403
+ fragment: 2,
404
+ fragments: 3,
405
+ overlapping_event_ids: []
406
+ }, {
407
+ id: 12,
408
+ task_id: 418,
409
+ type: "pinned",
410
+ day: "2026-10-29",
411
+ starts_at: "11:00",
412
+ ends_at: "12:30",
413
+ fragment: null,
414
+ fragments: null,
415
+ overlapping_event_ids: []
416
+ }, {
417
+ id: 13,
418
+ task_id: 431,
419
+ type: "suggested",
420
+ day: "2026-10-29",
421
+ starts_at: "12:30",
422
+ ends_at: "13:30",
423
+ fragment: 3,
424
+ fragments: 3,
425
+ overlapping_event_ids: []
426
+ }, {
427
+ id: 14,
428
+ task_id: 437,
429
+ type: "suggested",
430
+ day: "2026-10-29",
431
+ starts_at: "13:30",
432
+ ends_at: "14:00",
433
+ fragment: 1,
434
+ fragments: 2,
435
+ overlapping_event_ids: []
436
+ }, {
437
+ id: 15,
438
+ task_id: 437,
439
+ type: "suggested",
440
+ day: "2026-10-29",
441
+ starts_at: "15:00",
442
+ ends_at: "16:00",
443
+ fragment: 2,
444
+ fragments: 2,
445
+ overlapping_event_ids: []
446
+ },
447
+ /* Friday: overbooked — the important deck first, then by due date, then
448
+ My Work order; 1.5h of the localization does not fit. */
449
+ {
450
+ id: 16,
451
+ task_id: 445,
452
+ type: "pinned",
453
+ day: "2026-10-30",
454
+ starts_at: "09:00",
455
+ ends_at: "10:00",
456
+ fragment: null,
457
+ fragments: null,
458
+ overlapping_event_ids: []
459
+ }, {
460
+ id: 17,
461
+ task_id: 450,
462
+ type: "suggested",
463
+ day: "2026-10-30",
464
+ starts_at: "10:00",
465
+ ends_at: "14:00",
466
+ fragment: 1,
467
+ fragments: 2,
468
+ overlapping_event_ids: []
469
+ }, {
470
+ id: 18,
471
+ task_id: 450,
472
+ type: "suggested",
473
+ day: "2026-10-30",
474
+ starts_at: "15:00",
475
+ ends_at: "15:30",
476
+ fragment: 2,
477
+ fragments: 2,
478
+ overlapping_event_ids: []
479
+ }, {
480
+ id: 19,
481
+ task_id: 437,
482
+ type: "suggested",
483
+ day: "2026-10-30",
484
+ starts_at: "15:30",
485
+ ends_at: "16:30",
486
+ fragment: 1,
487
+ fragments: 1,
488
+ overlapping_event_ids: []
489
+ }, {
490
+ id: 20,
491
+ task_id: 433,
492
+ type: "suggested",
493
+ day: "2026-10-30",
494
+ starts_at: "16:30",
495
+ ends_at: "17:00",
496
+ fragment: 1,
497
+ fragments: 1,
498
+ overlapping_event_ids: []
499
+ }];
500
+ const DAY_SCHEDULES = [{
501
+ day: "2026-10-26",
502
+ capacity: 480,
503
+ allocated: 240,
504
+ scheduled: 240,
505
+ unscheduled: []
506
+ }, {
507
+ day: "2026-10-27",
508
+ capacity: 480,
509
+ allocated: 240,
510
+ scheduled: 240,
511
+ unscheduled: []
512
+ }, {
513
+ day: "2026-10-28",
514
+ capacity: 480,
515
+ allocated: 270,
516
+ scheduled: 270,
517
+ unscheduled: []
518
+ }, {
519
+ day: "2026-10-29",
520
+ capacity: 480,
521
+ allocated: 360,
522
+ scheduled: 360,
523
+ unscheduled: [],
524
+ free_slots: [{
525
+ starts_at: "16:00",
526
+ ends_at: "17:00"
527
+ }]
528
+ }, {
529
+ day: "2026-10-30",
530
+ capacity: 480,
531
+ allocated: 510,
532
+ scheduled: 420,
533
+ unscheduled: [{
534
+ task_id: 433,
535
+ minutes: 90
536
+ }]
537
+ }, {
538
+ day: "2026-10-31",
539
+ capacity: 0,
540
+ allocated: 0,
541
+ scheduled: 0,
542
+ unscheduled: []
543
+ }, {
544
+ day: "2026-11-01",
545
+ capacity: 0,
546
+ allocated: 0,
547
+ scheduled: 0,
548
+ unscheduled: []
549
+ }];
550
+ /* Thursday's allocations: the Day view story's day. */
551
+ const ALLOCATIONS = [{
552
+ task_id: 412,
553
+ day: "2026-10-29",
554
+ minutes: 60,
555
+ left_after_day: 0
556
+ }, {
557
+ task_id: 418,
558
+ day: "2026-10-29",
559
+ minutes: 90,
560
+ left_after_day: 0
561
+ }, {
562
+ task_id: 431,
563
+ day: "2026-10-29",
564
+ minutes: 120,
565
+ left_after_day: 0
566
+ }, {
567
+ task_id: 437,
568
+ day: "2026-10-29",
569
+ minutes: 90,
570
+ left_after_day: 60
571
+ }];
572
+ /** Whose schedule it is. */
573
+ const OWNER = {
574
+ id: 7,
575
+ first_name: "Marko",
576
+ timezone: "Europe/Belgrade",
577
+ timezone_abbr: "CET",
578
+ utc_offset: 60
579
+ };
580
+
581
+ /** A teammate looking at the owner's schedule, eleven hours behind. */
582
+ const VIEWER = {
583
+ id: 12,
584
+ first_name: "Ana",
585
+ timezone: "Pacific/Honolulu",
586
+ timezone_abbr: "HST",
587
+ utc_offset: -600
588
+ };
589
+ const TIMEZONE_CHANGE = {
590
+ previous_timezone_abbr: "CET",
591
+ current_timezone: "Europe/London",
592
+ current_timezone_abbr: "GMT",
593
+ pinned_blocks_in_previous_timezone: 3
594
+ };
595
+
596
+ /* ================================================================== */
597
+ /* Render-time lookups */
598
+ /* ================================================================== */
599
+
600
+ const projectOf = projectId => PROJECTS.find(project => project.id === projectId);
601
+ const taskOf = taskId => TASKS.find(task => task.id === taskId);
602
+ const scheduleOf = day => DAY_SCHEDULES.find(schedule => isoToDayNumber(schedule.day) === day);
603
+
604
+ /** "6h", "1.5h" — the estimate's own unit. */
605
+ const formatHours = minutes => Math.round(minutes / 60 * 100) / 100 + "h";
606
+ const isWorkingDay = day => SETTINGS.working_days.includes((toDate(day).getUTCDay() + 6) % 7 + 1);
607
+
608
+ /** Work window: from the configured start, as long as the daily capacity. */
609
+ const WORK_START = clockToMinutes(SETTINGS.workday_starts_at);
610
+ const WORK_END = WORK_START + SETTINGS.daily_capacity * 60;
611
+
612
+ /* ================================================================== */
613
+ /* Geometry */
614
+ /* ================================================================== */
615
+
616
+ /** A departure from the app's 36px: 48px an hour, so a 30-min block (24px)
617
+ holds its name line. Half-hour lines are added for the same reason. */
618
+ const BLOCK_HOUR_HEIGHT = 48;
619
+ const HALF_HOUR = BLOCK_HOUR_HEIGHT / 2;
620
+ /** Under this a block shows its name line only (DayEvent.jsx's 36px). */
621
+ const TWO_LINE_HEIGHT = 36;
622
+ const minuteTop = minutes => minutes / 60 * BLOCK_HOUR_HEIGHT;
623
+
624
+ /* ================================================================== */
625
+ /* Styles */
626
+ /* ================================================================== */
627
+
628
+ /* The Agenda's hour grid at 48px an hour. Lines move to their own layer
629
+ (.slot-lines) so the off-hours tint sits under them. */
630
+ const StyledBlockHourGrid = styled(StyledHourGrid).withConfig({
631
+ displayName: "timeBlocks__StyledBlockHourGrid",
632
+ componentId: "sc-qxsot7-0"
633
+ })([".time-canvas{height:", "px;}.time-column{background-image:none;}.off-hours{position:absolute;left:0;right:0;background-color:var(--color-theme-200);}.slot-lines{position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient( to bottom,transparent 0,transparent ", "px,var(--border-primary) ", "px,var(--border-primary) ", "px ),repeating-linear-gradient( to bottom,transparent 0,transparent ", "px,var(--color-theme-transparent-300) ", "px,var(--color-theme-transparent-300) ", "px );}.time-column.past .block.suggested{opacity:0.5;}.time-column.reflowing .block.suggested{opacity:0.3;}"], 24 * BLOCK_HOUR_HEIGHT, BLOCK_HOUR_HEIGHT - 1, BLOCK_HOUR_HEIGHT - 1, BLOCK_HOUR_HEIGHT, HALF_HOUR - 1, HALF_HOUR - 1, HALF_HOUR);
634
+
635
+ /* The block's menu: the task menu's list (TaskOptionsMenu), text items. */
636
+ const StyledBlockMenu = styled.div.withConfig({
637
+ displayName: "timeBlocks__StyledBlockMenu",
638
+ componentId: "sc-qxsot7-1"
639
+ })([".menu-list{padding:8px 0;}"]);
640
+
641
+ /* A block's hover-only "…" (top right; centred in a one-line block). The
642
+ first line makes room for it while it shows. */
643
+ const BLOCK_MENU_ANCHOR = css([".block-menu-anchor{position:absolute;top:1px;right:1px;display:flex;opacity:0;transition:opacity ", ";}&.compact .block-menu-anchor{top:50%;transform:translateY(-50%);}&:hover .block-menu-anchor,.block-menu-anchor.open{opacity:1;}&:hover .block-line,&.menu-open .block-line{padding-right:22px;}"], TRANSITION);
644
+
645
+ /* The unscheduled remainder in the All Day row: the pill, dashed in the
646
+ alert colour. */
647
+ const StyledUnscheduledPill = styled(StyledPill).withConfig({
648
+ displayName: "timeBlocks__StyledUnscheduledPill",
649
+ componentId: "sc-qxsot7-2"
650
+ })(["&&{justify-content:flex-start;background-color:var(--page-paper-main);border-style:dashed;border-width:1px;border-color:var(--red-alert);}"]);
651
+
652
+ /* ================================================================== */
653
+ /* Pieces */
654
+ /* ================================================================== */
655
+
656
+ /** The header's bar from the day's schedule (the shared CapacityBar). */
657
+ const DayCapacityBar = _ref => {
658
+ let day = _ref.day;
659
+ const schedule = scheduleOf(day);
660
+ if (!schedule) {
661
+ return /*#__PURE__*/React.createElement(CapacityBar, {
662
+ scheduled: 0,
663
+ allocated: 0,
664
+ capacity: 0,
665
+ over: false,
666
+ tooltip: ""
667
+ });
668
+ }
669
+ const capacity = schedule.capacity,
670
+ allocated = schedule.allocated,
671
+ scheduled = schedule.scheduled;
672
+ const over = allocated > capacity;
673
+ const due = TASKS.filter(task => isoToDayNumber(task.due_on) === day);
674
+ const done = due.filter(task => task.is_completed).length;
675
+ const title = [formatHours(scheduled) + " / " + formatHours(allocated) + " / " + formatHours(capacity) + " \u2014 scheduled / allocated / capacity", over ? "Overbooked by " + formatHours(allocated - capacity) : null, due.length > 0 ? "Due: " + done + " of " + due.length + " completed" : null].filter(Boolean).join(" · ");
676
+ return /*#__PURE__*/React.createElement(CapacityBar, {
677
+ scheduled: scheduled,
678
+ allocated: allocated,
679
+ capacity: capacity,
680
+ over: over,
681
+ tooltip: title
682
+ });
683
+ };
684
+ DayCapacityBar.displayName = "DayCapacityBar";
685
+
686
+ /** "1h 15m", "45m", "2h" — a block's length while it is resized. */
687
+ const formatBlockLength = minutes => {
688
+ const hours = Math.floor(minutes / 60);
689
+ const rest = minutes % 60;
690
+ if (hours === 0) return rest + "m";
691
+ return rest === 0 ? hours + "h" : hours + "h " + rest + "m";
692
+ };
693
+
694
+ /** A state a story opens in (block interactions): drawn, not wired. */
695
+
696
+ /** A block's hover-only "…": the actions a pinned or a suggested block
697
+ offers. Clicks only close it. */
698
+ const BlockMenu = _ref2 => {
699
+ let pinned = _ref2.pinned,
700
+ open = _ref2.open,
701
+ onOpen = _ref2.onOpen,
702
+ onClose = _ref2.onClose;
703
+ return /*#__PURE__*/React.createElement("span", {
704
+ className: open ? "block-menu-anchor open" : "block-menu-anchor"
705
+ }, /*#__PURE__*/React.createElement(Menu, {
706
+ open: open,
707
+ onOpen: onOpen,
708
+ onClose: onClose,
709
+ position: "bottom-end",
710
+ target: /*#__PURE__*/React.createElement(IconButton, {
711
+ type: "button",
712
+ size: "small",
713
+ variant: "text gray",
714
+ "aria-label": "Block options",
715
+ active: open
716
+ }, /*#__PURE__*/React.createElement(TreeDotsIcon, null))
717
+ }, /*#__PURE__*/React.createElement(StyledBlockMenu, null, /*#__PURE__*/React.createElement(List, {
718
+ className: "menu-list",
719
+ tabIndex: 0
720
+ }, pinned ? /*#__PURE__*/React.createElement(ListItem, {
721
+ onClick: onClose
722
+ }, "Unpin (back to suggestions)") : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItem, {
723
+ onClick: onClose
724
+ }, "Pin"), /*#__PURE__*/React.createElement(ListItem, {
725
+ onClick: onClose
726
+ }, "Pin all suggestions for today")), /*#__PURE__*/React.createElement(ListSeparator, null), /*#__PURE__*/React.createElement(ListItem, {
727
+ onClick: onClose
728
+ }, "Open task")))));
729
+ };
730
+ BlockMenu.displayName = "BlockMenu";
731
+ /** A timed event, read off the payload for the grid. */
732
+ const eventEntryOf = event => {
733
+ var _event$meeting_url;
734
+ return {
735
+ key: "event-" + event.id,
736
+ kind: "event",
737
+ name: event.name,
738
+ startDay: isoToDayNumber(event.starts_on),
739
+ endDay: isoToDayNumber(event.ends_on),
740
+ color: event.color,
741
+ completed: false,
742
+ important: false,
743
+ participant: event.is_participant,
744
+ meetingUrl: (_event$meeting_url = event.meeting_url) != null ? _event$meeting_url : undefined,
745
+ startMinute: event.starts_on_time ? clockToMinutes(event.starts_on_time) : undefined,
746
+ endMinute: event.ends_on_time ? clockToMinutes(event.ends_on_time) : undefined
747
+ };
748
+ };
749
+
750
+ /* ================================================================== */
751
+ /* Pills (the new_task look, ./pillLook, shared with the simulation) */
752
+ /* ================================================================== */
753
+
754
+ /* A task or an event in the hour grid: the app's pill filled with its
755
+ palette colour (PILL_LOOK). Line 1 is the name with the length on the
756
+ right; line 2 the times and what the block is (fragments as dots,
757
+ overlaps as a warning chip). */
758
+ const StyledPillCard = styled.div.withConfig({
759
+ displayName: "timeBlocks__StyledPillCard",
760
+ componentId: "sc-qxsot7-3"
761
+ })(["", " cursor:pointer;transition:background ", ";.block-length{flex-shrink:0;}.block-time{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}&.completed{opacity:0.5;}&.continues-before{border-top-left-radius:0;border-top-right-radius:0;}&.continues-after{border-bottom-left-radius:0;border-bottom-right-radius:0;}", " .resize-handle{box-sizing:border-box;position:absolute;left:50%;display:none;width:24px;height:2px;border-top:3px double var(--border-primary);transform:translateX(-50%);cursor:ns-resize;}.resize-handle.top{top:3px;}.resize-handle.bottom{bottom:3px;}&:not(.compact):hover .resize-handle{display:block;}&.resizing{z-index:3;outline:1px solid var(--color-primary);}&.resizing .resize-handle.bottom{display:block;border-top-color:var(--color-primary);}"], PILL_LOOK, TRANSITION, BLOCK_MENU_ANCHOR);
762
+
763
+ /** A pinned or suggested block as a new_task pill: pinned is the palette
764
+ fill, a suggestion the colour's see-through hatch. */
765
+ const PillBlockCard = _ref3 => {
766
+ let block = _ref3.block,
767
+ style = _ref3.style,
768
+ start = _ref3.start,
769
+ end = _ref3.end,
770
+ label = _ref3.label,
771
+ _ref3$continuesBefore = _ref3.continuesBefore,
772
+ continuesBefore = _ref3$continuesBefore === void 0 ? false : _ref3$continuesBefore,
773
+ _ref3$continuesAfter = _ref3.continuesAfter,
774
+ continuesAfter = _ref3$continuesAfter === void 0 ? false : _ref3$continuesAfter,
775
+ shiftedFrom = _ref3.shiftedFrom,
776
+ linked = _ref3.linked,
777
+ onHover = _ref3.onHover,
778
+ showTaskIds = _ref3.showTaskIds,
779
+ menuOpen = _ref3.menuOpen,
780
+ onMenuOpen = _ref3.onMenuOpen,
781
+ onMenuClose = _ref3.onMenuClose,
782
+ resizedEnd = _ref3.resizedEnd;
783
+ const task = taskOf(block.task_id);
784
+ const project = task ? projectOf(task.project_id) : undefined;
785
+ if (!task || !project) return null;
786
+ const resizing = resizedEnd !== undefined;
787
+ const shownEnd = resizedEnd != null ? resizedEnd : end;
788
+ const labelEnd = resizing ? label.start + (shownEnd - start) : label.end;
789
+ const height = Math.max(minuteTop(shownEnd - start), 20);
790
+ const pinned = block.type === "pinned";
791
+ const overlaps = EVENTS.filter(event => block.overlapping_event_ids.includes(event.id));
792
+ const linkKey = block.task_id + "-" + block.day;
793
+ const _paletteOf = paletteOf(project.color),
794
+ base = _paletteOf.base;
795
+ const className = ["block", block.type, height < TWO_LINE_HEIGHT ? "compact" : "", linked ? "linked" : "", task.is_completed ? "completed" : "", menuOpen ? "menu-open" : "", resizing ? "resizing" : "", continuesBefore ? "continues-before" : "", continuesAfter ? "continues-after" : ""].filter(Boolean).join(" ");
796
+ /* A completed task's pinned block is history: no resize. */
797
+ const resizable = pinned && !task.is_completed;
798
+ return /*#__PURE__*/React.createElement(StyledPillCard, {
799
+ className: className,
800
+ style: _extends({}, style, {
801
+ height,
802
+ background: pinned ? paletteFill(base) : tentativeHatch(base, linked),
803
+ boxShadow: PAPER_RING
804
+ }),
805
+ onMouseEnter: pinned ? undefined : () => onHover(linkKey),
806
+ onMouseLeave: pinned ? undefined : () => onHover(null)
807
+ }, /*#__PURE__*/React.createElement("span", {
808
+ className: "block-line"
809
+ }, /*#__PURE__*/React.createElement("span", {
810
+ className: "block-glyph"
811
+ }, pinned ? /*#__PURE__*/React.createElement(PinSmallIcon, {
812
+ width: 12,
813
+ height: 12,
814
+ style: {
815
+ fill: base
816
+ },
817
+ "aria-label": "Pinned"
818
+ }) : /*#__PURE__*/React.createElement(SparkIcon, {
819
+ width: 12,
820
+ height: 12,
821
+ style: {
822
+ fill: base
823
+ },
824
+ "aria-label": "Suggested"
825
+ })), showTaskIds ? /*#__PURE__*/React.createElement(Caption1, {
826
+ color: "tertiary",
827
+ className: "block-meta fill-text",
828
+ tabularNums: true
829
+ }, "#" + task.id) : null, /*#__PURE__*/React.createElement(Typography, {
830
+ variant: "Caption 1",
831
+ weight: "regular",
832
+ className: "block-name",
833
+ color: task.is_important ? "alert" : "primary",
834
+ decoration: task.is_completed ? "line-through" : undefined
835
+ }, task.name), shiftedFrom ? /*#__PURE__*/React.createElement(Tooltip, {
836
+ title: shiftedFrom
837
+ }, /*#__PURE__*/React.createElement("span", {
838
+ className: "block-glyph"
839
+ }, /*#__PURE__*/React.createElement(ClockSmallIcon, {
840
+ width: 12,
841
+ height: 12,
842
+ style: {
843
+ fill: "var(--color-theme-700)"
844
+ },
845
+ "aria-label": shiftedFrom
846
+ }))) : null, /*#__PURE__*/React.createElement(Caption1, {
847
+ color: "tertiary",
848
+ className: "block-length",
849
+ tabularNums: true
850
+ }, formatBlockLength(shownEnd - start))), /*#__PURE__*/React.createElement("span", {
851
+ className: "block-detail"
852
+ }, /*#__PURE__*/React.createElement(Caption1, {
853
+ color: "secondary",
854
+ className: "block-time fill-text",
855
+ tabularNums: true
856
+ }, formatTimeOfDay(dayMinute(label.start)) + " \u2013 " + formatTimeOfDay(dayMinute(labelEnd))), block.fragment !== null && block.fragments !== null ? /*#__PURE__*/React.createElement(Tooltip, {
857
+ title: "Part " + block.fragment + " of " + block.fragments
858
+ }, /*#__PURE__*/React.createElement("span", {
859
+ className: "fragment-dots"
860
+ }, Array.from({
861
+ length: block.fragments
862
+ }, (_, index) => /*#__PURE__*/React.createElement("span", {
863
+ className: "fragment-dot",
864
+ key: index,
865
+ style: {
866
+ borderColor: base,
867
+ backgroundColor: index + 1 === block.fragment ? base : "transparent"
868
+ }
869
+ })))) : null, overlaps.map(event => /*#__PURE__*/React.createElement(Tooltip, {
870
+ title: "Overlaps: " + event.name,
871
+ key: event.id
872
+ }, /*#__PURE__*/React.createElement("span", {
873
+ className: "overlap-chip"
874
+ }, /*#__PURE__*/React.createElement(WarningTriangleSmallIcon, {
875
+ width: 12,
876
+ height: 12,
877
+ style: {
878
+ fill: "var(--red-alert)",
879
+ flexShrink: 0
880
+ },
881
+ "aria-hidden": true
882
+ }), /*#__PURE__*/React.createElement(Caption1, {
883
+ color: "alert",
884
+ className: "block-name"
885
+ }, event.name))))), resizable ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
886
+ className: "resize-handle top"
887
+ }), /*#__PURE__*/React.createElement("span", {
888
+ className: "resize-handle bottom"
889
+ })) : null, /*#__PURE__*/React.createElement(BlockMenu, {
890
+ pinned: pinned,
891
+ open: menuOpen,
892
+ onOpen: onMenuOpen,
893
+ onClose: onMenuClose
894
+ }));
895
+ };
896
+ PillBlockCard.displayName = "PillBlockCard";
897
+
898
+ /** A timed event as a new_task pill: filled with the calendar's palette
899
+ colour; an event without the user stays neutral with its colour on the
900
+ leading edge (calendar-event-fill / calendar-event-muted). */
901
+ const PillEventCard = _ref4 => {
902
+ var _style$height;
903
+ let entry = _ref4.entry,
904
+ style = _ref4.style,
905
+ label = _ref4.label,
906
+ _ref4$continuesBefore = _ref4.continuesBefore,
907
+ continuesBefore = _ref4$continuesBefore === void 0 ? false : _ref4$continuesBefore,
908
+ _ref4$continuesAfter = _ref4.continuesAfter,
909
+ continuesAfter = _ref4$continuesAfter === void 0 ? false : _ref4$continuesAfter;
910
+ const height = Number((_style$height = style.height) != null ? _style$height : 20);
911
+ const _paletteOf2 = paletteOf(entry.color),
912
+ base = _paletteOf2.base;
913
+ const muted = !entry.participant;
914
+ const paint = muted ? {
915
+ backgroundColor: MUTED_EVENT_FILL,
916
+ borderLeftColor: base,
917
+ boxShadow: PAPER_RING
918
+ } : {
919
+ backgroundColor: paletteFill(base),
920
+ boxShadow: PAPER_RING
921
+ };
922
+ const className = ["event", height < TWO_LINE_HEIGHT ? "compact" : "", continuesBefore ? "continues-before" : "", continuesAfter ? "continues-after" : ""].filter(Boolean).join(" ");
923
+ return /*#__PURE__*/React.createElement(StyledPillCard, {
924
+ className: className,
925
+ style: _extends({}, style, paint)
926
+ }, /*#__PURE__*/React.createElement("span", {
927
+ className: "block-line"
928
+ }, /*#__PURE__*/React.createElement(EventGlyph, {
929
+ color: base
930
+ }), entry.meetingUrl ? /*#__PURE__*/React.createElement(MeetingServiceIcon, {
931
+ url: entry.meetingUrl
932
+ }) : null, /*#__PURE__*/React.createElement(Typography, {
933
+ variant: "Caption 1",
934
+ weight: "medium",
935
+ className: "block-name",
936
+ color: entry.participant ? "primary" : "tertiary"
937
+ }, entry.name), /*#__PURE__*/React.createElement(Caption1, {
938
+ color: "tertiary",
939
+ className: "block-length",
940
+ tabularNums: true
941
+ }, formatBlockLength(label.end - label.start))), /*#__PURE__*/React.createElement("span", {
942
+ className: "block-detail"
943
+ }, /*#__PURE__*/React.createElement(Caption1, {
944
+ color: "secondary",
945
+ className: muted ? "block-time" : "block-time fill-text",
946
+ tabularNums: true
947
+ }, formatTimeOfDay(dayMinute(label.start)) + " \u2013 " + formatTimeOfDay(dayMinute(label.end)))));
948
+ };
949
+ PillEventCard.displayName = "PillEventCard";
950
+
951
+ /* The All Day row: secondary text on a new_task fill follows the primary
952
+ one. */
953
+ const StyledAllDayRow = styled.div.withConfig({
954
+ displayName: "timeBlocks__StyledAllDayRow",
955
+ componentId: "sc-qxsot7-4"
956
+ })([".fill-text{color:color-mix(in srgb,var(--color-theme-900) 80%,transparent);}"]);
957
+
958
+ /** All Day pills, new_task (AgendaItemPill with calendarEventPaint): a task
959
+ is the palette fill with no border; a subtask stays a line with its
960
+ circle in the palette colour. The unscheduled remainder keeps its own
961
+ pill. */
962
+ const renderNewTaskSegment = (segment, style) => {
963
+ if (segment.key.startsWith("unscheduled-")) {
964
+ return renderAllDaySegment(segment, style);
965
+ }
966
+ const _paletteOf3 = paletteOf(segment.color),
967
+ base = _paletteOf3.base;
968
+ const className = [segment.kind === "subtask" ? "subtask" : "", segment.completed ? "completed" : "", segment.continuesPrior ? "continues-prior" : "", segment.continuesAfter ? "continues-after" : ""].filter(Boolean).join(" ");
969
+ if (segment.kind === "subtask") {
970
+ return /*#__PURE__*/React.createElement(StyledPill, {
971
+ className: className,
972
+ style: style
973
+ }, /*#__PURE__*/React.createElement(CheckboxCircleBlankIcon, {
974
+ width: 14,
975
+ height: 14,
976
+ style: {
977
+ fill: base,
978
+ flexShrink: 0
979
+ },
980
+ "aria-hidden": true
981
+ }), /*#__PURE__*/React.createElement(Caption1, {
982
+ className: "pill-name",
983
+ decoration: segment.completed ? "line-through" : undefined
984
+ }, segment.name));
985
+ }
986
+ return /*#__PURE__*/React.createElement(StyledPill, {
987
+ className: className || undefined,
988
+ style: _extends({}, style, {
989
+ borderColor: "transparent",
990
+ backgroundColor: paletteFill(base),
991
+ boxShadow: PAPER_RING
992
+ })
993
+ }, /*#__PURE__*/React.createElement("span", {
994
+ className: "pill-lead"
995
+ }, segment.taskNumber !== undefined ? /*#__PURE__*/React.createElement(Caption1, {
996
+ color: "tertiary",
997
+ className: "pill-time fill-text"
998
+ }, "#" + segment.taskNumber) : null, /*#__PURE__*/React.createElement(Caption1, {
999
+ className: "pill-name",
1000
+ color: segment.important ? "alert" : "primary",
1001
+ decoration: segment.completed ? "line-through" : undefined
1002
+ }, segment.name)));
1003
+ };
1004
+ const MINUTES_PER_DAY = 24 * 60;
1005
+
1006
+ /** Minutes after midnight for an absolute minute (any day). */
1007
+ const dayMinute = minutes => (minutes % MINUTES_PER_DAY + MINUTES_PER_DAY) % MINUTES_PER_DAY;
1008
+
1009
+ /** The day an absolute minute falls on. */
1010
+ const dayOfMinute = minutes => Math.floor(minutes / MINUTES_PER_DAY);
1011
+
1012
+ /** "YYYY-MM-DD" + "HH:mm" on the owner's clock, as minutes since the epoch
1013
+ on the shown clock (the owner's moved by `shift`). */
1014
+ const absoluteMinute = (day, clock, shift) => isoToDayNumber(day) * MINUTES_PER_DAY + clockToMinutes(clock) + shift;
1015
+
1016
+ /** "29 Oct" — the planned day in the shifted-day tooltip. */
1017
+ const shortDateOf = day => toDate(day).getUTCDate() + " " + SHORT_MONTHS[toDate(day).getUTCMonth()];
1018
+
1019
+ /** One item's part in one day column, in minutes of that day. */
1020
+
1021
+ /** The clock the grid shows: the owner's own, or a viewer's. */
1022
+
1023
+ const OWNER_CLOCK = {
1024
+ shift: 0,
1025
+ ownerClockName: ""
1026
+ };
1027
+ /** The hour grid with events and time blocks; overlapping items sit side by
1028
+ side (only events and pinned blocks can overlap). Items are placed by
1029
+ their absolute time, so on another clock they move between days and an
1030
+ item that crosses midnight is cut into two parts. */
1031
+ const TimeBlockGrid = _ref5 => {
1032
+ let days = _ref5.days,
1033
+ options = _ref5.options,
1034
+ demo = _ref5.demo,
1035
+ _ref5$clock = _ref5.clock,
1036
+ clock = _ref5$clock === void 0 ? OWNER_CLOCK : _ref5$clock;
1037
+ const scrollRef = useRef(null);
1038
+ const _useState = useState(null),
1039
+ hovered = _useState[0],
1040
+ setHovered = _useState[1];
1041
+ const _useState2 = useState(null),
1042
+ menuBlockId = _useState2[0],
1043
+ setMenuBlockId = _useState2[1];
1044
+ const menuBlock = TIME_BLOCKS.find(block => block.id === menuBlockId);
1045
+ /* The task-day whose fragments read as one: hovered, or its menu open. */
1046
+ const linkedKey = hovered != null ? hovered : menuBlock ? menuBlock.task_id + "-" + menuBlock.day : null;
1047
+ const shift = clock.shift;
1048
+ const now = TODAY_DAY * MINUTES_PER_DAY + NOW_MINUTES + shift;
1049
+ const today = dayOfMinute(now);
1050
+ useEffect(() => {
1051
+ if (scrollRef.current) {
1052
+ /* An hour before the owner's work window on the shown clock — 08:00
1053
+ on the owner's own (calendar_starting_hours). */
1054
+ scrollRef.current.scrollTop = minuteTop(Math.max(0, dayMinute(WORK_START + shift) - 60));
1055
+ }
1056
+ /* A story's open menu opens once the grid has scrolled, so it lands
1057
+ beside its block. */
1058
+ if ((demo == null ? void 0 : demo.menuBlockId) !== undefined) setMenuBlockId(demo.menuBlockId);
1059
+ }, [demo, shift]);
1060
+ const items = [...(options.showEvents ? EVENTS : []).filter(event => event.starts_on_time !== null && event.ends_on_time !== null).map(event => {
1061
+ var _event$starts_on_time, _event$ends_on_time;
1062
+ return {
1063
+ kind: "event",
1064
+ entry: eventEntryOf(event),
1065
+ start: absoluteMinute(event.starts_on, (_event$starts_on_time = event.starts_on_time) != null ? _event$starts_on_time : "00:00", shift),
1066
+ end: absoluteMinute(event.ends_on, (_event$ends_on_time = event.ends_on_time) != null ? _event$ends_on_time : "00:00", shift)
1067
+ };
1068
+ }), ...(options.showTasks ? TIME_BLOCKS : []).filter(block => {
1069
+ var _taskOf;
1070
+ const completed = (_taskOf = taskOf(block.task_id)) == null ? void 0 : _taskOf.is_completed;
1071
+ /* A completed task keeps its pinned blocks (when Show Completed is
1072
+ on) and loses its suggestions. */
1073
+ if (!completed) return true;
1074
+ return block.type === "pinned" && options.showCompleted;
1075
+ }).map(block => ({
1076
+ kind: "block",
1077
+ block,
1078
+ start: absoluteMinute(block.day, block.starts_at, shift),
1079
+ end: absoluteMinute(block.day, block.ends_at, shift)
1080
+ }))];
1081
+
1082
+ /* The owner's work windows on the shown clock, a day either side of the
1083
+ week so a shifted window still reaches its edge columns. */
1084
+ const workWindows = Array.from({
1085
+ length: days.length + 2
1086
+ }, (_, index) => days[0] - 1 + index).filter(isWorkingDay).map(day => ({
1087
+ start: day * MINUTES_PER_DAY + WORK_START + shift,
1088
+ end: day * MINUTES_PER_DAY + WORK_END + shift
1089
+ }));
1090
+
1091
+ /** The parts of [from, to) that fall on a day, in minutes of that day. */
1092
+ const clipTo = (day, from, to) => {
1093
+ const dayStart = day * MINUTES_PER_DAY;
1094
+ const start = Math.max(from, dayStart);
1095
+ const end = Math.min(to, dayStart + MINUTES_PER_DAY);
1096
+ return end > start ? {
1097
+ start: start - dayStart,
1098
+ end: end - dayStart
1099
+ } : null;
1100
+ };
1101
+ return /*#__PURE__*/React.createElement(StyledBlockHourGrid, {
1102
+ ref: scrollRef,
1103
+ className: "hour-grid"
1104
+ }, /*#__PURE__*/React.createElement("div", {
1105
+ className: "time-canvas"
1106
+ }, /*#__PURE__*/React.createElement("div", {
1107
+ className: "time-gutter",
1108
+ style: {
1109
+ width: TIME_GUTTER
1110
+ }
1111
+ }, Array.from({
1112
+ length: 23
1113
+ }, (_, index) => index + 1).map(hour => {
1114
+ return /*#__PURE__*/React.createElement(Caption1, {
1115
+ color: "secondary",
1116
+ className: "hour-label",
1117
+ key: hour,
1118
+ style: {
1119
+ top: hour * BLOCK_HOUR_HEIGHT
1120
+ }
1121
+ }, formatTimeOfDay(hour * 60));
1122
+ })), /*#__PURE__*/React.createElement("div", {
1123
+ className: "time-columns"
1124
+ }, days.map(day => {
1125
+ const resizing = TIME_BLOCKS.find(block => {
1126
+ var _demo$resizing;
1127
+ return block.id === (demo == null || (_demo$resizing = demo.resizing) == null ? void 0 : _demo$resizing.blockId);
1128
+ });
1129
+ const classes = ["time-column", day === today ? "today" : "", day < today ? "past" : "", resizing && dayOfMinute(absoluteMinute(resizing.day, resizing.starts_at, shift)) === day ? "reflowing" : "", options.showNonWorking && isWeekendDay(day) ? "non-working" : ""].filter(Boolean).join(" ");
1130
+ /* Off-hours: what the work windows leave of the day, on days
1131
+ they touch at all (a day they miss is a day off, hatched). */
1132
+ const work = workWindows.map(window => clipTo(day, window.start, window.end)).filter(part => Boolean(part)).sort((a, b) => a.start - b.start);
1133
+ const offHours = [];
1134
+ if (work.length > 0) {
1135
+ let cursor = 0;
1136
+ work.forEach(part => {
1137
+ if (part.start > cursor) {
1138
+ offHours.push({
1139
+ start: cursor,
1140
+ end: part.start
1141
+ });
1142
+ }
1143
+ cursor = Math.max(cursor, part.end);
1144
+ });
1145
+ if (cursor < MINUTES_PER_DAY) {
1146
+ offHours.push({
1147
+ start: cursor,
1148
+ end: MINUTES_PER_DAY
1149
+ });
1150
+ }
1151
+ }
1152
+ const dayStart = day * MINUTES_PER_DAY;
1153
+ const parts = items.flatMap(item => {
1154
+ const part = clipTo(day, item.start, item.end);
1155
+ return part ? [_extends({
1156
+ item
1157
+ }, part, {
1158
+ continuesBefore: item.start < dayStart,
1159
+ continuesAfter: item.end > dayStart + MINUTES_PER_DAY
1160
+ })] : [];
1161
+ });
1162
+ return /*#__PURE__*/React.createElement("div", {
1163
+ className: classes,
1164
+ key: day
1165
+ }, offHours.map(part => /*#__PURE__*/React.createElement("span", {
1166
+ className: "off-hours",
1167
+ key: part.start,
1168
+ style: {
1169
+ top: minuteTop(part.start),
1170
+ height: minuteTop(part.end - part.start)
1171
+ }
1172
+ })), /*#__PURE__*/React.createElement("span", {
1173
+ className: "slot-lines"
1174
+ }), placeSideBySide(parts, part => part.start, part => part.end).map(_ref6 => {
1175
+ var _demo$resizing2;
1176
+ let part = _ref6.item,
1177
+ column = _ref6.column,
1178
+ columns = _ref6.columns;
1179
+ const placement = {
1180
+ top: minuteTop(part.start),
1181
+ left: "calc(" + percentOf(column, columns) + " + 2px)",
1182
+ width: "calc(" + percentOf(1, columns) + " - 4px)"
1183
+ };
1184
+ const item = part.item;
1185
+ if (item.kind === "event") {
1186
+ const height = Math.max(minuteTop(part.end - part.start), 20);
1187
+ return /*#__PURE__*/React.createElement(PillEventCard, {
1188
+ key: item.entry.key + "-" + day,
1189
+ entry: item.entry,
1190
+ label: {
1191
+ start: item.start,
1192
+ end: item.end
1193
+ },
1194
+ continuesBefore: part.continuesBefore,
1195
+ continuesAfter: part.continuesAfter,
1196
+ style: _extends({}, placement, {
1197
+ height
1198
+ })
1199
+ });
1200
+ }
1201
+ const block = item.block;
1202
+ const linkKey = block.task_id + "-" + block.day;
1203
+ /* The layout keeps the block's saved length while it is
1204
+ dragged; the block itself draws the new one on top. */
1205
+ const resizedEnd = (demo == null || (_demo$resizing2 = demo.resizing) == null ? void 0 : _demo$resizing2.blockId) === block.id ? absoluteMinute(block.day, demo.resizing.endsAt, shift) - dayStart : undefined;
1206
+ const plannedDay = isoToDayNumber(block.day);
1207
+ const shiftedFrom = shift !== 0 && block.type === "pinned" && dayOfMinute(item.start) !== plannedDay ? "Planned for " + shortDateOf(plannedDay) + " in " + clock.ownerClockName : undefined;
1208
+ return /*#__PURE__*/React.createElement(PillBlockCard, {
1209
+ key: block.id + "-" + day,
1210
+ block: block,
1211
+ style: placement,
1212
+ start: part.start,
1213
+ end: part.end,
1214
+ label: {
1215
+ start: item.start,
1216
+ end: item.end
1217
+ },
1218
+ continuesBefore: part.continuesBefore,
1219
+ continuesAfter: part.continuesAfter,
1220
+ shiftedFrom: shiftedFrom,
1221
+ linked: linkedKey === linkKey,
1222
+ onHover: setHovered,
1223
+ showTaskIds: options.showTaskIds,
1224
+ menuOpen: menuBlockId === block.id,
1225
+ onMenuOpen: () => setMenuBlockId(block.id),
1226
+ onMenuClose: () => setMenuBlockId(null),
1227
+ resizedEnd: resizedEnd
1228
+ });
1229
+ }), day === today ? /*#__PURE__*/React.createElement("span", {
1230
+ className: "now-line",
1231
+ style: {
1232
+ top: minuteTop(dayMinute(now))
1233
+ }
1234
+ }) : null);
1235
+ }))));
1236
+ };
1237
+ TimeBlockGrid.displayName = "TimeBlockGrid";
1238
+
1239
+ /** The All Day row keeps what has no time block: tasks without an estimate,
1240
+ subtasks, and the part of a day's allocation that did not fit. */
1241
+ const allDayEntriesFor = options => {
1242
+ if (!options.showTasks) return [];
1243
+ const entries = [];
1244
+ TASKS.filter(task => task.estimate === null).forEach(task => {
1245
+ var _projectOf$color, _projectOf;
1246
+ if (task.is_completed && !options.showCompleted) return;
1247
+ entries.push({
1248
+ key: "task-" + task.id,
1249
+ kind: "task",
1250
+ name: task.name,
1251
+ startDay: isoToDayNumber(task.start_on),
1252
+ endDay: isoToDayNumber(task.due_on),
1253
+ color: (_projectOf$color = (_projectOf = projectOf(task.project_id)) == null ? void 0 : _projectOf.color) != null ? _projectOf$color : "",
1254
+ completed: task.is_completed,
1255
+ important: task.is_important,
1256
+ participant: true,
1257
+ taskNumber: task.id
1258
+ });
1259
+ });
1260
+ if (options.showSubtasks) {
1261
+ SUBTASKS.forEach(subtask => {
1262
+ var _projectOf$color2, _projectOf2;
1263
+ if (subtask.is_completed && !options.showCompleted) return;
1264
+ const parent = taskOf(subtask.task_id);
1265
+ entries.push({
1266
+ key: "subtask-" + subtask.id,
1267
+ kind: "subtask",
1268
+ name: subtask.name,
1269
+ startDay: isoToDayNumber(subtask.due_on),
1270
+ endDay: isoToDayNumber(subtask.due_on),
1271
+ color: parent ? (_projectOf$color2 = (_projectOf2 = projectOf(parent.project_id)) == null ? void 0 : _projectOf2.color) != null ? _projectOf$color2 : "" : "",
1272
+ completed: subtask.is_completed,
1273
+ important: false,
1274
+ participant: true
1275
+ });
1276
+ });
1277
+ }
1278
+ DAY_SCHEDULES.forEach(schedule => schedule.unscheduled.forEach(rest => {
1279
+ const task = taskOf(rest.task_id);
1280
+ if (!task) return;
1281
+ entries.push({
1282
+ /* The key marks the remainder for renderSegment. */
1283
+ key: "unscheduled-" + rest.task_id + "-" + schedule.day,
1284
+ kind: "task",
1285
+ name: task.name + " \xB7 " + formatHours(rest.minutes) + " unscheduled",
1286
+ startDay: isoToDayNumber(schedule.day),
1287
+ endDay: isoToDayNumber(schedule.day),
1288
+ color: "",
1289
+ completed: false,
1290
+ important: false,
1291
+ participant: true,
1292
+ taskNumber: task.id
1293
+ });
1294
+ }));
1295
+ return entries;
1296
+ };
1297
+ const renderAllDaySegment = (segment, style) => {
1298
+ if (!segment.key.startsWith("unscheduled-")) return null;
1299
+ return /*#__PURE__*/React.createElement(Tooltip, {
1300
+ title: "Didn't fit into this day's free time"
1301
+ }, /*#__PURE__*/React.createElement(StyledUnscheduledPill, {
1302
+ style: style
1303
+ }, /*#__PURE__*/React.createElement(WarningTriangleSmallIcon, {
1304
+ width: 12,
1305
+ height: 12,
1306
+ style: {
1307
+ fill: "var(--red-alert)",
1308
+ flexShrink: 0
1309
+ },
1310
+ "aria-hidden": true
1311
+ }), /*#__PURE__*/React.createElement(Caption1, {
1312
+ color: "alert",
1313
+ className: "pill-name"
1314
+ }, segment.name)));
1315
+ };
1316
+
1317
+ /* ================================================================== */
1318
+ /* Day list */
1319
+ /* ================================================================== */
1320
+
1321
+ /** The task as the Tasks tab's row reads it (day numbers for dates). */
1322
+ const listTaskOf = task => {
1323
+ var _task$estimate;
1324
+ return {
1325
+ id: task.id,
1326
+ project_id: task.project_id,
1327
+ task_list_id: 0,
1328
+ name: task.name,
1329
+ start_on: isoToDayNumber(task.start_on),
1330
+ due_on: isoToDayNumber(task.due_on),
1331
+ label_ids: [],
1332
+ is_important: task.is_important,
1333
+ is_completed: task.is_completed,
1334
+ estimate: (_task$estimate = task.estimate) != null ? _task$estimate : undefined
1335
+ };
1336
+ };
1337
+
1338
+ /** The day's tasks and subtasks per project, in My Work project order. */
1339
+ const dayGroupsFor = (day, options, completedKeys) => PROJECTS.map(project => {
1340
+ const tasks = TASKS.filter(task => task.project_id === project.id && isoToDayNumber(task.start_on) <= day && isoToDayNumber(task.due_on) >= day).map(task => ({
1341
+ kind: "task",
1342
+ key: "task-" + task.id,
1343
+ task: listTaskOf(task)
1344
+ }));
1345
+ const subtasks = options.showSubtasks ? SUBTASKS.filter(subtask => {
1346
+ var _taskOf2;
1347
+ return isoToDayNumber(subtask.due_on) === day && ((_taskOf2 = taskOf(subtask.task_id)) == null ? void 0 : _taskOf2.project_id) === project.id;
1348
+ }).flatMap(subtask => {
1349
+ const parent = taskOf(subtask.task_id);
1350
+ return parent ? [{
1351
+ kind: "subtask",
1352
+ key: "subtask-" + subtask.id,
1353
+ subtask: {
1354
+ id: subtask.id,
1355
+ task_id: subtask.task_id,
1356
+ name: subtask.name,
1357
+ due_on: isoToDayNumber(subtask.due_on),
1358
+ is_completed: subtask.is_completed
1359
+ },
1360
+ task: listTaskOf(parent)
1361
+ }] : [];
1362
+ }) : [];
1363
+ /* Completed now: the payload's state, flipped by a click in the list. */
1364
+ const rows = [...tasks, ...subtasks].filter(row => options.showCompleted || Boolean(row.kind === "task" ? row.task.is_completed : row.subtask.is_completed) === completedKeys.has(row.key));
1365
+ return {
1366
+ project,
1367
+ rows
1368
+ };
1369
+ }).filter(group => group.rows.length > 0);
1370
+
1371
+ /** Whether the task has time on the day: blocks or an allocation. Tasks
1372
+ without an estimate and subtasks have neither and keep one line. */
1373
+ const hasDayPlan = (taskId, day) => TIME_BLOCKS.some(block => block.task_id === taskId && isoToDayNumber(block.day) === day) || ALLOCATIONS.some(item => item.task_id === taskId && isoToDayNumber(item.day) === day);
1374
+
1375
+ /**
1376
+ * A row's second line: when the task's work happens today and what is left
1377
+ * for later days. "09:30 AM – 10:30 AM · pinned", "3 suggested blocks · 2h",
1378
+ * "1h left after today".
1379
+ */
1380
+ const DayBlocksLine = _ref7 => {
1381
+ var _projectOf$color3, _projectOf3, _taskOf$project_id, _taskOf3;
1382
+ let taskId = _ref7.taskId,
1383
+ day = _ref7.day;
1384
+ const blocks = TIME_BLOCKS.filter(block => block.task_id === taskId && isoToDayNumber(block.day) === day);
1385
+ const allocation = ALLOCATIONS.find(item => item.task_id === taskId && isoToDayNumber(item.day) === day);
1386
+ const color = (_projectOf$color3 = (_projectOf3 = projectOf((_taskOf$project_id = (_taskOf3 = taskOf(taskId)) == null ? void 0 : _taskOf3.project_id) != null ? _taskOf$project_id : 0)) == null ? void 0 : _projectOf3.color) != null ? _projectOf$color3 : "";
1387
+ const pinned = blocks.filter(block => block.type === "pinned");
1388
+ const suggested = blocks.filter(block => block.type === "suggested");
1389
+ const suggestedMinutes = suggested.reduce((sum, block) => sum + clockToMinutes(block.ends_at) - clockToMinutes(block.starts_at), 0);
1390
+ const timeOf = block => formatTimeOfDay(clockToMinutes(block.starts_at)) + " \u2013 " + formatTimeOfDay(clockToMinutes(block.ends_at));
1391
+ return /*#__PURE__*/React.createElement(React.Fragment, null, pinned.map(block => /*#__PURE__*/React.createElement("span", {
1392
+ className: "block-part",
1393
+ key: block.id
1394
+ }, /*#__PURE__*/React.createElement(PinSmallIcon, {
1395
+ width: 12,
1396
+ height: 12,
1397
+ style: {
1398
+ fill: color,
1399
+ flexShrink: 0
1400
+ },
1401
+ "aria-hidden": true
1402
+ }), /*#__PURE__*/React.createElement(Caption1, {
1403
+ color: "secondary"
1404
+ }, timeOf(block) + " \xB7 pinned"))), suggested.length > 0 ? /*#__PURE__*/React.createElement(Tooltip, {
1405
+ title: suggested.map(timeOf).join(", ")
1406
+ }, /*#__PURE__*/React.createElement("span", {
1407
+ className: "block-part"
1408
+ }, /*#__PURE__*/React.createElement(SparkIcon, {
1409
+ width: 12,
1410
+ height: 12,
1411
+ style: {
1412
+ fill: color,
1413
+ flexShrink: 0
1414
+ },
1415
+ "aria-hidden": true
1416
+ }), /*#__PURE__*/React.createElement(Caption1, {
1417
+ color: "secondary"
1418
+ }, suggested.length + " suggested " + (suggested.length === 1 ? "block" : "blocks") + " \xB7 " + formatHours(suggestedMinutes)))) : null, allocation && allocation.left_after_day > 0 ? /*#__PURE__*/React.createElement(Caption1, {
1419
+ color: "tertiary",
1420
+ className: "block-part"
1421
+ }, formatHours(allocation.left_after_day) + " left after today") : null);
1422
+ };
1423
+ DayBlocksLine.displayName = "DayBlocksLine";
1424
+
1425
+ /* The second line's parts, a dot between them (the list's signifier dot). */
1426
+ const StyledDayAgenda = styled.div.withConfig({
1427
+ displayName: "timeBlocks__StyledDayAgenda",
1428
+ componentId: "sc-qxsot7-5"
1429
+ })([".block-part{display:inline-flex;align-items:center;gap:4px;min-width:0;white-space:nowrap;}.block-part + .block-part::before{content:\"\";flex-shrink:0;width:2px;height:2px;margin:0 4px 0 2px;border-radius:100%;background-color:var(--color-theme-600);}"]);
1430
+
1431
+ /* ================================================================== */
1432
+ /* The page */
1433
+ /* ================================================================== */
1434
+
1435
+ const weekendShownFor = options => day => options.showNonWorking && isWeekendDay(day);
1436
+ /** Header, All Day row and hour grid for the days shown (7 or 1). */
1437
+ const BlockDays = _ref8 => {
1438
+ let days = _ref8.days,
1439
+ options = _ref8.options,
1440
+ demo = _ref8.demo,
1441
+ clock = _ref8.clock;
1442
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatedHeaders, {
1443
+ days: days,
1444
+ today: TODAY_DAY,
1445
+ isNonWorking: weekendShownFor(options),
1446
+ renderBar: day => /*#__PURE__*/React.createElement(DayCapacityBar, {
1447
+ day: day
1448
+ })
1449
+ }), /*#__PURE__*/React.createElement(StyledAllDayRow, null, /*#__PURE__*/React.createElement(LaneRow, {
1450
+ className: "all-day-row",
1451
+ days: days,
1452
+ entries: allDayEntriesFor(options),
1453
+ today: TODAY_DAY,
1454
+ isNonWorking: weekendShownFor(options),
1455
+ gutterWidth: TIME_GUTTER,
1456
+ gutter: /*#__PURE__*/React.createElement(Caption1, {
1457
+ color: "secondary"
1458
+ }, "All Day"),
1459
+ showTaskIds: options.showTaskIds,
1460
+ maxLanes: ALL_DAY_VISIBLE_LANES,
1461
+ renderSegment: renderNewTaskSegment
1462
+ })), /*#__PURE__*/React.createElement(TimeBlockGrid, {
1463
+ days: days,
1464
+ options: options,
1465
+ demo: demo,
1466
+ clock: clock
1467
+ }));
1468
+ };
1469
+ BlockDays.displayName = "BlockDays";
1470
+
1471
+ /** The timezone states: a teammate viewing the schedule, or the owner
1472
+ after moving to another timezone. */
1473
+
1474
+ /* The toolbar's timezone note and "Show in my time" switch, before the
1475
+ options gear. */
1476
+ const StyledTimezoneControl = styled.div.withConfig({
1477
+ displayName: "timeBlocks__StyledTimezoneControl",
1478
+ componentId: "sc-qxsot7-6"
1479
+ })(["display:flex;align-items:center;gap:8px;margin-right:12px;white-space:nowrap;.c-label{cursor:pointer;}.timezone-divider{width:1px;height:16px;background-color:var(--color-theme-300);}"]);
1480
+
1481
+ /* The timezone-change notice: under the toolbar, inset from the paper. */
1482
+ const StyledTimezoneBanner = styled.div.withConfig({
1483
+ displayName: "timeBlocks__StyledTimezoneBanner",
1484
+ componentId: "sc-qxsot7-7"
1485
+ })(["flex-shrink:0;padding:12px 12px 0;.banner-actions{display:flex;align-items:center;gap:4px;}"]);
1486
+ const AgendaBody = _ref9 => {
1487
+ let view = _ref9.view,
1488
+ tasks = _ref9.tasks,
1489
+ demo = _ref9.demo,
1490
+ timezone = _ref9.timezone;
1491
+ const _useState3 = useState((timezone == null ? void 0 : timezone.kind) === "viewer" && timezone.showInViewerTime),
1492
+ showInViewerTime = _useState3[0],
1493
+ setShowInViewerTime = _useState3[1];
1494
+ const _useState4 = useState((timezone == null ? void 0 : timezone.kind) === "changed"),
1495
+ bannerOpen = _useState4[0],
1496
+ setBannerOpen = _useState4[1];
1497
+ const viewer = (timezone == null ? void 0 : timezone.kind) === "viewer" ? timezone.viewer : undefined;
1498
+ const clock = viewer && showInViewerTime ? {
1499
+ shift: viewer.utc_offset - OWNER.utc_offset,
1500
+ ownerClockName: OWNER.first_name + "'s time (" + OWNER.timezone_abbr + ")"
1501
+ } : undefined;
1502
+ const _useState5 = useState({
1503
+ showTasks: true,
1504
+ showEvents: true,
1505
+ showCompleted: true,
1506
+ showSubtasks: true,
1507
+ showNonWorking: true,
1508
+ showWeekNumbers: true,
1509
+ showTaskIds: true
1510
+ }),
1511
+ options = _useState5[0],
1512
+ setOptions = _useState5[1];
1513
+ const toggleOption = useCallback(key => setOptions(previous => _extends({}, previous, {
1514
+ [key]: !previous[key]
1515
+ })), []);
1516
+ /* The day view holds the viewport's height; its sides scroll. */
1517
+ const paperRef = useRef(null);
1518
+ const fillHeight = useViewportFillHeight(paperRef, view === "day");
1519
+ const dayGrid = useResizableWidth({
1520
+ min: DAY_GRID_MIN_WIDTH,
1521
+ max: DAY_GRID_MAX_WIDTH,
1522
+ storageKey: DAY_GRID_WIDTH_STORAGE_KEY
1523
+ });
1524
+ const dayGroups = useMemo(() => dayGroupsFor(TODAY_DAY, options, tasks.completed), [options, tasks.completed]);
1525
+ const step = view === "day" ? 1 : 7;
1526
+ return /*#__PURE__*/React.createElement(StyledMyCalendarPaper, {
1527
+ type: "paper-2",
1528
+ ref: paperRef,
1529
+ className: fillHeight === null ? undefined : "fill-height",
1530
+ style: fillHeight === null ? undefined : {
1531
+ "--fill-height": fillHeight + "px"
1532
+ }
1533
+ }, /*#__PURE__*/React.createElement(StyledMyCalendarToolbar, null, /*#__PURE__*/React.createElement(Tooltip, {
1534
+ title: periodLabelFor(view, TODAY_DAY - step)
1535
+ }, /*#__PURE__*/React.createElement(IconButton, {
1536
+ type: "button",
1537
+ size: "small",
1538
+ variant: "text gray",
1539
+ "aria-label": view === "day" ? "Previous Day" : "Previous Week"
1540
+ }, /*#__PURE__*/React.createElement(ArrowLeftIcon, null))), /*#__PURE__*/React.createElement(Tooltip, {
1541
+ title: periodLabelFor(view, TODAY_DAY + step)
1542
+ }, /*#__PURE__*/React.createElement(IconButton, {
1543
+ type: "button",
1544
+ size: "small",
1545
+ variant: "text gray",
1546
+ "aria-label": view === "day" ? "Next Day" : "Next Week"
1547
+ }, /*#__PURE__*/React.createElement(ArrowRightIcon, null))), /*#__PURE__*/React.createElement(Body2, {
1548
+ weight: "bold",
1549
+ className: "period-label"
1550
+ }, periodLabelFor(view, TODAY_DAY)), /*#__PURE__*/React.createElement("span", {
1551
+ className: "toolbar-spacer"
1552
+ }), viewer ? /*#__PURE__*/React.createElement(StyledTimezoneControl, null, /*#__PURE__*/React.createElement(Caption1, {
1553
+ color: "secondary"
1554
+ }, showInViewerTime ? "Times shown in your timezone (" + viewer.timezone_abbr + ")" : "Times shown in " + OWNER.first_name + "'s timezone (" + OWNER.timezone_abbr + ")"), /*#__PURE__*/React.createElement("span", {
1555
+ className: "timezone-divider"
1556
+ }), /*#__PURE__*/React.createElement(Label, {
1557
+ htmlFor: "show-in-my-time",
1558
+ weight: "regular"
1559
+ }, /*#__PURE__*/React.createElement(Caption1, null, "Show in my time")), /*#__PURE__*/React.createElement(Toggle, {
1560
+ id: "show-in-my-time",
1561
+ size: "small",
1562
+ defaultChecked: showInViewerTime,
1563
+ onChange: event => setShowInViewerTime(event.target.checked)
1564
+ })) : null, /*#__PURE__*/React.createElement(MyCalendarOptionsMenu, {
1565
+ options: options,
1566
+ onToggle: toggleOption
1567
+ })), (timezone == null ? void 0 : timezone.kind) === "changed" && bannerOpen ? /*#__PURE__*/React.createElement(StyledTimezoneBanner, null, /*#__PURE__*/React.createElement(InfoBox, {
1568
+ type: "note",
1569
+ showIcon: true,
1570
+ title: timezone.change.pinned_blocks_in_previous_timezone + " pinned blocks were planned in " + timezone.change.previous_timezone_abbr,
1571
+ action: /*#__PURE__*/React.createElement("span", {
1572
+ className: "banner-actions"
1573
+ }, /*#__PURE__*/React.createElement(Button, {
1574
+ variant: "text colored",
1575
+ size: "small",
1576
+ onClick: () => setBannerOpen(false)
1577
+ }, "Move to current timezone"), /*#__PURE__*/React.createElement(Tooltip, {
1578
+ title: "Dismiss"
1579
+ }, /*#__PURE__*/React.createElement(IconButton, {
1580
+ type: "button",
1581
+ size: "small",
1582
+ variant: "text gray",
1583
+ "aria-label": "Dismiss",
1584
+ onClick: () => setBannerOpen(false)
1585
+ }, /*#__PURE__*/React.createElement(CancelCrossIcon, null))))
1586
+ }, /*#__PURE__*/React.createElement(Body2, {
1587
+ color: "secondary"
1588
+ }, "You're on " + timezone.change.current_timezone_abbr + " now. They keep their " + timezone.change.previous_timezone_abbr + " times until you move them."))) : null, view === "week" ? /*#__PURE__*/React.createElement(BlockDays, {
1589
+ days: WEEK_DAYS,
1590
+ options: options,
1591
+ clock: clock
1592
+ }) : /*#__PURE__*/React.createElement(StyledDaySplit, {
1593
+ style: dayGrid.width === null ? undefined : {
1594
+ "--day-grid-width": dayGrid.width + "px"
1595
+ }
1596
+ }, /*#__PURE__*/React.createElement("div", {
1597
+ className: "day-grid"
1598
+ }, /*#__PURE__*/React.createElement(BlockDays, {
1599
+ days: [TODAY_DAY],
1600
+ options: options,
1601
+ demo: demo,
1602
+ clock: clock
1603
+ }), /*#__PURE__*/React.createElement(StyledPanelResizer, {
1604
+ role: "separator",
1605
+ "aria-label": "Resize calendar",
1606
+ "aria-orientation": "vertical",
1607
+ className: dayGrid.resizing ? "day-resizer resizing" : "day-resizer",
1608
+ onPointerDown: dayGrid.startResize
1609
+ })), /*#__PURE__*/React.createElement(StyledDayAgenda, {
1610
+ className: "day-agenda"
1611
+ }, /*#__PURE__*/React.createElement("div", {
1612
+ className: "agenda-header"
1613
+ }, /*#__PURE__*/React.createElement(Header3, null, "Tasks"), /*#__PURE__*/React.createElement(Tooltip, {
1614
+ title: "Add Task"
1615
+ }, /*#__PURE__*/React.createElement(IconButton, {
1616
+ size: "small",
1617
+ variant: "text gray",
1618
+ "aria-label": "Add Task"
1619
+ }, /*#__PURE__*/React.createElement(AddCrossTinyIcon, null)))), /*#__PURE__*/React.createElement(DayProjectList, {
1620
+ groups: dayGroups,
1621
+ state: tasks,
1622
+ empty: /*#__PURE__*/React.createElement(Body2, {
1623
+ color: "tertiary"
1624
+ }, "No tasks on this day."),
1625
+ extraFor: row => row.kind === "task" && hasDayPlan(row.task.id, TODAY_DAY) ? /*#__PURE__*/React.createElement(DayBlocksLine, {
1626
+ taskId: row.task.id,
1627
+ day: TODAY_DAY
1628
+ }) : null
1629
+ }))));
1630
+ };
1631
+ AgendaBody.displayName = "AgendaBody";
1632
+ const TimeBlocksPage = _ref0 => {
1633
+ let initialView = _ref0.initialView,
1634
+ demo = _ref0.demo,
1635
+ timezone = _ref0.timezone;
1636
+ const tasks = useMyWorkTasks();
1637
+ const _useState6 = useState(initialView),
1638
+ view = _useState6[0],
1639
+ setView = _useState6[1];
1640
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MyWorkTabs, {
1641
+ active: "agenda",
1642
+ onSelect: () => undefined,
1643
+ tasksCount: tasks.openCount,
1644
+ controls: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AgendaFilter, null), /*#__PURE__*/React.createElement(AgendaViewSwitch, {
1645
+ view: view,
1646
+ onChange: next => {
1647
+ if (next === "week" || next === "day") setView(next);
1648
+ }
1649
+ }))
1650
+ }), /*#__PURE__*/React.createElement(AgendaBody, {
1651
+ view: view,
1652
+ tasks: tasks,
1653
+ demo: demo,
1654
+ timezone: timezone
1655
+ }));
1656
+ };
1657
+ TimeBlocksPage.displayName = "TimeBlocksPage";
1658
+
1659
+ /** My Work's page header: the title and the add menu (MyWorkPageShell). */
1660
+ const MY_WORK_HEADER = /*#__PURE__*/React.createElement(PageHeader, {
1661
+ title: "My Work"
1662
+ }, /*#__PURE__*/React.createElement(MyWorkAddMenu, null));
1663
+ export const WeekView = () => /*#__PURE__*/React.createElement(PresentationShell, {
1664
+ header: MY_WORK_HEADER,
1665
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1666
+ activeMenuItem: "My Work"
1667
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1668
+ initialView: "week"
1669
+ }));
1670
+ export const DayView = () => /*#__PURE__*/React.createElement(PresentationShell, {
1671
+ header: MY_WORK_HEADER,
1672
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1673
+ activeMenuItem: "My Work"
1674
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1675
+ initialView: "day"
1676
+ }));
1677
+
1678
+ /* Block interactions: static states on Thursday's day view, where blocks
1679
+ are wide. Hover "…" on any block for the same menus. */
1680
+
1681
+ /** Thursday's blocks (TIME_BLOCKS ids) the stories open on. */
1682
+ const THURSDAY_BLOCK_IDS = {
1683
+ campaignBrief2of3: 11,
1684
+ paginationSpec: 12,
1685
+ homepageWireframes: 10
1686
+ };
1687
+ export const SuggestedBlockMenu = () => /*#__PURE__*/React.createElement(PresentationShell, {
1688
+ header: MY_WORK_HEADER,
1689
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1690
+ activeMenuItem: "My Work"
1691
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1692
+ initialView: "day",
1693
+ demo: {
1694
+ menuBlockId: THURSDAY_BLOCK_IDS.campaignBrief2of3
1695
+ }
1696
+ }));
1697
+ export const PinnedBlockMenu = () => /*#__PURE__*/React.createElement(PresentationShell, {
1698
+ header: MY_WORK_HEADER,
1699
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1700
+ activeMenuItem: "My Work"
1701
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1702
+ initialView: "day",
1703
+ demo: {
1704
+ menuBlockId: THURSDAY_BLOCK_IDS.paginationSpec
1705
+ }
1706
+ }));
1707
+ export const ResizingPinnedBlock = () => /*#__PURE__*/React.createElement(PresentationShell, {
1708
+ header: MY_WORK_HEADER,
1709
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1710
+ activeMenuItem: "My Work"
1711
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1712
+ initialView: "day",
1713
+ demo: {
1714
+ resizing: {
1715
+ blockId: THURSDAY_BLOCK_IDS.homepageWireframes,
1716
+ endsAt: "10:45"
1717
+ }
1718
+ }
1719
+ }));
1720
+
1721
+ /* Timezones. A teammate (Ana, Honolulu) views Marko's schedule: times are
1722
+ Marko's (CET) until she switches "Show in my time"; then every item moves
1723
+ eleven hours back, and a pinned block that lands on another day carries
1724
+ the clock icon and the day it was planned for. */
1725
+ export const SomeoneElsesSchedule = () => /*#__PURE__*/React.createElement(PresentationShell, {
1726
+ header: /*#__PURE__*/React.createElement(PageHeader, {
1727
+ title: OWNER.first_name + "'s Work"
1728
+ }),
1729
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1730
+ activeMenuItem: "People"
1731
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1732
+ initialView: "week",
1733
+ timezone: {
1734
+ kind: "viewer",
1735
+ viewer: VIEWER,
1736
+ showInViewerTime: false
1737
+ }
1738
+ }));
1739
+ export const SomeoneElsesScheduleInMyTime = () => /*#__PURE__*/React.createElement(PresentationShell, {
1740
+ header: /*#__PURE__*/React.createElement(PageHeader, {
1741
+ title: OWNER.first_name + "'s Work"
1742
+ }),
1743
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1744
+ activeMenuItem: "People"
1745
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1746
+ initialView: "week",
1747
+ timezone: {
1748
+ kind: "viewer",
1749
+ viewer: VIEWER,
1750
+ showInViewerTime: true
1751
+ }
1752
+ }));
1753
+
1754
+ /* The owner moved from CET to London: the notice over the week. The grid
1755
+ still draws the CET plan (the mock has no London-time payload). */
1756
+ export const TimezoneChanged = () => /*#__PURE__*/React.createElement(PresentationShell, {
1757
+ header: MY_WORK_HEADER,
1758
+ floating: /*#__PURE__*/React.createElement(FloatingControls, null),
1759
+ activeMenuItem: "My Work"
1760
+ }, /*#__PURE__*/React.createElement(TimeBlocksPage, {
1761
+ initialView: "week",
1762
+ timezone: {
1763
+ kind: "changed",
1764
+ change: TIMEZONE_CHANGE
1765
+ }
1766
+ }));
1767
+ //# sourceMappingURL=timeBlocks.js.map