@feedmepos/mf-hrm-portal 2.3.0-dev.10 → 2.3.0-dev.11
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.
- package/dist/{ApprovalCodeList-BLA2rhLB.js → ApprovalCodeList-Ce9BWzt9.js} +2 -2
- package/dist/{AuditLogList-DBYdZhZl.js → AuditLogList-Cw7WN8K4.js} +3 -3
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CtCEzPbE.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BuofBFPC.js} +2 -2
- package/dist/{EmployeeList-CA7DWLmy.js → EmployeeList-B8qWPNvj.js} +23 -22
- package/dist/{GrantUserList-BYnegeEr.js → GrantUserList-CgigJIPF.js} +3 -3
- package/dist/{Main-BeXx0hAc.js → Main-BfoVdxlY.js} +5 -5
- package/dist/{Main-Dh-gZSaa.js → Main-Cg2vC_cj.js} +2 -2
- package/dist/{Main-NDK7LUmm.js → Main-D26pgKy1.js} +9 -9
- package/dist/{PermissionSetList-DDIacDpQ.js → PermissionSetList-CbtDiF4k.js} +17 -16
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-ONMn3v_f.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DW1oBTbb.js} +680 -680
- package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
- package/dist/{RoleList-B30FHIzu.js → RoleList-D0I8mbyI.js} +19 -18
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CRRguWTG.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-Ctwukt6o.js} +1 -1
- package/dist/{ScheduleGeneralPage-8gEeZbFR.js → ScheduleGeneralPage-Kv4pnxCL.js} +130 -128
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-TfxTAjO8.js → ScheduleModal.vue_vue_type_script_setup_true_lang-CSA0aaqJ.js} +545 -512
- package/dist/SchedulePage-BMWd0bod.js +17942 -0
- package/dist/{SchedulePositionPage-oGIDGneA.js → SchedulePositionPage-5Xvx6Dk5.js} +3 -3
- package/dist/{TeamMemberList-Drj6R4Y3.js → TeamMemberList-Bh7i5l16.js} +20 -19
- package/dist/{TimesheetList-CDQfN5LE.js → TimesheetList-BJKU-hnk.js} +5 -5
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-Bx-6hjs7.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-MMWnb9bj.js} +2 -2
- package/dist/{app-DWe_4-ct.js → app-BDJ5qxhF.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-QSwC9dtX.js → dayjs.min-BWM0vY4w.js} +1 -1
- package/dist/{employee-Bb2b3dP6.js → employee-bBSuAJUr.js} +3 -3
- package/dist/{iteration-TDU7bFxZ.js → iteration-Dg7VAkAn.js} +1 -1
- package/dist/{lodash-D3Ns5VMN.js → lodash-BknY3p4o.js} +1 -1
- package/dist/{role-D57Le_-U.js → role-BJnJnNd_.js} +1 -1
- package/dist/{rule-DzesUEX7.js → rule-BEuOY7Wf.js} +2 -2
- package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
- package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +2 -1
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +0 -3
- package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +7 -0
- package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +2 -2
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +7 -0
- package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +1 -0
- package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +6 -1
- package/dist/src/views/scheduling/schedule-store.d.ts +13 -0
- package/dist/src/views/scheduling/types.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
- package/dist/{useReportPermissions-Cmuead1K.js → useReportPermissions-D8hJ5W0t.js} +3 -3
- package/package.json +1 -1
- package/dist/SchedulePage-DQ0VXWWi.js +0 -17832
- package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { g as
|
|
5
|
-
import { E as
|
|
1
|
+
import { onMounted as Se, onBeforeUnmount as Le, ref as A, reactive as I, shallowRef as we, watch as Ie, computed as T, defineComponent as Re, createElementBlock as C, openBlock as N, renderSlot as ze, useAttrs as la, nextTick as be, normalizeClass as pe, createElementVNode as Y, createBlock as ua, mergeProps as da, toDisplayString as U, Teleport as ca, createCommentVNode as W, withDirectives as ya, vModelText as ma, Fragment as He, renderList as pa, createTextVNode as fa, withModifiers as ha, normalizeStyle as va } from "vue";
|
|
2
|
+
import { useRoute as Da, useRouter as ga } from "vue-router";
|
|
3
|
+
import { useCoreStore as Ve } from "@feedmepos/mf-common";
|
|
4
|
+
import { g as v, b as p, u as wa } from "./restaurant-BbYRA_IT.js";
|
|
5
|
+
import { E as Pe, u as Ke } from "./employee-bBSuAJUr.js";
|
|
6
6
|
function zn(e) {
|
|
7
7
|
let a = null;
|
|
8
8
|
function t() {
|
|
@@ -11,104 +11,104 @@ function zn(e) {
|
|
|
11
11
|
const n = a.getBoundingClientRect().top;
|
|
12
12
|
a.style.height = `${Math.max(0, window.innerHeight - n)}px`;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
Se(() => {
|
|
15
15
|
var n;
|
|
16
16
|
a = ((n = e.value) == null ? void 0 : n.closest(".sch-page")) ?? null, t(), window.addEventListener("resize", t);
|
|
17
|
-
}),
|
|
17
|
+
}), Le(() => {
|
|
18
18
|
window.removeEventListener("resize", t), a && (a.style.height = "");
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ne(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
|
}
|
|
25
|
-
function
|
|
25
|
+
function Ha(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
29
|
function Aa(e, a) {
|
|
30
|
-
const t =
|
|
31
|
-
let n =
|
|
30
|
+
const t = Ne(e);
|
|
31
|
+
let n = Ne(a);
|
|
32
32
|
return n <= t && (n += 1440), [t, n];
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Ge(e, a) {
|
|
35
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 = (
|
|
39
|
+
const a = (Ne(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, i = t < 12 ? "am" : "pm", s = t % 12 || 12;
|
|
40
40
|
return n ? `${s}:${String(n).padStart(2, "0")}${i}` : `${s}${i}`;
|
|
41
41
|
}
|
|
42
42
|
function Vn(e) {
|
|
43
|
-
return Ea(
|
|
43
|
+
return Ea(Ha(e % 1440));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function je(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
49
|
const [i, s] = n.startTime.split(":").map(Number), [l, o] = n.endTime.split(":").map(Number);
|
|
50
|
-
let
|
|
51
|
-
return
|
|
50
|
+
let u = l * 60 + o - (i * 60 + s);
|
|
51
|
+
return u < 0 && (u += 24 * 60), t + u;
|
|
52
52
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
53
53
|
}
|
|
54
54
|
function Kn(e, a) {
|
|
55
55
|
var i;
|
|
56
|
-
const t = a ??
|
|
56
|
+
const t = a ?? Ge(e.start, e.end), n = (i = e.breaks) != null && i.length ? e.breaks.reduce((s, l) => s + (l.breakPayType === "UNPAID" ? je([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
57
57
|
return Math.max(0, t - Math.min(t, n));
|
|
58
58
|
}
|
|
59
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 ae = 500, ba = 10,
|
|
63
|
+
const ae = 500, ba = 10, Te = 6, jn = 1500, Qe = 1e6, w = {
|
|
64
64
|
async listEmployeeProfiles(e) {
|
|
65
|
-
return
|
|
66
|
-
await
|
|
65
|
+
return v(
|
|
66
|
+
await p("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
|
|
73
|
-
await
|
|
72
|
+
return v(
|
|
73
|
+
await p(`restaurants/${e}/schedules`).get("employee-configs")
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
async saveEmployeeConfigs(e, a) {
|
|
77
|
-
return
|
|
78
|
-
await
|
|
77
|
+
return v(
|
|
78
|
+
await p(`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
|
|
86
|
-
await
|
|
85
|
+
return v(
|
|
86
|
+
await p(`restaurants/${e}/schedules`).get("settings")
|
|
87
87
|
);
|
|
88
88
|
},
|
|
89
89
|
async saveSettings(e, a) {
|
|
90
|
-
return
|
|
91
|
-
await
|
|
90
|
+
return v(
|
|
91
|
+
await p(`restaurants/${e}/schedules`).post("settings", a)
|
|
92
92
|
);
|
|
93
93
|
},
|
|
94
94
|
async generateAutoSchedule(e, a) {
|
|
95
|
-
return
|
|
96
|
-
await
|
|
95
|
+
return v(
|
|
96
|
+
await p(`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
|
|
104
|
-
await
|
|
103
|
+
return v(
|
|
104
|
+
await p(`restaurants/${e}/schedules`).get(
|
|
105
105
|
"auto-schedule/capabilities"
|
|
106
106
|
)
|
|
107
107
|
);
|
|
108
108
|
},
|
|
109
109
|
async applyAutoSchedule(e, a) {
|
|
110
|
-
return
|
|
111
|
-
await
|
|
110
|
+
return v(
|
|
111
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
112
112
|
"auto-schedule/apply",
|
|
113
113
|
a
|
|
114
114
|
)
|
|
@@ -116,75 +116,75 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 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
|
|
120
|
-
await
|
|
119
|
+
return v(
|
|
120
|
+
await p(`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
|
|
127
|
-
await
|
|
126
|
+
return v(
|
|
127
|
+
await p(`restaurants/${e}/schedules`).post("time-off", a)
|
|
128
128
|
);
|
|
129
129
|
},
|
|
130
130
|
async updateTimeOffStatus(e, a, t) {
|
|
131
|
-
return
|
|
132
|
-
await
|
|
131
|
+
return v(
|
|
132
|
+
await p(`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
|
|
139
|
+
await p(`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
|
|
143
|
+
return v(await p("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
|
|
148
|
-
await
|
|
147
|
+
return v(
|
|
148
|
+
await p("schedules").post("employees", { employeeId: a, ...t })
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
151
|
async validatePosAccess(e) {
|
|
152
|
-
await
|
|
152
|
+
await p("schedules").post("employees/validate-pos-access", e);
|
|
153
153
|
},
|
|
154
154
|
/** Positions are shared across the business. */
|
|
155
155
|
async createPosition(e) {
|
|
156
|
-
return
|
|
156
|
+
return v(await p("schedules").post("positions", e));
|
|
157
157
|
},
|
|
158
158
|
async updatePosition(e, a) {
|
|
159
|
-
return
|
|
159
|
+
return v(await p("schedules").post(`positions/${e}`, a));
|
|
160
160
|
},
|
|
161
161
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
162
162
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
163
163
|
async deletePosition(e) {
|
|
164
|
-
await
|
|
164
|
+
await p("schedules").delete("positions", {
|
|
165
165
|
params: { ids: e }
|
|
166
166
|
});
|
|
167
167
|
},
|
|
168
168
|
/** Creates one flat demand interval. */
|
|
169
169
|
async createDemand(e, a) {
|
|
170
|
-
return
|
|
171
|
-
await
|
|
170
|
+
return v(
|
|
171
|
+
await p(`restaurants/${e}/schedules`).post("demands", a)
|
|
172
172
|
);
|
|
173
173
|
},
|
|
174
174
|
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
175
175
|
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
176
176
|
* array. */
|
|
177
177
|
async deleteDemands(e, a) {
|
|
178
|
-
return
|
|
179
|
-
await
|
|
178
|
+
return v(
|
|
179
|
+
await p(`restaurants/${e}/schedules`).delete("demands", {
|
|
180
180
|
params: { ids: a.join(",") }
|
|
181
181
|
})
|
|
182
182
|
);
|
|
183
183
|
},
|
|
184
184
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
185
185
|
async replaceDemands(e, a) {
|
|
186
|
-
return
|
|
187
|
-
await
|
|
186
|
+
return v(
|
|
187
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
188
188
|
"demands/replace",
|
|
189
189
|
a
|
|
190
190
|
)
|
|
@@ -192,8 +192,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
192
192
|
},
|
|
193
193
|
/** Atomically replaces several date/weekday demand generations. */
|
|
194
194
|
async bulkReplaceDemands(e, a) {
|
|
195
|
-
return
|
|
196
|
-
await
|
|
195
|
+
return v(
|
|
196
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
197
197
|
"demands/bulk-replace",
|
|
198
198
|
a
|
|
199
199
|
)
|
|
@@ -201,8 +201,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
201
201
|
},
|
|
202
202
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
203
203
|
async saveScheduleDay(e, a, t) {
|
|
204
|
-
return
|
|
205
|
-
await
|
|
204
|
+
return v(
|
|
205
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
206
206
|
`days/${a}`,
|
|
207
207
|
t
|
|
208
208
|
)
|
|
@@ -210,13 +210,13 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
210
210
|
},
|
|
211
211
|
/** A one-off shift assignment. */
|
|
212
212
|
async createAssignment(e, a) {
|
|
213
|
-
return
|
|
214
|
-
await
|
|
213
|
+
return v(
|
|
214
|
+
await p(`restaurants/${e}/schedules`).post("assignments", a)
|
|
215
215
|
);
|
|
216
216
|
},
|
|
217
217
|
async updateAssignment(e, a, t) {
|
|
218
|
-
return
|
|
219
|
-
await
|
|
218
|
+
return v(
|
|
219
|
+
await p(`restaurants/${e}/schedules`).patch(
|
|
220
220
|
`assignments/${a}`,
|
|
221
221
|
t
|
|
222
222
|
)
|
|
@@ -224,8 +224,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
224
224
|
},
|
|
225
225
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
226
226
|
async bulkSaveAssignments(e, a) {
|
|
227
|
-
return
|
|
228
|
-
await
|
|
227
|
+
return v(
|
|
228
|
+
await p(`restaurants/${e}/schedules`).post(
|
|
229
229
|
"assignments/bulk",
|
|
230
230
|
a
|
|
231
231
|
)
|
|
@@ -235,8 +235,8 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
235
235
|
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
236
236
|
* array. */
|
|
237
237
|
async deleteAssignments(e, a) {
|
|
238
|
-
return
|
|
239
|
-
await
|
|
238
|
+
return v(
|
|
239
|
+
await p(`restaurants/${e}/schedules`).delete("assignments", {
|
|
240
240
|
params: { ids: a.join(",") }
|
|
241
241
|
})
|
|
242
242
|
);
|
|
@@ -244,37 +244,37 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
244
244
|
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
245
245
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
246
246
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
247
|
-
return
|
|
248
|
-
await
|
|
247
|
+
return v(
|
|
248
|
+
await p(`restaurants/${e}/schedules`).patch(
|
|
249
249
|
"assignments/bulk-status",
|
|
250
250
|
a
|
|
251
251
|
)
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
},
|
|
255
|
-
payload:
|
|
256
|
-
loading:
|
|
257
|
-
rosterLoading:
|
|
258
|
-
loadError:
|
|
259
|
-
scheduleSetupCompleted:
|
|
260
|
-
dataVersion:
|
|
261
|
-
outletId:
|
|
262
|
-
restaurantEmployees:
|
|
263
|
-
employeeConfigs:
|
|
264
|
-
employeeOutletIds:
|
|
265
|
-
businessEmployees:
|
|
266
|
-
positions:
|
|
267
|
-
positionRecords:
|
|
268
|
-
rolePositions:
|
|
269
|
-
outlet:
|
|
270
|
-
locationOptions:
|
|
271
|
-
locationLabelById:
|
|
272
|
-
departmentOptions:
|
|
273
|
-
compensationGroupOptions:
|
|
274
|
-
compensationGroupMeta:
|
|
275
|
-
existingStaff:
|
|
276
|
-
shiftTemplates:
|
|
277
|
-
rules:
|
|
254
|
+
}, Xe = {
|
|
255
|
+
payload: we(null),
|
|
256
|
+
loading: A(!1),
|
|
257
|
+
rosterLoading: A(!1),
|
|
258
|
+
loadError: A(null),
|
|
259
|
+
scheduleSetupCompleted: A(!1),
|
|
260
|
+
dataVersion: A(0),
|
|
261
|
+
outletId: A(""),
|
|
262
|
+
restaurantEmployees: A([]),
|
|
263
|
+
employeeConfigs: A([]),
|
|
264
|
+
employeeOutletIds: we({}),
|
|
265
|
+
businessEmployees: we([]),
|
|
266
|
+
positions: I([]),
|
|
267
|
+
positionRecords: I([]),
|
|
268
|
+
rolePositions: I({}),
|
|
269
|
+
outlet: I({ name: "" }),
|
|
270
|
+
locationOptions: I([]),
|
|
271
|
+
locationLabelById: I({}),
|
|
272
|
+
departmentOptions: I([]),
|
|
273
|
+
compensationGroupOptions: I([]),
|
|
274
|
+
compensationGroupMeta: I({}),
|
|
275
|
+
existingStaff: I([]),
|
|
276
|
+
shiftTemplates: I([]),
|
|
277
|
+
rules: I({
|
|
278
278
|
coverage: {},
|
|
279
279
|
openFrom: "00:00",
|
|
280
280
|
openTo: "24:00",
|
|
@@ -300,30 +300,30 @@ const ae = 500, ba = 10, Oe = 6, jn = 1500, Ge = 1e6, D = {
|
|
|
300
300
|
}
|
|
301
301
|
})
|
|
302
302
|
}, {
|
|
303
|
-
payload:
|
|
304
|
-
loading:
|
|
305
|
-
rosterLoading:
|
|
306
|
-
loadError:
|
|
307
|
-
scheduleSetupCompleted:
|
|
303
|
+
payload: c,
|
|
304
|
+
loading: $e,
|
|
305
|
+
rosterLoading: Ye,
|
|
306
|
+
loadError: fe,
|
|
307
|
+
scheduleSetupCompleted: Je,
|
|
308
308
|
dataVersion: V,
|
|
309
|
-
outletId:
|
|
310
|
-
restaurantEmployees:
|
|
311
|
-
employeeConfigs:
|
|
312
|
-
employeeOutletIds:
|
|
313
|
-
businessEmployees:
|
|
309
|
+
outletId: m,
|
|
310
|
+
restaurantEmployees: se,
|
|
311
|
+
employeeConfigs: F,
|
|
312
|
+
employeeOutletIds: Ze,
|
|
313
|
+
businessEmployees: Ae,
|
|
314
314
|
positions: Pa,
|
|
315
315
|
positionRecords: K,
|
|
316
|
-
rolePositions:
|
|
316
|
+
rolePositions: Qn,
|
|
317
317
|
outlet: Na,
|
|
318
|
-
locationOptions:
|
|
318
|
+
locationOptions: xe,
|
|
319
319
|
locationLabelById: ne,
|
|
320
|
-
compensationGroupMeta:
|
|
321
|
-
existingStaff:
|
|
322
|
-
shiftTemplates:
|
|
320
|
+
compensationGroupMeta: Xn,
|
|
321
|
+
existingStaff: Jn,
|
|
322
|
+
shiftTemplates: Zn,
|
|
323
323
|
rules: M
|
|
324
|
-
} =
|
|
324
|
+
} = Xe;
|
|
325
325
|
function ka() {
|
|
326
|
-
const e =
|
|
326
|
+
const e = Xe.rules;
|
|
327
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, {
|
|
328
328
|
waConnected: !1,
|
|
329
329
|
waNumber: "",
|
|
@@ -331,7 +331,7 @@ function ka() {
|
|
|
331
331
|
defaults: { wa: !1, push: !1, email: !1 }
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
|
-
const
|
|
334
|
+
const ke = 7;
|
|
335
335
|
function Ca(e) {
|
|
336
336
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
337
337
|
return `${a}-${t}-${n}`;
|
|
@@ -340,62 +340,62 @@ function oe(e, a) {
|
|
|
340
340
|
const t = new Date(e);
|
|
341
341
|
return t.setDate(t.getDate() + a), t;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Ce(e) {
|
|
344
344
|
const a = new Date(e);
|
|
345
345
|
return a.setHours(0, 0, 0, 0), a.setDate(a.getDate() - (a.getDay() + 6) % 7), a;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
const t = oe(
|
|
349
|
-
return Array.from({ length:
|
|
347
|
+
function qn(e, a = /* @__PURE__ */ new Date()) {
|
|
348
|
+
const t = oe(Ce(a), e * ke);
|
|
349
|
+
return Array.from({ length: ke }, (n, i) => oe(t, i));
|
|
350
350
|
}
|
|
351
351
|
function eo(e, a) {
|
|
352
|
-
const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(
|
|
353
|
-
return Math.trunc((i - n) / (
|
|
352
|
+
const t = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate()), n = t(Ce(e)), i = t(Ce(a));
|
|
353
|
+
return Math.trunc((i - n) / (ke * 24 * 60 * 60 * 1e3));
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
let G = null, j = null, z = null, te = 0,
|
|
357
|
-
function
|
|
358
|
-
return e ===
|
|
355
|
+
const ie = Ca;
|
|
356
|
+
let G = null, j = null, z = null, te = 0, he = null;
|
|
357
|
+
function Be(e) {
|
|
358
|
+
return e === m.value ? !1 : (ka(), m.value = e, c.value = null, G = null, j = null, fe.value = null, he = null, Je.value = !1, se.value = [], F.value = [], z = null, te += 1, V.value += 1, !0);
|
|
359
359
|
}
|
|
360
|
-
async function
|
|
361
|
-
if (!(!e ||
|
|
362
|
-
|
|
360
|
+
async function Me(e) {
|
|
361
|
+
if (!(!e || he === e)) {
|
|
362
|
+
Ye.value = !0;
|
|
363
363
|
try {
|
|
364
364
|
await Ma(e);
|
|
365
365
|
} finally {
|
|
366
|
-
|
|
366
|
+
Ye.value = !1;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
async function Ma(e) {
|
|
371
|
-
const a = await
|
|
371
|
+
const a = await Pe.readEmployeesPage({
|
|
372
372
|
limit: ae,
|
|
373
373
|
offset: 0,
|
|
374
374
|
restaurantIds: [e]
|
|
375
375
|
});
|
|
376
|
-
e ===
|
|
377
|
-
e ===
|
|
376
|
+
e === m.value && (se.value = a.items, F.value = await w.listEmployeeConfigs(e), he = e, V.value += 1, Ra().then((t) => {
|
|
377
|
+
e === m.value && (Ze.value = t, V.value += 1);
|
|
378
378
|
}));
|
|
379
379
|
}
|
|
380
380
|
async function Sa(e) {
|
|
381
|
-
const a =
|
|
381
|
+
const a = m.value;
|
|
382
382
|
if (!a || !e.length) return;
|
|
383
|
-
const t = await
|
|
384
|
-
|
|
383
|
+
const t = await w.saveEmployeeConfigs(a, { configs: e });
|
|
384
|
+
F.value = t, V.value += 1;
|
|
385
385
|
}
|
|
386
386
|
async function La(e, a) {
|
|
387
|
-
const t =
|
|
387
|
+
const t = F.value.find((i) => i.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (a && F.value.some((i) => i.displayOrder !== null) ? Math.max(
|
|
388
388
|
0,
|
|
389
|
-
...
|
|
389
|
+
...F.value.filter((i) => i.displayOrder !== null).map((i) => i.displayOrder)
|
|
390
390
|
) + 100 : null);
|
|
391
391
|
await Sa([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
392
392
|
}
|
|
393
|
-
async function
|
|
394
|
-
const e =
|
|
395
|
-
e && (
|
|
393
|
+
async function Oe() {
|
|
394
|
+
const e = m.value;
|
|
395
|
+
e && (he = null, await Me(e));
|
|
396
396
|
}
|
|
397
|
-
async function
|
|
398
|
-
const t =
|
|
397
|
+
async function qe(e, a) {
|
|
398
|
+
const t = Ke(), n = (await re(!0)).find((o) => o._id === e);
|
|
399
399
|
if (!n) throw new Error("Could not find this employee");
|
|
400
400
|
const i = n.restaurantRole.map((o) => ({
|
|
401
401
|
restaurantId: o.restaurantId,
|
|
@@ -413,37 +413,60 @@ async function Re(e, a) {
|
|
|
413
413
|
user: { name: n.name, passcode: n.passcode },
|
|
414
414
|
roles: s,
|
|
415
415
|
previousRoles: i
|
|
416
|
-
});
|
|
416
|
+
}), await re(!0);
|
|
417
417
|
}
|
|
418
418
|
async function ao(e, a, t = "") {
|
|
419
419
|
const n = [...new Set(a.filter(Boolean))];
|
|
420
|
-
n.length && (await
|
|
420
|
+
n.length && (await qe(e, (i) => [
|
|
421
421
|
...i.filter((s) => !n.includes(s.restaurantId)),
|
|
422
422
|
...n.map((s) => ({ restaurantId: s, roleId: t }))
|
|
423
|
-
]),
|
|
423
|
+
]), m.value && n.includes(m.value) && await La(e, !0), await Oe());
|
|
424
424
|
}
|
|
425
425
|
async function to(e, a) {
|
|
426
|
-
const t = new Set(a);
|
|
427
|
-
t.size && (await Re(e, (n) => n.filter((i) => !t.has(i.restaurantId))), await Ie());
|
|
428
|
-
}
|
|
429
|
-
async function no(e, a) {
|
|
430
426
|
if (!a.length) return;
|
|
431
427
|
const t = new Map(a.map((n) => [n.restaurantId, n.roleId]));
|
|
432
|
-
await
|
|
428
|
+
await qe(e, (n) => [
|
|
433
429
|
...n.filter((i) => !t.has(i.restaurantId)),
|
|
434
430
|
...[...t.entries()].map(([i, s]) => ({ restaurantId: i, roleId: s }))
|
|
435
|
-
]), await
|
|
431
|
+
]), await Oe();
|
|
432
|
+
}
|
|
433
|
+
async function no(e, a) {
|
|
434
|
+
const t = Ke(), n = (await re(!0)).find((u) => u._id === e);
|
|
435
|
+
if (!n) throw new Error("Could not find this employee");
|
|
436
|
+
const i = (u) => u.slice().sort((f, H) => f.restaurantId.localeCompare(H.restaurantId)).map((f) => `${f.restaurantId}:${f.roleId}`).join("|"), s = i(n.restaurantRole) !== i(a.roles), l = n.passcode !== a.passcode || n.isMasterUser !== a.masterUser || a.masterUser && (n.code ?? "") !== a.masterCode;
|
|
437
|
+
if (!s && !l) return;
|
|
438
|
+
const o = n.restaurantRole.map((u) => ({
|
|
439
|
+
restaurantId: u.restaurantId,
|
|
440
|
+
roleId: u.roleId
|
|
441
|
+
}));
|
|
442
|
+
if (a.masterUser) {
|
|
443
|
+
const u = {
|
|
444
|
+
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
445
|
+
roles: a.roles,
|
|
446
|
+
previousRoles: o
|
|
447
|
+
};
|
|
448
|
+
n.isMasterUser ? await t.updateMasterEmployee(e, u) : await t.migrateToMasterUser(e, u);
|
|
449
|
+
} else {
|
|
450
|
+
if (n.isMasterUser)
|
|
451
|
+
throw new Error("Master users cannot be converted back from this form");
|
|
452
|
+
await t.updateEmployee(e, {
|
|
453
|
+
user: { name: a.name, passcode: a.passcode },
|
|
454
|
+
roles: a.roles,
|
|
455
|
+
previousRoles: o
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
await re(!0), await Oe();
|
|
436
459
|
}
|
|
437
460
|
let ee = null;
|
|
438
461
|
async function Ia() {
|
|
439
|
-
const e = await
|
|
462
|
+
const e = await Pe.readEmployeesPage({
|
|
440
463
|
limit: ae,
|
|
441
464
|
offset: 0,
|
|
442
465
|
includeEmptyPasscode: !0
|
|
443
466
|
}), a = Math.min(ba, Math.ceil(e.total / ae)), t = await Promise.all(
|
|
444
467
|
Array.from(
|
|
445
468
|
{ length: Math.max(0, a - 1) },
|
|
446
|
-
(n, i) =>
|
|
469
|
+
(n, i) => Pe.readEmployeesPage({
|
|
447
470
|
limit: ae,
|
|
448
471
|
offset: (i + 1) * ae,
|
|
449
472
|
includeEmptyPasscode: !0
|
|
@@ -452,12 +475,12 @@ async function Ia() {
|
|
|
452
475
|
);
|
|
453
476
|
return [...e.items, ...t.flatMap((n) => n.items)];
|
|
454
477
|
}
|
|
455
|
-
function
|
|
478
|
+
function re(e = !1) {
|
|
456
479
|
if (!e) {
|
|
457
480
|
if (ee) return ee;
|
|
458
|
-
if (
|
|
481
|
+
if (Ae.value.length) return Promise.resolve(Ae.value);
|
|
459
482
|
}
|
|
460
|
-
const a = Ia().then((t) => (
|
|
483
|
+
const a = Ia().then((t) => (Ae.value = t, t)).finally(() => {
|
|
461
484
|
ee === a && (ee = null);
|
|
462
485
|
});
|
|
463
486
|
return ee = a, a;
|
|
@@ -465,7 +488,7 @@ function Xe(e = !1) {
|
|
|
465
488
|
async function Ra() {
|
|
466
489
|
const e = {};
|
|
467
490
|
try {
|
|
468
|
-
(await
|
|
491
|
+
(await re()).forEach((a) => {
|
|
469
492
|
e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
|
|
470
493
|
});
|
|
471
494
|
} catch {
|
|
@@ -473,65 +496,65 @@ async function Ra() {
|
|
|
473
496
|
}
|
|
474
497
|
return e;
|
|
475
498
|
}
|
|
476
|
-
function
|
|
499
|
+
function _e(e, a) {
|
|
477
500
|
return G !== null && j !== null && G <= e && j >= a;
|
|
478
501
|
}
|
|
479
502
|
async function Oa(e) {
|
|
480
|
-
const a =
|
|
481
|
-
|
|
482
|
-
oe(e, -7 *
|
|
483
|
-
oe(e, 7 *
|
|
503
|
+
const a = ie(e), t = ie(oe(e, 6));
|
|
504
|
+
_e(a, t) || z && (await z, _e(a, t)) || await ea(
|
|
505
|
+
oe(e, -7 * Te),
|
|
506
|
+
oe(e, 7 * Te)
|
|
484
507
|
);
|
|
485
508
|
}
|
|
486
509
|
async function oo() {
|
|
487
|
-
!G || !j || await
|
|
510
|
+
!G || !j || await ea(/* @__PURE__ */ new Date(`${G}T00:00:00`), /* @__PURE__ */ new Date(`${j}T00:00:00`));
|
|
488
511
|
}
|
|
489
512
|
async function so(e) {
|
|
490
|
-
if (!
|
|
491
|
-
const a = await
|
|
492
|
-
|
|
513
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
514
|
+
const a = await w.createEmployeeProfile(m.value, e);
|
|
515
|
+
c.value && (c.value.employees.push(a), V.value += 1);
|
|
493
516
|
}
|
|
494
517
|
async function io(e) {
|
|
495
|
-
await
|
|
518
|
+
await w.validatePosAccess(e);
|
|
496
519
|
}
|
|
497
520
|
async function ro(e, a) {
|
|
498
|
-
if (!
|
|
499
|
-
const t = await
|
|
500
|
-
if (
|
|
501
|
-
const n =
|
|
502
|
-
n > -1 && (
|
|
503
|
-
...
|
|
504
|
-
employees:
|
|
521
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
522
|
+
const t = await w.updateEmployeeProfile(m.value, e, a);
|
|
523
|
+
if (c.value) {
|
|
524
|
+
const n = c.value.employees.findIndex((i) => i.employeeId === e);
|
|
525
|
+
n > -1 && (c.value = {
|
|
526
|
+
...c.value,
|
|
527
|
+
employees: c.value.employees.map((i, s) => s === n ? t : i)
|
|
505
528
|
});
|
|
506
529
|
}
|
|
507
530
|
}
|
|
508
531
|
async function lo(e) {
|
|
509
|
-
const a = await
|
|
510
|
-
|
|
532
|
+
const a = await w.createPosition(e);
|
|
533
|
+
c.value && (c.value = { ...c.value, positions: [...c.value.positions, a] });
|
|
511
534
|
}
|
|
512
535
|
async function uo(e, a) {
|
|
513
|
-
const t = await
|
|
514
|
-
|
|
515
|
-
...
|
|
516
|
-
positions:
|
|
536
|
+
const t = await w.updatePosition(e, a);
|
|
537
|
+
c.value && (c.value = {
|
|
538
|
+
...c.value,
|
|
539
|
+
positions: c.value.positions.map((n) => n.id === e ? t : n)
|
|
517
540
|
});
|
|
518
541
|
}
|
|
519
542
|
async function co(e) {
|
|
520
|
-
await
|
|
521
|
-
...
|
|
522
|
-
positions:
|
|
543
|
+
await w.deletePosition(e), c.value && (c.value = {
|
|
544
|
+
...c.value,
|
|
545
|
+
positions: c.value.positions.filter((a) => a.id !== e)
|
|
523
546
|
});
|
|
524
547
|
}
|
|
525
548
|
async function yo(e, a) {
|
|
526
549
|
var i;
|
|
527
|
-
if (!
|
|
528
|
-
const t = (i =
|
|
550
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
551
|
+
const t = (i = c.value) == null ? void 0 : i.days.find((s) => s.date === e), n = await w.saveScheduleDay(m.value, e, {
|
|
529
552
|
...a,
|
|
530
553
|
expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
|
|
531
554
|
});
|
|
532
|
-
if (
|
|
533
|
-
const s =
|
|
534
|
-
n && s.push(n),
|
|
555
|
+
if (c.value) {
|
|
556
|
+
const s = c.value.days.filter((l) => l.date !== e);
|
|
557
|
+
n && s.push(n), c.value = { ...c.value, days: s };
|
|
535
558
|
}
|
|
536
559
|
}
|
|
537
560
|
async function mo(e) {
|
|
@@ -558,23 +581,23 @@ function Ta(e) {
|
|
|
558
581
|
};
|
|
559
582
|
}
|
|
560
583
|
async function $a(e) {
|
|
561
|
-
if (!
|
|
584
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
562
585
|
if (!e.length) return;
|
|
563
|
-
const a = e.map(Ta), t = e.length === 1 ? await
|
|
564
|
-
if (
|
|
565
|
-
const n = new Set(e.map((s) => s.date)), i =
|
|
566
|
-
|
|
586
|
+
const a = e.map(Ta), t = e.length === 1 ? await w.replaceDemands(m.value, a[0]) : await w.bulkReplaceDemands(m.value, { replacements: a });
|
|
587
|
+
if (c.value) {
|
|
588
|
+
const n = new Set(e.map((s) => s.date)), i = c.value.demands.filter((s) => s.date === null || !n.has(s.date));
|
|
589
|
+
c.value = { ...c.value, demands: [...i, ...t] };
|
|
567
590
|
}
|
|
568
591
|
}
|
|
569
592
|
async function po(e, a) {
|
|
570
|
-
if (!
|
|
571
|
-
const t =
|
|
593
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
594
|
+
const t = c.value;
|
|
572
595
|
if (!t || t.demands.some((s) => s.date === a)) return 0;
|
|
573
596
|
const n = t.demands.filter((s) => s.date === e);
|
|
574
597
|
if (!n.length) return 0;
|
|
575
598
|
const i = await Promise.all(
|
|
576
599
|
n.map(
|
|
577
|
-
(s) =>
|
|
600
|
+
(s) => w.createDemand(m.value, {
|
|
578
601
|
date: a,
|
|
579
602
|
startTime: s.startTime,
|
|
580
603
|
endTime: s.endTime,
|
|
@@ -588,70 +611,70 @@ async function po(e, a) {
|
|
|
588
611
|
})
|
|
589
612
|
)
|
|
590
613
|
);
|
|
591
|
-
return
|
|
614
|
+
return c.value && (c.value = { ...c.value, demands: [...c.value.demands, ...i] }), i.length;
|
|
592
615
|
}
|
|
593
616
|
async function fo(e) {
|
|
594
|
-
if (!
|
|
595
|
-
return
|
|
617
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
618
|
+
return w.generateAutoSchedule(m.value, e);
|
|
596
619
|
}
|
|
597
620
|
async function ho() {
|
|
598
|
-
if (!
|
|
599
|
-
return
|
|
621
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
622
|
+
return w.getAutoScheduleCapabilities(m.value);
|
|
600
623
|
}
|
|
601
624
|
async function vo(e) {
|
|
602
|
-
if (!
|
|
603
|
-
return
|
|
625
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
626
|
+
return w.applyAutoSchedule(m.value, e);
|
|
604
627
|
}
|
|
605
628
|
async function Do(e) {
|
|
606
|
-
if (!
|
|
607
|
-
return
|
|
629
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
630
|
+
return w.bulkSaveAssignments(m.value, e);
|
|
608
631
|
}
|
|
609
632
|
async function go(e) {
|
|
610
|
-
if (!
|
|
611
|
-
e.length && await
|
|
612
|
-
}
|
|
613
|
-
async function
|
|
614
|
-
if (!
|
|
615
|
-
const a = await
|
|
616
|
-
return
|
|
617
|
-
}
|
|
618
|
-
async function
|
|
619
|
-
if (!
|
|
620
|
-
const t = await
|
|
621
|
-
return t &&
|
|
622
|
-
...
|
|
623
|
-
timeOff:
|
|
633
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
634
|
+
e.length && await w.deleteAssignments(m.value, e);
|
|
635
|
+
}
|
|
636
|
+
async function wo(e) {
|
|
637
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
638
|
+
const a = await w.createTimeOff(m.value, e);
|
|
639
|
+
return c.value && (c.value = { ...c.value, timeOff: [...c.value.timeOff, a] }), a;
|
|
640
|
+
}
|
|
641
|
+
async function Ho(e, a) {
|
|
642
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
643
|
+
const t = await w.updateTimeOffStatus(m.value, e, a);
|
|
644
|
+
return t && c.value && (c.value = {
|
|
645
|
+
...c.value,
|
|
646
|
+
timeOff: c.value.timeOff.map((n) => n.id === e ? t : n)
|
|
624
647
|
}), t;
|
|
625
648
|
}
|
|
626
649
|
async function Ao(e) {
|
|
627
|
-
if (!
|
|
628
|
-
await
|
|
629
|
-
...
|
|
630
|
-
timeOff:
|
|
650
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
651
|
+
await w.deleteTimeOff(m.value, e), c.value && (c.value = {
|
|
652
|
+
...c.value,
|
|
653
|
+
timeOff: c.value.timeOff.filter((a) => a.id !== e)
|
|
631
654
|
});
|
|
632
655
|
}
|
|
633
656
|
async function Eo(e) {
|
|
634
|
-
if (!
|
|
635
|
-
return
|
|
657
|
+
if (!m.value) throw new Error("No outlet selected");
|
|
658
|
+
return w.bulkUpdateAssignmentStatus(m.value, e);
|
|
636
659
|
}
|
|
637
|
-
async function
|
|
638
|
-
const t =
|
|
660
|
+
async function ea(e, a) {
|
|
661
|
+
const t = m.value;
|
|
639
662
|
if (!t) {
|
|
640
|
-
|
|
663
|
+
fe.value = "No outlet selected";
|
|
641
664
|
return;
|
|
642
665
|
}
|
|
643
|
-
const n =
|
|
644
|
-
|
|
666
|
+
const n = ie(e), i = ie(a), s = ++te;
|
|
667
|
+
$e.value = !0, fe.value = null;
|
|
645
668
|
const l = (async () => {
|
|
646
669
|
try {
|
|
647
|
-
const o = await
|
|
648
|
-
if (
|
|
649
|
-
|
|
670
|
+
const o = await w.readBoard(t, n, i);
|
|
671
|
+
if (m.value !== t || s !== te) return;
|
|
672
|
+
c.value = o, Je.value = o.settings.setupCompleted, G = n, j = i, V.value += 1;
|
|
650
673
|
} catch (o) {
|
|
651
|
-
if (
|
|
652
|
-
|
|
674
|
+
if (m.value !== t || s !== te) return;
|
|
675
|
+
fe.value = o instanceof Error ? o.message : "Could not load the schedule";
|
|
653
676
|
} finally {
|
|
654
|
-
|
|
677
|
+
m.value === t && s === te && ($e.value = !1);
|
|
655
678
|
}
|
|
656
679
|
})();
|
|
657
680
|
z = l;
|
|
@@ -747,11 +770,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
747
770
|
}
|
|
748
771
|
}, ja = {
|
|
749
772
|
maxHoursPerMonth: 72
|
|
750
|
-
},
|
|
773
|
+
}, Qa = {
|
|
751
774
|
minHoursPerDay: null,
|
|
752
775
|
maxHoursPerDay: 8,
|
|
753
776
|
maxHoursPerWeek: 44
|
|
754
|
-
},
|
|
777
|
+
}, Xa = [
|
|
755
778
|
{
|
|
756
779
|
month: 1,
|
|
757
780
|
day: 1,
|
|
@@ -777,7 +800,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
777
800
|
day: 25,
|
|
778
801
|
name: "Christmas Day"
|
|
779
802
|
}
|
|
780
|
-
],
|
|
803
|
+
], Ja = {
|
|
781
804
|
2026: {
|
|
782
805
|
"2026-01-01": "New Year's Day",
|
|
783
806
|
"2026-02-17": "Chinese New Year",
|
|
@@ -807,15 +830,15 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
807
830
|
"2027-08-15": "Prophet Muhammad's Birthday",
|
|
808
831
|
"2027-12-25": "Christmas Day"
|
|
809
832
|
}
|
|
810
|
-
},
|
|
833
|
+
}, Za = {
|
|
811
834
|
countryCode: Va,
|
|
812
835
|
timezone: Ka,
|
|
813
836
|
payRate: Ga,
|
|
814
837
|
overtime: ja,
|
|
815
|
-
workingHours:
|
|
816
|
-
recurringPublicHolidays:
|
|
817
|
-
publicHolidays:
|
|
818
|
-
},
|
|
838
|
+
workingHours: Qa,
|
|
839
|
+
recurringPublicHolidays: Xa,
|
|
840
|
+
publicHolidays: Ja
|
|
841
|
+
}, qa = "ID", et = "Asia/Jakarta", at = {
|
|
819
842
|
NORMAL: {
|
|
820
843
|
overtime: 1.5
|
|
821
844
|
},
|
|
@@ -895,7 +918,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
895
918
|
"2027-12-26": "Isra Mi'raj"
|
|
896
919
|
}
|
|
897
920
|
}, it = {
|
|
898
|
-
countryCode:
|
|
921
|
+
countryCode: qa,
|
|
899
922
|
timezone: et,
|
|
900
923
|
payRate: at,
|
|
901
924
|
overtime: tt,
|
|
@@ -1029,7 +1052,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1029
1052
|
minHoursPerDay: null,
|
|
1030
1053
|
maxHoursPerDay: 8,
|
|
1031
1054
|
maxHoursPerWeek: 48
|
|
1032
|
-
},
|
|
1055
|
+
}, wt = [
|
|
1033
1056
|
{
|
|
1034
1057
|
month: 1,
|
|
1035
1058
|
day: 1,
|
|
@@ -1055,7 +1078,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1055
1078
|
day: 11,
|
|
1056
1079
|
name: "Republic Day"
|
|
1057
1080
|
}
|
|
1058
|
-
],
|
|
1081
|
+
], Ht = {
|
|
1059
1082
|
2026: {
|
|
1060
1083
|
"2026-01-01": "New Year's Day",
|
|
1061
1084
|
"2026-03-20": "Eid al-Fitr Holiday",
|
|
@@ -1099,8 +1122,8 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1099
1122
|
payRate: vt,
|
|
1100
1123
|
overtime: Dt,
|
|
1101
1124
|
workingHours: gt,
|
|
1102
|
-
recurringPublicHolidays:
|
|
1103
|
-
publicHolidays:
|
|
1125
|
+
recurringPublicHolidays: wt,
|
|
1126
|
+
publicHolidays: Ht
|
|
1104
1127
|
}, Et = "MY", bt = "Asia/Kuala_Lumpur", Pt = {
|
|
1105
1128
|
NORMAL: {
|
|
1106
1129
|
overtime: 1.5
|
|
@@ -1351,7 +1374,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1351
1374
|
workingHours: Wt,
|
|
1352
1375
|
recurringPublicHolidays: zt,
|
|
1353
1376
|
publicHolidays: Vt
|
|
1354
|
-
}, Gt = "TH", jt = "Asia/Bangkok",
|
|
1377
|
+
}, Gt = "TH", jt = "Asia/Bangkok", Qt = {
|
|
1355
1378
|
NORMAL: {
|
|
1356
1379
|
overtime: 1.5
|
|
1357
1380
|
},
|
|
@@ -1363,13 +1386,13 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1363
1386
|
regular: 2,
|
|
1364
1387
|
overtime: 3
|
|
1365
1388
|
}
|
|
1366
|
-
}, Qt = {
|
|
1367
|
-
maxHoursPerMonth: 36
|
|
1368
1389
|
}, Xt = {
|
|
1390
|
+
maxHoursPerMonth: 36
|
|
1391
|
+
}, Jt = {
|
|
1369
1392
|
minHoursPerDay: null,
|
|
1370
1393
|
maxHoursPerDay: 8,
|
|
1371
1394
|
maxHoursPerWeek: 48
|
|
1372
|
-
},
|
|
1395
|
+
}, Zt = [
|
|
1373
1396
|
{
|
|
1374
1397
|
month: 1,
|
|
1375
1398
|
day: 1,
|
|
@@ -1415,7 +1438,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1415
1438
|
day: 31,
|
|
1416
1439
|
name: "New Year's Eve"
|
|
1417
1440
|
}
|
|
1418
|
-
],
|
|
1441
|
+
], qt = {
|
|
1419
1442
|
2026: {
|
|
1420
1443
|
"2026-01-01": "New Year's Day",
|
|
1421
1444
|
"2026-03-03": "Makha Bucha Day",
|
|
@@ -1458,11 +1481,11 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1458
1481
|
}, en = {
|
|
1459
1482
|
countryCode: Gt,
|
|
1460
1483
|
timezone: jt,
|
|
1461
|
-
payRate:
|
|
1462
|
-
overtime:
|
|
1463
|
-
workingHours:
|
|
1464
|
-
recurringPublicHolidays:
|
|
1465
|
-
publicHolidays:
|
|
1484
|
+
payRate: Qt,
|
|
1485
|
+
overtime: Xt,
|
|
1486
|
+
workingHours: Jt,
|
|
1487
|
+
recurringPublicHolidays: Zt,
|
|
1488
|
+
publicHolidays: qt
|
|
1466
1489
|
}, an = "VN", tn = "Asia/Ho_Chi_Minh", nn = {
|
|
1467
1490
|
NORMAL: {
|
|
1468
1491
|
overtime: 1.5
|
|
@@ -1538,7 +1561,7 @@ const Ya = "AE", xa = "Asia/Dubai", Ba = {
|
|
|
1538
1561
|
workingHours: sn,
|
|
1539
1562
|
recurringPublicHolidays: rn,
|
|
1540
1563
|
publicHolidays: ln
|
|
1541
|
-
},
|
|
1564
|
+
}, Fe = { AE: za, BN: Za, ID: it, MO: pt, MV: At, MY: St, PK: xt, SG: Kt, TH: en, VN: un };
|
|
1542
1565
|
function dn(e) {
|
|
1543
1566
|
if (typeof e == "string") return e.toUpperCase();
|
|
1544
1567
|
if (e && typeof e == "object" && "code" in e) {
|
|
@@ -1548,7 +1571,7 @@ function dn(e) {
|
|
|
1548
1571
|
return "MY";
|
|
1549
1572
|
}
|
|
1550
1573
|
function cn(e) {
|
|
1551
|
-
return
|
|
1574
|
+
return Fe[dn(e)] ?? Fe.MY;
|
|
1552
1575
|
}
|
|
1553
1576
|
function bo(e, a) {
|
|
1554
1577
|
var s, l;
|
|
@@ -1557,7 +1580,7 @@ function bo(e, a) {
|
|
|
1557
1580
|
const n = Number(a.slice(5, 7)), i = Number(a.slice(8, 10));
|
|
1558
1581
|
return ((l = e.recurringPublicHolidays.find((o) => o.month === n && o.day === i)) == null ? void 0 : l.name) ?? null;
|
|
1559
1582
|
}
|
|
1560
|
-
const yn =
|
|
1583
|
+
const yn = Ve(), aa = "unassigned", Po = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], No = "All Stations", ko = [{ id: aa, label: "Assigned", roles: [], system: !0 }], Ue = [
|
|
1561
1584
|
"#903E1F",
|
|
1562
1585
|
"#5F090A",
|
|
1563
1586
|
"#0A5384",
|
|
@@ -1580,45 +1603,45 @@ function Mo(e, a) {
|
|
|
1580
1603
|
return a ? !K.some((t) => t.id === a) : !!e && !K.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1581
1604
|
}
|
|
1582
1605
|
const So = [1, 1, 1, 1, 1, 1, 1];
|
|
1583
|
-
function
|
|
1606
|
+
function le(e) {
|
|
1584
1607
|
return (e + 6) % 7;
|
|
1585
1608
|
}
|
|
1586
1609
|
function Lo(e) {
|
|
1587
1610
|
return (e + 1) % 7;
|
|
1588
1611
|
}
|
|
1589
|
-
function
|
|
1612
|
+
function me(e, a) {
|
|
1590
1613
|
e.splice(0, e.length, ...a);
|
|
1591
1614
|
}
|
|
1592
1615
|
function pn(e, a) {
|
|
1593
|
-
return
|
|
1616
|
+
return Ge(e, a) / 60;
|
|
1594
1617
|
}
|
|
1595
1618
|
function fn(e) {
|
|
1596
1619
|
var t;
|
|
1597
1620
|
const a = e.trim().split(/\s+/).filter(Boolean);
|
|
1598
1621
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1599
1622
|
}
|
|
1600
|
-
const
|
|
1623
|
+
const ta = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
|
|
1601
1624
|
function Io(e) {
|
|
1602
|
-
return
|
|
1625
|
+
return ta.get(e);
|
|
1603
1626
|
}
|
|
1604
1627
|
function hn(e) {
|
|
1605
|
-
const a =
|
|
1628
|
+
const a = Ee.get(e);
|
|
1606
1629
|
if (a !== void 0) return a;
|
|
1607
|
-
const t =
|
|
1608
|
-
return
|
|
1630
|
+
const t = Qe + Ee.size + 1;
|
|
1631
|
+
return Ee.set(e, t), ta.set(t, e), t;
|
|
1609
1632
|
}
|
|
1610
1633
|
function Ro(e) {
|
|
1611
1634
|
return e.sourceId || String(e.id);
|
|
1612
1635
|
}
|
|
1613
1636
|
function vn(e) {
|
|
1614
|
-
Na.name = (e == null ? void 0 : e.outlet.name) ?? "",
|
|
1637
|
+
Na.name = (e == null ? void 0 : e.outlet.name) ?? "", me(Pa, (e == null ? void 0 : e.positions.map((o) => o.name)) ?? []), me(K, (e == null ? void 0 : e.positions) ?? []);
|
|
1615
1638
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1616
|
-
for (const o of a) t[
|
|
1617
|
-
|
|
1639
|
+
for (const o of a) t[le(o.dayOfWeek)] = o.closed ? [] : o.hours;
|
|
1640
|
+
me(M.dayHours, t);
|
|
1618
1641
|
const n = a.filter((o) => !o.closed).flatMap((o) => o.hours);
|
|
1619
|
-
M.openFrom = n.length ? n.map((o) => o.start).reduce((o,
|
|
1642
|
+
M.openFrom = n.length ? n.map((o) => o.start).reduce((o, u) => u < o ? u : o) : "00:00", M.openTo = n.length ? n.map((o) => o.end).reduce((o, u) => u > o ? u : o) : "24:00", me(
|
|
1620
1643
|
M.closedWeekdays,
|
|
1621
|
-
a.filter((o) => o.closed).map((o) =>
|
|
1644
|
+
a.filter((o) => o.closed).map((o) => le(o.dayOfWeek)).sort((o, u) => o - u)
|
|
1622
1645
|
);
|
|
1623
1646
|
const i = cn(yn.currentCountry.value), s = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = s ? e.settings.payRate : i.payRate;
|
|
1624
1647
|
M.otCapHours = s ? e.settings.overtime.maxHoursPerMonth : i.overtime.maxHoursPerMonth, M.workingHours = s ? e.settings.workingHours : {
|
|
@@ -1627,8 +1650,8 @@ function vn(e) {
|
|
|
1627
1650
|
maxHoursPerWeek: i.workingHours.maxHoursPerWeek
|
|
1628
1651
|
}, 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;
|
|
1629
1652
|
}
|
|
1630
|
-
|
|
1631
|
-
function
|
|
1653
|
+
Ie(c, vn, { immediate: !0 });
|
|
1654
|
+
function ve(e) {
|
|
1632
1655
|
var a, t, n;
|
|
1633
1656
|
return {
|
|
1634
1657
|
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? M.workingHours.minHoursPerDay,
|
|
@@ -1639,7 +1662,7 @@ function he(e) {
|
|
|
1639
1662
|
function Dn(e) {
|
|
1640
1663
|
return e.reduce(
|
|
1641
1664
|
(a, t) => {
|
|
1642
|
-
const n =
|
|
1665
|
+
const n = ve(t).maxHoursPerWeek;
|
|
1643
1666
|
return t.employmentType === "FULLTIME" && n != null ? Math.max(a, n) : a;
|
|
1644
1667
|
},
|
|
1645
1668
|
0
|
|
@@ -1647,15 +1670,15 @@ function Dn(e) {
|
|
|
1647
1670
|
}
|
|
1648
1671
|
function gn(e, a) {
|
|
1649
1672
|
if (e.wage.type === "HOURLY") return e.wage.amount;
|
|
1650
|
-
const t =
|
|
1673
|
+
const t = ve(e).maxHoursPerWeek ?? a;
|
|
1651
1674
|
return t ? e.wage.amount / (t * (52 / 12)) : 0;
|
|
1652
1675
|
}
|
|
1653
|
-
function
|
|
1676
|
+
function wn(e, a) {
|
|
1654
1677
|
if (e.employmentType === "FULLTIME") return 100;
|
|
1655
|
-
const t =
|
|
1678
|
+
const t = ve(e).maxHoursPerWeek;
|
|
1656
1679
|
return !a || t == null ? 0 : Math.min(99, Math.round(t / a * 100));
|
|
1657
1680
|
}
|
|
1658
|
-
function
|
|
1681
|
+
function Hn(e) {
|
|
1659
1682
|
var a, t;
|
|
1660
1683
|
return {
|
|
1661
1684
|
start: e.startTime,
|
|
@@ -1669,7 +1692,7 @@ function wn(e) {
|
|
|
1669
1692
|
// Mongo distinguishes a draft from a published/confirmed assignment; the board's third
|
|
1670
1693
|
// state ('ot') is a costing outcome, never something stored.
|
|
1671
1694
|
status: e.status === "DRAFT" ? "pending" : "confirmed",
|
|
1672
|
-
breakMins:
|
|
1695
|
+
breakMins: je(e.breaks),
|
|
1673
1696
|
breaks: e.breaks,
|
|
1674
1697
|
// Carried through so an edit updates this same ScheduleShiftAssignments document instead of
|
|
1675
1698
|
// creating a duplicate — see useScheduleBoard's commitShift/persistSlot.
|
|
@@ -1705,69 +1728,79 @@ function bn(e) {
|
|
|
1705
1728
|
};
|
|
1706
1729
|
}
|
|
1707
1730
|
function Pn(e) {
|
|
1708
|
-
const a = ne[
|
|
1731
|
+
const a = ne[m.value];
|
|
1709
1732
|
return !a || !e.includes(a) ? e : [a, ...e.filter((t) => t !== a)];
|
|
1710
1733
|
}
|
|
1711
1734
|
function Nn(e) {
|
|
1712
1735
|
var n;
|
|
1713
|
-
const t = (
|
|
1736
|
+
const t = (Ze.value[e] ?? ((n = se.value.find((i) => i._id === e)) == null ? void 0 : n.restaurantRole.map((i) => i.restaurantId)) ?? []).map((i) => ne[i]).filter((i) => !!i);
|
|
1714
1737
|
return t.length ? Pn([...new Set(t)]) : void 0;
|
|
1715
1738
|
}
|
|
1716
1739
|
function Oo(e = []) {
|
|
1717
|
-
const a =
|
|
1740
|
+
const a = c.value;
|
|
1718
1741
|
if (!a) return [];
|
|
1719
1742
|
const t = new Map(a.employees.map((o) => [o.employeeId, o])), n = new Map(
|
|
1720
|
-
|
|
1721
|
-
), i =
|
|
1722
|
-
var
|
|
1723
|
-
return ((
|
|
1743
|
+
F.value.map((o) => [o.employeeId, o])
|
|
1744
|
+
), i = se.value.filter((o) => {
|
|
1745
|
+
var u;
|
|
1746
|
+
return ((u = n.get(o._id)) == null ? void 0 : u.enabled) !== !1;
|
|
1724
1747
|
}).map((o) => t.get(o._id) ?? bn(o)), s = Dn(i), l = /* @__PURE__ */ new Map();
|
|
1725
1748
|
for (const o of a.assignments) {
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1749
|
+
const u = `${o.employeeId}|${o.date}`, f = l.get(u);
|
|
1750
|
+
f ? f.push(o) : l.set(u, [o]);
|
|
1728
1751
|
}
|
|
1729
1752
|
return i.map((o) => {
|
|
1730
|
-
var
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1753
|
+
var ce;
|
|
1754
|
+
const u = se.value.find((D) => D._id === o.employeeId) ?? {
|
|
1755
|
+
code: void 0,
|
|
1756
|
+
passcode: "",
|
|
1757
|
+
isMasterUser: !1
|
|
1758
|
+
}, f = ve(o), H = hn(o.employeeId), $ = new Set(K.map((D) => D.id)), h = new Set(K.map((D) => D.name.toLocaleLowerCase())), b = (D) => D.positionId ? $.has(D.positionId) : h.has(D.positionName.toLocaleLowerCase()), k = (ce = o.primaryPosition) == null ? void 0 : ce.positionName, O = !!o.primaryPosition && b(o.primaryPosition), Q = o.secondaryPositions.filter(b).map((D) => D.positionName), X = k ? O ? [k, ...Q] : [] : Q, J = [
|
|
1759
|
+
...k && !O ? [k] : [],
|
|
1760
|
+
...o.secondaryPositions.filter((D) => !b(D)).map((D) => D.positionName)
|
|
1761
|
+
], x = X[0] ?? "", S = e.map((D) => {
|
|
1762
|
+
const E = ie(D), g = (a.timeOff ?? []).filter((P) => P.employeeId === o.employeeId).map((P) => En(P, E)).find((P) => P !== null);
|
|
1763
|
+
if (g) return g;
|
|
1764
|
+
const _ = (l.get(`${o.employeeId}|${E}`) ?? []).filter((P) => P.startTime && P.endTime).map((P) => Hn(P)).sort((P, De) => P.start.localeCompare(De.start));
|
|
1765
|
+
return _.length ? _.length === 1 ? _[0] : _ : null;
|
|
1766
|
+
}), Z = o.availability.length > 0, ue = Array.from(
|
|
1740
1767
|
{ length: 7 },
|
|
1741
|
-
(
|
|
1742
|
-
),
|
|
1743
|
-
const
|
|
1744
|
-
return { from: (
|
|
1768
|
+
(D, E) => Z ? o.availability.some((g) => le(g.dayOfWeek) === E) : !0
|
|
1769
|
+
), de = Array.from({ length: 7 }, (D, E) => {
|
|
1770
|
+
const g = o.availability.find((B) => le(B.dayOfWeek) === E);
|
|
1771
|
+
return { from: (g == null ? void 0 : g.start) ?? "", to: (g == null ? void 0 : g.end) ?? "" };
|
|
1745
1772
|
});
|
|
1746
1773
|
return {
|
|
1747
|
-
id:
|
|
1774
|
+
id: H,
|
|
1748
1775
|
sourceId: o.employeeId,
|
|
1749
1776
|
name: o.name,
|
|
1777
|
+
// POS access belongs to the POS roster, not the scheduling profile. Keep these
|
|
1778
|
+
// fields on the board employee so the edit form can initialise its access section
|
|
1779
|
+
// from the employee's existing POS account.
|
|
1780
|
+
passcode: u.passcode || void 0,
|
|
1781
|
+
code: u.code,
|
|
1782
|
+
masterUser: u.isMasterUser,
|
|
1750
1783
|
employmentType: o.employmentType,
|
|
1751
|
-
role:
|
|
1784
|
+
role: x,
|
|
1752
1785
|
initials: fn(o.name),
|
|
1753
|
-
color:
|
|
1786
|
+
color: Ue[(H - Qe - 1) % Ue.length],
|
|
1754
1787
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
1755
1788
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
1756
1789
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
1757
1790
|
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
1758
1791
|
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
1759
1792
|
weekHours: Math.round(
|
|
1760
|
-
|
|
1761
|
-
(
|
|
1762
|
-
(
|
|
1793
|
+
S.reduce(
|
|
1794
|
+
(D, E) => D + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
|
|
1795
|
+
(g, B) => g + pn(B.start, B.end),
|
|
1763
1796
|
0
|
|
1764
1797
|
),
|
|
1765
1798
|
0
|
|
1766
1799
|
) * 10
|
|
1767
1800
|
) / 10,
|
|
1768
|
-
pct:
|
|
1769
|
-
contractHours:
|
|
1770
|
-
minHoursPerDay:
|
|
1801
|
+
pct: wn(o, s),
|
|
1802
|
+
contractHours: f.maxHoursPerWeek ?? void 0,
|
|
1803
|
+
minHoursPerDay: f.minHoursPerDay ?? void 0,
|
|
1771
1804
|
// Keep the persisted override shape here. Consumers that need the effective value use
|
|
1772
1805
|
// effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
|
|
1773
1806
|
workingHours: o.workingHours,
|
|
@@ -1775,17 +1808,17 @@ function Oo(e = []) {
|
|
|
1775
1808
|
// shows them, and saving keeps them.
|
|
1776
1809
|
locations: Nn(o.employeeId),
|
|
1777
1810
|
rate: gn(o, s),
|
|
1778
|
-
positions:
|
|
1779
|
-
archivedPositions:
|
|
1780
|
-
shifts:
|
|
1811
|
+
positions: X,
|
|
1812
|
+
archivedPositions: J.length ? J : void 0,
|
|
1813
|
+
shifts: S,
|
|
1781
1814
|
// Remarks live in their own collection in the older scheduling design and are not
|
|
1782
1815
|
// part of this board's payload yet.
|
|
1783
1816
|
remarks: [],
|
|
1784
|
-
section:
|
|
1817
|
+
section: aa,
|
|
1785
1818
|
payBasis: o.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
1786
1819
|
payAmount: o.wage.amount,
|
|
1787
|
-
availDays:
|
|
1788
|
-
availHours:
|
|
1820
|
+
availDays: ue,
|
|
1821
|
+
availHours: de
|
|
1789
1822
|
};
|
|
1790
1823
|
});
|
|
1791
1824
|
}
|
|
@@ -1794,11 +1827,11 @@ function To() {
|
|
|
1794
1827
|
}
|
|
1795
1828
|
function $o() {
|
|
1796
1829
|
var n, i;
|
|
1797
|
-
const e =
|
|
1830
|
+
const e = c.value, a = {}, t = {};
|
|
1798
1831
|
for (const s of (e == null ? void 0 : e.demands) ?? []) {
|
|
1799
|
-
const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i =
|
|
1832
|
+
const l = s.date ? a[n = s.date] ?? (a[n] = []) : s.dayOfWeek !== null ? t[i = le(s.dayOfWeek)] ?? (t[i] = []) : null;
|
|
1800
1833
|
if (!l) continue;
|
|
1801
|
-
let o = l.find((
|
|
1834
|
+
let o = l.find((u) => u.from === s.startTime && u.to === s.endTime);
|
|
1802
1835
|
o || (o = { from: s.startTime, to: s.endTime, n: 0, roles: [] }, l.push(o)), o.n += s.headcount, s.position && o.roles.push({
|
|
1803
1836
|
position: s.position.positionName,
|
|
1804
1837
|
positionId: s.position.positionId || void 0,
|
|
@@ -1808,29 +1841,29 @@ function $o() {
|
|
|
1808
1841
|
return { byDate: a, byWeekday: t };
|
|
1809
1842
|
}
|
|
1810
1843
|
function Yo() {
|
|
1811
|
-
const e =
|
|
1812
|
-
() => [...a.value].map((
|
|
1813
|
-
), o =
|
|
1814
|
-
var
|
|
1815
|
-
return ((
|
|
1844
|
+
const e = Ve(), { restaurants: a, readRestaurants: t } = wa(), n = Da(), i = ga(), s = A(!1), l = T(
|
|
1845
|
+
() => [...a.value].map((h) => ({ value: h._id, label: h.profile.name })).sort((h, b) => h.label.localeCompare(b.label))
|
|
1846
|
+
), o = T(() => {
|
|
1847
|
+
var h;
|
|
1848
|
+
return ((h = e.currentRestaurant.value) == null ? void 0 : h._id) ?? "";
|
|
1816
1849
|
});
|
|
1817
|
-
async function
|
|
1818
|
-
return
|
|
1850
|
+
async function u(h, b) {
|
|
1851
|
+
return Be(h) ? (n.query.restaurantId !== h && i.replace({ query: { ...n.query, restaurantId: h } }), await Promise.all([Me(h), Oa(b)]), !0) : !1;
|
|
1819
1852
|
}
|
|
1820
|
-
const
|
|
1821
|
-
async function
|
|
1822
|
-
var
|
|
1823
|
-
await t(),
|
|
1824
|
-
const
|
|
1825
|
-
return
|
|
1853
|
+
const f = (h) => !!h && l.value.some((b) => b.value === h);
|
|
1854
|
+
async function H() {
|
|
1855
|
+
var b;
|
|
1856
|
+
await t(), xe.splice(0, xe.length, ...l.value.map((k) => k.label)), Object.keys(ne).forEach((k) => delete ne[k]), l.value.forEach((k) => ne[k.value] = k.label);
|
|
1857
|
+
const h = f(m.value) ? m.value : f(o.value) ? o.value : ((b = l.value[0]) == null ? void 0 : b.value) ?? "";
|
|
1858
|
+
return h && Be(h), s.value = !0, h;
|
|
1826
1859
|
}
|
|
1827
|
-
async function
|
|
1828
|
-
const
|
|
1829
|
-
return
|
|
1860
|
+
async function $() {
|
|
1861
|
+
const h = await H();
|
|
1862
|
+
return h && await Me(h), h;
|
|
1830
1863
|
}
|
|
1831
|
-
return { options: l, ready: s, outletId:
|
|
1864
|
+
return { options: l, ready: s, outletId: m, resolve: $, resolveOutlet: H, switchTo: u };
|
|
1832
1865
|
}
|
|
1833
|
-
const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */
|
|
1866
|
+
const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Re({
|
|
1834
1867
|
__name: "ScheduleButton",
|
|
1835
1868
|
props: {
|
|
1836
1869
|
hierarchy: { default: "primary" },
|
|
@@ -1838,14 +1871,14 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1838
1871
|
iconOnly: { type: Boolean, default: !1 }
|
|
1839
1872
|
},
|
|
1840
1873
|
setup(e) {
|
|
1841
|
-
return (a, t) => (
|
|
1874
|
+
return (a, t) => (N(), C("button", {
|
|
1842
1875
|
type: "button",
|
|
1843
1876
|
class: "sch-button",
|
|
1844
1877
|
"data-hierarchy": e.hierarchy,
|
|
1845
1878
|
"data-size": e.size,
|
|
1846
1879
|
"data-icon": e.iconOnly ? "only" : void 0
|
|
1847
1880
|
}, [
|
|
1848
|
-
|
|
1881
|
+
ze(a.$slots, "default")
|
|
1849
1882
|
], 8, kn));
|
|
1850
1883
|
}
|
|
1851
1884
|
}), Cn = ["disabled", "aria-expanded"], Mn = { class: "sch" }, Sn = ["aria-multiselectable"], Ln = {
|
|
@@ -1863,7 +1896,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1863
1896
|
}, Tn = ["aria-selected", "onClick"], $n = {
|
|
1864
1897
|
key: 0,
|
|
1865
1898
|
class: "fx-opt-text"
|
|
1866
|
-
}, Yn = { key: 0 }, Bo = /* @__PURE__ */
|
|
1899
|
+
}, Yn = { key: 0 }, Bo = /* @__PURE__ */ Re({
|
|
1867
1900
|
inheritAttrs: !1,
|
|
1868
1901
|
__name: "ScheduleSelect",
|
|
1869
1902
|
props: {
|
|
@@ -1881,202 +1914,202 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
1881
1914
|
},
|
|
1882
1915
|
emits: ["update:modelValue", "toggle"],
|
|
1883
1916
|
setup(e, { emit: a }) {
|
|
1884
|
-
const t = e, n = a, i =
|
|
1885
|
-
|
|
1917
|
+
const t = e, n = a, i = la(), s = T(() => i.class ?? ""), l = A(!1), o = A(!1), u = A(null), f = A(null), H = A(null), $ = T(() => t.teleport !== !1 && o.value);
|
|
1918
|
+
Se(() => {
|
|
1886
1919
|
o.value = typeof document < "u" && !!document.body;
|
|
1887
1920
|
});
|
|
1888
|
-
const
|
|
1889
|
-
var r,
|
|
1921
|
+
const h = T(() => {
|
|
1922
|
+
var r, y;
|
|
1890
1923
|
if (!t.multiple && t.selectedLabel != null) return t.selectedLabel;
|
|
1891
1924
|
if (t.multiple) {
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
1925
|
+
const d = ((r = t.selected) == null ? void 0 : r.length) ?? 0;
|
|
1926
|
+
return d ? `${d} selected` : t.placeholder ?? "";
|
|
1894
1927
|
}
|
|
1895
|
-
return ((
|
|
1928
|
+
return ((y = t.options.find((d) => d.value === t.modelValue)) == null ? void 0 : y.label) ?? "";
|
|
1896
1929
|
});
|
|
1897
|
-
function
|
|
1898
|
-
var
|
|
1899
|
-
return t.multiple ? !!((
|
|
1930
|
+
function b(r) {
|
|
1931
|
+
var y;
|
|
1932
|
+
return t.multiple ? !!((y = t.selected) != null && y.includes(r.value)) : t.selectedId != null ? r.id === t.selectedId : r.value === t.modelValue;
|
|
1900
1933
|
}
|
|
1901
|
-
const
|
|
1902
|
-
const r =
|
|
1903
|
-
return !t.searchable || !r ? t.options : t.options.filter((
|
|
1904
|
-
}),
|
|
1934
|
+
const k = T(() => !!t.menuTitle || t.options.some((r) => r.hint)), O = A(""), Q = A(null), X = T(() => {
|
|
1935
|
+
const r = O.value.trim().toLowerCase();
|
|
1936
|
+
return !t.searchable || !r ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(r));
|
|
1937
|
+
}), J = T(() => {
|
|
1905
1938
|
const r = [];
|
|
1906
|
-
let
|
|
1907
|
-
for (const
|
|
1908
|
-
|
|
1939
|
+
let y;
|
|
1940
|
+
for (const d of X.value)
|
|
1941
|
+
d.group !== y && (y = d.group, y && r.push({ heading: y })), r.push({ option: d });
|
|
1909
1942
|
return r;
|
|
1910
|
-
}), x = 5,
|
|
1911
|
-
function
|
|
1912
|
-
const r =
|
|
1913
|
-
if (!r || !
|
|
1914
|
-
const
|
|
1915
|
-
r.style.minWidth = `${Math.round(
|
|
1916
|
-
const
|
|
1917
|
-
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(
|
|
1918
|
-
const
|
|
1919
|
-
let
|
|
1920
|
-
|
|
1921
|
-
const
|
|
1922
|
-
r.style.top = `${Math.round(
|
|
1943
|
+
}), x = 5, S = 8;
|
|
1944
|
+
function Z() {
|
|
1945
|
+
const r = H.value, y = f.value;
|
|
1946
|
+
if (!r || !y) return;
|
|
1947
|
+
const d = y.getBoundingClientRect(), L = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
|
|
1948
|
+
r.style.minWidth = `${Math.round(d.width)}px`, r.style.maxWidth = `${Math.max(180, Math.round(L - S * 2))}px`;
|
|
1949
|
+
const q = R - d.bottom - x - S, sa = d.top - x - S;
|
|
1950
|
+
r.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(q, sa)))}px`;
|
|
1951
|
+
const ye = r.offsetHeight, ia = r.offsetWidth;
|
|
1952
|
+
let ge = d.bottom + x;
|
|
1953
|
+
ge + ye > R - S && (ge = d.top - x - ye >= S ? d.top - x - ye : Math.max(S, R - ye - S));
|
|
1954
|
+
const ra = Math.min(Math.max(S, d.left), Math.max(S, L - ia - S));
|
|
1955
|
+
r.style.top = `${Math.round(ge)}px`, r.style.left = `${Math.round(ra)}px`, r.style.visibility = "visible";
|
|
1923
1956
|
}
|
|
1924
|
-
function
|
|
1925
|
-
var
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1957
|
+
function ue(r) {
|
|
1958
|
+
var d, L;
|
|
1959
|
+
const y = r.target;
|
|
1960
|
+
y && ((d = u.value) != null && d.contains(y) || (L = H.value) != null && L.contains(y)) || g();
|
|
1928
1961
|
}
|
|
1929
|
-
function
|
|
1930
|
-
const
|
|
1931
|
-
if (
|
|
1932
|
-
const
|
|
1933
|
-
if (!
|
|
1934
|
-
const
|
|
1935
|
-
if (
|
|
1936
|
-
|
|
1962
|
+
function de(r) {
|
|
1963
|
+
const y = H.value, d = r.target;
|
|
1964
|
+
if (y && d && d !== document && y.contains(d)) return;
|
|
1965
|
+
const L = f.value;
|
|
1966
|
+
if (!L) return;
|
|
1967
|
+
const R = L.getBoundingClientRect(), q = window.innerHeight || document.documentElement.clientHeight;
|
|
1968
|
+
if (R.bottom < 0 || R.top > q) {
|
|
1969
|
+
g();
|
|
1937
1970
|
return;
|
|
1938
1971
|
}
|
|
1939
|
-
|
|
1972
|
+
Z();
|
|
1940
1973
|
}
|
|
1941
|
-
function
|
|
1942
|
-
document.addEventListener("click",
|
|
1974
|
+
function ce() {
|
|
1975
|
+
document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", g);
|
|
1943
1976
|
}
|
|
1944
|
-
function
|
|
1945
|
-
document.removeEventListener("click",
|
|
1977
|
+
function D() {
|
|
1978
|
+
document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", g);
|
|
1946
1979
|
}
|
|
1947
|
-
async function
|
|
1948
|
-
var r,
|
|
1949
|
-
t.disabled || l.value || (
|
|
1980
|
+
async function E() {
|
|
1981
|
+
var r, y, d;
|
|
1982
|
+
t.disabled || l.value || (O.value = "", l.value = !0, await be(), Z(), (r = Q.value) == null || r.focus(), (d = (y = H.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || d.scrollIntoView({ block: "nearest" }), ce());
|
|
1950
1983
|
}
|
|
1951
|
-
function
|
|
1952
|
-
l.value && (l.value = !1,
|
|
1984
|
+
function g() {
|
|
1985
|
+
l.value && (l.value = !1, O.value = "", D());
|
|
1953
1986
|
}
|
|
1954
|
-
|
|
1955
|
-
l.value && (await
|
|
1987
|
+
Ie(O, async () => {
|
|
1988
|
+
l.value && (await be(), Z());
|
|
1956
1989
|
});
|
|
1957
|
-
function
|
|
1958
|
-
var
|
|
1990
|
+
function B(r) {
|
|
1991
|
+
var y;
|
|
1959
1992
|
if (r.key === "Escape")
|
|
1960
|
-
r.preventDefault(),
|
|
1993
|
+
r.preventDefault(), g(), (y = f.value) == null || y.focus();
|
|
1961
1994
|
else if (r.key === "Enter") {
|
|
1962
1995
|
r.preventDefault();
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1996
|
+
const d = X.value.find((L) => !L.disabled);
|
|
1997
|
+
d && P(d);
|
|
1965
1998
|
}
|
|
1966
1999
|
}
|
|
1967
|
-
function
|
|
1968
|
-
l.value ?
|
|
2000
|
+
function _() {
|
|
2001
|
+
l.value ? g() : E();
|
|
1969
2002
|
}
|
|
1970
|
-
function
|
|
2003
|
+
function P(r) {
|
|
1971
2004
|
if (!r.disabled) {
|
|
1972
2005
|
if (t.multiple && !r.command) {
|
|
1973
2006
|
n("toggle", r.value);
|
|
1974
2007
|
return;
|
|
1975
2008
|
}
|
|
1976
|
-
if (
|
|
2009
|
+
if (g(), t.multiple) {
|
|
1977
2010
|
n("update:modelValue", r.value);
|
|
1978
2011
|
return;
|
|
1979
2012
|
}
|
|
1980
2013
|
r.value !== t.modelValue && n("update:modelValue", r.value);
|
|
1981
2014
|
}
|
|
1982
2015
|
}
|
|
1983
|
-
const
|
|
1984
|
-
function
|
|
1985
|
-
const
|
|
1986
|
-
if (t.multiple || !
|
|
1987
|
-
|
|
2016
|
+
const De = T(() => t.options.filter((r) => !r.disabled));
|
|
2017
|
+
function na(r) {
|
|
2018
|
+
const y = De.value;
|
|
2019
|
+
if (t.multiple || !y.length) {
|
|
2020
|
+
E();
|
|
1988
2021
|
return;
|
|
1989
2022
|
}
|
|
1990
|
-
const
|
|
1991
|
-
|
|
2023
|
+
const d = y.findIndex((q) => q.value === t.modelValue), L = r === "Home" ? 0 : r === "End" ? y.length - 1 : r === "ArrowDown" ? Math.min(y.length - 1, (d < 0 ? -1 : d) + 1) : Math.max(0, (d < 0 ? 1 : d) - 1), R = y[L];
|
|
2024
|
+
R && R.value !== t.modelValue ? n("update:modelValue", R.value) : E();
|
|
1992
2025
|
}
|
|
1993
|
-
function
|
|
1994
|
-
var
|
|
2026
|
+
function oa(r) {
|
|
2027
|
+
var y;
|
|
1995
2028
|
if (r.key === "Escape") {
|
|
1996
2029
|
if (!l.value) return;
|
|
1997
|
-
r.preventDefault(),
|
|
2030
|
+
r.preventDefault(), g(), (y = f.value) == null || y.focus();
|
|
1998
2031
|
return;
|
|
1999
2032
|
}
|
|
2000
2033
|
if (r.key === "Enter" || r.key === " ") {
|
|
2001
|
-
r.preventDefault(),
|
|
2034
|
+
r.preventDefault(), _();
|
|
2002
2035
|
return;
|
|
2003
2036
|
}
|
|
2004
|
-
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(),
|
|
2037
|
+
r.key !== "ArrowDown" && r.key !== "ArrowUp" && r.key !== "Home" && r.key !== "End" || (r.preventDefault(), na(r.key));
|
|
2005
2038
|
}
|
|
2006
|
-
return
|
|
2039
|
+
return Le(D), (r, y) => (N(), C("div", {
|
|
2007
2040
|
ref_key: "rootEl",
|
|
2008
|
-
ref:
|
|
2009
|
-
class:
|
|
2041
|
+
ref: u,
|
|
2042
|
+
class: pe(["fx-sel", s.value])
|
|
2010
2043
|
}, [
|
|
2011
|
-
|
|
2044
|
+
Y("button", da({
|
|
2012
2045
|
ref_key: "btnEl",
|
|
2013
|
-
ref:
|
|
2046
|
+
ref: f
|
|
2014
2047
|
}, r.$attrs, {
|
|
2015
2048
|
type: "button",
|
|
2016
2049
|
class: ["sch-input fx-btn", { "is-open": l.value }],
|
|
2017
2050
|
disabled: e.disabled,
|
|
2018
2051
|
"aria-haspopup": "listbox",
|
|
2019
2052
|
"aria-expanded": l.value,
|
|
2020
|
-
onClick:
|
|
2021
|
-
onKeydown:
|
|
2022
|
-
}), U(
|
|
2023
|
-
(
|
|
2053
|
+
onClick: y[0] || (y[0] = (d) => _()),
|
|
2054
|
+
onKeydown: oa
|
|
2055
|
+
}), U(h.value), 17, Cn),
|
|
2056
|
+
(N(), ua(ca, {
|
|
2024
2057
|
to: "body",
|
|
2025
|
-
disabled:
|
|
2058
|
+
disabled: !$.value
|
|
2026
2059
|
}, [
|
|
2027
|
-
|
|
2028
|
-
l.value ? (
|
|
2060
|
+
Y("div", Mn, [
|
|
2061
|
+
l.value ? (N(), C("div", {
|
|
2029
2062
|
key: 0,
|
|
2030
2063
|
ref_key: "popEl",
|
|
2031
|
-
ref:
|
|
2032
|
-
class:
|
|
2064
|
+
ref: H,
|
|
2065
|
+
class: pe(["fx-pop", { "fx-pop-rich": k.value }]),
|
|
2033
2066
|
role: "listbox",
|
|
2034
2067
|
"aria-multiselectable": e.multiple || void 0,
|
|
2035
2068
|
style: { visibility: "hidden" }
|
|
2036
2069
|
}, [
|
|
2037
|
-
e.menuTitle ? (
|
|
2038
|
-
e.searchable ? (
|
|
2039
|
-
|
|
2070
|
+
e.menuTitle ? (N(), C("div", Ln, U(e.menuTitle), 1)) : W("", !0),
|
|
2071
|
+
e.searchable ? (N(), C("div", In, [
|
|
2072
|
+
ya(Y("input", {
|
|
2040
2073
|
ref_key: "searchEl",
|
|
2041
|
-
ref:
|
|
2042
|
-
"onUpdate:modelValue":
|
|
2074
|
+
ref: Q,
|
|
2075
|
+
"onUpdate:modelValue": y[1] || (y[1] = (d) => O.value = d),
|
|
2043
2076
|
class: "sch-input fx-pop-q",
|
|
2044
2077
|
type: "search",
|
|
2045
2078
|
placeholder: "Search",
|
|
2046
2079
|
autocomplete: "off",
|
|
2047
2080
|
spellcheck: "false",
|
|
2048
2081
|
"aria-label": "Search",
|
|
2049
|
-
onKeydown:
|
|
2082
|
+
onKeydown: B
|
|
2050
2083
|
}, null, 544), [
|
|
2051
|
-
[
|
|
2084
|
+
[ma, O.value]
|
|
2052
2085
|
])
|
|
2053
2086
|
])) : W("", !0),
|
|
2054
|
-
e.searchable && !
|
|
2055
|
-
(
|
|
2056
|
-
key: "heading" in
|
|
2087
|
+
e.searchable && !J.value.length ? (N(), C("div", Rn, "No matches")) : W("", !0),
|
|
2088
|
+
(N(!0), C(He, null, pa(J.value, (d) => (N(), C(He, {
|
|
2089
|
+
key: "heading" in d ? `heading:${d.heading}` : `option:${d.option.value}`
|
|
2057
2090
|
}, [
|
|
2058
|
-
"heading" in
|
|
2091
|
+
"heading" in d ? (N(), C("div", On, U(d.heading), 1)) : (N(), C("div", {
|
|
2059
2092
|
key: 1,
|
|
2060
|
-
class:
|
|
2061
|
-
"is-on":
|
|
2062
|
-
"is-off":
|
|
2063
|
-
"is-new":
|
|
2093
|
+
class: pe(["fx-opt", {
|
|
2094
|
+
"is-on": b(d.option),
|
|
2095
|
+
"is-off": d.option.disabled,
|
|
2096
|
+
"is-new": d.option.command
|
|
2064
2097
|
}]),
|
|
2065
2098
|
role: "option",
|
|
2066
|
-
"aria-selected":
|
|
2067
|
-
onClick: (
|
|
2099
|
+
"aria-selected": b(d.option),
|
|
2100
|
+
onClick: (L) => P(d.option)
|
|
2068
2101
|
}, [
|
|
2069
|
-
|
|
2102
|
+
y[2] || (y[2] = Y("span", {
|
|
2070
2103
|
class: "fx-tick",
|
|
2071
2104
|
"aria-hidden": "true"
|
|
2072
2105
|
}, [
|
|
2073
|
-
|
|
2106
|
+
Y("svg", {
|
|
2074
2107
|
width: "11",
|
|
2075
2108
|
height: "11",
|
|
2076
2109
|
viewBox: "0 0 16 16",
|
|
2077
2110
|
fill: "none"
|
|
2078
2111
|
}, [
|
|
2079
|
-
|
|
2112
|
+
Y("path", {
|
|
2080
2113
|
d: "m3.5 8.4 3 3 6-7",
|
|
2081
2114
|
stroke: "currentColor",
|
|
2082
2115
|
"stroke-width": "2.2",
|
|
@@ -2085,11 +2118,11 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2085
2118
|
})
|
|
2086
2119
|
])
|
|
2087
2120
|
], -1)),
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
])) : (
|
|
2092
|
-
|
|
2121
|
+
k.value ? (N(), C("span", $n, [
|
|
2122
|
+
Y("b", null, U(d.option.label), 1),
|
|
2123
|
+
d.option.hint ? (N(), C("small", Yn, U(d.option.hint), 1)) : W("", !0)
|
|
2124
|
+
])) : (N(), C(He, { key: 1 }, [
|
|
2125
|
+
fa(U(d.option.label), 1)
|
|
2093
2126
|
], 64))
|
|
2094
2127
|
], 10, Tn))
|
|
2095
2128
|
], 64))), 128))
|
|
@@ -2098,7 +2131,7 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2098
2131
|
], 8, ["disabled"]))
|
|
2099
2132
|
], 2));
|
|
2100
2133
|
}
|
|
2101
|
-
}), xn = ["id", "aria-labelledby", "aria-label"],
|
|
2134
|
+
}), xn = ["id", "aria-labelledby", "aria-label"], We = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', _o = /* @__PURE__ */ Re({
|
|
2102
2135
|
__name: "ScheduleModal",
|
|
2103
2136
|
props: {
|
|
2104
2137
|
open: { type: Boolean },
|
|
@@ -2110,52 +2143,52 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2110
2143
|
},
|
|
2111
2144
|
emits: ["close"],
|
|
2112
2145
|
setup(e, { emit: a }) {
|
|
2113
|
-
const t = e, n = a, i =
|
|
2146
|
+
const t = e, n = a, i = A(null);
|
|
2114
2147
|
let s = null;
|
|
2115
2148
|
function l() {
|
|
2116
|
-
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2149
|
+
be(() => {
|
|
2150
|
+
const u = i.value;
|
|
2151
|
+
u && (u.querySelector(We) ?? u).focus();
|
|
2119
2152
|
});
|
|
2120
2153
|
}
|
|
2121
|
-
function o(
|
|
2154
|
+
function o(u) {
|
|
2122
2155
|
if (!t.open) return;
|
|
2123
|
-
if (
|
|
2124
|
-
|
|
2156
|
+
if (u.key === "Escape") {
|
|
2157
|
+
u.preventDefault(), n("close");
|
|
2125
2158
|
return;
|
|
2126
2159
|
}
|
|
2127
|
-
if (
|
|
2128
|
-
const
|
|
2129
|
-
if (!
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2160
|
+
if (u.key !== "Tab" || !i.value) return;
|
|
2161
|
+
const f = Array.from(i.value.querySelectorAll(We));
|
|
2162
|
+
if (!f.length) return;
|
|
2163
|
+
const H = f[0], $ = f[f.length - 1];
|
|
2164
|
+
u.shiftKey && document.activeElement === H ? (u.preventDefault(), $.focus()) : !u.shiftKey && document.activeElement === $ && (u.preventDefault(), H.focus());
|
|
2132
2165
|
}
|
|
2133
|
-
return
|
|
2166
|
+
return Ie(
|
|
2134
2167
|
() => t.open,
|
|
2135
|
-
(
|
|
2136
|
-
|
|
2168
|
+
(u) => {
|
|
2169
|
+
u ? (s = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (s == null || s.focus(), s = null);
|
|
2137
2170
|
},
|
|
2138
2171
|
{ immediate: !0 }
|
|
2139
|
-
),
|
|
2172
|
+
), Se(() => document.addEventListener("keydown", o)), Le(() => {
|
|
2140
2173
|
document.removeEventListener("keydown", o), s = null;
|
|
2141
|
-
}), (
|
|
2174
|
+
}), (u, f) => e.open ? (N(), C("div", {
|
|
2142
2175
|
key: 0,
|
|
2143
2176
|
class: "modal-overlay open",
|
|
2144
|
-
onClick:
|
|
2177
|
+
onClick: f[0] || (f[0] = ha((H) => n("close"), ["self"]))
|
|
2145
2178
|
}, [
|
|
2146
|
-
|
|
2179
|
+
Y("div", {
|
|
2147
2180
|
id: e.id,
|
|
2148
2181
|
ref_key: "panel",
|
|
2149
2182
|
ref: i,
|
|
2150
|
-
class:
|
|
2151
|
-
style:
|
|
2183
|
+
class: pe(["schedule-modal-panel", e.panelClass]),
|
|
2184
|
+
style: va(e.panelStyle),
|
|
2152
2185
|
role: "dialog",
|
|
2153
2186
|
"aria-modal": "true",
|
|
2154
2187
|
"aria-labelledby": e.labelledBy,
|
|
2155
2188
|
"aria-label": e.label,
|
|
2156
2189
|
tabindex: "-1"
|
|
2157
2190
|
}, [
|
|
2158
|
-
|
|
2191
|
+
ze(u.$slots, "default")
|
|
2159
2192
|
], 14, xn)
|
|
2160
2193
|
])) : W("", !0);
|
|
2161
2194
|
}
|
|
@@ -2163,40 +2196,40 @@ const kn = ["data-hierarchy", "data-size", "data-icon"], xo = /* @__PURE__ */ Le
|
|
|
2163
2196
|
export {
|
|
2164
2197
|
no as $,
|
|
2165
2198
|
No as A,
|
|
2166
|
-
|
|
2167
|
-
|
|
2199
|
+
Ne as B,
|
|
2200
|
+
Xn as C,
|
|
2168
2201
|
Ea as D,
|
|
2169
|
-
|
|
2202
|
+
Zn as E,
|
|
2170
2203
|
ro as F,
|
|
2171
2204
|
Mo as G,
|
|
2172
|
-
|
|
2205
|
+
Ha as H,
|
|
2173
2206
|
Ao as I,
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2207
|
+
Ho as J,
|
|
2208
|
+
wo as K,
|
|
2209
|
+
Je as L,
|
|
2210
|
+
w as M,
|
|
2211
|
+
F as N,
|
|
2179
2212
|
Sa as O,
|
|
2180
2213
|
Pa as P,
|
|
2181
|
-
|
|
2182
|
-
|
|
2214
|
+
xe as Q,
|
|
2215
|
+
Qn as R,
|
|
2183
2216
|
ko as S,
|
|
2184
2217
|
Lo as T,
|
|
2185
|
-
|
|
2186
|
-
|
|
2218
|
+
aa as U,
|
|
2219
|
+
Jn as V,
|
|
2187
2220
|
Po as W,
|
|
2188
|
-
|
|
2221
|
+
le as X,
|
|
2189
2222
|
Pn as Y,
|
|
2190
|
-
|
|
2223
|
+
re as Z,
|
|
2191
2224
|
ne as _,
|
|
2192
2225
|
Oo as a,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2226
|
+
so as a0,
|
|
2227
|
+
Oe as a1,
|
|
2228
|
+
to as a2,
|
|
2229
|
+
ao as a3,
|
|
2197
2230
|
io as a4,
|
|
2198
2231
|
hn as a5,
|
|
2199
|
-
|
|
2232
|
+
ie as a6,
|
|
2200
2233
|
vo as a7,
|
|
2201
2234
|
fo as a8,
|
|
2202
2235
|
ho as a9,
|
|
@@ -2206,13 +2239,13 @@ export {
|
|
|
2206
2239
|
Na as ad,
|
|
2207
2240
|
Vn as ae,
|
|
2208
2241
|
$a as af,
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2242
|
+
$e as ag,
|
|
2243
|
+
$o as ah,
|
|
2244
|
+
mn as ai,
|
|
2245
|
+
mo as aj,
|
|
2246
|
+
Ye as ak,
|
|
2247
|
+
fe as al,
|
|
2248
|
+
Me as am,
|
|
2216
2249
|
La as an,
|
|
2217
2250
|
xo as ao,
|
|
2218
2251
|
Bo as ap,
|
|
@@ -2222,13 +2255,13 @@ export {
|
|
|
2222
2255
|
Yo as at,
|
|
2223
2256
|
co as au,
|
|
2224
2257
|
lo as av,
|
|
2225
|
-
|
|
2258
|
+
se as aw,
|
|
2226
2259
|
uo as ax,
|
|
2227
2260
|
M as b,
|
|
2228
2261
|
To as c,
|
|
2229
2262
|
V as d,
|
|
2230
2263
|
Gn as e,
|
|
2231
|
-
|
|
2264
|
+
c as f,
|
|
2232
2265
|
cn as g,
|
|
2233
2266
|
bo as h,
|
|
2234
2267
|
Ca as i,
|
|
@@ -2237,16 +2270,16 @@ export {
|
|
|
2237
2270
|
Do as l,
|
|
2238
2271
|
go as m,
|
|
2239
2272
|
Eo as n,
|
|
2240
|
-
|
|
2273
|
+
m as o,
|
|
2241
2274
|
Co as p,
|
|
2242
|
-
|
|
2275
|
+
Ce as q,
|
|
2243
2276
|
oo as r,
|
|
2244
2277
|
Aa as s,
|
|
2245
2278
|
eo as t,
|
|
2246
|
-
|
|
2279
|
+
ke as u,
|
|
2247
2280
|
jn as v,
|
|
2248
|
-
|
|
2281
|
+
qn as w,
|
|
2249
2282
|
Ro as x,
|
|
2250
2283
|
Kn as y,
|
|
2251
|
-
|
|
2284
|
+
Ge as z
|
|
2252
2285
|
};
|