@feedmepos/mf-hrm-portal 2.3.0-dev.8 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/{ApprovalCodeList-D5E_FN3f.js → ApprovalCodeList-DwubNElp.js} +7 -7
  2. package/dist/{AuditLogList-CqqiS2xW.js → AuditLogList-CTeMbyHL.js} +18 -19
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-DC_oQTsP.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CmLLNcB4.js} +2 -2
  4. package/dist/{EmployeeList-ChMlGxmu.js → EmployeeList-DEAJPx9F.js} +255 -266
  5. package/dist/{FormItem.vue_vue_type_script_setup_true_lang-CUnlKsxk.js → FormItem.vue_vue_type_script_setup_true_lang-OAvd6eHM.js} +6 -6
  6. package/dist/{GrantUserList-DA26W3K3.js → GrantUserList-Dx4jF2qJ.js} +8 -8
  7. package/dist/{Main-C0gVAR92.js → Main-BirWXk7o.js} +5 -5
  8. package/dist/{Main-m39gMG-a.js → Main-C2PBSCte.js} +11 -11
  9. package/dist/{Main-B27Qx8R2.js → Main-CL5JYCPg.js} +8 -8
  10. package/dist/{PermissionSetList-mdA65jmw.js → PermissionSetList-BtYcqPiO.js} +19 -18
  11. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dp6bdEZp.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BXw4aX39.js} +1211 -1211
  12. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-BVz6q3HE.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-DaAx79pC.js} +1 -1
  13. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  14. package/dist/{RoleList-BPayuLxA.js → RoleList-YS_LBfoJ.js} +21 -20
  15. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BorKuXxL.js +530 -0
  16. package/dist/ScheduleGeneralPage-C1p2mivt.js +780 -0
  17. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-CnKzVz3I.js +2457 -0
  18. package/dist/SchedulePage-BP7x7JAl.js +19485 -0
  19. package/dist/{SchedulePositionPage-BUQy-Itg.js → SchedulePositionPage-BogOQZVW.js} +78 -80
  20. package/dist/{SelectFilter-CG13h83-.js → SelectFilter-Dh3eY1hV.js} +1 -1
  21. package/dist/{TeamMemberList-CIlvRlf8.js → TeamMemberList-Bv6_2bzs.js} +27 -27
  22. package/dist/{TimesheetList-DFAfhWYG.js → TimesheetList-B3BmpH0I.js} +52 -53
  23. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-QGzHuY7V.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-C4rbnZh1.js} +3 -3
  24. package/dist/{app-C_EW9DFr.js → app-CyS8c8dx.js} +2879 -2462
  25. package/dist/app.js +1 -1
  26. package/dist/{approval-code-DHsUgc4K.js → approval-code-BIpLingm.js} +1 -1
  27. package/dist/{dayjs.min-ibysRBBa.js → dayjs.min-BRlEc3-d.js} +1 -1
  28. package/dist/{employee-B1BQc4gB.js → employee-CcdjLOLQ.js} +51 -47
  29. package/dist/{grant-user-qzKHFTro.js → grant-user-uZmvD_bw.js} +1 -1
  30. package/dist/{iteration-DQVB-iz0.js → iteration-CL1RDmws.js} +1 -1
  31. package/dist/{lodash-DOj41a0A.js → lodash-C00ieagp.js} +1 -1
  32. package/dist/object-Dwyg2LgX.js +16 -0
  33. package/dist/{restaurant-BbYRA_IT.js → restaurant-CHpkjUPy.js} +46 -47
  34. package/dist/{role-B9MSLu4B.js → role-DtatkKp9.js} +2 -2
  35. package/dist/{rule-e6okoXK6.js → rule-DJJMpkoG.js} +3 -3
  36. package/dist/src/api/employee/index.d.ts +2 -2
  37. package/dist/src/api/schedule/index.d.ts +12 -1
  38. package/dist/src/components/layout/SchedulePromoBanner.vue.d.ts +2 -0
  39. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  40. package/dist/src/stores/employee.d.ts +12 -12
  41. package/dist/src/types/schedule.d.ts +3 -4
  42. package/dist/src/views/audit-log/locales/index.d.ts +252 -0
  43. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +4 -8
  44. package/dist/src/views/scheduling/components/ScheduleAutoScheduleDoneArt.vue.d.ts +2 -0
  45. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +1 -4
  46. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +0 -2
  47. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +0 -7
  48. package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +5 -0
  49. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +2 -6
  50. package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +1 -0
  51. package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +0 -1
  52. package/dist/src/views/scheduling/components/ScheduleCompletionDialog.vue.d.ts +1 -1
  53. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +4 -1
  54. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +1 -5
  55. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +5 -0
  56. package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +0 -1
  57. package/dist/src/views/scheduling/components/{ScheduleAssignEmployeePopover.vue.d.ts → ScheduleOnboardingSettings.vue.d.ts} +2 -2
  58. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +10 -0
  59. package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +1 -1
  60. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +0 -10
  61. package/dist/src/views/scheduling/composables/auto-schedule-mapping.d.ts +3 -3
  62. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +2 -1
  63. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +4 -2
  64. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +12 -8
  65. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +4 -0
  66. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +1 -3
  67. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +13 -1
  68. package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
  69. package/dist/src/views/scheduling/composables/schedule-leave-split.d.ts +5 -0
  70. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +22 -0
  71. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +3 -0
  72. package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +3 -1
  73. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +1 -0
  74. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +46 -11
  75. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +3 -11
  76. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +0 -13
  77. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +2 -9
  78. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +25 -13
  79. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +87 -11
  80. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +3 -10
  81. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +13 -1
  82. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +0 -1
  83. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +16 -5
  84. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +3 -5
  85. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +18 -3
  86. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +1 -0
  87. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +20 -7
  88. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +1 -1
  89. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +26 -3
  90. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +7 -0
  91. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +2 -2
  92. package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +1 -0
  93. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +2 -0
  94. package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +5 -1
  95. package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +1 -1
  96. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +48 -4
  97. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +302 -30
  98. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +11 -8
  99. package/dist/src/views/scheduling/composables/useSchedulePageActions.d.ts +1 -1
  100. package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +3 -1
  101. package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +1 -0
  102. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +0 -4
  103. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +1 -0
  104. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +7 -1
  105. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +4 -1
  106. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +70 -4
  107. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +7 -2
  108. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +2 -2
  109. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +41 -3
  110. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -0
  111. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +47 -6
  112. package/dist/src/views/scheduling/country-rules/index.d.ts +9 -4
  113. package/dist/src/views/scheduling/data.d.ts +22 -1
  114. package/dist/src/views/scheduling/locales/index.d.ts +28 -0
  115. package/dist/src/views/scheduling/schedule-state.d.ts +276 -212
  116. package/dist/src/views/scheduling/schedule-store.d.ts +37 -11
  117. package/dist/src/views/scheduling/types.d.ts +30 -5
  118. package/dist/style.css +1 -1
  119. package/dist/tsconfig.app.tsbuildinfo +1 -1
  120. package/dist/{useAppStore-BoLkvkE2.js → useAppStore-Bp0PwbAN.js} +1 -1
  121. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  122. package/dist/{useLoading-Ch1AUYT1.js → useLoading-sgL8DRUz.js} +1 -1
  123. package/dist/{useReportPermissions-CJ9ey1bN.js → useReportPermissions-DI-xg3OX.js} +3 -3
  124. package/package.json +2 -2
  125. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-C_EQivMd.js +0 -470
  126. package/dist/ScheduleGeneralPage-sAqR1-hf.js +0 -666
  127. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-ABipaQiR.js +0 -2205
  128. package/dist/SchedulePage-DhbtCR8U.js +0 -18546
  129. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  130. package/dist/src/views/scheduling/components/ScheduleAllShiftsRow.vue.d.ts +0 -22
  131. package/dist/src/views/scheduling/components/ScheduleStackPopover.vue.d.ts +0 -14
  132. package/dist/src/views/scheduling/composables/useScheduleAllShiftsRow.d.ts +0 -77
  133. package/dist/src/views/scheduling/composables/useScheduleAssign.d.ts +0 -124
  134. package/dist/src/views/scheduling/composables/useScheduleOpenShiftCard.d.ts +0 -23
  135. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
@@ -1,2205 +0,0 @@
1
- import { onMounted as He, onBeforeUnmount as Ae, ref as w, reactive as O, shallowRef as ce, watch as Ee, computed as P, defineComponent as be, createElementBlock as k, openBlock as b, renderSlot as Ye, useAttrs as ia, nextTick as pe, normalizeClass as se, createElementVNode as _, createBlock as ra, mergeProps as la, toDisplayString as F, Teleport as ua, createCommentVNode as U, withDirectives as da, vModelText as ca, Fragment as ye, renderList as ya, createTextVNode as ma, withModifiers as fa, normalizeStyle as pa } from "vue";
2
- import { useRoute as ha, useRouter as va } from "vue-router";
3
- import { useCoreStore as Be } from "@feedmepos/mf-common";
4
- import { g as h, b as p, u as Da } from "./restaurant-BbYRA_IT.js";
5
- import { E as he, u as ga } from "./employee-B1BQc4gB.js";
6
- function Wn(e) {
7
- let a = null;
8
- function t() {
9
- if (!a) return;
10
- a.style.height = "";
11
- const n = a.getBoundingClientRect().top;
12
- a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
13
- }
14
- He(() => {
15
- var n;
16
- a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
17
- }), Ae(() => {
18
- window.removeEventListener("resize", t), a && (a.style.height = "");
19
- });
20
- }
21
- function ve(e) {
22
- const [a, t] = String(e || "0:0").split(":").map(Number);
23
- return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
24
- }
25
- function wa(e) {
26
- const a = Math.max(0, Math.min(1439, Math.round(e)));
27
- return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
28
- }
29
- function Ha(e, a) {
30
- const t = ve(e);
31
- let n = ve(a);
32
- return n <= t && (n += 1440), [t, n];
33
- }
34
- function _e(e, a) {
35
- const [t, n] = Ha(e, a);
36
- return Math.max(0, n - t);
37
- }
38
- function Aa(e) {
39
- const a = (ve(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, r = t < 12 ? "am" : "pm", o = t % 12 || 12;
40
- return n ? `${o}:${String(n).padStart(2, "0")}${r}` : `${o}${r}`;
41
- }
42
- function zn(e) {
43
- return Aa(wa(e % 1440));
44
- }
45
- function xe(e) {
46
- const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
47
- return a != null && a.length ? a.reduce((t, n) => {
48
- if (n.type === "DURATION") return t + n.minutes;
49
- const [r, o] = n.startTime.split(":").map(Number), [s, i] = n.endTime.split(":").map(Number);
50
- let m = s * 60 + i - (r * 60 + o);
51
- return m < 0 && (m += 24 * 60), t + m;
52
- }, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
53
- }
54
- function Vn(e, a) {
55
- var r;
56
- const t = a ?? _e(e.start, e.end), n = (r = e.breaks) != null && r.length ? e.breaks.reduce((o, s) => o + (s.breakPayType === "UNPAID" ? xe([s]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
57
- return Math.max(0, t - Math.min(t, n));
58
- }
59
- function Kn(e) {
60
- const a = Math.max(0, Math.round(e ?? 0));
61
- return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
62
- }
63
- const q = 500, Ea = 10, Me = 6, Gn = 1500, Fe = 1e6, D = {
64
- async listEmployeeProfiles(e) {
65
- return h(
66
- await p("schedules").get("employees", {
67
- params: e != null && e.length ? { ids: e.join(",") } : void 0
68
- })
69
- );
70
- },
71
- async listEmployeeConfigs(e) {
72
- return h(
73
- await p(`restaurants/${e}/schedules`).get("employee-configs")
74
- );
75
- },
76
- async saveEmployeeConfigs(e, a) {
77
- return h(
78
- await p(`restaurants/${e}/schedules`).post(
79
- "employee-configs/reorder",
80
- a
81
- )
82
- );
83
- },
84
- async getSettings(e) {
85
- return h(
86
- await p(`restaurants/${e}/schedules`).get("settings")
87
- );
88
- },
89
- async saveSettings(e, a) {
90
- return h(
91
- await p(`restaurants/${e}/schedules`).post("settings", a)
92
- );
93
- },
94
- async generateAutoSchedule(e, a) {
95
- return h(
96
- await p(`restaurants/${e}/schedules`).post(
97
- "auto-schedule/generate",
98
- a
99
- )
100
- );
101
- },
102
- async getAutoScheduleCapabilities(e) {
103
- return h(
104
- await p(`restaurants/${e}/schedules`).get(
105
- "auto-schedule/capabilities"
106
- )
107
- );
108
- },
109
- async applyAutoSchedule(e, a) {
110
- return h(
111
- await p(`restaurants/${e}/schedules`).post(
112
- "auto-schedule/apply",
113
- a
114
- )
115
- );
116
- },
117
- /** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
118
- async readBoard(e, a, t) {
119
- return h(
120
- await p(`restaurants/${e}/schedules`).get("board", {
121
- params: { from: a, to: t }
122
- })
123
- );
124
- },
125
- async createTimeOff(e, a) {
126
- return h(
127
- await p(`restaurants/${e}/schedules`).post("time-off", a)
128
- );
129
- },
130
- async updateTimeOffStatus(e, a, t) {
131
- return h(
132
- await p(`restaurants/${e}/schedules`).post(
133
- `time-off/${a}/status`,
134
- t
135
- )
136
- );
137
- },
138
- async deleteTimeOff(e, a) {
139
- await p(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
140
- },
141
- /** Creates or updates the employee's shared business-level scheduling profile. */
142
- async createEmployeeProfile(e, a) {
143
- return h(await p("schedules").post("employees", a));
144
- },
145
- /** Edits the employee's shared business-level scheduling profile. */
146
- async updateEmployeeProfile(e, a, t) {
147
- return h(
148
- await p("schedules").post("employees", { employeeId: a, ...t })
149
- );
150
- },
151
- /** Positions are shared across the business. */
152
- async createPosition(e) {
153
- return h(await p("schedules").post("positions", e));
154
- },
155
- async updatePosition(e, a) {
156
- return h(await p("schedules").post(`positions/${e}`, a));
157
- },
158
- /** Deleting one position is `deletePositions` with a single-id array — the backend's
159
- * `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
160
- async deletePosition(e) {
161
- await p("schedules").delete("positions", {
162
- params: { ids: e }
163
- });
164
- },
165
- /** Creates one flat demand interval. */
166
- async createDemand(e, a) {
167
- return h(
168
- await p(`restaurants/${e}/schedules`).post("demands", a)
169
- );
170
- },
171
- /** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
172
- * day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
173
- * array. */
174
- async deleteDemands(e, a) {
175
- return h(
176
- await p(`restaurants/${e}/schedules`).delete("demands", {
177
- params: { ids: a.join(",") }
178
- })
179
- );
180
- },
181
- /** Atomically replaces one date/weekday's flattened demand rows. */
182
- async replaceDemands(e, a) {
183
- return h(
184
- await p(`restaurants/${e}/schedules`).post(
185
- "demands/replace",
186
- a
187
- )
188
- );
189
- },
190
- /** Atomically replaces several date/weekday demand generations. */
191
- async bulkReplaceDemands(e, a) {
192
- return h(
193
- await p(`restaurants/${e}/schedules`).post(
194
- "demands/bulk-replace",
195
- a
196
- )
197
- );
198
- },
199
- /** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
200
- async saveScheduleDay(e, a, t) {
201
- return h(
202
- await p(`restaurants/${e}/schedules`).post(
203
- `days/${a}`,
204
- t
205
- )
206
- );
207
- },
208
- /** A one-off shift assignment. */
209
- async createAssignment(e, a) {
210
- return h(
211
- await p(`restaurants/${e}/schedules`).post("assignments", a)
212
- );
213
- },
214
- async updateAssignment(e, a, t) {
215
- return h(
216
- await p(`restaurants/${e}/schedules`).patch(
217
- `assignments/${a}`,
218
- t
219
- )
220
- );
221
- },
222
- /** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
223
- async bulkSaveAssignments(e, a) {
224
- return h(
225
- await p(`restaurants/${e}/schedules`).post(
226
- "assignments/bulk",
227
- a
228
- )
229
- );
230
- },
231
- /** Deletes a batch of assignments in one request — e.g. a shift split into several segments
232
- * getting replaced wholesale. Deleting one assignment is just this with a single-id
233
- * array. */
234
- async deleteAssignments(e, a) {
235
- return h(
236
- await p(`restaurants/${e}/schedules`).delete("assignments", {
237
- params: { ids: a.join(",") }
238
- })
239
- );
240
- },
241
- /** Flips a batch of assignments to one status in a single request — e.g. Publish sending
242
- * every DRAFT shift on the board to PUBLISHED at once. */
243
- async bulkUpdateAssignmentStatus(e, a) {
244
- return h(
245
- await p(`restaurants/${e}/schedules`).patch(
246
- "assignments/bulk-status",
247
- a
248
- )
249
- );
250
- }
251
- }, Ue = {
252
- payload: ce(null),
253
- loading: w(!1),
254
- rosterLoading: w(!1),
255
- loadError: w(null),
256
- scheduleSetupCompleted: w(!1),
257
- dataVersion: w(0),
258
- outletId: w(""),
259
- restaurantEmployees: w([]),
260
- employeeConfigs: w([]),
261
- employeeOutletIds: ce({}),
262
- businessEmployees: ce([]),
263
- positions: O([]),
264
- positionRecords: O([]),
265
- rolePositions: O({}),
266
- outlet: O({ name: "" }),
267
- locationOptions: O([]),
268
- locationLabelById: O({}),
269
- departmentOptions: O([]),
270
- compensationGroupOptions: O([]),
271
- compensationGroupMeta: O({}),
272
- existingStaff: O([]),
273
- shiftTemplates: O([]),
274
- rules: O({
275
- coverage: {},
276
- openFrom: "00:00",
277
- openTo: "24:00",
278
- dayHours: Array.from({ length: 7 }, () => []),
279
- payRate: {
280
- NORMAL: { overtime: 1.5 },
281
- REST_DAY: { regular: 1, overtime: 2 },
282
- PUBLIC_HOLIDAY: { regular: 2, overtime: 3 }
283
- },
284
- otAfterDaily: 0,
285
- salesForecast: 0,
286
- closedWeekdays: [],
287
- labourTarget: 0,
288
- budgetFromSales: !1,
289
- budget: 0,
290
- otCapHours: 0,
291
- otBudget: 0,
292
- notify: {
293
- waConnected: !1,
294
- waNumber: "",
295
- waDisplayName: "",
296
- defaults: { wa: !1, push: !1, email: !1 }
297
- }
298
- })
299
- }, {
300
- payload: d,
301
- loading: Se,
302
- rosterLoading: Oe,
303
- loadError: ie,
304
- scheduleSetupCompleted: We,
305
- dataVersion: z,
306
- outletId: y,
307
- restaurantEmployees: re,
308
- employeeConfigs: x,
309
- employeeOutletIds: ze,
310
- businessEmployees: me,
311
- positions: ba,
312
- positionRecords: Ve,
313
- rolePositions: jn,
314
- outlet: Na,
315
- locationOptions: Le,
316
- locationLabelById: J,
317
- compensationGroupMeta: Qn,
318
- existingStaff: qn,
319
- shiftTemplates: Xn,
320
- rules: I
321
- } = Ue;
322
- function ka() {
323
- const e = Ue.rules;
324
- Object.keys(e.coverage).forEach((a) => delete e.coverage[a]), e.openFrom = "00:00", e.openTo = "24:00", e.dayHours.splice(0, e.dayHours.length, ...Array.from({ length: 7 }, () => [])), Object.assign(e.payRate.NORMAL, { overtime: 1.5 }), Object.assign(e.payRate.REST_DAY, { regular: 1, overtime: 2 }), Object.assign(e.payRate.PUBLIC_HOLIDAY, { regular: 2, overtime: 3 }), e.otAfterDaily = 0, e.salesForecast = 0, e.closedWeekdays.splice(0, e.closedWeekdays.length), e.labourTarget = 0, e.budgetFromSales = !1, e.budget = 0, e.otCapHours = 0, e.otBudget = 0, Object.assign(e.notify, {
325
- waConnected: !1,
326
- waNumber: "",
327
- waDisplayName: "",
328
- defaults: { wa: !1, push: !1, email: !1 }
329
- });
330
- }
331
- const De = 7;
332
- function Ca(e) {
333
- const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
334
- return `${a}-${t}-${n}`;
335
- }
336
- function Z(e, a) {
337
- const t = new Date(e);
338
- return t.setDate(t.getDate() + a), t;
339
- }
340
- function ge(e) {
341
- const a = new Date(e);
342
- return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
343
- }
344
- function Jn(e, a = /* @__PURE__ */ new Date()) {
345
- const t = Z(ge(a), e * De);
346
- return Array.from({ length: De }, (n, r) => Z(t, r));
347
- }
348
- function Zn(e, a) {
349
- const t = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), n = t(ge(e)), r = t(ge(a));
350
- return Math.trunc((r - n) / (De * 24 * 60 * 60 * 1e3));
351
- }
352
- const ee = Ca;
353
- let V = null, K = null, W = null, X = 0, le = null;
354
- function Re(e) {
355
- return e === y.value ? !1 : (ka(), y.value = e, d.value = null, V = null, K = null, ie.value = null, le = null, We.value = !1, re.value = [], x.value = [], W = null, X += 1, z.value += 1, !0);
356
- }
357
- async function we(e) {
358
- if (!(!e || le === e)) {
359
- Oe.value = !0;
360
- try {
361
- await Ma(e);
362
- } finally {
363
- Oe.value = !1;
364
- }
365
- }
366
- }
367
- async function Ma(e) {
368
- const a = await he.readEmployeesPage({
369
- limit: q,
370
- offset: 0,
371
- restaurantIds: [e]
372
- });
373
- e === y.value && (re.value = a.items, x.value = await D.listEmployeeConfigs(e), le = e, z.value += 1, Ra().then((t) => {
374
- e === y.value && (ze.value = t, z.value += 1);
375
- }));
376
- }
377
- async function Sa(e) {
378
- const a = y.value;
379
- if (!a || !e.length) return;
380
- const t = await D.saveEmployeeConfigs(a, { configs: e });
381
- x.value = t, z.value += 1;
382
- }
383
- async function Oa(e, a) {
384
- const t = x.value.find((r) => r.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && x.value.some((r) => r.displayOrder !== null) ? Math.max(
385
- 0,
386
- ...x.value.filter((r) => r.displayOrder !== null).map((r) => r.displayOrder)
387
- ) + 100 : null);
388
- await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
389
- }
390
- async function Ke() {
391
- const e = y.value;
392
- e && (le = null, await we(e));
393
- }
394
- async function Ge(e, a) {
395
- const t = ga(), n = (await je(!0)).find((i) => i._id === e);
396
- if (!n) throw new Error("Could not find this employee");
397
- const r = n.restaurantRole.map((i) => ({
398
- restaurantId: i.restaurantId,
399
- roleId: i.roleId
400
- })), o = a(r);
401
- if (!o.length)
402
- throw new Error(
403
- "An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
404
- );
405
- (n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
406
- user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
407
- roles: o,
408
- previousRoles: r
409
- }) : await t.updateEmployee(e, {
410
- user: { name: n.name, passcode: n.passcode },
411
- roles: o,
412
- previousRoles: r
413
- });
414
- }
415
- async function eo(e, a, t = "") {
416
- const n = [...new Set(a.filter(Boolean))];
417
- n.length && (await Ge(e, (r) => [
418
- ...r.filter((o) => !n.includes(o.restaurantId)),
419
- ...n.map((o) => ({ restaurantId: o, roleId: t }))
420
- ]), y.value && n.includes(y.value) && await Oa(e, !0), await Ke());
421
- }
422
- async function ao(e, a) {
423
- const t = new Set(a);
424
- t.size && (await Ge(e, (n) => n.filter((r) => !t.has(r.restaurantId))), await Ke());
425
- }
426
- let Q = null;
427
- async function La() {
428
- const e = await he.readEmployeesPage({
429
- limit: q,
430
- offset: 0,
431
- includeEmptyPasscode: !0
432
- }), a = Math.min(Ea, Math.ceil(e.total / q)), t = await Promise.all(
433
- Array.from(
434
- { length: Math.max(0, a - 1) },
435
- (n, r) => he.readEmployeesPage({
436
- limit: q,
437
- offset: (r + 1) * q,
438
- includeEmptyPasscode: !0
439
- })
440
- )
441
- );
442
- return [...e.items, ...t.flatMap((n) => n.items)];
443
- }
444
- function je(e = !1) {
445
- if (!e) {
446
- if (Q) return Q;
447
- if (me.value.length) return Promise.resolve(me.value);
448
- }
449
- const a = La().then((t) => (me.value = t, t)).finally(() => {
450
- Q === a && (Q = null);
451
- });
452
- return Q = a, a;
453
- }
454
- async function Ra() {
455
- const e = {};
456
- try {
457
- (await je()).forEach((a) => {
458
- e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
459
- });
460
- } catch {
461
- return e;
462
- }
463
- return e;
464
- }
465
- function Ie(e, a) {
466
- return V !== null && K !== null && V <= e && K >= a;
467
- }
468
- async function Ia(e) {
469
- const a = ee(e), t = ee(Z(e, 6));
470
- Ie(a, t) || W && (await W, Ie(a, t)) || await Qe(
471
- Z(e, -7 * Me),
472
- Z(e, 7 * Me)
473
- );
474
- }
475
- async function to() {
476
- !V || !K || await Qe(/* @__PURE__ */ new Date(`${V}T00:00:00`), /* @__PURE__ */ new Date(`${K}T00:00:00`));
477
- }
478
- async function no(e) {
479
- if (!y.value) throw new Error("No outlet selected");
480
- const a = await D.createEmployeeProfile(y.value, e);
481
- d.value && (d.value.employees.push(a), z.value += 1);
482
- }
483
- async function oo(e, a) {
484
- if (!y.value) throw new Error("No outlet selected");
485
- const t = await D.updateEmployeeProfile(y.value, e, a);
486
- if (d.value) {
487
- const n = d.value.employees.findIndex((r) => r.employeeId === e);
488
- n > -1 && (d.value = {
489
- ...d.value,
490
- employees: d.value.employees.map((r, o) => o === n ? t : r)
491
- });
492
- }
493
- }
494
- async function so(e) {
495
- const a = await D.createPosition(e);
496
- d.value && (d.value = { ...d.value, positions: [...d.value.positions, a] });
497
- }
498
- async function io(e, a) {
499
- const t = await D.updatePosition(e, a);
500
- d.value && (d.value = {
501
- ...d.value,
502
- positions: d.value.positions.map((n) => n.id === e ? t : n)
503
- });
504
- }
505
- async function ro(e) {
506
- await D.deletePosition(e), d.value && (d.value = {
507
- ...d.value,
508
- positions: d.value.positions.filter((a) => a.id !== e)
509
- });
510
- }
511
- async function lo(e, a) {
512
- var r;
513
- if (!y.value) throw new Error("No outlet selected");
514
- const t = (r = d.value) == null ? void 0 : r.days.find((o) => o.date === e), n = await D.saveScheduleDay(y.value, e, {
515
- ...a,
516
- expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
517
- });
518
- if (d.value) {
519
- const o = d.value.days.filter((s) => s.date !== e);
520
- n && o.push(n), d.value = { ...d.value, days: o };
521
- }
522
- }
523
- async function uo(e) {
524
- await $a([e]);
525
- }
526
- function Ta(e) {
527
- const a = e.periods.flatMap((t) => {
528
- const n = (t.roles ?? []).filter((s) => s.positionName && s.headcount > 0), r = n.reduce((s, i) => s + i.headcount, 0), o = {
529
- ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
530
- startTime: t.startTime,
531
- endTime: t.endTime
532
- };
533
- return [
534
- ...n.map((s) => ({
535
- ...o,
536
- headcount: s.headcount,
537
- position: { positionId: s.positionId, positionName: s.positionName }
538
- })),
539
- ...t.headcount > r ? [{ ...o, headcount: t.headcount - r }] : []
540
- ];
541
- });
542
- return {
543
- ...e.date ? { date: e.date } : { dayOfWeek: e.dayOfWeek },
544
- demands: a
545
- };
546
- }
547
- async function $a(e) {
548
- if (!y.value) throw new Error("No outlet selected");
549
- if (!e.length) return;
550
- const a = e.map(Ta), t = e.length === 1 ? await D.replaceDemands(y.value, a[0]) : await D.bulkReplaceDemands(y.value, { replacements: a });
551
- if (d.value) {
552
- const n = e.map((o) => ({ date: o.date, dayOfWeek: o.dayOfWeek })), r = d.value.demands.filter(
553
- (o) => !n.some((s) => s.date ? o.date === s.date : o.dayOfWeek === s.dayOfWeek)
554
- );
555
- d.value = { ...d.value, demands: [...r, ...t] };
556
- }
557
- }
558
- async function co(e, a) {
559
- if (!y.value) throw new Error("No outlet selected");
560
- const t = d.value;
561
- if (!t || t.demands.some((o) => o.date === a)) return 0;
562
- const n = t.demands.filter((o) => o.date === e);
563
- if (!n.length) return 0;
564
- const r = await Promise.all(
565
- n.map(
566
- (o) => D.createDemand(y.value, {
567
- date: a,
568
- startTime: o.startTime,
569
- endTime: o.endTime,
570
- headcount: o.headcount,
571
- ...o.position ? {
572
- position: {
573
- positionId: o.position.positionId,
574
- positionName: o.position.positionName
575
- }
576
- } : {}
577
- })
578
- )
579
- );
580
- return d.value && (d.value = { ...d.value, demands: [...d.value.demands, ...r] }), r.length;
581
- }
582
- async function yo(e) {
583
- if (!y.value) throw new Error("No outlet selected");
584
- return D.generateAutoSchedule(y.value, e);
585
- }
586
- async function mo() {
587
- if (!y.value) throw new Error("No outlet selected");
588
- return D.getAutoScheduleCapabilities(y.value);
589
- }
590
- async function fo(e) {
591
- if (!y.value) throw new Error("No outlet selected");
592
- return D.applyAutoSchedule(y.value, e);
593
- }
594
- async function po(e) {
595
- if (!y.value) throw new Error("No outlet selected");
596
- return D.bulkSaveAssignments(y.value, e);
597
- }
598
- async function ho(e) {
599
- if (!y.value) throw new Error("No outlet selected");
600
- e.length && await D.deleteAssignments(y.value, e);
601
- }
602
- async function vo(e) {
603
- if (!y.value) throw new Error("No outlet selected");
604
- const a = await D.createTimeOff(y.value, e);
605
- return d.value && (d.value = { ...d.value, timeOff: [...d.value.timeOff, a] }), a;
606
- }
607
- async function Do(e, a) {
608
- if (!y.value) throw new Error("No outlet selected");
609
- const t = await D.updateTimeOffStatus(y.value, e, a);
610
- return t && d.value && (d.value = {
611
- ...d.value,
612
- timeOff: d.value.timeOff.map((n) => n.id === e ? t : n)
613
- }), t;
614
- }
615
- async function go(e) {
616
- if (!y.value) throw new Error("No outlet selected");
617
- await D.deleteTimeOff(y.value, e), d.value && (d.value = {
618
- ...d.value,
619
- timeOff: d.value.timeOff.filter((a) => a.id !== e)
620
- });
621
- }
622
- async function wo(e) {
623
- if (!y.value) throw new Error("No outlet selected");
624
- return D.bulkUpdateAssignmentStatus(y.value, e);
625
- }
626
- async function Qe(e, a) {
627
- const t = y.value;
628
- if (!t) {
629
- ie.value = "No outlet selected";
630
- return;
631
- }
632
- const n = ee(e), r = ee(a), o = ++X;
633
- Se.value = !0, ie.value = null;
634
- const s = (async () => {
635
- try {
636
- const i = await D.readBoard(t, n, r);
637
- if (y.value !== t || o !== X) return;
638
- d.value = i, We.value = i.settings.setupCompleted, V = n, K = r, z.value += 1;
639
- } catch (i) {
640
- if (y.value !== t || o !== X) return;
641
- ie.value = i instanceof Error ? i.message : "Could not load the schedule";
642
- } finally {
643
- y.value === t && o === X && (Se.value = !1);
644
- }
645
- })();
646
- W = s;
647
- try {
648
- await s;
649
- } finally {
650
- W === s && (W = null);
651
- }
652
- }
653
- const Pa = "AE", Ya = "Asia/Dubai", Ba = {
654
- NORMAL: {
655
- overtime: 1.25
656
- },
657
- REST_DAY: {
658
- regular: 1,
659
- overtime: 2
660
- },
661
- PUBLIC_HOLIDAY: {
662
- regular: 2.5,
663
- overtime: 1.5
664
- }
665
- }, _a = {
666
- maxMonthlyHours: null,
667
- afterDailyHours: 2
668
- }, xa = {
669
- standardWeeklyHours: 48,
670
- maxDailyHours: 8
671
- }, Fa = [
672
- {
673
- month: 1,
674
- day: 1,
675
- name: "New Year's Day"
676
- },
677
- {
678
- month: 12,
679
- day: 2,
680
- name: "UAE National Day"
681
- },
682
- {
683
- month: 12,
684
- day: 3,
685
- name: "UAE National Day Holiday"
686
- }
687
- ], Ua = {
688
- 2026: {
689
- "2026-01-01": "Gregorian New Year",
690
- "2026-03-20": "Eid Al-Fitr Holiday",
691
- "2026-03-21": "Eid Al-Fitr Holiday",
692
- "2026-03-22": "Eid Al-Fitr Holiday",
693
- "2026-05-26": "Arafat Day",
694
- "2026-05-27": "Eid Al-Adha Holiday",
695
- "2026-05-28": "Eid Al-Adha Holiday",
696
- "2026-05-29": "Eid Al-Adha Holiday",
697
- "2026-06-17": "Islamic New Year",
698
- "2026-08-26": "Prophet Muhammad's Birthday",
699
- "2026-12-02": "UAE National Day",
700
- "2026-12-03": "UAE National Day Holiday"
701
- },
702
- 2027: {
703
- "2027-01-01": "Gregorian New Year",
704
- "2027-03-08": "Eid Al-Fitr Holiday",
705
- "2027-03-09": "Eid Al-Fitr Holiday",
706
- "2027-03-10": "Eid Al-Fitr Holiday",
707
- "2027-03-11": "Eid Al-Fitr Holiday",
708
- "2027-05-15": "Arafat Day",
709
- "2027-05-16": "Eid Al-Adha Holiday",
710
- "2027-05-17": "Eid Al-Adha Holiday",
711
- "2027-05-18": "Eid Al-Adha Holiday",
712
- "2027-06-06": "Islamic New Year",
713
- "2027-08-14": "Prophet Muhammad's Birthday",
714
- "2027-12-02": "UAE National Day",
715
- "2027-12-03": "UAE National Day Holiday"
716
- }
717
- }, Wa = {
718
- countryCode: Pa,
719
- timezone: Ya,
720
- payRate: Ba,
721
- overtime: _a,
722
- workingHours: xa,
723
- recurringPublicHolidays: Fa,
724
- publicHolidays: Ua
725
- }, za = "BN", Va = "Asia/Brunei", Ka = {
726
- NORMAL: {
727
- overtime: 1.5
728
- },
729
- REST_DAY: {
730
- regular: 1,
731
- overtime: 2
732
- },
733
- PUBLIC_HOLIDAY: {
734
- regular: 2,
735
- overtime: 3
736
- }
737
- }, Ga = {
738
- maxMonthlyHours: 72,
739
- afterDailyHours: null
740
- }, ja = {
741
- standardWeeklyHours: 44,
742
- maxDailyHours: 8
743
- }, Qa = [
744
- {
745
- month: 1,
746
- day: 1,
747
- name: "New Year's Day"
748
- },
749
- {
750
- month: 2,
751
- day: 23,
752
- name: "National Day"
753
- },
754
- {
755
- month: 5,
756
- day: 1,
757
- name: "International Labour Day"
758
- },
759
- {
760
- month: 7,
761
- day: 15,
762
- name: "Sultan's Birthday"
763
- },
764
- {
765
- month: 12,
766
- day: 25,
767
- name: "Christmas Day"
768
- }
769
- ], qa = {
770
- 2026: {
771
- "2026-01-01": "New Year's Day",
772
- "2026-02-17": "Chinese New Year",
773
- "2026-02-23": "National Day",
774
- "2026-03-07": "Nuzul Al-Quran",
775
- "2026-03-20": "Hari Raya Aidilfitri",
776
- "2026-03-21": "Hari Raya Aidilfitri Holiday",
777
- "2026-03-22": "Hari Raya Aidilfitri Holiday",
778
- "2026-05-01": "International Labour Day",
779
- "2026-05-27": "Hari Raya Aidiladha",
780
- "2026-06-17": "Islamic New Year",
781
- "2026-07-15": "Sultan's Birthday",
782
- "2026-08-25": "Prophet Muhammad's Birthday",
783
- "2026-12-25": "Christmas Day"
784
- },
785
- 2027: {
786
- "2027-01-01": "New Year's Day",
787
- "2027-02-06": "Chinese New Year",
788
- "2027-02-23": "National Day",
789
- "2027-03-07": "Nuzul Al-Quran",
790
- "2027-03-10": "Hari Raya Aidilfitri",
791
- "2027-03-11": "Hari Raya Aidilfitri Holiday",
792
- "2027-05-01": "International Labour Day",
793
- "2027-05-17": "Hari Raya Aidiladha",
794
- "2027-06-06": "Islamic New Year",
795
- "2027-07-15": "Sultan's Birthday",
796
- "2027-08-15": "Prophet Muhammad's Birthday",
797
- "2027-12-25": "Christmas Day"
798
- }
799
- }, Xa = {
800
- countryCode: za,
801
- timezone: Va,
802
- payRate: Ka,
803
- overtime: Ga,
804
- workingHours: ja,
805
- recurringPublicHolidays: Qa,
806
- publicHolidays: qa
807
- }, Ja = "ID", Za = "Asia/Jakarta", et = {
808
- NORMAL: {
809
- overtime: 1.5
810
- },
811
- REST_DAY: {
812
- regular: 1,
813
- overtime: 2
814
- },
815
- PUBLIC_HOLIDAY: {
816
- regular: 2,
817
- overtime: 2
818
- }
819
- }, at = {
820
- maxMonthlyHours: 72,
821
- afterDailyHours: 3
822
- }, tt = {
823
- standardWeeklyHours: 40,
824
- maxDailyHours: 8
825
- }, nt = [
826
- {
827
- month: 1,
828
- day: 1,
829
- name: "New Year's Day"
830
- },
831
- {
832
- month: 5,
833
- day: 1,
834
- name: "International Labour Day"
835
- },
836
- {
837
- month: 8,
838
- day: 17,
839
- name: "Independence Day"
840
- },
841
- {
842
- month: 12,
843
- day: 25,
844
- name: "Christmas Day"
845
- }
846
- ], ot = {
847
- 2026: {
848
- "2026-01-01": "New Year's Day",
849
- "2026-01-16": "Isra Mi'raj",
850
- "2026-02-17": "Chinese New Year",
851
- "2026-03-19": "Nyepi",
852
- "2026-03-21": "Eid al-Fitr",
853
- "2026-03-22": "Eid al-Fitr Holiday",
854
- "2026-04-03": "Good Friday",
855
- "2026-04-05": "Easter Sunday",
856
- "2026-05-01": "International Labour Day",
857
- "2026-05-14": "Ascension Day",
858
- "2026-05-27": "Eid al-Adha",
859
- "2026-05-31": "Vesak Day",
860
- "2026-06-01": "Pancasila Day",
861
- "2026-06-16": "Islamic New Year",
862
- "2026-08-17": "Independence Day",
863
- "2026-08-25": "Prophet Muhammad's Birthday",
864
- "2026-12-25": "Christmas Day"
865
- },
866
- 2027: {
867
- "2027-01-01": "New Year's Day",
868
- "2027-01-05": "Isra Mi'raj",
869
- "2027-02-06": "Chinese New Year",
870
- "2027-03-08": "Nyepi",
871
- "2027-03-10": "Eid al-Fitr",
872
- "2027-03-11": "Eid al-Fitr Holiday",
873
- "2027-03-26": "Good Friday",
874
- "2027-03-28": "Easter Sunday",
875
- "2027-05-01": "International Labour Day",
876
- "2027-05-06": "Ascension Day",
877
- "2027-05-17": "Eid al-Adha",
878
- "2027-05-20": "Vesak Day",
879
- "2027-06-01": "Pancasila Day",
880
- "2027-06-06": "Islamic New Year",
881
- "2027-08-15": "Prophet Muhammad's Birthday",
882
- "2027-08-17": "Independence Day",
883
- "2027-12-25": "Christmas Day",
884
- "2027-12-26": "Isra Mi'raj"
885
- }
886
- }, st = {
887
- countryCode: Ja,
888
- timezone: Za,
889
- payRate: et,
890
- overtime: at,
891
- workingHours: tt,
892
- recurringPublicHolidays: nt,
893
- publicHolidays: ot
894
- }, it = "MO", rt = "Asia/Macau", lt = {
895
- NORMAL: {
896
- overtime: 1.5
897
- },
898
- REST_DAY: {
899
- regular: 1,
900
- overtime: 2
901
- },
902
- PUBLIC_HOLIDAY: {
903
- regular: 2,
904
- overtime: 3
905
- }
906
- }, ut = {
907
- maxMonthlyHours: null,
908
- afterDailyHours: null
909
- }, dt = {
910
- standardWeeklyHours: 48,
911
- maxDailyHours: 8
912
- }, ct = [
913
- {
914
- month: 1,
915
- day: 1,
916
- name: "New Year's Day"
917
- },
918
- {
919
- month: 5,
920
- day: 1,
921
- name: "Labour Day"
922
- },
923
- {
924
- month: 10,
925
- day: 1,
926
- name: "National Day"
927
- },
928
- {
929
- month: 12,
930
- day: 20,
931
- name: "Macao Special Administrative Region Establishment Day"
932
- },
933
- {
934
- month: 12,
935
- day: 25,
936
- name: "Christmas Day"
937
- }
938
- ], yt = {
939
- 2026: {
940
- "2026-01-01": "New Year's Day",
941
- "2026-02-17": "Lunar New Year's Day",
942
- "2026-02-18": "Second day of Lunar New Year",
943
- "2026-02-19": "Third day of Lunar New Year",
944
- "2026-04-03": "Good Friday",
945
- "2026-04-04": "Day before Easter",
946
- "2026-04-05": "Cheng Ming Festival",
947
- "2026-04-06": "Compensatory rest day",
948
- "2026-04-07": "Compensatory rest day",
949
- "2026-05-01": "Labour Day",
950
- "2026-05-24": "Buddha's Birthday",
951
- "2026-05-25": "Compensatory rest day",
952
- "2026-06-19": "Dragon Boat Festival",
953
- "2026-09-26": "Day following Mid-Autumn Festival",
954
- "2026-09-28": "Compensatory rest day",
955
- "2026-10-01": "National Day",
956
- "2026-10-02": "Day following National Day",
957
- "2026-10-18": "Chong Yeung Festival",
958
- "2026-10-19": "Compensatory rest day",
959
- "2026-11-02": "All Souls' Day",
960
- "2026-12-08": "Immaculate Conception",
961
- "2026-12-20": "Macao SAR Establishment Day",
962
- "2026-12-21": "Compensatory rest day",
963
- "2026-12-22": "Winter Solstice",
964
- "2026-12-24": "Christmas Eve",
965
- "2026-12-25": "Christmas Day"
966
- },
967
- 2027: {
968
- "2027-01-01": "New Year's Day",
969
- "2027-02-06": "Lunar New Year's Day",
970
- "2027-02-07": "Second day of Lunar New Year",
971
- "2027-02-08": "Third day of Lunar New Year",
972
- "2027-02-09": "Compensatory rest day",
973
- "2027-02-10": "Compensatory rest day",
974
- "2027-03-26": "Good Friday",
975
- "2027-03-27": "Day before Easter",
976
- "2027-03-29": "Compensatory rest day",
977
- "2027-04-05": "Cheng Ming Festival",
978
- "2027-05-01": "Labour Day",
979
- "2027-05-03": "Compensatory rest day",
980
- "2027-05-13": "Buddha's Birthday",
981
- "2027-06-09": "Dragon Boat Festival",
982
- "2027-09-16": "Day following Mid-Autumn Festival",
983
- "2027-10-01": "National Day",
984
- "2027-10-02": "Day following National Day",
985
- "2027-10-04": "Compensatory rest day",
986
- "2027-10-08": "Chong Yeung Festival",
987
- "2027-11-02": "All Souls' Day",
988
- "2027-12-08": "Immaculate Conception",
989
- "2027-12-20": "Macao SAR Establishment Day",
990
- "2027-12-22": "Winter Solstice",
991
- "2027-12-24": "Christmas Eve",
992
- "2027-12-25": "Christmas Day",
993
- "2027-12-27": "Compensatory rest day"
994
- }
995
- }, mt = {
996
- countryCode: it,
997
- timezone: rt,
998
- payRate: lt,
999
- overtime: ut,
1000
- workingHours: dt,
1001
- recurringPublicHolidays: ct,
1002
- publicHolidays: yt
1003
- }, ft = "MV", pt = "Indian/Maldives", ht = {
1004
- NORMAL: {
1005
- overtime: 1.5
1006
- },
1007
- REST_DAY: {
1008
- regular: 1,
1009
- overtime: 2
1010
- },
1011
- PUBLIC_HOLIDAY: {
1012
- regular: 2,
1013
- overtime: 3
1014
- }
1015
- }, vt = {
1016
- maxMonthlyHours: null,
1017
- afterDailyHours: null
1018
- }, Dt = {
1019
- standardWeeklyHours: 48,
1020
- maxDailyHours: 8
1021
- }, gt = [
1022
- {
1023
- month: 1,
1024
- day: 1,
1025
- name: "New Year's Day"
1026
- },
1027
- {
1028
- month: 5,
1029
- day: 1,
1030
- name: "Labour Day"
1031
- },
1032
- {
1033
- month: 7,
1034
- day: 26,
1035
- name: "Independence Day"
1036
- },
1037
- {
1038
- month: 11,
1039
- day: 3,
1040
- name: "Victory Day"
1041
- },
1042
- {
1043
- month: 11,
1044
- day: 11,
1045
- name: "Republic Day"
1046
- }
1047
- ], wt = {
1048
- 2026: {
1049
- "2026-01-01": "New Year's Day",
1050
- "2026-03-20": "Eid al-Fitr Holiday",
1051
- "2026-03-21": "Eid al-Fitr Holiday",
1052
- "2026-03-22": "Eid al-Fitr Holiday",
1053
- "2026-05-01": "Labour Day",
1054
- "2026-05-26": "Arafah Day",
1055
- "2026-05-27": "Eid al-Adha Holiday",
1056
- "2026-05-28": "Eid al-Adha Holiday",
1057
- "2026-05-29": "Eid al-Adha Holiday",
1058
- "2026-06-17": "Islamic New Year",
1059
- "2026-07-26": "Independence Day",
1060
- "2026-07-27": "Independence Day Holiday",
1061
- "2026-08-14": "National Day",
1062
- "2026-08-25": "Prophet Muhammad's Birthday",
1063
- "2026-09-13": "The Day Maldives Embraced Islam",
1064
- "2026-11-03": "Victory Day",
1065
- "2026-11-11": "Republic Day"
1066
- },
1067
- 2027: {
1068
- "2027-01-01": "New Year's Day",
1069
- "2027-03-10": "Eid al-Fitr Holiday",
1070
- "2027-03-11": "Eid al-Fitr Holiday",
1071
- "2027-05-01": "Labour Day",
1072
- "2027-05-15": "Arafah Day",
1073
- "2027-05-16": "Eid al-Adha Holiday",
1074
- "2027-05-17": "Eid al-Adha Holiday",
1075
- "2027-05-18": "Eid al-Adha Holiday",
1076
- "2027-06-06": "Islamic New Year",
1077
- "2027-07-26": "Independence Day",
1078
- "2027-07-27": "Independence Day Holiday",
1079
- "2027-08-14": "National Day",
1080
- "2027-08-15": "Prophet Muhammad's Birthday",
1081
- "2027-09-03": "The Day Maldives Embraced Islam",
1082
- "2027-11-03": "Victory Day",
1083
- "2027-11-11": "Republic Day"
1084
- }
1085
- }, Ht = {
1086
- countryCode: ft,
1087
- timezone: pt,
1088
- payRate: ht,
1089
- overtime: vt,
1090
- workingHours: Dt,
1091
- recurringPublicHolidays: gt,
1092
- publicHolidays: wt
1093
- }, At = "MY", Et = "Asia/Kuala_Lumpur", bt = {
1094
- NORMAL: {
1095
- overtime: 1.5
1096
- },
1097
- REST_DAY: {
1098
- regular: 1,
1099
- overtime: 2
1100
- },
1101
- PUBLIC_HOLIDAY: {
1102
- regular: 2,
1103
- overtime: 3
1104
- }
1105
- }, Nt = {
1106
- maxMonthlyHours: 104,
1107
- afterDailyHours: null
1108
- }, kt = {
1109
- standardWeeklyHours: 45,
1110
- maxDailyHours: 8
1111
- }, Ct = [
1112
- {
1113
- month: 1,
1114
- day: 1,
1115
- name: "New Year's Day"
1116
- },
1117
- {
1118
- month: 5,
1119
- day: 1,
1120
- name: "Labour Day"
1121
- },
1122
- {
1123
- month: 8,
1124
- day: 31,
1125
- name: "Merdeka Day"
1126
- },
1127
- {
1128
- month: 9,
1129
- day: 16,
1130
- name: "Malaysia Day"
1131
- },
1132
- {
1133
- month: 12,
1134
- day: 25,
1135
- name: "Christmas Day"
1136
- }
1137
- ], Mt = {
1138
- 2026: {
1139
- "2026-01-01": "New Year's Day",
1140
- "2026-02-17": "Chinese New Year",
1141
- "2026-02-18": "Chinese New Year Holiday",
1142
- "2026-03-07": "Nuzul Al-Quran",
1143
- "2026-03-20": "Hari Raya Aidilfitri",
1144
- "2026-03-21": "Hari Raya Aidilfitri Holiday",
1145
- "2026-03-22": "Hari Raya Aidilfitri Holiday",
1146
- "2026-03-23": "Hari Raya Aidilfitri Holiday",
1147
- "2026-05-01": "Labour Day",
1148
- "2026-05-27": "Hari Raya Haji",
1149
- "2026-05-31": "Wesak Day",
1150
- "2026-06-01": "Agong's Birthday",
1151
- "2026-06-17": "Awal Muharram",
1152
- "2026-08-25": "Prophet Muhammad's Birthday",
1153
- "2026-08-31": "Merdeka Day",
1154
- "2026-09-16": "Malaysia Day",
1155
- "2026-11-08": "Deepavali",
1156
- "2026-12-25": "Christmas Day"
1157
- },
1158
- 2027: {
1159
- "2027-01-01": "New Year's Day",
1160
- "2027-02-06": "Chinese New Year",
1161
- "2027-02-07": "Chinese New Year Holiday",
1162
- "2027-03-10": "Hari Raya Aidilfitri",
1163
- "2027-03-11": "Hari Raya Aidilfitri Holiday",
1164
- "2027-05-01": "Labour Day",
1165
- "2027-05-17": "Hari Raya Haji",
1166
- "2027-05-20": "Wesak Day",
1167
- "2027-06-01": "Agong's Birthday",
1168
- "2027-06-06": "Awal Muharram",
1169
- "2027-08-15": "Prophet Muhammad's Birthday",
1170
- "2027-08-31": "Merdeka Day",
1171
- "2027-09-16": "Malaysia Day",
1172
- "2027-10-28": "Deepavali",
1173
- "2027-12-25": "Christmas Day"
1174
- }
1175
- }, St = {
1176
- countryCode: At,
1177
- timezone: Et,
1178
- payRate: bt,
1179
- overtime: Nt,
1180
- workingHours: kt,
1181
- recurringPublicHolidays: Ct,
1182
- publicHolidays: Mt
1183
- }, Ot = "PK", Lt = "Asia/Karachi", Rt = {
1184
- NORMAL: {
1185
- overtime: 1.5
1186
- },
1187
- REST_DAY: {
1188
- regular: 1,
1189
- overtime: 2
1190
- },
1191
- PUBLIC_HOLIDAY: {
1192
- regular: 2,
1193
- overtime: 3
1194
- }
1195
- }, It = {
1196
- maxMonthlyHours: null,
1197
- afterDailyHours: null
1198
- }, Tt = {
1199
- standardWeeklyHours: 48,
1200
- maxDailyHours: 9
1201
- }, $t = [
1202
- {
1203
- month: 1,
1204
- day: 1,
1205
- name: "New Year's Day"
1206
- },
1207
- {
1208
- month: 2,
1209
- day: 5,
1210
- name: "Kashmir Day"
1211
- },
1212
- {
1213
- month: 3,
1214
- day: 23,
1215
- name: "Pakistan Day"
1216
- },
1217
- {
1218
- month: 5,
1219
- day: 1,
1220
- name: "Labour Day"
1221
- },
1222
- {
1223
- month: 8,
1224
- day: 14,
1225
- name: "Independence Day"
1226
- },
1227
- {
1228
- month: 12,
1229
- day: 25,
1230
- name: "Quaid-e-Azam Day and Christmas Day"
1231
- }
1232
- ], Pt = {
1233
- 2026: {
1234
- "2026-01-01": "New Year's Day",
1235
- "2026-02-05": "Kashmir Day",
1236
- "2026-03-23": "Pakistan Day",
1237
- "2026-05-01": "Labour Day",
1238
- "2026-06-27": "Eid al-Adha",
1239
- "2026-06-28": "Eid al-Adha Holiday",
1240
- "2026-06-29": "Eid al-Adha Holiday",
1241
- "2026-08-14": "Independence Day",
1242
- "2026-08-25": "Eid Milad-un-Nabi",
1243
- "2026-12-25": "Quaid-e-Azam Day and Christmas Day"
1244
- },
1245
- 2027: {
1246
- "2027-01-01": "New Year's Day",
1247
- "2027-02-05": "Kashmir Day",
1248
- "2027-03-23": "Pakistan Day",
1249
- "2027-05-01": "Labour Day",
1250
- "2027-05-17": "Eid al-Adha",
1251
- "2027-05-18": "Eid al-Adha Holiday",
1252
- "2027-05-19": "Eid al-Adha Holiday",
1253
- "2027-08-14": "Independence Day",
1254
- "2027-08-15": "Eid Milad-un-Nabi",
1255
- "2027-12-25": "Quaid-e-Azam Day and Christmas Day"
1256
- }
1257
- }, Yt = {
1258
- countryCode: Ot,
1259
- timezone: Lt,
1260
- payRate: Rt,
1261
- overtime: It,
1262
- workingHours: Tt,
1263
- recurringPublicHolidays: $t,
1264
- publicHolidays: Pt
1265
- }, Bt = "SG", _t = "Asia/Singapore", xt = {
1266
- NORMAL: {
1267
- overtime: 1.5
1268
- },
1269
- REST_DAY: {
1270
- regular: 1,
1271
- overtime: 2
1272
- },
1273
- PUBLIC_HOLIDAY: {
1274
- regular: 2,
1275
- overtime: 1.5
1276
- }
1277
- }, Ft = {
1278
- maxMonthlyHours: 72,
1279
- afterDailyHours: null
1280
- }, Ut = {
1281
- standardWeeklyHours: 44,
1282
- maxDailyHours: 12
1283
- }, Wt = [
1284
- {
1285
- month: 1,
1286
- day: 1,
1287
- name: "New Year's Day"
1288
- },
1289
- {
1290
- month: 5,
1291
- day: 1,
1292
- name: "Labour Day"
1293
- },
1294
- {
1295
- month: 8,
1296
- day: 9,
1297
- name: "National Day"
1298
- },
1299
- {
1300
- month: 12,
1301
- day: 25,
1302
- name: "Christmas Day"
1303
- }
1304
- ], zt = {
1305
- 2026: {
1306
- "2026-01-01": "New Year's Day",
1307
- "2026-02-17": "Chinese New Year's Day",
1308
- "2026-02-18": "Chinese New Year's Holiday",
1309
- "2026-03-21": "Hari Raya Puasa",
1310
- "2026-04-03": "Good Friday",
1311
- "2026-05-01": "Labour Day",
1312
- "2026-05-27": "Hari Raya Haji",
1313
- "2026-05-31": "Vesak Day",
1314
- "2026-06-01": "Vesak Day Holiday",
1315
- "2026-08-09": "National Day",
1316
- "2026-08-10": "National Day Holiday",
1317
- "2026-11-08": "Deepavali",
1318
- "2026-11-09": "Deepavali Holiday",
1319
- "2026-12-25": "Christmas Day"
1320
- },
1321
- 2027: {
1322
- "2027-01-01": "New Year's Day",
1323
- "2027-02-06": "Chinese New Year's Day",
1324
- "2027-02-07": "Chinese New Year's Holiday",
1325
- "2027-02-08": "Chinese New Year Holiday",
1326
- "2027-03-10": "Hari Raya Puasa",
1327
- "2027-03-26": "Good Friday",
1328
- "2027-05-01": "Labour Day",
1329
- "2027-05-17": "Hari Raya Haji",
1330
- "2027-05-20": "Vesak Day",
1331
- "2027-08-09": "National Day",
1332
- "2027-10-28": "Deepavali",
1333
- "2027-12-25": "Christmas Day"
1334
- }
1335
- }, Vt = {
1336
- countryCode: Bt,
1337
- timezone: _t,
1338
- payRate: xt,
1339
- overtime: Ft,
1340
- workingHours: Ut,
1341
- recurringPublicHolidays: Wt,
1342
- publicHolidays: zt
1343
- }, Kt = "TH", Gt = "Asia/Bangkok", jt = {
1344
- NORMAL: {
1345
- overtime: 1.5
1346
- },
1347
- REST_DAY: {
1348
- regular: 1,
1349
- overtime: 2
1350
- },
1351
- PUBLIC_HOLIDAY: {
1352
- regular: 2,
1353
- overtime: 3
1354
- }
1355
- }, Qt = {
1356
- maxMonthlyHours: 36,
1357
- afterDailyHours: null
1358
- }, qt = {
1359
- standardWeeklyHours: 48,
1360
- maxDailyHours: 8
1361
- }, Xt = [
1362
- {
1363
- month: 1,
1364
- day: 1,
1365
- name: "New Year's Day"
1366
- },
1367
- {
1368
- month: 4,
1369
- day: 6,
1370
- name: "Chakri Memorial Day"
1371
- },
1372
- {
1373
- month: 5,
1374
- day: 1,
1375
- name: "National Labour Day"
1376
- },
1377
- {
1378
- month: 7,
1379
- day: 28,
1380
- name: "King's Birthday"
1381
- },
1382
- {
1383
- month: 8,
1384
- day: 12,
1385
- name: "Queen Mother's Birthday"
1386
- },
1387
- {
1388
- month: 10,
1389
- day: 13,
1390
- name: "Memorial Day"
1391
- },
1392
- {
1393
- month: 12,
1394
- day: 5,
1395
- name: "King Bhumibol's Birthday"
1396
- },
1397
- {
1398
- month: 12,
1399
- day: 10,
1400
- name: "Constitution Day"
1401
- },
1402
- {
1403
- month: 12,
1404
- day: 31,
1405
- name: "New Year's Eve"
1406
- }
1407
- ], Jt = {
1408
- 2026: {
1409
- "2026-01-01": "New Year's Day",
1410
- "2026-03-03": "Makha Bucha Day",
1411
- "2026-04-06": "Chakri Memorial Day",
1412
- "2026-04-13": "Songkran Festival",
1413
- "2026-04-14": "Songkran Festival",
1414
- "2026-04-15": "Songkran Festival",
1415
- "2026-05-01": "National Labour Day",
1416
- "2026-05-04": "Coronation Day",
1417
- "2026-05-13": "Royal Ploughing Ceremony",
1418
- "2026-05-31": "Visakha Bucha Day",
1419
- "2026-06-01": "Visakha Bucha Holiday",
1420
- "2026-07-28": "King's Birthday",
1421
- "2026-08-12": "Queen Mother's Birthday",
1422
- "2026-10-13": "Memorial Day",
1423
- "2026-10-23": "Chulalongkorn Memorial Day",
1424
- "2026-12-05": "King Bhumibol's Birthday",
1425
- "2026-12-10": "Constitution Day",
1426
- "2026-12-31": "New Year's Eve"
1427
- },
1428
- 2027: {
1429
- "2027-01-01": "New Year's Day",
1430
- "2027-02-26": "Makha Bucha Day",
1431
- "2027-04-06": "Chakri Memorial Day",
1432
- "2027-04-13": "Songkran Festival",
1433
- "2027-04-14": "Songkran Festival",
1434
- "2027-04-15": "Songkran Festival",
1435
- "2027-05-01": "National Labour Day",
1436
- "2027-05-03": "Labour Day Holiday",
1437
- "2027-05-04": "Coronation Day",
1438
- "2027-07-28": "King's Birthday",
1439
- "2027-08-12": "Queen Mother's Birthday",
1440
- "2027-10-13": "Memorial Day",
1441
- "2027-10-23": "Chulalongkorn Memorial Day",
1442
- "2027-12-05": "King Bhumibol's Birthday",
1443
- "2027-12-06": "King Bhumibol's Birthday Holiday",
1444
- "2027-12-10": "Constitution Day",
1445
- "2027-12-31": "New Year's Eve"
1446
- }
1447
- }, Zt = {
1448
- countryCode: Kt,
1449
- timezone: Gt,
1450
- payRate: jt,
1451
- overtime: Qt,
1452
- workingHours: qt,
1453
- recurringPublicHolidays: Xt,
1454
- publicHolidays: Jt
1455
- }, en = "VN", an = "Asia/Ho_Chi_Minh", tn = {
1456
- NORMAL: {
1457
- overtime: 1.5
1458
- },
1459
- REST_DAY: {
1460
- regular: 1,
1461
- overtime: 2
1462
- },
1463
- PUBLIC_HOLIDAY: {
1464
- regular: 2,
1465
- overtime: 3
1466
- }
1467
- }, nn = {
1468
- maxMonthlyHours: 40,
1469
- afterDailyHours: null
1470
- }, on = {
1471
- standardWeeklyHours: 48,
1472
- maxDailyHours: 8
1473
- }, sn = [
1474
- {
1475
- month: 1,
1476
- day: 1,
1477
- name: "New Year's Day"
1478
- },
1479
- {
1480
- month: 4,
1481
- day: 30,
1482
- name: "Reunification Day"
1483
- },
1484
- {
1485
- month: 5,
1486
- day: 1,
1487
- name: "International Labour Day"
1488
- },
1489
- {
1490
- month: 9,
1491
- day: 2,
1492
- name: "National Day"
1493
- }
1494
- ], rn = {
1495
- 2026: {
1496
- "2026-01-01": "New Year's Day",
1497
- "2026-02-16": "Tet Holiday",
1498
- "2026-02-17": "Tet Holiday",
1499
- "2026-02-18": "Tet Holiday",
1500
- "2026-02-19": "Tet Holiday",
1501
- "2026-02-20": "Tet Holiday",
1502
- "2026-04-26": "Hung Kings Commemoration Day",
1503
- "2026-04-27": "Hung Kings Holiday",
1504
- "2026-04-30": "Reunification Day",
1505
- "2026-05-01": "International Labour Day",
1506
- "2026-09-02": "National Day",
1507
- "2026-09-03": "National Day Holiday"
1508
- },
1509
- 2027: {
1510
- "2027-01-01": "New Year's Day",
1511
- "2027-02-05": "Tet Holiday",
1512
- "2027-02-06": "Tet Holiday",
1513
- "2027-02-07": "Tet Holiday",
1514
- "2027-02-08": "Tet Holiday",
1515
- "2027-02-09": "Tet Holiday",
1516
- "2027-04-16": "Hung Kings Commemoration Day",
1517
- "2027-04-30": "Reunification Day",
1518
- "2027-05-01": "International Labour Day",
1519
- "2027-09-02": "National Day",
1520
- "2027-09-03": "National Day Holiday"
1521
- }
1522
- }, ln = {
1523
- countryCode: en,
1524
- timezone: an,
1525
- payRate: tn,
1526
- overtime: nn,
1527
- workingHours: on,
1528
- recurringPublicHolidays: sn,
1529
- publicHolidays: rn
1530
- }, Te = { AE: Wa, BN: Xa, ID: st, MO: mt, MV: Ht, MY: St, PK: Yt, SG: Vt, TH: Zt, VN: ln };
1531
- function un(e) {
1532
- if (typeof e == "string") return e.toUpperCase();
1533
- if (e && typeof e == "object" && "code" in e) {
1534
- const a = e.code;
1535
- if (typeof a == "string") return a.toUpperCase();
1536
- }
1537
- return "MY";
1538
- }
1539
- function dn(e) {
1540
- return Te[un(e)] ?? Te.MY;
1541
- }
1542
- function Ho(e, a) {
1543
- var o, s;
1544
- const t = (o = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : o[a];
1545
- if (t) return t;
1546
- const n = Number(a.slice(5, 7)), r = Number(a.slice(8, 10));
1547
- return ((s = e.recurringPublicHolidays.find((i) => i.month === n && i.day === r)) == null ? void 0 : s.name) ?? null;
1548
- }
1549
- const cn = Be(), qe = "unassigned", Ao = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Eo = "All Stations", bo = [
1550
- { id: qe, label: "Assigned", roles: [], system: !0 }
1551
- ], $e = [
1552
- "#903E1F",
1553
- "#5F090A",
1554
- "#0A5384",
1555
- "#1F5F3E",
1556
- "#5B2C6F",
1557
- "#7D5A00",
1558
- "#0F5C5C",
1559
- "#6E2142"
1560
- ];
1561
- function yn(e) {
1562
- var a;
1563
- return (a = Ve.find((t) => t.name === e)) == null ? void 0 : a.id;
1564
- }
1565
- function No(e) {
1566
- if (e)
1567
- return { positionId: yn(e), positionName: e };
1568
- }
1569
- const ko = [1, 1, 1, 1, 1, 1, 1];
1570
- function ae(e) {
1571
- return (e + 6) % 7;
1572
- }
1573
- function Co(e) {
1574
- return (e + 1) % 7;
1575
- }
1576
- function oe(e, a) {
1577
- e.splice(0, e.length, ...a);
1578
- }
1579
- function mn(e, a) {
1580
- return _e(e, a) / 60;
1581
- }
1582
- function fn(e) {
1583
- var t;
1584
- const a = e.trim().split(/\s+/).filter(Boolean);
1585
- return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
1586
- }
1587
- const Xe = /* @__PURE__ */ new Map(), fe = /* @__PURE__ */ new Map();
1588
- function Mo(e) {
1589
- return Xe.get(e);
1590
- }
1591
- function pn(e) {
1592
- const a = fe.get(e);
1593
- if (a !== void 0) return a;
1594
- const t = Fe + fe.size + 1;
1595
- return fe.set(e, t), Xe.set(t, e), t;
1596
- }
1597
- function So(e) {
1598
- return e.sourceId || String(e.id);
1599
- }
1600
- function hn(e) {
1601
- Na.name = (e == null ? void 0 : e.outlet.name) ?? "", oe(ba, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), oe(Ve, (e == null ? void 0 : e.positions) ?? []);
1602
- const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
1603
- for (const s of a) t[ae(s.dayOfWeek)] = s.closed ? [] : s.hours;
1604
- oe(I.dayHours, t);
1605
- const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
1606
- I.openFrom = n.length ? n.map((s) => s.start).reduce((s, i) => i < s ? i : s) : "00:00", I.openTo = n.length ? n.map((s) => s.end).reduce((s, i) => i > s ? i : s) : "24:00", oe(
1607
- I.closedWeekdays,
1608
- a.filter((s) => s.closed).map((s) => ae(s.dayOfWeek)).sort((s, i) => s - i)
1609
- );
1610
- const r = dn(cn.currentCountry.value), o = (e == null ? void 0 : e.settings.payRate) ?? r.payRate;
1611
- I.otCapHours = (e == null ? void 0 : e.settings.overtime.maxMonthlyHours) ?? r.overtime.maxMonthlyHours ?? 0, I.payRate.NORMAL.overtime = o.NORMAL.overtime, I.payRate.REST_DAY.regular = o.REST_DAY.regular, I.payRate.REST_DAY.overtime = o.REST_DAY.overtime, I.payRate.PUBLIC_HOLIDAY.regular = o.PUBLIC_HOLIDAY.regular, I.payRate.PUBLIC_HOLIDAY.overtime = o.PUBLIC_HOLIDAY.overtime;
1612
- }
1613
- Ee(d, hn, { immediate: !0 });
1614
- function vn(e) {
1615
- return e.reduce(
1616
- (a, t) => t.employmentType === "FULLTIME" ? Math.max(a, t.workingHour) : a,
1617
- 0
1618
- );
1619
- }
1620
- function Dn(e, a) {
1621
- if (e.wage.type === "HOURLY") return e.wage.amount;
1622
- const t = e.workingHour || a;
1623
- return t ? e.wage.amount / (t * (52 / 12)) : 0;
1624
- }
1625
- function gn(e, a) {
1626
- return e.employmentType === "FULLTIME" ? 100 : !a || !e.workingHour ? 0 : Math.min(99, Math.round(e.workingHour / a * 100));
1627
- }
1628
- function wn(e) {
1629
- var a;
1630
- return {
1631
- start: e.startTime,
1632
- end: e.endTime,
1633
- // A missing position means this assignment was genuinely saved as "Any position" — it must
1634
- // stay blank rather than falling back to the employee's own primary position, or a reload
1635
- // silently reassigns every "Any position" shift to whatever station the employee is normally
1636
- // pinned to.
1637
- role: ((a = e.position) == null ? void 0 : a.positionName) ?? "",
1638
- // Mongo distinguishes a draft from a published/confirmed assignment; the board's third
1639
- // state ('ot') is a costing outcome, never something stored.
1640
- status: e.status === "DRAFT" ? "pending" : "confirmed",
1641
- breakMins: xe(e.breaks),
1642
- breaks: e.breaks,
1643
- // Carried through so an edit updates this same ScheduleShiftAssignments document instead of
1644
- // creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
1645
- assignmentId: e.id,
1646
- updatedAt: e.updatedAt
1647
- };
1648
- }
1649
- function Hn(e) {
1650
- return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
1651
- }
1652
- function An(e, a) {
1653
- if (a < e.startDate || a > e.endDate) return null;
1654
- const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
1655
- return {
1656
- requestId: e.id,
1657
- type: e.type,
1658
- leaveType: e.leaveType ?? void 0,
1659
- timeOff: e.status === "PENDING" ? "pending" : "approved",
1660
- reason: Hn(e),
1661
- half: n !== "FULL_DAY",
1662
- halfPart: n === "FULL_DAY" ? void 0 : n
1663
- };
1664
- }
1665
- function En(e) {
1666
- return {
1667
- employeeId: e._id,
1668
- name: e.name,
1669
- employmentType: "FULLTIME",
1670
- workingHour: 0,
1671
- wage: { type: "HOURLY", amount: 0 },
1672
- primaryPosition: null,
1673
- secondaryPositions: [],
1674
- availability: []
1675
- };
1676
- }
1677
- function bn(e) {
1678
- const a = J[y.value];
1679
- return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
1680
- }
1681
- function Nn(e) {
1682
- var n;
1683
- const t = (ze.value[e] ?? ((n = re.value.find((r) => r._id === e)) == null ? void 0 : n.restaurantRole.map((r) => r.restaurantId)) ?? []).map((r) => J[r]).filter((r) => !!r);
1684
- return t.length ? bn([...new Set(t)]) : void 0;
1685
- }
1686
- function Oo(e = []) {
1687
- const a = d.value;
1688
- if (!a) return [];
1689
- const t = new Map(a.employees.map((i) => [i.employeeId, i])), n = new Map(x.value.map((i) => [i.employeeId, i])), r = re.value.filter((i) => {
1690
- var m;
1691
- return ((m = n.get(i._id)) == null ? void 0 : m.enabled) !== !1;
1692
- }).map((i) => t.get(i._id) ?? En(i)), o = vn(r), s = /* @__PURE__ */ new Map();
1693
- for (const i of a.assignments) {
1694
- const m = `${i.employeeId}|${i.date}`, v = s.get(m);
1695
- v ? v.push(i) : s.set(m, [i]);
1696
- }
1697
- return r.map((i) => {
1698
- var $, G;
1699
- const m = pn(i.employeeId), v = (($ = i.primaryPosition) == null ? void 0 : $.positionName) ?? "", N = [
1700
- (G = i.primaryPosition) == null ? void 0 : G.positionName,
1701
- ...i.secondaryPositions.map((S) => S.positionName)
1702
- ].filter((S) => !!S), T = e.map((S) => {
1703
- const A = ee(S), g = (a.timeOff ?? []).filter((E) => E.employeeId === i.employeeId).map((E) => An(E, A)).find((E) => E !== null);
1704
- if (g) return g;
1705
- const Y = (s.get(`${i.employeeId}|${A}`) ?? []).filter((E) => E.startTime && E.endTime).map((E) => wn(E)).sort((E, te) => E.start.localeCompare(te.start));
1706
- return Y.length ? Y.length === 1 ? Y[0] : Y : null;
1707
- }), f = i.availability.length > 0, C = Array.from(
1708
- { length: 7 },
1709
- (S, A) => f ? i.availability.some((g) => ae(g.dayOfWeek) === A) : !0
1710
- ), L = Array.from({ length: 7 }, (S, A) => {
1711
- const g = i.availability.find((H) => ae(H.dayOfWeek) === A);
1712
- return { from: (g == null ? void 0 : g.start) ?? "", to: (g == null ? void 0 : g.end) ?? "" };
1713
- });
1714
- return {
1715
- id: m,
1716
- sourceId: i.employeeId,
1717
- name: i.name,
1718
- employmentType: i.employmentType,
1719
- role: v,
1720
- initials: fn(i.name),
1721
- color: $e[(m - Fe - 1) % $e.length],
1722
- // Gross hours actually rostered this week — the figure the cost rail multiplies by
1723
- // the rate. Contracted hours are a separate question, answered by RULES.contract.
1724
- // Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
1725
- // as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
1726
- // verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
1727
- weekHours: Math.round(
1728
- T.reduce(
1729
- (S, A) => S + (Array.isArray(A) ? A : A && "start" in A ? [A] : []).reduce(
1730
- (g, H) => g + mn(H.start, H.end),
1731
- 0
1732
- ),
1733
- 0
1734
- ) * 10
1735
- ) / 10,
1736
- pct: gn(i, o),
1737
- contractHours: i.workingHour || void 0,
1738
- // Every outlet the POS says this person works at, not just this one — the Add / Edit form
1739
- // shows them, and saving keeps them.
1740
- locations: Nn(i.employeeId),
1741
- rate: Dn(i, o),
1742
- positions: N,
1743
- shifts: T,
1744
- // Remarks live in their own collection in the older scheduling design and are not
1745
- // part of this board's payload yet.
1746
- remarks: [],
1747
- section: qe,
1748
- payBasis: i.wage.type === "HOURLY" ? "hourly" : "monthly",
1749
- payAmount: i.wage.amount,
1750
- availDays: C,
1751
- availHours: L
1752
- };
1753
- });
1754
- }
1755
- function Lo() {
1756
- return [];
1757
- }
1758
- function Ro() {
1759
- var n, r;
1760
- const e = d.value, a = {}, t = {};
1761
- for (const o of (e == null ? void 0 : e.demands) ?? []) {
1762
- const s = o.date ? a[n = o.date] ?? (a[n] = []) : o.dayOfWeek !== null ? t[r = ae(o.dayOfWeek)] ?? (t[r] = []) : null;
1763
- if (!s) continue;
1764
- let i = s.find((m) => m.from === o.startTime && m.to === o.endTime);
1765
- i || (i = { from: o.startTime, to: o.endTime, n: 0, roles: [] }, s.push(i)), i.n += o.headcount, o.position && i.roles.push({ position: o.position.positionName, n: o.headcount });
1766
- }
1767
- return { byDate: a, byWeekday: t };
1768
- }
1769
- function Io() {
1770
- const e = Be(), { restaurants: a, readRestaurants: t } = Da(), n = ha(), r = va(), o = w(!1), s = P(
1771
- () => [...a.value].map((f) => ({ value: f._id, label: f.profile.name })).sort((f, C) => f.label.localeCompare(C.label))
1772
- ), i = P(() => {
1773
- var f;
1774
- return ((f = e.currentRestaurant.value) == null ? void 0 : f._id) ?? "";
1775
- });
1776
- async function m(f, C) {
1777
- return Re(f) ? (n.query.restaurantId !== f && r.replace({ query: { ...n.query, restaurantId: f } }), await Promise.all([we(f), Ia(C)]), !0) : !1;
1778
- }
1779
- const v = (f) => !!f && s.value.some((C) => C.value === f);
1780
- async function N() {
1781
- var C;
1782
- await t(), Le.splice(0, Le.length, ...s.value.map((L) => L.label)), Object.keys(J).forEach((L) => delete J[L]), s.value.forEach((L) => J[L.value] = L.label);
1783
- const f = v(y.value) ? y.value : v(i.value) ? i.value : ((C = s.value[0]) == null ? void 0 : C.value) ?? "";
1784
- return f && Re(f), o.value = !0, f;
1785
- }
1786
- async function T() {
1787
- const f = await N();
1788
- return f && await we(f), f;
1789
- }
1790
- return { options: s, ready: o, outletId: y, resolve: T, resolveOutlet: N, switchTo: m };
1791
- }
1792
- const kn = ["data-hierarchy", "data-size", "data-icon"], To = /* @__PURE__ */ be({
1793
- __name: "ScheduleButton",
1794
- props: {
1795
- hierarchy: { default: "primary" },
1796
- size: { default: "sm" },
1797
- iconOnly: { type: Boolean, default: !1 }
1798
- },
1799
- setup(e) {
1800
- return (a, t) => (b(), k("button", {
1801
- type: "button",
1802
- class: "sch-button",
1803
- "data-hierarchy": e.hierarchy,
1804
- "data-size": e.size,
1805
- "data-icon": e.iconOnly ? "only" : void 0
1806
- }, [
1807
- Ye(a.$slots, "default")
1808
- ], 8, kn));
1809
- }
1810
- }), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], On = {
1811
- key: 0,
1812
- class: "fx-pop-head"
1813
- }, Ln = {
1814
- key: 1,
1815
- class: "fx-pop-search"
1816
- }, Rn = {
1817
- key: 2,
1818
- class: "fx-opt is-off"
1819
- }, In = {
1820
- key: 0,
1821
- class: "fx-grp"
1822
- }, Tn = ["aria-selected", "onClick"], $n = {
1823
- key: 0,
1824
- class: "fx-opt-text"
1825
- }, Pn = { key: 0 }, $o = /* @__PURE__ */ be({
1826
- inheritAttrs: !1,
1827
- __name: "ScheduleSelect",
1828
- props: {
1829
- modelValue: {},
1830
- options: {},
1831
- multiple: { type: Boolean },
1832
- selected: {},
1833
- placeholder: {},
1834
- disabled: { type: Boolean },
1835
- menuTitle: {},
1836
- searchable: { type: Boolean },
1837
- teleport: { type: Boolean, default: !0 }
1838
- },
1839
- emits: ["update:modelValue", "toggle"],
1840
- setup(e, { emit: a }) {
1841
- const t = e, n = a, r = ia(), o = P(() => r.class ?? ""), s = w(!1), i = w(!1), m = w(null), v = w(null), N = w(null), T = P(() => t.teleport !== !1 && i.value);
1842
- He(() => {
1843
- i.value = typeof document < "u" && !!document.body;
1844
- });
1845
- const f = P(() => {
1846
- var l, c;
1847
- if (t.multiple) {
1848
- const u = ((l = t.selected) == null ? void 0 : l.length) ?? 0;
1849
- return u ? `${u} selected` : t.placeholder ?? "";
1850
- }
1851
- return ((c = t.options.find((u) => u.value === t.modelValue)) == null ? void 0 : c.label) ?? "";
1852
- });
1853
- function C(l) {
1854
- var c;
1855
- return t.multiple ? !!((c = t.selected) != null && c.includes(l.value)) : l.value === t.modelValue;
1856
- }
1857
- const L = P(() => !!t.menuTitle || t.options.some((l) => l.hint)), $ = w(""), G = w(null), S = P(() => {
1858
- const l = $.value.trim().toLowerCase();
1859
- return !t.searchable || !l ? t.options : t.options.filter((c) => `${c.label} ${c.hint ?? ""}`.toLowerCase().includes(l));
1860
- }), A = P(() => {
1861
- const l = [];
1862
- let c;
1863
- for (const u of S.value)
1864
- u.group !== c && (c = u.group, c && l.push({ heading: c })), l.push({ option: u });
1865
- return l;
1866
- }), g = 5, H = 8;
1867
- function Y() {
1868
- const l = N.value, c = v.value;
1869
- if (!l || !c) return;
1870
- const u = c.getBoundingClientRect(), M = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
1871
- l.style.minWidth = `${Math.round(u.width)}px`, l.style.maxWidth = `${Math.max(180, Math.round(M - H * 2))}px`;
1872
- const j = R - u.bottom - g - H, na = u.top - g - H;
1873
- l.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(j, na)))}px`;
1874
- const ne = l.offsetHeight, oa = l.offsetWidth;
1875
- let de = u.bottom + g;
1876
- de + ne > R - H && (de = u.top - g - ne >= H ? u.top - g - ne : Math.max(H, R - ne - H));
1877
- const sa = Math.min(Math.max(H, u.left), Math.max(H, M - oa - H));
1878
- l.style.top = `${Math.round(de)}px`, l.style.left = `${Math.round(sa)}px`, l.style.visibility = "visible";
1879
- }
1880
- function E(l) {
1881
- var u, M;
1882
- const c = l.target;
1883
- c && ((u = m.value) != null && u.contains(c) || (M = N.value) != null && M.contains(c)) || B();
1884
- }
1885
- function te(l) {
1886
- const c = N.value, u = l.target;
1887
- if (c && u && u !== document && c.contains(u)) return;
1888
- const M = v.value;
1889
- if (!M) return;
1890
- const R = M.getBoundingClientRect(), j = window.innerHeight || document.documentElement.clientHeight;
1891
- if (R.bottom < 0 || R.top > j) {
1892
- B();
1893
- return;
1894
- }
1895
- Y();
1896
- }
1897
- function Je() {
1898
- document.addEventListener("click", E), document.addEventListener("scroll", te, !0), window.addEventListener("resize", B);
1899
- }
1900
- function Ne() {
1901
- document.removeEventListener("click", E), document.removeEventListener("scroll", te, !0), window.removeEventListener("resize", B);
1902
- }
1903
- async function ue() {
1904
- var l, c, u;
1905
- t.disabled || s.value || ($.value = "", s.value = !0, await pe(), Y(), (l = G.value) == null || l.focus(), (u = (c = N.value) == null ? void 0 : c.querySelector(".fx-opt.is-on")) == null || u.scrollIntoView({ block: "nearest" }), Je());
1906
- }
1907
- function B() {
1908
- s.value && (s.value = !1, $.value = "", Ne());
1909
- }
1910
- Ee($, async () => {
1911
- s.value && (await pe(), Y());
1912
- });
1913
- function Ze(l) {
1914
- var c;
1915
- if (l.key === "Escape")
1916
- l.preventDefault(), B(), (c = v.value) == null || c.focus();
1917
- else if (l.key === "Enter") {
1918
- l.preventDefault();
1919
- const u = S.value.find((M) => !M.disabled);
1920
- u && Ce(u);
1921
- }
1922
- }
1923
- function ke() {
1924
- s.value ? B() : ue();
1925
- }
1926
- function Ce(l) {
1927
- if (!l.disabled) {
1928
- if (t.multiple && !l.command) {
1929
- n("toggle", l.value);
1930
- return;
1931
- }
1932
- if (B(), t.multiple) {
1933
- n("update:modelValue", l.value);
1934
- return;
1935
- }
1936
- l.value !== t.modelValue && n("update:modelValue", l.value);
1937
- }
1938
- }
1939
- const ea = P(() => t.options.filter((l) => !l.disabled));
1940
- function aa(l) {
1941
- const c = ea.value;
1942
- if (t.multiple || !c.length) {
1943
- ue();
1944
- return;
1945
- }
1946
- const u = c.findIndex((j) => j.value === t.modelValue), M = l === "Home" ? 0 : l === "End" ? c.length - 1 : l === "ArrowDown" ? Math.min(c.length - 1, (u < 0 ? -1 : u) + 1) : Math.max(0, (u < 0 ? 1 : u) - 1), R = c[M];
1947
- R && R.value !== t.modelValue ? n("update:modelValue", R.value) : ue();
1948
- }
1949
- function ta(l) {
1950
- var c;
1951
- if (l.key === "Escape") {
1952
- if (!s.value) return;
1953
- l.preventDefault(), B(), (c = v.value) == null || c.focus();
1954
- return;
1955
- }
1956
- if (l.key === "Enter" || l.key === " ") {
1957
- l.preventDefault(), ke();
1958
- return;
1959
- }
1960
- l.key !== "ArrowDown" && l.key !== "ArrowUp" && l.key !== "Home" && l.key !== "End" || (l.preventDefault(), aa(l.key));
1961
- }
1962
- return Ae(Ne), (l, c) => (b(), k("div", {
1963
- ref_key: "rootEl",
1964
- ref: m,
1965
- class: se(["fx-sel", o.value])
1966
- }, [
1967
- _("button", la({
1968
- ref_key: "btnEl",
1969
- ref: v
1970
- }, l.$attrs, {
1971
- type: "button",
1972
- class: ["sch-input fx-btn", { "is-open": s.value }],
1973
- disabled: e.disabled,
1974
- "aria-haspopup": "listbox",
1975
- "aria-expanded": s.value,
1976
- onClick: c[0] || (c[0] = (u) => ke()),
1977
- onKeydown: ta
1978
- }), F(f.value), 17, Cn),
1979
- (b(), ra(ua, {
1980
- to: "body",
1981
- disabled: !T.value
1982
- }, [
1983
- _("div", Mn, [
1984
- s.value ? (b(), k("div", {
1985
- key: 0,
1986
- ref_key: "popEl",
1987
- ref: N,
1988
- class: se(["fx-pop", { "fx-pop-rich": L.value }]),
1989
- role: "listbox",
1990
- "aria-multiselectable": e.multiple || void 0,
1991
- style: { visibility: "hidden" }
1992
- }, [
1993
- e.menuTitle ? (b(), k("div", On, F(e.menuTitle), 1)) : U("", !0),
1994
- e.searchable ? (b(), k("div", Ln, [
1995
- da(_("input", {
1996
- ref_key: "searchEl",
1997
- ref: G,
1998
- "onUpdate:modelValue": c[1] || (c[1] = (u) => $.value = u),
1999
- class: "sch-input fx-pop-q",
2000
- type: "search",
2001
- placeholder: "Search",
2002
- autocomplete: "off",
2003
- spellcheck: "false",
2004
- "aria-label": "Search",
2005
- onKeydown: Ze
2006
- }, null, 544), [
2007
- [ca, $.value]
2008
- ])
2009
- ])) : U("", !0),
2010
- e.searchable && !A.value.length ? (b(), k("div", Rn, "No matches")) : U("", !0),
2011
- (b(!0), k(ye, null, ya(A.value, (u) => (b(), k(ye, {
2012
- key: "heading" in u ? `heading:${u.heading}` : `option:${u.option.value}`
2013
- }, [
2014
- "heading" in u ? (b(), k("div", In, F(u.heading), 1)) : (b(), k("div", {
2015
- key: 1,
2016
- class: se(["fx-opt", {
2017
- "is-on": C(u.option),
2018
- "is-off": u.option.disabled,
2019
- "is-new": u.option.command
2020
- }]),
2021
- role: "option",
2022
- "aria-selected": C(u.option),
2023
- onClick: (M) => Ce(u.option)
2024
- }, [
2025
- c[2] || (c[2] = _("span", {
2026
- class: "fx-tick",
2027
- "aria-hidden": "true"
2028
- }, [
2029
- _("svg", {
2030
- width: "11",
2031
- height: "11",
2032
- viewBox: "0 0 16 16",
2033
- fill: "none"
2034
- }, [
2035
- _("path", {
2036
- d: "m3.5 8.4 3 3 6-7",
2037
- stroke: "currentColor",
2038
- "stroke-width": "2.2",
2039
- "stroke-linecap": "round",
2040
- "stroke-linejoin": "round"
2041
- })
2042
- ])
2043
- ], -1)),
2044
- L.value ? (b(), k("span", $n, [
2045
- _("b", null, F(u.option.label), 1),
2046
- u.option.hint ? (b(), k("small", Pn, F(u.option.hint), 1)) : U("", !0)
2047
- ])) : (b(), k(ye, { key: 1 }, [
2048
- ma(F(u.option.label), 1)
2049
- ], 64))
2050
- ], 10, Tn))
2051
- ], 64))), 128))
2052
- ], 10, Sn)) : U("", !0)
2053
- ])
2054
- ], 8, ["disabled"]))
2055
- ], 2));
2056
- }
2057
- }), Yn = ["id", "aria-labelledby", "aria-label"], Pe = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', Po = /* @__PURE__ */ be({
2058
- __name: "ScheduleModal",
2059
- props: {
2060
- open: { type: Boolean },
2061
- id: {},
2062
- panelClass: { default: "ob-modal" },
2063
- panelStyle: {},
2064
- labelledBy: {},
2065
- label: {}
2066
- },
2067
- emits: ["close"],
2068
- setup(e, { emit: a }) {
2069
- const t = e, n = a, r = w(null);
2070
- let o = null;
2071
- function s() {
2072
- pe(() => {
2073
- const m = r.value;
2074
- m && (m.querySelector(Pe) ?? m).focus();
2075
- });
2076
- }
2077
- function i(m) {
2078
- if (!t.open) return;
2079
- if (m.key === "Escape") {
2080
- m.preventDefault(), n("close");
2081
- return;
2082
- }
2083
- if (m.key !== "Tab" || !r.value) return;
2084
- const v = Array.from(r.value.querySelectorAll(Pe));
2085
- if (!v.length) return;
2086
- const N = v[0], T = v[v.length - 1];
2087
- m.shiftKey && document.activeElement === N ? (m.preventDefault(), T.focus()) : !m.shiftKey && document.activeElement === T && (m.preventDefault(), N.focus());
2088
- }
2089
- return Ee(
2090
- () => t.open,
2091
- (m) => {
2092
- m ? (o = document.activeElement instanceof HTMLElement ? document.activeElement : null, s()) : (o == null || o.focus(), o = null);
2093
- },
2094
- { immediate: !0 }
2095
- ), He(() => document.addEventListener("keydown", i)), Ae(() => {
2096
- document.removeEventListener("keydown", i), o = null;
2097
- }), (m, v) => e.open ? (b(), k("div", {
2098
- key: 0,
2099
- class: "modal-overlay open",
2100
- onClick: v[0] || (v[0] = fa((N) => n("close"), ["self"]))
2101
- }, [
2102
- _("div", {
2103
- id: e.id,
2104
- ref_key: "panel",
2105
- ref: r,
2106
- class: se(["schedule-modal-panel", e.panelClass]),
2107
- style: pa(e.panelStyle),
2108
- role: "dialog",
2109
- "aria-modal": "true",
2110
- "aria-labelledby": e.labelledBy,
2111
- "aria-label": e.label,
2112
- tabindex: "-1"
2113
- }, [
2114
- Ye(m.$slots, "default")
2115
- ], 14, Yn)
2116
- ])) : U("", !0);
2117
- }
2118
- });
2119
- export {
2120
- no as $,
2121
- Eo as A,
2122
- Aa as B,
2123
- Qn as C,
2124
- Xn as D,
2125
- oo as E,
2126
- wa as F,
2127
- go as G,
2128
- Do as H,
2129
- vo as I,
2130
- We as J,
2131
- D as K,
2132
- x as L,
2133
- Sa as M,
2134
- Le as N,
2135
- Co as O,
2136
- ba as P,
2137
- qn as Q,
2138
- jn as R,
2139
- bo as S,
2140
- ae as T,
2141
- qe as U,
2142
- bn as V,
2143
- Ao as W,
2144
- je as X,
2145
- J as Y,
2146
- eo as Z,
2147
- ao as _,
2148
- Oo as a,
2149
- Ke as a0,
2150
- pn as a1,
2151
- ee as a2,
2152
- fo as a3,
2153
- yo as a4,
2154
- mo as a5,
2155
- ko as a6,
2156
- Ia as a7,
2157
- co as a8,
2158
- Na as a9,
2159
- Ha as aa,
2160
- zn as ab,
2161
- $a as ac,
2162
- uo as ad,
2163
- yn as ae,
2164
- Se as af,
2165
- Oe as ag,
2166
- ie as ah,
2167
- we as ai,
2168
- Ro as aj,
2169
- Oa as ak,
2170
- To as al,
2171
- $o as am,
2172
- Po as an,
2173
- Wn as ao,
2174
- Io as ap,
2175
- Ve as aq,
2176
- ro as ar,
2177
- so as as,
2178
- re as at,
2179
- io as au,
2180
- I as b,
2181
- Lo as c,
2182
- z as d,
2183
- Kn as e,
2184
- d as f,
2185
- dn as g,
2186
- Ho as h,
2187
- Ca as i,
2188
- Mo as j,
2189
- po as k,
2190
- ho as l,
2191
- wo as m,
2192
- ge as n,
2193
- y as o,
2194
- No as p,
2195
- Zn as q,
2196
- to as r,
2197
- lo as s,
2198
- De as t,
2199
- Gn as u,
2200
- So as v,
2201
- Jn as w,
2202
- Vn as x,
2203
- _e as y,
2204
- ve as z
2205
- };