@feedmepos/mf-hrm-portal 2.3.0-dev.7 → 2.3.0-dev.9

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