@feedmepos/mf-hrm-portal 2.3.0-dev.2 → 2.3.0-dev.20

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