@feedmepos/mf-hrm-portal 2.3.0-dev.25 → 2.3.0-dev.26
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-3wBWXPam.js → ApprovalCodeList-BErlk4ha.js} +4 -4
- package/dist/{AuditLogList-Dlph1SCP.js → AuditLogList-Chvwt0ar.js} +4 -4
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CJW-spxu.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-2u2WyZdb.js} +2 -2
- package/dist/{EmployeeList-RAaFG8p6.js → EmployeeList-CGD1h2OK.js} +6 -6
- package/dist/{FormItem.vue_vue_type_script_setup_true_lang-BaMXEfJr.js → FormItem.vue_vue_type_script_setup_true_lang-BuGNer42.js} +1 -1
- package/dist/{GrantUserList-CxL7ELvs.js → GrantUserList-DzpqTaSY.js} +5 -5
- package/dist/{Main-Ccg399Ra.js → Main-CPyn7NFE.js} +5 -5
- package/dist/{Main-D19GDYjL.js → Main-DAGEZQlr.js} +2 -2
- package/dist/{Main-DQcp3NRa.js → Main-iNdaHQX2.js} +9 -9
- package/dist/{PermissionSetList-CdQjM54-.js → PermissionSetList-Db8_PEwm.js} +5 -5
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CzUGRJe4.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BjUf9foK.js} +985 -985
- package/dist/{RoleList-DTyp8dcV.js → RoleList-CQi7_guB.js} +7 -7
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BOg6mQYF.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-D5wnGhBH.js} +47 -47
- package/dist/{ScheduleGeneralPage-Cn_jBdfC.js → ScheduleGeneralPage-Box_itY2.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-BbSv92Ry.js → ScheduleModal.vue_vue_type_script_setup_true_lang-3XOtfHXG.js} +511 -493
- package/dist/{SchedulePage-CTAIOE59.js → SchedulePage-D5ech6qY.js} +7318 -7345
- package/dist/{SchedulePositionPage-BIXuH4Pk.js → SchedulePositionPage-Df5K6dRn.js} +8 -8
- package/dist/{SelectFilter-DvWwcdKo.js → SelectFilter-CnL5hOUi.js} +1 -1
- package/dist/{TeamMemberList-CqTvtoGc.js → TeamMemberList-BJDrGXAU.js} +7 -7
- package/dist/{TimesheetList-CanJSlhF.js → TimesheetList-DjasY9Ga.js} +6 -6
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-UAdvuPmt.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-BipggXKS.js} +2 -2
- package/dist/{app-CTAbM1YW.js → app-6RyACUtu.js} +8 -8
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-Bv1ruj1a.js → dayjs.min-dR2BNXww.js} +1 -1
- package/dist/{employee-D-jow9b7.js → employee-CZII8yO4.js} +3 -3
- package/dist/{iteration-KG5GZWLu.js → iteration-BrBn3q_q.js} +1 -1
- package/dist/{lodash-BCapmkFh.js → lodash-CiDhR4Jm.js} +1 -1
- package/dist/{role-Dx1RfQ1m.js → role-DzoAHzTj.js} +1 -1
- package/dist/{rule-D8e9LFze.js → rule-DucHSUev.js} +2 -2
- package/dist/src/api/schedule/index.d.ts +5 -0
- package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +17 -0
- package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +3 -3
- package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +23 -4
- package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +2 -0
- package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +1 -1
- package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +17 -0
- package/dist/src/views/scheduling/schedule-state.d.ts +12 -12
- package/dist/src/views/scheduling/schedule-store.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useReportPermissions-DXiMU0Is.js → useReportPermissions-B0VLybQf.js} +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { onMounted as Ie, onBeforeUnmount as Te, ref as
|
|
1
|
+
import { onMounted as Ie, onBeforeUnmount as Te, ref as P, reactive as I, shallowRef as He, watch as Re, computed as _, defineComponent as Oe, createElementBlock as k, openBlock as N, renderSlot as Ke, useAttrs as da, nextTick as be, normalizeClass as pe, createElementVNode as B, createBlock as ca, mergeProps as ma, toDisplayString as G, Teleport as ya, createCommentVNode as j, withDirectives as pa, vModelText as fa, Fragment as Ae, renderList as ha, createTextVNode as va, withModifiers as ga, normalizeStyle as Da } from "vue";
|
|
2
2
|
import { useRoute as wa, useRouter as Ha } from "vue-router";
|
|
3
3
|
import { useCoreStore as Ge } from "@feedmepos/mf-common";
|
|
4
|
-
import { g, b as
|
|
5
|
-
import { E as
|
|
6
|
-
import { t as $e, q as Ea } from "./rule-
|
|
4
|
+
import { g as D, b as f, u as Aa } from "./restaurant-D2mfKHaH.js";
|
|
5
|
+
import { E as Ne, u as je } from "./employee-CZII8yO4.js";
|
|
6
|
+
import { t as $e, q as Ea } from "./rule-DucHSUev.js";
|
|
7
7
|
function Qn(e) {
|
|
8
8
|
let a = null;
|
|
9
9
|
function t() {
|
|
@@ -19,7 +19,7 @@ function Qn(e) {
|
|
|
19
19
|
window.removeEventListener("resize", t), a && (a.style.height = "");
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function ke(e) {
|
|
23
23
|
const [a, t] = String(e || "0:0").split(":").map(Number);
|
|
24
24
|
return (Number.isFinite(a) ? a : 0) * 60 + (Number.isFinite(t) ? t : 0);
|
|
25
25
|
}
|
|
@@ -28,93 +28,93 @@ function Pa(e) {
|
|
|
28
28
|
return `${String(Math.floor(a / 60)).padStart(2, "0")}:${String(a % 60).padStart(2, "0")}`;
|
|
29
29
|
}
|
|
30
30
|
function ba(e, a) {
|
|
31
|
-
const t =
|
|
32
|
-
let n =
|
|
31
|
+
const t = ke(e);
|
|
32
|
+
let n = ke(a);
|
|
33
33
|
return n <= t && (n += 1440), [t, n];
|
|
34
34
|
}
|
|
35
35
|
function Qe(e, a) {
|
|
36
36
|
const [t, n] = ba(e, a);
|
|
37
37
|
return Math.max(0, n - t);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const a = (
|
|
41
|
-
return n ? `${i}:${String(n).padStart(2, "0")}${
|
|
39
|
+
function Na(e) {
|
|
40
|
+
const a = (ke(e) % 1440 + 1440) % 1440, t = Math.floor(a / 60), n = a % 60, o = t < 12 ? "am" : "pm", i = t % 12 || 12;
|
|
41
|
+
return n ? `${i}:${String(n).padStart(2, "0")}${o}` : `${i}${o}`;
|
|
42
42
|
}
|
|
43
43
|
function Xn(e) {
|
|
44
|
-
return
|
|
44
|
+
return Na(Pa(e % 1440));
|
|
45
45
|
}
|
|
46
46
|
function Xe(e) {
|
|
47
47
|
const a = Array.isArray(e) ? e : e == null ? void 0 : e.breaks;
|
|
48
48
|
return a != null && a.length ? a.reduce((t, n) => {
|
|
49
49
|
if (n.type === "DURATION") return t + n.minutes;
|
|
50
|
-
const [
|
|
51
|
-
let d =
|
|
50
|
+
const [o, i] = n.startTime.split(":").map(Number), [l, s] = n.endTime.split(":").map(Number);
|
|
51
|
+
let d = l * 60 + s - (o * 60 + i);
|
|
52
52
|
return d < 0 && (d += 24 * 60), t + d;
|
|
53
53
|
}, 0) : Math.max(0, e && !Array.isArray(e) ? e.breakMins ?? 0 : 0);
|
|
54
54
|
}
|
|
55
55
|
function Jn(e, a) {
|
|
56
|
-
var
|
|
57
|
-
const t = a ?? Qe(e.start, e.end), n = (
|
|
56
|
+
var o;
|
|
57
|
+
const t = a ?? Qe(e.start, e.end), n = (o = e.breaks) != null && o.length ? e.breaks.reduce((i, l) => i + (l.breakPayType === "UNPAID" ? Xe([l]) : 0), 0) : Math.max(0, e.breakMins ?? 0);
|
|
58
58
|
return Math.max(0, t - Math.min(t, n));
|
|
59
59
|
}
|
|
60
60
|
function Zn(e) {
|
|
61
61
|
const a = Math.max(0, Math.round(e ?? 0));
|
|
62
62
|
return a ? [{ type: "DURATION", minutes: a, breakPayType: "UNPAID" }] : [];
|
|
63
63
|
}
|
|
64
|
-
const te = 500,
|
|
64
|
+
const te = 500, ka = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
65
65
|
async completeOnboarding(e, a) {
|
|
66
|
-
return
|
|
67
|
-
await
|
|
66
|
+
return D(
|
|
67
|
+
await f(`restaurants/${e}/schedules`).post("onboarding", a)
|
|
68
68
|
);
|
|
69
69
|
},
|
|
70
70
|
async listEmployeeProfiles(e) {
|
|
71
|
-
return
|
|
72
|
-
await
|
|
71
|
+
return D(
|
|
72
|
+
await f("schedules").get("employees", {
|
|
73
73
|
params: e != null && e.length ? { ids: e.join(",") } : void 0
|
|
74
74
|
})
|
|
75
75
|
);
|
|
76
76
|
},
|
|
77
77
|
async listEmployeeConfigs(e) {
|
|
78
|
-
return
|
|
79
|
-
await
|
|
78
|
+
return D(
|
|
79
|
+
await f(`restaurants/${e}/schedules`).get("employee-configs")
|
|
80
80
|
);
|
|
81
81
|
},
|
|
82
82
|
async saveEmployeeConfigs(e, a) {
|
|
83
|
-
return
|
|
84
|
-
await
|
|
83
|
+
return D(
|
|
84
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
85
85
|
"employee-configs/reorder",
|
|
86
86
|
a
|
|
87
87
|
)
|
|
88
88
|
);
|
|
89
89
|
},
|
|
90
90
|
async getSettings(e) {
|
|
91
|
-
return
|
|
92
|
-
await
|
|
91
|
+
return D(
|
|
92
|
+
await f(`restaurants/${e}/schedules`).get("settings")
|
|
93
93
|
);
|
|
94
94
|
},
|
|
95
95
|
async saveSettings(e, a) {
|
|
96
|
-
return
|
|
97
|
-
await
|
|
96
|
+
return D(
|
|
97
|
+
await f(`restaurants/${e}/schedules`).post("settings", a)
|
|
98
98
|
);
|
|
99
99
|
},
|
|
100
100
|
async generateAutoSchedule(e, a) {
|
|
101
|
-
return
|
|
102
|
-
await
|
|
101
|
+
return D(
|
|
102
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
103
103
|
"auto-schedule/generate",
|
|
104
104
|
a
|
|
105
105
|
)
|
|
106
106
|
);
|
|
107
107
|
},
|
|
108
108
|
async getAutoScheduleCapabilities(e) {
|
|
109
|
-
return
|
|
110
|
-
await
|
|
109
|
+
return D(
|
|
110
|
+
await f(`restaurants/${e}/schedules`).get(
|
|
111
111
|
"auto-schedule/capabilities"
|
|
112
112
|
)
|
|
113
113
|
);
|
|
114
114
|
},
|
|
115
115
|
async applyAutoSchedule(e, a) {
|
|
116
|
-
return
|
|
117
|
-
await
|
|
116
|
+
return D(
|
|
117
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
118
118
|
"auto-schedule/apply",
|
|
119
119
|
a
|
|
120
120
|
)
|
|
@@ -122,75 +122,75 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
122
122
|
},
|
|
123
123
|
/** One outlet's whole board over `[from, to]` (inclusive, 'YYYY-MM-DD'). */
|
|
124
124
|
async readBoard(e, a, t) {
|
|
125
|
-
return
|
|
126
|
-
await
|
|
125
|
+
return D(
|
|
126
|
+
await f(`restaurants/${e}/schedules`).get("board", {
|
|
127
127
|
params: { from: a, to: t }
|
|
128
128
|
})
|
|
129
129
|
);
|
|
130
130
|
},
|
|
131
131
|
async createTimeOff(e, a) {
|
|
132
|
-
return
|
|
133
|
-
await
|
|
132
|
+
return D(
|
|
133
|
+
await f(`restaurants/${e}/schedules`).post("time-off", a)
|
|
134
134
|
);
|
|
135
135
|
},
|
|
136
136
|
async updateTimeOffStatus(e, a, t) {
|
|
137
|
-
return
|
|
138
|
-
await
|
|
137
|
+
return D(
|
|
138
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
139
139
|
`time-off/${a}/status`,
|
|
140
140
|
t
|
|
141
141
|
)
|
|
142
142
|
);
|
|
143
143
|
},
|
|
144
144
|
async deleteTimeOff(e, a) {
|
|
145
|
-
await
|
|
145
|
+
await f(`restaurants/${e}/schedules`).delete(`time-off/${a}`);
|
|
146
146
|
},
|
|
147
147
|
/** Creates or updates the employee's shared business-level scheduling profile. */
|
|
148
148
|
async createEmployeeProfile(e, a) {
|
|
149
|
-
return
|
|
149
|
+
return D(await f("schedules").post("employees", a));
|
|
150
150
|
},
|
|
151
151
|
/** Edits the employee's shared business-level scheduling profile. */
|
|
152
152
|
async updateEmployeeProfile(e, a, t) {
|
|
153
|
-
return
|
|
154
|
-
await
|
|
153
|
+
return D(
|
|
154
|
+
await f("schedules").post("employees", { employeeId: a, ...t })
|
|
155
155
|
);
|
|
156
156
|
},
|
|
157
157
|
async validatePosAccess(e) {
|
|
158
|
-
await
|
|
158
|
+
await f("schedules").post("employees/validate-pos-access", e);
|
|
159
159
|
},
|
|
160
160
|
/** Positions are shared across the business. */
|
|
161
161
|
async createPosition(e) {
|
|
162
|
-
return
|
|
162
|
+
return D(await f("schedules").post("positions", e));
|
|
163
163
|
},
|
|
164
164
|
async updatePosition(e, a) {
|
|
165
|
-
return
|
|
165
|
+
return D(await f("schedules").post(`positions/${e}`, a));
|
|
166
166
|
},
|
|
167
167
|
/** Deleting one position is `deletePositions` with a single-id array — the backend's
|
|
168
168
|
* `DELETE positions/:id` route is gone; this is now `DELETE positions?ids=`. */
|
|
169
169
|
async deletePosition(e) {
|
|
170
|
-
await
|
|
170
|
+
await f("schedules").delete("positions", {
|
|
171
171
|
params: { ids: e }
|
|
172
172
|
});
|
|
173
173
|
},
|
|
174
174
|
/** Creates one flat demand interval. */
|
|
175
175
|
async createDemand(e, a) {
|
|
176
|
-
return
|
|
177
|
-
await
|
|
176
|
+
return D(
|
|
177
|
+
await f(`restaurants/${e}/schedules`).post("demands", a)
|
|
178
178
|
);
|
|
179
179
|
},
|
|
180
180
|
/** Deletes a batch of demands in one request — e.g. `saveDemand` replacing a whole
|
|
181
181
|
* day/weekday's demand rows wholesale. Deleting one demand is just this with a single-id
|
|
182
182
|
* array. */
|
|
183
183
|
async deleteDemands(e, a) {
|
|
184
|
-
return
|
|
185
|
-
await
|
|
184
|
+
return D(
|
|
185
|
+
await f(`restaurants/${e}/schedules`).delete("demands", {
|
|
186
186
|
params: { ids: a.join(",") }
|
|
187
187
|
})
|
|
188
188
|
);
|
|
189
189
|
},
|
|
190
190
|
/** Atomically replaces one date/weekday's flattened demand rows. */
|
|
191
191
|
async replaceDemands(e, a) {
|
|
192
|
-
return
|
|
193
|
-
await
|
|
192
|
+
return D(
|
|
193
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
194
194
|
"demands/replace",
|
|
195
195
|
a
|
|
196
196
|
)
|
|
@@ -198,8 +198,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
198
198
|
},
|
|
199
199
|
/** Atomically replaces several date/weekday demand generations. */
|
|
200
200
|
async bulkReplaceDemands(e, a) {
|
|
201
|
-
return
|
|
202
|
-
await
|
|
201
|
+
return D(
|
|
202
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
203
203
|
"demands/bulk-replace",
|
|
204
204
|
a
|
|
205
205
|
)
|
|
@@ -207,8 +207,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
207
207
|
},
|
|
208
208
|
/** Replaces one date's note/holiday-mark. All three fields back to empty/false clears it. */
|
|
209
209
|
async saveScheduleDay(e, a, t) {
|
|
210
|
-
return
|
|
211
|
-
await
|
|
210
|
+
return D(
|
|
211
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
212
212
|
`days/${a}`,
|
|
213
213
|
t
|
|
214
214
|
)
|
|
@@ -216,13 +216,13 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
216
216
|
},
|
|
217
217
|
/** A one-off shift assignment. */
|
|
218
218
|
async createAssignment(e, a) {
|
|
219
|
-
return
|
|
220
|
-
await
|
|
219
|
+
return D(
|
|
220
|
+
await f(`restaurants/${e}/schedules`).post("assignments", a)
|
|
221
221
|
);
|
|
222
222
|
},
|
|
223
223
|
async updateAssignment(e, a, t) {
|
|
224
|
-
return
|
|
225
|
-
await
|
|
224
|
+
return D(
|
|
225
|
+
await f(`restaurants/${e}/schedules`).patch(
|
|
226
226
|
`assignments/${a}`,
|
|
227
227
|
t
|
|
228
228
|
)
|
|
@@ -230,8 +230,8 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
230
230
|
},
|
|
231
231
|
/** Atomically applies assignment updates, creates, and deletes used by moves and swaps. */
|
|
232
232
|
async bulkSaveAssignments(e, a) {
|
|
233
|
-
return
|
|
234
|
-
await
|
|
233
|
+
return D(
|
|
234
|
+
await f(`restaurants/${e}/schedules`).post(
|
|
235
235
|
"assignments/bulk",
|
|
236
236
|
a
|
|
237
237
|
)
|
|
@@ -239,31 +239,40 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
239
239
|
},
|
|
240
240
|
/** Replaces demand and/or assignments in one backend transaction. */
|
|
241
241
|
async copySchedule(e, a) {
|
|
242
|
-
return
|
|
243
|
-
await
|
|
242
|
+
return D(
|
|
243
|
+
await f(`restaurants/${e}/schedules`).post("copy", a)
|
|
244
244
|
);
|
|
245
245
|
},
|
|
246
246
|
/** Clears demand and/or assignments in one backend transaction. */
|
|
247
247
|
async clearSchedule(e, a) {
|
|
248
|
-
return
|
|
249
|
-
await
|
|
248
|
+
return D(
|
|
249
|
+
await f(`restaurants/${e}/schedules`).post("clear", a)
|
|
250
250
|
);
|
|
251
251
|
},
|
|
252
252
|
/** Deletes a batch of assignments in one request — e.g. a shift split into several segments
|
|
253
253
|
* getting replaced wholesale. Deleting one assignment is just this with a single-id
|
|
254
254
|
* array. */
|
|
255
255
|
async deleteAssignments(e, a) {
|
|
256
|
-
return
|
|
257
|
-
await
|
|
256
|
+
return D(
|
|
257
|
+
await f(`restaurants/${e}/schedules`).delete("assignments", {
|
|
258
258
|
params: { ids: a.join(",") }
|
|
259
259
|
})
|
|
260
260
|
);
|
|
261
261
|
},
|
|
262
|
+
/** Removes all assignments for an employee from the inclusive removal date onward. */
|
|
263
|
+
async deleteEmployeeFutureAssignments(e, a, t) {
|
|
264
|
+
return D(
|
|
265
|
+
await f(`restaurants/${e}/schedules`).delete(
|
|
266
|
+
"assignments/employee-future",
|
|
267
|
+
{ params: { employeeId: a, from: t } }
|
|
268
|
+
)
|
|
269
|
+
);
|
|
270
|
+
},
|
|
262
271
|
/** Flips a batch of assignments to one status in a single request — e.g. Publish sending
|
|
263
272
|
* every DRAFT shift on the board to PUBLISHED at once. */
|
|
264
273
|
async bulkUpdateAssignmentStatus(e, a) {
|
|
265
|
-
return
|
|
266
|
-
await
|
|
274
|
+
return D(
|
|
275
|
+
await f(`restaurants/${e}/schedules`).patch(
|
|
267
276
|
"assignments/bulk-status",
|
|
268
277
|
a
|
|
269
278
|
)
|
|
@@ -271,14 +280,14 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
271
280
|
}
|
|
272
281
|
}, Ze = {
|
|
273
282
|
payload: He(null),
|
|
274
|
-
loading:
|
|
275
|
-
rosterLoading:
|
|
276
|
-
loadError:
|
|
277
|
-
scheduleSetupCompleted:
|
|
278
|
-
dataVersion:
|
|
279
|
-
outletId:
|
|
280
|
-
restaurantEmployees:
|
|
281
|
-
employeeConfigs:
|
|
283
|
+
loading: P(!1),
|
|
284
|
+
rosterLoading: P(!1),
|
|
285
|
+
loadError: P(null),
|
|
286
|
+
scheduleSetupCompleted: P(!1),
|
|
287
|
+
dataVersion: P(0),
|
|
288
|
+
outletId: P(""),
|
|
289
|
+
restaurantEmployees: P([]),
|
|
290
|
+
employeeConfigs: P([]),
|
|
282
291
|
employeeOutletIds: He({}),
|
|
283
292
|
businessEmployees: He([]),
|
|
284
293
|
positions: I([]),
|
|
@@ -322,19 +331,19 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
322
331
|
}
|
|
323
332
|
})
|
|
324
333
|
}, {
|
|
325
|
-
payload:
|
|
334
|
+
payload: r,
|
|
326
335
|
loading: Ye,
|
|
327
336
|
rosterLoading: Be,
|
|
328
337
|
loadError: fe,
|
|
329
338
|
scheduleSetupCompleted: he,
|
|
330
|
-
dataVersion:
|
|
339
|
+
dataVersion: J,
|
|
331
340
|
outletId: m,
|
|
332
341
|
restaurantEmployees: re,
|
|
333
|
-
employeeConfigs:
|
|
342
|
+
employeeConfigs: z,
|
|
334
343
|
employeeOutletIds: qe,
|
|
335
344
|
businessEmployees: Ee,
|
|
336
345
|
positions: Sa,
|
|
337
|
-
positionRecords:
|
|
346
|
+
positionRecords: U,
|
|
338
347
|
rolePositions: eo,
|
|
339
348
|
outlet: Ca,
|
|
340
349
|
locationOptions: _e,
|
|
@@ -342,7 +351,7 @@ const te = 500, Na = 10, xe = 6, qn = 1500, Je = 1e6, H = {
|
|
|
342
351
|
compensationGroupMeta: ao,
|
|
343
352
|
existingStaff: to,
|
|
344
353
|
shiftTemplates: no,
|
|
345
|
-
rules:
|
|
354
|
+
rules: S
|
|
346
355
|
} = Ze;
|
|
347
356
|
function Ma() {
|
|
348
357
|
const e = Ze.rules;
|
|
@@ -372,16 +381,16 @@ function Ce(e) {
|
|
|
372
381
|
}
|
|
373
382
|
function oo(e, a = /* @__PURE__ */ new Date()) {
|
|
374
383
|
const t = se(Ce(a), e * Se);
|
|
375
|
-
return Array.from({ length: Se }, (n,
|
|
384
|
+
return Array.from({ length: Se }, (n, o) => se(t, o));
|
|
376
385
|
}
|
|
377
386
|
function so(e, a) {
|
|
378
|
-
const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Ce(e)),
|
|
379
|
-
return Math.trunc((
|
|
387
|
+
const t = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), n = t(Ce(e)), o = t(Ce(a));
|
|
388
|
+
return Math.trunc((o - n) / (Se * 24 * 60 * 60 * 1e3));
|
|
380
389
|
}
|
|
381
|
-
const
|
|
382
|
-
let
|
|
390
|
+
const V = La;
|
|
391
|
+
let Z = null, q = null, Q = null, ne = 0, ve = null;
|
|
383
392
|
function Fe(e) {
|
|
384
|
-
return e === m.value ? !1 : (Ma(), m.value = e,
|
|
393
|
+
return e === m.value ? !1 : (Ma(), m.value = e, r.value = null, Z = null, q = null, fe.value = null, ve = null, he.value = !1, re.value = [], z.value = [], Q = null, ne += 1, J.value += 1, !0);
|
|
385
394
|
}
|
|
386
395
|
async function Me(e) {
|
|
387
396
|
if (!(!e || ve === e)) {
|
|
@@ -394,50 +403,60 @@ async function Me(e) {
|
|
|
394
403
|
}
|
|
395
404
|
}
|
|
396
405
|
async function Ia(e) {
|
|
397
|
-
const a = await
|
|
406
|
+
const a = await Ne.readEmployeesPage({
|
|
398
407
|
limit: te,
|
|
399
408
|
offset: 0,
|
|
400
409
|
restaurantIds: [e]
|
|
401
410
|
});
|
|
402
|
-
e === m.value && (re.value = a.items,
|
|
403
|
-
e === m.value && (qe.value = t,
|
|
411
|
+
e === m.value && (re.value = a.items, z.value = await H.listEmployeeConfigs(e), ve = e, J.value += 1, xa().then((t) => {
|
|
412
|
+
e === m.value && (qe.value = t, J.value += 1);
|
|
404
413
|
}));
|
|
405
414
|
}
|
|
406
415
|
async function Ta(e) {
|
|
407
416
|
const a = m.value;
|
|
408
417
|
if (!a || !e.length) return;
|
|
409
418
|
const t = await H.saveEmployeeConfigs(a, { configs: e });
|
|
410
|
-
|
|
419
|
+
z.value = t, J.value += 1;
|
|
411
420
|
}
|
|
412
421
|
async function io(e) {
|
|
413
422
|
const a = m.value;
|
|
414
423
|
if (!a) throw new Error("No outlet selected");
|
|
415
424
|
const t = await H.saveSettings(a, e);
|
|
416
|
-
return m.value === a &&
|
|
425
|
+
return m.value === a && r.value && (r.value = { ...r.value, settings: t }), t;
|
|
417
426
|
}
|
|
418
427
|
function ea() {
|
|
419
|
-
!he.value &&
|
|
428
|
+
!he.value && r.value && r.value.demands.length > 0 && r.value.assignments.length > 0 && (he.value = !0);
|
|
420
429
|
}
|
|
421
430
|
async function Ra(e, a) {
|
|
422
|
-
const t =
|
|
431
|
+
const t = z.value.find((o) => o.employeeId === e), n = (t == null ? void 0 : t.displayOrder) ?? (z.value.some((o) => o.displayOrder !== null) ? Math.max(
|
|
423
432
|
0,
|
|
424
|
-
...
|
|
425
|
-
(
|
|
426
|
-
).map((
|
|
433
|
+
...z.value.filter(
|
|
434
|
+
(o) => o.displayOrder !== null
|
|
435
|
+
).map((o) => o.displayOrder)
|
|
427
436
|
) + 100 : null);
|
|
428
437
|
await Ta([{ employeeId: e, enabled: a, displayOrder: n }]);
|
|
429
438
|
}
|
|
439
|
+
async function ro(e, a = V(/* @__PURE__ */ new Date())) {
|
|
440
|
+
const t = m.value;
|
|
441
|
+
if (!t) throw new Error("No outlet selected");
|
|
442
|
+
await H.deleteEmployeeFutureAssignments(t, e, a), r.value && (r.value = {
|
|
443
|
+
...r.value,
|
|
444
|
+
assignments: r.value.assignments.filter(
|
|
445
|
+
(n) => n.employeeId !== e || n.date < a
|
|
446
|
+
)
|
|
447
|
+
});
|
|
448
|
+
}
|
|
430
449
|
async function Le() {
|
|
431
450
|
const e = m.value;
|
|
432
451
|
e && (ve = null, await Me(e));
|
|
433
452
|
}
|
|
434
453
|
async function Oa(e, a) {
|
|
435
|
-
const t = je(), n = (await
|
|
454
|
+
const t = je(), n = (await X(!0)).find((s) => s._id === e);
|
|
436
455
|
if (!n) throw new Error("Could not find this employee");
|
|
437
|
-
const
|
|
438
|
-
restaurantId:
|
|
439
|
-
roleId:
|
|
440
|
-
})), i = a(
|
|
456
|
+
const o = n.restaurantRole.map((s) => ({
|
|
457
|
+
restaurantId: s.restaurantId,
|
|
458
|
+
roleId: s.roleId
|
|
459
|
+
})), i = a(o);
|
|
441
460
|
if (!i.length)
|
|
442
461
|
throw new Error(
|
|
443
462
|
"An employee must keep at least 1 location, otherwise they are deleted. To delete them, use the Employee page."
|
|
@@ -445,84 +464,82 @@ async function Oa(e, a) {
|
|
|
445
464
|
(n.isMasterUser ? "master" : "user") === "master" ? await t.updateMasterEmployee(e, {
|
|
446
465
|
user: { name: n.name, passcode: n.passcode, code: n.code ?? "" },
|
|
447
466
|
roles: i,
|
|
448
|
-
previousRoles:
|
|
467
|
+
previousRoles: o
|
|
449
468
|
}) : await t.updateEmployee(e, {
|
|
450
469
|
user: { name: n.name, passcode: n.passcode },
|
|
451
470
|
roles: i,
|
|
452
|
-
previousRoles:
|
|
453
|
-
}), await
|
|
454
|
-
}
|
|
455
|
-
async function
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
...i.filter((
|
|
459
|
-
...
|
|
460
|
-
]), n && m.value &&
|
|
461
|
-
}
|
|
462
|
-
async function
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
);
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (d) {
|
|
474
|
-
const f = Ea(), D = f.getPermissionAssignmentByUserId(d.id) ?? await f.readPermissionAssignmentByUserId(d.id), C = a.masterUser ? {
|
|
471
|
+
previousRoles: o
|
|
472
|
+
}), await X(!0);
|
|
473
|
+
}
|
|
474
|
+
async function lo(e, a, t = "", n = !0) {
|
|
475
|
+
const o = [...new Set(a.filter(Boolean))];
|
|
476
|
+
o.length && (await Oa(e, (i) => [
|
|
477
|
+
...i.filter((l) => !o.includes(l.restaurantId)),
|
|
478
|
+
...o.map((l) => ({ restaurantId: l, roleId: t }))
|
|
479
|
+
]), n && m.value && o.includes(m.value) && await Ra(e, !0), await Le());
|
|
480
|
+
}
|
|
481
|
+
async function uo(e, a, t) {
|
|
482
|
+
const n = je(), o = (t == null ? void 0 : t._id) === e ? t : (await X(!0)).find((g) => g._id === e);
|
|
483
|
+
if (!o) throw new Error("Could not find this employee");
|
|
484
|
+
const i = (g) => g.slice().sort((A, O) => A.restaurantId.localeCompare(O.restaurantId)).map((A) => `${A.restaurantId}:${A.roleId}`).join("|"), l = i(o.restaurantRole) !== i(a.roles), s = o.name !== a.name || o.passcode !== a.passcode || o.isMasterUser !== a.masterUser || a.masterUser && (o.code ?? "") !== a.masterCode;
|
|
485
|
+
if (!l && !s) return;
|
|
486
|
+
const d = o.restaurantRole.map((g) => ({
|
|
487
|
+
restaurantId: g.restaurantId,
|
|
488
|
+
roleId: g.roleId
|
|
489
|
+
})), v = o.isMasterUser ? (await $e.readTeamMembers()).find((g) => g.doc.posUserId === e) : void 0;
|
|
490
|
+
if (v) {
|
|
491
|
+
const g = Ea(), A = g.getPermissionAssignmentByUserId(v.id) ?? await g.readPermissionAssignmentByUserId(v.id), O = a.masterUser ? {
|
|
475
492
|
code: a.masterCode,
|
|
476
493
|
name: a.name,
|
|
477
494
|
passcode: a.passcode,
|
|
478
495
|
roles: a.roles
|
|
479
496
|
} : null;
|
|
480
|
-
await $e.updateTeamMember(
|
|
481
|
-
permissions:
|
|
482
|
-
customPermissions: (
|
|
483
|
-
permissionSetIds: (
|
|
484
|
-
posUser:
|
|
485
|
-
}), await
|
|
497
|
+
await $e.updateTeamMember(v.id, {
|
|
498
|
+
permissions: v.permissions,
|
|
499
|
+
customPermissions: (A == null ? void 0 : A.customPermissions) ?? v.permissions,
|
|
500
|
+
permissionSetIds: (A == null ? void 0 : A.permissionSetIds) ?? v.doc.permissionSetIds ?? [],
|
|
501
|
+
posUser: O
|
|
502
|
+
}), await X(!0), await Le();
|
|
486
503
|
return;
|
|
487
504
|
}
|
|
488
505
|
if (a.masterUser) {
|
|
489
|
-
const
|
|
506
|
+
const g = {
|
|
490
507
|
user: { name: a.name, passcode: a.passcode, code: a.masterCode },
|
|
491
508
|
roles: a.roles,
|
|
492
|
-
previousRoles:
|
|
509
|
+
previousRoles: d
|
|
493
510
|
};
|
|
494
|
-
|
|
511
|
+
o.isMasterUser ? await n.updateMasterEmployee(e, g) : await n.migrateToMasterUser(e, g);
|
|
495
512
|
} else
|
|
496
|
-
|
|
497
|
-
user: { name:
|
|
513
|
+
o.isMasterUser ? await n.updateMasterEmployee(e, {
|
|
514
|
+
user: { name: o.name, passcode: o.passcode, code: o.code ?? "" },
|
|
498
515
|
roles: [],
|
|
499
|
-
previousRoles:
|
|
500
|
-
}) : await
|
|
516
|
+
previousRoles: d
|
|
517
|
+
}) : await n.updateEmployee(e, {
|
|
501
518
|
user: { name: a.name, passcode: a.passcode },
|
|
502
519
|
roles: a.roles,
|
|
503
|
-
previousRoles:
|
|
520
|
+
previousRoles: d
|
|
504
521
|
});
|
|
505
|
-
await
|
|
522
|
+
await X(!0), await Le();
|
|
506
523
|
}
|
|
507
524
|
let ae = null;
|
|
508
525
|
async function $a() {
|
|
509
|
-
const e = await
|
|
526
|
+
const e = await Ne.readEmployeesPage({
|
|
510
527
|
limit: te,
|
|
511
528
|
offset: 0,
|
|
512
529
|
includeEmptyPasscode: !0
|
|
513
|
-
}), a = Math.min(
|
|
530
|
+
}), a = Math.min(ka, Math.ceil(e.total / te)), t = await Promise.all(
|
|
514
531
|
Array.from(
|
|
515
532
|
{ length: Math.max(0, a - 1) },
|
|
516
|
-
(n,
|
|
533
|
+
(n, o) => Ne.readEmployeesPage({
|
|
517
534
|
limit: te,
|
|
518
|
-
offset: (
|
|
535
|
+
offset: (o + 1) * te,
|
|
519
536
|
includeEmptyPasscode: !0
|
|
520
537
|
})
|
|
521
538
|
)
|
|
522
539
|
);
|
|
523
540
|
return [...e.items, ...t.flatMap((n) => n.items)];
|
|
524
541
|
}
|
|
525
|
-
function
|
|
542
|
+
function X(e = !1) {
|
|
526
543
|
if (!e) {
|
|
527
544
|
if (ae) return ae;
|
|
528
545
|
if (Ee.value.length) return Promise.resolve(Ee.value);
|
|
@@ -535,7 +552,7 @@ function j(e = !1) {
|
|
|
535
552
|
async function xa() {
|
|
536
553
|
const e = {};
|
|
537
554
|
try {
|
|
538
|
-
(await
|
|
555
|
+
(await X()).forEach((a) => {
|
|
539
556
|
e[a._id] = [...new Set(a.restaurantRole.map((t) => t.restaurantId))];
|
|
540
557
|
});
|
|
541
558
|
} catch {
|
|
@@ -544,89 +561,89 @@ async function xa() {
|
|
|
544
561
|
return e;
|
|
545
562
|
}
|
|
546
563
|
function Ue(e, a) {
|
|
547
|
-
return
|
|
564
|
+
return Z !== null && q !== null && Z <= e && q >= a;
|
|
548
565
|
}
|
|
549
566
|
async function Ya(e) {
|
|
550
|
-
const a =
|
|
551
|
-
Ue(a, t) ||
|
|
567
|
+
const a = V(e), t = V(se(e, 6));
|
|
568
|
+
Ue(a, t) || Q && (await Q, Ue(a, t)) || await aa(
|
|
552
569
|
se(e, -7 * xe),
|
|
553
570
|
se(e, 7 * xe)
|
|
554
571
|
);
|
|
555
572
|
}
|
|
556
|
-
async function
|
|
557
|
-
!
|
|
573
|
+
async function co() {
|
|
574
|
+
!Z || !q || await aa(/* @__PURE__ */ new Date(`${Z}T00:00:00`), /* @__PURE__ */ new Date(`${q}T00:00:00`));
|
|
558
575
|
}
|
|
559
|
-
async function
|
|
576
|
+
async function mo(e) {
|
|
560
577
|
if (!m.value) throw new Error("No outlet selected");
|
|
561
578
|
const a = await H.createEmployeeProfile(m.value, e);
|
|
562
|
-
|
|
579
|
+
r.value && (r.value.employees.push(a), J.value += 1);
|
|
563
580
|
}
|
|
564
|
-
async function
|
|
581
|
+
async function yo(e) {
|
|
565
582
|
await H.validatePosAccess(e);
|
|
566
583
|
}
|
|
567
|
-
async function
|
|
584
|
+
async function po(e, a) {
|
|
568
585
|
if (!m.value) throw new Error("No outlet selected");
|
|
569
586
|
const t = await H.updateEmployeeProfile(m.value, e, a);
|
|
570
|
-
if (
|
|
571
|
-
const n =
|
|
572
|
-
n > -1 && (
|
|
573
|
-
...
|
|
574
|
-
employees:
|
|
587
|
+
if (r.value) {
|
|
588
|
+
const n = r.value.employees.findIndex((o) => o.employeeId === e);
|
|
589
|
+
n > -1 && (r.value = {
|
|
590
|
+
...r.value,
|
|
591
|
+
employees: r.value.employees.map((o, i) => i === n ? t : o)
|
|
575
592
|
});
|
|
576
593
|
}
|
|
577
594
|
}
|
|
578
|
-
async function
|
|
595
|
+
async function fo(e) {
|
|
579
596
|
const a = await H.createPosition(e);
|
|
580
|
-
|
|
597
|
+
r.value && (r.value = { ...r.value, positions: [...r.value.positions, a] });
|
|
581
598
|
}
|
|
582
|
-
async function
|
|
599
|
+
async function ho(e, a) {
|
|
583
600
|
const t = await H.updatePosition(e, a);
|
|
584
|
-
if (
|
|
585
|
-
const n =
|
|
586
|
-
|
|
587
|
-
...
|
|
588
|
-
positions:
|
|
589
|
-
employees:
|
|
601
|
+
if (r.value) {
|
|
602
|
+
const n = r.value.positions.find((i) => i.id === e), o = (i) => i.positionId === e || !i.positionId && i.positionName === (n == null ? void 0 : n.name);
|
|
603
|
+
r.value = {
|
|
604
|
+
...r.value,
|
|
605
|
+
positions: r.value.positions.map((i) => i.id === e ? t : i),
|
|
606
|
+
employees: r.value.employees.map((i) => ({
|
|
590
607
|
...i,
|
|
591
|
-
primaryPosition: i.primaryPosition &&
|
|
608
|
+
primaryPosition: i.primaryPosition && o(i.primaryPosition) ? { ...i.primaryPosition, positionName: t.name } : i.primaryPosition,
|
|
592
609
|
secondaryPositions: i.secondaryPositions.map(
|
|
593
|
-
(
|
|
610
|
+
(l) => o(l) ? { ...l, positionName: t.name } : l
|
|
594
611
|
)
|
|
595
612
|
}))
|
|
596
613
|
};
|
|
597
614
|
}
|
|
598
615
|
}
|
|
599
|
-
async function
|
|
600
|
-
await H.deletePosition(e),
|
|
601
|
-
...
|
|
602
|
-
positions:
|
|
616
|
+
async function vo(e) {
|
|
617
|
+
await H.deletePosition(e), r.value && (r.value = {
|
|
618
|
+
...r.value,
|
|
619
|
+
positions: r.value.positions.filter((a) => a.id !== e)
|
|
603
620
|
});
|
|
604
621
|
}
|
|
605
|
-
async function
|
|
606
|
-
var
|
|
622
|
+
async function go(e, a) {
|
|
623
|
+
var o;
|
|
607
624
|
if (!m.value) throw new Error("No outlet selected");
|
|
608
|
-
const t = (
|
|
625
|
+
const t = (o = r.value) == null ? void 0 : o.days.find((i) => i.date === e), n = await H.saveScheduleDay(m.value, e, {
|
|
609
626
|
...a,
|
|
610
627
|
expectedUpdatedAt: a.expectedUpdatedAt ?? (t == null ? void 0 : t.updatedAt)
|
|
611
628
|
});
|
|
612
|
-
if (
|
|
613
|
-
const i =
|
|
614
|
-
n && i.push(n),
|
|
629
|
+
if (r.value) {
|
|
630
|
+
const i = r.value.days.filter((l) => l.date !== e);
|
|
631
|
+
n && i.push(n), r.value = { ...r.value, days: i };
|
|
615
632
|
}
|
|
616
633
|
}
|
|
617
634
|
function Ba(e) {
|
|
618
635
|
const a = e.periods.flatMap((t) => {
|
|
619
|
-
const n = (t.roles ?? []).filter((
|
|
636
|
+
const n = (t.roles ?? []).filter((l) => l.positionName && l.headcount > 0), o = n.reduce((l, s) => l + s.headcount, 0), i = {
|
|
620
637
|
startTime: t.startTime,
|
|
621
638
|
endTime: t.endTime
|
|
622
639
|
};
|
|
623
640
|
return [
|
|
624
|
-
...n.map((
|
|
641
|
+
...n.map((l) => ({
|
|
625
642
|
...i,
|
|
626
|
-
headcount:
|
|
627
|
-
position: { positionId:
|
|
643
|
+
headcount: l.headcount,
|
|
644
|
+
position: { positionId: l.positionId, positionName: l.positionName }
|
|
628
645
|
})),
|
|
629
|
-
...t.headcount >
|
|
646
|
+
...t.headcount > o ? [{ ...i, headcount: t.headcount - o }] : []
|
|
630
647
|
];
|
|
631
648
|
});
|
|
632
649
|
return {
|
|
@@ -634,100 +651,100 @@ function Ba(e) {
|
|
|
634
651
|
demands: a
|
|
635
652
|
};
|
|
636
653
|
}
|
|
637
|
-
async function
|
|
654
|
+
async function Do(e) {
|
|
638
655
|
if (!m.value) throw new Error("No outlet selected");
|
|
639
656
|
if (!e.length) return;
|
|
640
657
|
const a = e.map(Ba), t = e.length === 1 ? await H.replaceDemands(m.value, a[0]) : await H.bulkReplaceDemands(m.value, { replacements: a });
|
|
641
|
-
if (
|
|
642
|
-
const n = new Set(e.map((i) => i.date)),
|
|
643
|
-
|
|
658
|
+
if (r.value) {
|
|
659
|
+
const n = new Set(e.map((i) => i.date)), o = r.value.demands.filter((i) => i.date === null || !n.has(i.date));
|
|
660
|
+
r.value = { ...r.value, demands: [...o, ...t] };
|
|
644
661
|
}
|
|
645
662
|
ea();
|
|
646
663
|
}
|
|
647
|
-
async function
|
|
664
|
+
async function wo(e) {
|
|
648
665
|
if (!m.value) throw new Error("No outlet selected");
|
|
649
666
|
return H.generateAutoSchedule(m.value, e);
|
|
650
667
|
}
|
|
651
|
-
async function
|
|
668
|
+
async function Ho() {
|
|
652
669
|
if (!m.value) throw new Error("No outlet selected");
|
|
653
670
|
return H.getAutoScheduleCapabilities(m.value);
|
|
654
671
|
}
|
|
655
|
-
async function
|
|
672
|
+
async function Ao(e) {
|
|
656
673
|
if (!m.value) throw new Error("No outlet selected");
|
|
657
674
|
return H.applyAutoSchedule(m.value, e);
|
|
658
675
|
}
|
|
659
|
-
async function
|
|
676
|
+
async function Eo(e) {
|
|
660
677
|
if (!m.value) throw new Error("No outlet selected");
|
|
661
678
|
const a = await H.bulkSaveAssignments(m.value, e);
|
|
662
|
-
if (
|
|
679
|
+
if (r.value) {
|
|
663
680
|
const t = new Set(e.deleteIds), n = new Map(
|
|
664
|
-
|
|
681
|
+
r.value.assignments.filter((o) => !t.has(o.id)).map((o) => [o.id, o])
|
|
665
682
|
);
|
|
666
|
-
a.updated.forEach((
|
|
683
|
+
a.updated.forEach((o) => n.set(o.id, o)), a.created.forEach((o) => n.set(o.id, o)), r.value = { ...r.value, assignments: [...n.values()] };
|
|
667
684
|
}
|
|
668
685
|
return ea(), a;
|
|
669
686
|
}
|
|
670
|
-
async function
|
|
687
|
+
async function Po(e) {
|
|
671
688
|
if (!m.value) throw new Error("No outlet selected");
|
|
672
689
|
return H.copySchedule(m.value, e);
|
|
673
690
|
}
|
|
674
|
-
async function
|
|
691
|
+
async function bo(e) {
|
|
675
692
|
var t;
|
|
676
693
|
if (!m.value) throw new Error("No outlet selected");
|
|
677
694
|
const a = await H.clearSchedule(m.value, e);
|
|
678
|
-
if (
|
|
695
|
+
if (r.value) {
|
|
679
696
|
const n = new Set(
|
|
680
|
-
(((t = e.demand) == null ? void 0 : t.replacements) ?? []).map((
|
|
681
|
-
),
|
|
682
|
-
|
|
683
|
-
...
|
|
697
|
+
(((t = e.demand) == null ? void 0 : t.replacements) ?? []).map((l) => l.date)
|
|
698
|
+
), o = new Set(a.deletedAssignmentIds), i = a.demand;
|
|
699
|
+
r.value = {
|
|
700
|
+
...r.value,
|
|
684
701
|
demands: [
|
|
685
|
-
...
|
|
702
|
+
...r.value.demands.filter((l) => l.date === null || !n.has(l.date)),
|
|
686
703
|
...i
|
|
687
704
|
],
|
|
688
|
-
assignments:
|
|
705
|
+
assignments: r.value.assignments.filter((l) => !o.has(l.id))
|
|
689
706
|
};
|
|
690
707
|
}
|
|
691
708
|
return a;
|
|
692
709
|
}
|
|
693
|
-
async function
|
|
710
|
+
async function No(e) {
|
|
694
711
|
if (!m.value) throw new Error("No outlet selected");
|
|
695
|
-
if (e.length && (await H.deleteAssignments(m.value, e),
|
|
712
|
+
if (e.length && (await H.deleteAssignments(m.value, e), r.value)) {
|
|
696
713
|
const a = new Set(e);
|
|
697
|
-
|
|
698
|
-
...
|
|
699
|
-
assignments:
|
|
714
|
+
r.value = {
|
|
715
|
+
...r.value,
|
|
716
|
+
assignments: r.value.assignments.filter((t) => !a.has(t.id))
|
|
700
717
|
};
|
|
701
718
|
}
|
|
702
719
|
}
|
|
703
720
|
async function ko(e) {
|
|
704
721
|
if (!m.value) throw new Error("No outlet selected");
|
|
705
722
|
const a = await H.createTimeOff(m.value, e);
|
|
706
|
-
return
|
|
723
|
+
return r.value && (r.value = { ...r.value, timeOff: [...r.value.timeOff, a] }), a;
|
|
707
724
|
}
|
|
708
|
-
async function
|
|
725
|
+
async function So(e, a) {
|
|
709
726
|
if (!m.value) throw new Error("No outlet selected");
|
|
710
727
|
const t = await H.updateTimeOffStatus(m.value, e, a);
|
|
711
|
-
return t &&
|
|
712
|
-
...
|
|
713
|
-
timeOff:
|
|
728
|
+
return t && r.value && (r.value = {
|
|
729
|
+
...r.value,
|
|
730
|
+
timeOff: r.value.timeOff.map((n) => n.id === e ? t : n)
|
|
714
731
|
}), t;
|
|
715
732
|
}
|
|
716
|
-
async function
|
|
733
|
+
async function Co(e) {
|
|
717
734
|
if (!m.value) throw new Error("No outlet selected");
|
|
718
|
-
await H.deleteTimeOff(m.value, e),
|
|
719
|
-
...
|
|
720
|
-
timeOff:
|
|
735
|
+
await H.deleteTimeOff(m.value, e), r.value && (r.value = {
|
|
736
|
+
...r.value,
|
|
737
|
+
timeOff: r.value.timeOff.filter((a) => a.id !== e)
|
|
721
738
|
});
|
|
722
739
|
}
|
|
723
|
-
async function
|
|
740
|
+
async function Mo(e) {
|
|
724
741
|
if (!m.value) throw new Error("No outlet selected");
|
|
725
742
|
const a = await H.bulkUpdateAssignmentStatus(m.value, e);
|
|
726
|
-
if (
|
|
743
|
+
if (r.value && a.length) {
|
|
727
744
|
const t = new Map(a.map((n) => [n.id, n]));
|
|
728
|
-
|
|
729
|
-
...
|
|
730
|
-
assignments:
|
|
745
|
+
r.value = {
|
|
746
|
+
...r.value,
|
|
747
|
+
assignments: r.value.assignments.map(
|
|
731
748
|
(n) => t.get(n.id) ?? n
|
|
732
749
|
)
|
|
733
750
|
};
|
|
@@ -740,25 +757,25 @@ async function aa(e, a) {
|
|
|
740
757
|
fe.value = "No outlet selected";
|
|
741
758
|
return;
|
|
742
759
|
}
|
|
743
|
-
const n =
|
|
760
|
+
const n = V(e), o = V(a), i = ++ne;
|
|
744
761
|
Ye.value = !0, fe.value = null;
|
|
745
|
-
const
|
|
762
|
+
const l = (async () => {
|
|
746
763
|
try {
|
|
747
|
-
const
|
|
764
|
+
const s = await H.readBoard(t, n, o);
|
|
748
765
|
if (m.value !== t || i !== ne) return;
|
|
749
|
-
|
|
750
|
-
} catch (
|
|
766
|
+
r.value = s, he.value = s.settings.setupCompleted, Z = n, q = o, J.value += 1;
|
|
767
|
+
} catch (s) {
|
|
751
768
|
if (m.value !== t || i !== ne) return;
|
|
752
|
-
fe.value =
|
|
769
|
+
fe.value = s instanceof Error ? s.message : "Could not load the schedule";
|
|
753
770
|
} finally {
|
|
754
771
|
m.value === t && i === ne && (Ye.value = !1);
|
|
755
772
|
}
|
|
756
773
|
})();
|
|
757
|
-
|
|
774
|
+
Q = l;
|
|
758
775
|
try {
|
|
759
|
-
await
|
|
776
|
+
await l;
|
|
760
777
|
} finally {
|
|
761
|
-
|
|
778
|
+
Q === l && (Q = null);
|
|
762
779
|
}
|
|
763
780
|
}
|
|
764
781
|
const _a = "AE", Fa = "Asia/Dubai", Ua = {
|
|
@@ -1226,7 +1243,7 @@ const _a = "AE", Fa = "Asia/Dubai", Ua = {
|
|
|
1226
1243
|
workingHours: At,
|
|
1227
1244
|
recurringPublicHolidays: Et,
|
|
1228
1245
|
publicHolidays: Pt
|
|
1229
|
-
},
|
|
1246
|
+
}, Nt = "MY", kt = "Asia/Kuala_Lumpur", St = {
|
|
1230
1247
|
NORMAL: {
|
|
1231
1248
|
overtime: 1.5
|
|
1232
1249
|
},
|
|
@@ -1314,8 +1331,8 @@ const _a = "AE", Fa = "Asia/Dubai", Ua = {
|
|
|
1314
1331
|
"2027-12-25": "Christmas Day"
|
|
1315
1332
|
}
|
|
1316
1333
|
}, Tt = {
|
|
1317
|
-
countryCode:
|
|
1318
|
-
timezone:
|
|
1334
|
+
countryCode: Nt,
|
|
1335
|
+
timezone: kt,
|
|
1319
1336
|
payRate: St,
|
|
1320
1337
|
overtime: Ct,
|
|
1321
1338
|
workingHours: Mt,
|
|
@@ -1700,14 +1717,14 @@ function yn(e) {
|
|
|
1700
1717
|
function pn(e) {
|
|
1701
1718
|
return We[yn(e)] ?? We.MY;
|
|
1702
1719
|
}
|
|
1703
|
-
function
|
|
1704
|
-
var i,
|
|
1720
|
+
function Lo(e, a) {
|
|
1721
|
+
var i, l;
|
|
1705
1722
|
const t = (i = e.publicHolidays[a.slice(0, 4)]) == null ? void 0 : i[a];
|
|
1706
1723
|
if (t) return t;
|
|
1707
|
-
const n = Number(a.slice(5, 7)),
|
|
1708
|
-
return ((
|
|
1724
|
+
const n = Number(a.slice(5, 7)), o = Number(a.slice(8, 10));
|
|
1725
|
+
return ((l = e.recurringPublicHolidays.find((s) => s.month === n && s.day === o)) == null ? void 0 : l.name) ?? null;
|
|
1709
1726
|
}
|
|
1710
|
-
const fn = Ge(), ta = "unassigned",
|
|
1727
|
+
const fn = Ge(), ta = "unassigned", Io = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], To = "All Stations", Ro = [{ id: ta, label: "Assigned", roles: [], system: !0 }], ze = [
|
|
1711
1728
|
"#903E1F",
|
|
1712
1729
|
"#5F090A",
|
|
1713
1730
|
"#0A5384",
|
|
@@ -1720,30 +1737,30 @@ const fn = Ge(), ta = "unassigned", Lo = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sa
|
|
|
1720
1737
|
function hn(e) {
|
|
1721
1738
|
var t;
|
|
1722
1739
|
const a = e.trim().toLocaleLowerCase();
|
|
1723
|
-
return (t =
|
|
1740
|
+
return (t = U.find((n) => n.name.toLocaleLowerCase() === a)) == null ? void 0 : t.id;
|
|
1724
1741
|
}
|
|
1725
|
-
function
|
|
1742
|
+
function Oo(e, a) {
|
|
1726
1743
|
if (e)
|
|
1727
1744
|
return { positionId: a ?? hn(e), positionName: e };
|
|
1728
1745
|
}
|
|
1729
|
-
function ie(e, a =
|
|
1746
|
+
function ie(e, a = U) {
|
|
1730
1747
|
var t;
|
|
1731
1748
|
if (e)
|
|
1732
1749
|
return (e.positionId && ((t = a.find((n) => n.id === e.positionId)) == null ? void 0 : t.name)) ?? e.positionName;
|
|
1733
1750
|
}
|
|
1734
|
-
function
|
|
1751
|
+
function $o(e, a = U) {
|
|
1735
1752
|
var t, n;
|
|
1736
1753
|
if (e)
|
|
1737
|
-
return e.positionId ? (t = a.find((
|
|
1754
|
+
return e.positionId ? (t = a.find((o) => o.id === e.positionId)) == null ? void 0 : t.name : (n = a.find((o) => o.name.toLocaleLowerCase() === e.positionName.toLocaleLowerCase())) == null ? void 0 : n.name;
|
|
1738
1755
|
}
|
|
1739
|
-
function
|
|
1740
|
-
return a ? !
|
|
1756
|
+
function xo(e, a) {
|
|
1757
|
+
return a ? !U.some((t) => t.id === a) : !!e && !U.some((t) => t.name.toLocaleLowerCase() === e.toLocaleLowerCase());
|
|
1741
1758
|
}
|
|
1742
|
-
const
|
|
1759
|
+
const Yo = [1, 1, 1, 1, 1, 1, 1];
|
|
1743
1760
|
function le(e) {
|
|
1744
1761
|
return (e + 6) % 7;
|
|
1745
1762
|
}
|
|
1746
|
-
function
|
|
1763
|
+
function Bo(e) {
|
|
1747
1764
|
return (e + 1) % 7;
|
|
1748
1765
|
}
|
|
1749
1766
|
function ye(e, a) {
|
|
@@ -1758,7 +1775,7 @@ function gn(e) {
|
|
|
1758
1775
|
return a.length ? (a[0][0] + (((t = a[1]) == null ? void 0 : t[0]) ?? "")).toUpperCase() : "??";
|
|
1759
1776
|
}
|
|
1760
1777
|
const na = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map();
|
|
1761
|
-
function
|
|
1778
|
+
function _o(e) {
|
|
1762
1779
|
return na.get(e);
|
|
1763
1780
|
}
|
|
1764
1781
|
function Dn(e) {
|
|
@@ -1767,33 +1784,33 @@ function Dn(e) {
|
|
|
1767
1784
|
const t = Je + Pe.size + 1;
|
|
1768
1785
|
return Pe.set(e, t), na.set(t, e), t;
|
|
1769
1786
|
}
|
|
1770
|
-
function
|
|
1787
|
+
function Fo(e) {
|
|
1771
1788
|
return e.sourceId || String(e.id);
|
|
1772
1789
|
}
|
|
1773
1790
|
function wn(e) {
|
|
1774
|
-
Ca.name = (e == null ? void 0 : e.outlet.name) ?? "", ye(Sa, (e == null ? void 0 : e.positions.map((
|
|
1791
|
+
Ca.name = (e == null ? void 0 : e.outlet.name) ?? "", ye(Sa, (e == null ? void 0 : e.positions.map((s) => s.name)) ?? []), ye(U, (e == null ? void 0 : e.positions) ?? []);
|
|
1775
1792
|
const a = (e == null ? void 0 : e.restaurantProfile.operatingHours) ?? [], t = Array.from({ length: 7 }, () => []);
|
|
1776
|
-
for (const
|
|
1777
|
-
ye(
|
|
1778
|
-
const n = a.filter((
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
a.filter((
|
|
1793
|
+
for (const s of a) t[le(s.dayOfWeek)] = s.closed ? [] : s.hours;
|
|
1794
|
+
ye(S.dayHours, t);
|
|
1795
|
+
const n = a.filter((s) => !s.closed).flatMap((s) => s.hours);
|
|
1796
|
+
S.openFrom = n.length ? n.map((s) => s.start).reduce((s, d) => d < s ? d : s) : "00:00", S.openTo = n.length ? n.map((s) => s.end).reduce((s, d) => d > s ? d : s) : "24:00", ye(
|
|
1797
|
+
S.closedWeekdays,
|
|
1798
|
+
a.filter((s) => s.closed).map((s) => le(s.dayOfWeek)).sort((s, d) => s - d)
|
|
1782
1799
|
);
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1800
|
+
const o = pn(fn.currentCountry.value), i = (e == null ? void 0 : e.settings.settingsConfigured) === !0, l = i ? e.settings.payRate : o.payRate;
|
|
1801
|
+
S.otCapHours = i ? e.settings.overtime.maxHoursPerMonth : o.overtime.maxHoursPerMonth, S.workingHours = i ? e.settings.workingHours : {
|
|
1785
1802
|
minHoursPerDay: null,
|
|
1786
|
-
maxHoursPerDay:
|
|
1787
|
-
maxHoursPerWeek:
|
|
1788
|
-
},
|
|
1803
|
+
maxHoursPerDay: o.workingHours.fullTime.maxHoursPerDay,
|
|
1804
|
+
maxHoursPerWeek: o.workingHours.fullTime.maxHoursPerWeek
|
|
1805
|
+
}, S.payRate.NORMAL.overtime = l.NORMAL.overtime, S.payRate.REST_DAY.regular = l.REST_DAY.regular, S.payRate.REST_DAY.overtime = l.REST_DAY.overtime, S.payRate.PUBLIC_HOLIDAY.regular = l.PUBLIC_HOLIDAY.regular, S.payRate.PUBLIC_HOLIDAY.overtime = l.PUBLIC_HOLIDAY.overtime;
|
|
1789
1806
|
}
|
|
1790
|
-
Re(
|
|
1807
|
+
Re(r, wn, { immediate: !0 });
|
|
1791
1808
|
function ge(e) {
|
|
1792
1809
|
var a, t, n;
|
|
1793
1810
|
return {
|
|
1794
|
-
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ??
|
|
1795
|
-
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ??
|
|
1796
|
-
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ??
|
|
1811
|
+
minHoursPerDay: ((a = e.workingHours) == null ? void 0 : a.minHoursPerDay) ?? S.workingHours.minHoursPerDay,
|
|
1812
|
+
maxHoursPerDay: ((t = e.workingHours) == null ? void 0 : t.maxHoursPerDay) ?? S.workingHours.maxHoursPerDay,
|
|
1813
|
+
maxHoursPerWeek: ((n = e.workingHours) == null ? void 0 : n.maxHoursPerWeek) ?? S.workingHours.maxHoursPerWeek
|
|
1797
1814
|
};
|
|
1798
1815
|
}
|
|
1799
1816
|
function Hn(e) {
|
|
@@ -1840,7 +1857,7 @@ function Pn(e) {
|
|
|
1840
1857
|
function bn(e) {
|
|
1841
1858
|
return e.type === "OFF_DAY" ? "Off day" : e.leaveType === "MEDICAL" ? "Medical Leave" : e.leaveType === "EMERGENCY" ? "Emergency Leave" : e.leaveType === "UNPAID" ? "Unpaid Leave" : "Annual Leave";
|
|
1842
1859
|
}
|
|
1843
|
-
function
|
|
1860
|
+
function Nn(e, a) {
|
|
1844
1861
|
if (a < e.startDate || a > e.endDate) return null;
|
|
1845
1862
|
const n = e.startDate === e.endDate || a === e.startDate ? e.startPart : a === e.endDate ? e.endPart : "FULL_DAY";
|
|
1846
1863
|
return {
|
|
@@ -1853,7 +1870,7 @@ function kn(e, a) {
|
|
|
1853
1870
|
halfPart: n === "FULL_DAY" ? void 0 : n
|
|
1854
1871
|
};
|
|
1855
1872
|
}
|
|
1856
|
-
function
|
|
1873
|
+
function kn(e) {
|
|
1857
1874
|
return {
|
|
1858
1875
|
employeeId: e._id,
|
|
1859
1876
|
name: e.name,
|
|
@@ -1870,47 +1887,47 @@ function Sn(e) {
|
|
|
1870
1887
|
}
|
|
1871
1888
|
function Cn(e) {
|
|
1872
1889
|
var n;
|
|
1873
|
-
const t = (qe.value[e] ?? ((n = re.value.find((
|
|
1890
|
+
const t = (qe.value[e] ?? ((n = re.value.find((o) => o._id === e)) == null ? void 0 : n.restaurantRole.map((o) => o.restaurantId)) ?? []).map((o) => oe[o]).filter((o) => !!o);
|
|
1874
1891
|
return t.length ? Sn([...new Set(t)]) : void 0;
|
|
1875
1892
|
}
|
|
1876
|
-
function
|
|
1877
|
-
const a =
|
|
1893
|
+
function Uo(e = []) {
|
|
1894
|
+
const a = r.value;
|
|
1878
1895
|
if (!a) return [];
|
|
1879
|
-
const t = new Map(a.employees.map((
|
|
1880
|
-
|
|
1881
|
-
),
|
|
1896
|
+
const t = new Map(a.employees.map((s) => [s.employeeId, s])), n = new Map(
|
|
1897
|
+
z.value.map((s) => [s.employeeId, s])
|
|
1898
|
+
), o = re.value.filter((s) => {
|
|
1882
1899
|
var d;
|
|
1883
|
-
return ((d = n.get(
|
|
1884
|
-
}).map((
|
|
1885
|
-
for (const
|
|
1886
|
-
const d = `${
|
|
1887
|
-
|
|
1888
|
-
}
|
|
1889
|
-
return
|
|
1890
|
-
const d = re.value.find((
|
|
1891
|
-
name:
|
|
1900
|
+
return ((d = n.get(s._id)) == null ? void 0 : d.enabled) !== !1;
|
|
1901
|
+
}).map((s) => t.get(s._id) ?? kn(s)), i = Hn(o), l = /* @__PURE__ */ new Map();
|
|
1902
|
+
for (const s of a.assignments) {
|
|
1903
|
+
const d = `${s.employeeId}|${s.date}`, v = l.get(d);
|
|
1904
|
+
v ? v.push(s) : l.set(d, [s]);
|
|
1905
|
+
}
|
|
1906
|
+
return o.map((s) => {
|
|
1907
|
+
const d = re.value.find((h) => h._id === s.employeeId) ?? {
|
|
1908
|
+
name: s.name,
|
|
1892
1909
|
code: void 0,
|
|
1893
1910
|
passcode: "",
|
|
1894
1911
|
isMasterUser: !1
|
|
1895
|
-
},
|
|
1896
|
-
|
|
1897
|
-
...
|
|
1898
|
-
],
|
|
1899
|
-
const
|
|
1900
|
-
return (a.timeOff ?? []).filter((w) => w.employeeId ===
|
|
1901
|
-
}),
|
|
1902
|
-
const
|
|
1912
|
+
}, v = ge(s), g = Dn(s.employeeId), A = new Set(U.map((h) => h.id)), O = new Set(U.map((h) => h.name.toLocaleLowerCase())), $ = (h) => h.positionId ? A.has(h.positionId) : O.has(h.positionName.toLocaleLowerCase()), x = ie(s.primaryPosition), p = !!s.primaryPosition && $(s.primaryPosition), b = s.secondaryPositions.filter($).map((h) => ie(h)).filter((h) => !!h), F = x ? p ? [x, ...b] : [] : b, M = [
|
|
1913
|
+
...x && !p ? [x] : [],
|
|
1914
|
+
...s.secondaryPositions.filter((h) => !$(h)).map((h) => ie(h)).filter((h) => !!h)
|
|
1915
|
+
], W = F[0] ?? "", L = e.map((h) => {
|
|
1916
|
+
const E = V(h);
|
|
1917
|
+
return (a.timeOff ?? []).filter((w) => w.employeeId === s.employeeId).map((w) => Nn(w, E)).find((w) => w !== null) ?? null;
|
|
1918
|
+
}), K = e.map((h) => {
|
|
1919
|
+
const E = V(h), T = (l.get(`${s.employeeId}|${E}`) ?? []).filter((Y) => Y.startTime && Y.endTime).map((Y) => Pn(Y)).sort((Y, ce) => Y.start.localeCompare(ce.start));
|
|
1903
1920
|
return T.length ? T.length === 1 ? T[0] : T : null;
|
|
1904
|
-
}), ue =
|
|
1921
|
+
}), ue = s.availability.length > 0, de = Array.from(
|
|
1905
1922
|
{ length: 7 },
|
|
1906
|
-
(
|
|
1907
|
-
), De = Array.from({ length: 7 }, (
|
|
1908
|
-
const w =
|
|
1923
|
+
(h, E) => ue ? s.availability.some((w) => le(w.dayOfWeek) === E) : !0
|
|
1924
|
+
), De = Array.from({ length: 7 }, (h, E) => {
|
|
1925
|
+
const w = s.availability.find((T) => le(T.dayOfWeek) === E);
|
|
1909
1926
|
return { from: (w == null ? void 0 : w.start) ?? "", to: (w == null ? void 0 : w.end) ?? "" };
|
|
1910
1927
|
});
|
|
1911
1928
|
return {
|
|
1912
|
-
id:
|
|
1913
|
-
sourceId:
|
|
1929
|
+
id: g,
|
|
1930
|
+
sourceId: s.employeeId,
|
|
1914
1931
|
// Employee page edits update the POS employee name. Use that as the display
|
|
1915
1932
|
// source so Scheduling reflects those changes after its roster refresh.
|
|
1916
1933
|
name: d.name,
|
|
@@ -1920,60 +1937,60 @@ function Fo(e = []) {
|
|
|
1920
1937
|
passcode: d.passcode || void 0,
|
|
1921
1938
|
code: d.code,
|
|
1922
1939
|
masterUser: d.isMasterUser,
|
|
1923
|
-
employmentType:
|
|
1924
|
-
role:
|
|
1940
|
+
employmentType: s.employmentType,
|
|
1941
|
+
role: W,
|
|
1925
1942
|
initials: gn(d.name),
|
|
1926
|
-
color: ze[(
|
|
1943
|
+
color: ze[(g - Je - 1) % ze.length],
|
|
1927
1944
|
// Gross hours actually rostered this week — the figure the cost rail multiplies by
|
|
1928
1945
|
// the rate. Contracted hours are a separate question, answered by RULES.contract.
|
|
1929
1946
|
// Rounded to one decimal — `hoursBetween` divides by 60, so an unrounded sum reads
|
|
1930
1947
|
// as a long, meaningless float (e.g. 31.983333333333334) everywhere this is shown
|
|
1931
1948
|
// verbatim, matching the rounding `employeeLoadOf`'s own hours figure already uses.
|
|
1932
1949
|
weekHours: Math.round(
|
|
1933
|
-
|
|
1934
|
-
(
|
|
1950
|
+
K.reduce(
|
|
1951
|
+
(h, E) => h + (Array.isArray(E) ? E : E && "start" in E ? [E] : []).reduce(
|
|
1935
1952
|
(w, T) => w + vn(T.start, T.end),
|
|
1936
1953
|
0
|
|
1937
1954
|
),
|
|
1938
1955
|
0
|
|
1939
1956
|
) * 10
|
|
1940
1957
|
) / 10,
|
|
1941
|
-
pct: En(
|
|
1942
|
-
contractHours:
|
|
1943
|
-
minHoursPerDay:
|
|
1958
|
+
pct: En(s, i),
|
|
1959
|
+
contractHours: v.maxHoursPerWeek ?? void 0,
|
|
1960
|
+
minHoursPerDay: v.minHoursPerDay ?? void 0,
|
|
1944
1961
|
// Keep the persisted override shape here. Consumers that need the effective value use
|
|
1945
1962
|
// effectiveWorkingHours(), so an inherited null remains distinguishable from an override.
|
|
1946
|
-
workingHours:
|
|
1963
|
+
workingHours: s.workingHours,
|
|
1947
1964
|
// Every outlet the POS says this person works at, not just this one — the Add / Edit form
|
|
1948
1965
|
// shows them, and saving keeps them.
|
|
1949
|
-
locations: Cn(
|
|
1950
|
-
rate: An(
|
|
1951
|
-
positions:
|
|
1966
|
+
locations: Cn(s.employeeId),
|
|
1967
|
+
rate: An(s, i),
|
|
1968
|
+
positions: F,
|
|
1952
1969
|
archivedPositions: M.length ? M : void 0,
|
|
1953
|
-
shifts:
|
|
1970
|
+
shifts: K,
|
|
1954
1971
|
timeOff: L,
|
|
1955
1972
|
// Remarks live in their own collection in the older scheduling design and are not
|
|
1956
1973
|
// part of this board's payload yet.
|
|
1957
1974
|
remarks: [],
|
|
1958
1975
|
section: ta,
|
|
1959
|
-
payBasis:
|
|
1960
|
-
payAmount:
|
|
1976
|
+
payBasis: s.wage.type === "HOURLY" ? "hourly" : "monthly",
|
|
1977
|
+
payAmount: s.wage.amount,
|
|
1961
1978
|
availDays: de,
|
|
1962
1979
|
availHours: De
|
|
1963
1980
|
};
|
|
1964
1981
|
});
|
|
1965
1982
|
}
|
|
1966
|
-
function
|
|
1983
|
+
function Wo() {
|
|
1967
1984
|
return [];
|
|
1968
1985
|
}
|
|
1969
|
-
function
|
|
1970
|
-
var n,
|
|
1971
|
-
const e =
|
|
1986
|
+
function zo() {
|
|
1987
|
+
var n, o;
|
|
1988
|
+
const e = r.value, a = {}, t = {};
|
|
1972
1989
|
for (const i of (e == null ? void 0 : e.demands) ?? []) {
|
|
1973
|
-
const
|
|
1974
|
-
if (!
|
|
1975
|
-
let
|
|
1976
|
-
|
|
1990
|
+
const l = i.date ? a[n = i.date] ?? (a[n] = []) : i.dayOfWeek !== null ? t[o = le(i.dayOfWeek)] ?? (t[o] = []) : null;
|
|
1991
|
+
if (!l) continue;
|
|
1992
|
+
let s = l.find((d) => d.from === i.startTime && d.to === i.endTime);
|
|
1993
|
+
s || (s = { from: i.startTime, to: i.endTime, n: 0, roles: [] }, l.push(s)), s.n += i.headcount, i.position && s.roles.push({
|
|
1977
1994
|
position: ie(i.position) ?? "",
|
|
1978
1995
|
positionId: i.position.positionId || void 0,
|
|
1979
1996
|
n: i.headcount
|
|
@@ -1981,38 +1998,38 @@ function Wo() {
|
|
|
1981
1998
|
}
|
|
1982
1999
|
return { byDate: a, byWeekday: t };
|
|
1983
2000
|
}
|
|
1984
|
-
function
|
|
1985
|
-
const e = Ge(), { restaurants: a, readRestaurants: t } = Aa(), n = wa(),
|
|
1986
|
-
let
|
|
1987
|
-
const
|
|
1988
|
-
() => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p,
|
|
2001
|
+
function Vo() {
|
|
2002
|
+
const e = Ge(), { restaurants: a, readRestaurants: t } = Aa(), n = wa(), o = Ha(), i = P(!1);
|
|
2003
|
+
let l = () => !0;
|
|
2004
|
+
const s = _(
|
|
2005
|
+
() => a.value.filter((p) => p.managable).map((p) => ({ value: p._id, label: p.profile.name })).sort((p, b) => p.label.localeCompare(b.label))
|
|
1989
2006
|
), d = () => {
|
|
1990
2007
|
var p;
|
|
1991
2008
|
return `hrm-schedule-outlet:${((p = e.currentBusiness.value) == null ? void 0 : p._id) ?? ""}`;
|
|
1992
|
-
},
|
|
2009
|
+
}, v = _(() => {
|
|
1993
2010
|
var p;
|
|
1994
2011
|
return ((p = e.currentRestaurant.value) == null ? void 0 : p._id) ?? "";
|
|
1995
2012
|
});
|
|
1996
|
-
async function
|
|
1997
|
-
return p !== m.value && !await
|
|
2013
|
+
async function g(p, b) {
|
|
2014
|
+
return p !== m.value && !await l(p) || !Fe(p) ? !1 : (localStorage.setItem(d(), p), n.query.restaurantId !== p && o.replace({ query: { ...n.query, restaurantId: p } }), await Promise.all([Me(p), Ya(b)]), !0);
|
|
1998
2015
|
}
|
|
1999
|
-
function
|
|
2000
|
-
|
|
2001
|
-
}
|
|
2002
|
-
const q = (p) => !!p && o.value.some((P) => P.value === p);
|
|
2003
|
-
async function O() {
|
|
2004
|
-
var _;
|
|
2005
|
-
await t(), _e.splice(0, _e.length, ...o.value.map((M) => M.label)), Object.keys(oe).forEach((M) => delete oe[M]), a.value.forEach((M) => oe[M._id] = M.profile.name);
|
|
2006
|
-
const p = localStorage.getItem(d()) ?? "", P = [m.value, p, f.value].find(q) ?? ((_ = o.value[0]) == null ? void 0 : _.value) ?? "";
|
|
2007
|
-
return P && Fe(P), i.value = !0, P;
|
|
2016
|
+
function A(p) {
|
|
2017
|
+
l = p;
|
|
2008
2018
|
}
|
|
2019
|
+
const O = (p) => !!p && s.value.some((b) => b.value === p);
|
|
2009
2020
|
async function $() {
|
|
2010
|
-
|
|
2021
|
+
var F;
|
|
2022
|
+
await t(), _e.splice(0, _e.length, ...s.value.map((M) => M.label)), Object.keys(oe).forEach((M) => delete oe[M]), a.value.forEach((M) => oe[M._id] = M.profile.name);
|
|
2023
|
+
const p = localStorage.getItem(d()) ?? "", b = [m.value, p, v.value].find(O) ?? ((F = s.value[0]) == null ? void 0 : F.value) ?? "";
|
|
2024
|
+
return b && Fe(b), i.value = !0, b;
|
|
2025
|
+
}
|
|
2026
|
+
async function x() {
|
|
2027
|
+
const p = await $();
|
|
2011
2028
|
return p && await Me(p), p;
|
|
2012
2029
|
}
|
|
2013
|
-
return { options:
|
|
2030
|
+
return { options: s, ready: i, outletId: m, resolve: x, resolveOutlet: $, switchTo: g, setBeforeSwitch: A };
|
|
2014
2031
|
}
|
|
2015
|
-
const Mn = ["data-hierarchy", "data-size", "data-icon"],
|
|
2032
|
+
const Mn = ["data-hierarchy", "data-size", "data-icon"], Ko = /* @__PURE__ */ Oe({
|
|
2016
2033
|
__name: "ScheduleButton",
|
|
2017
2034
|
props: {
|
|
2018
2035
|
hierarchy: { default: "primary" },
|
|
@@ -2020,7 +2037,7 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2020
2037
|
iconOnly: { type: Boolean, default: !1 }
|
|
2021
2038
|
},
|
|
2022
2039
|
setup(e) {
|
|
2023
|
-
return (a, t) => (
|
|
2040
|
+
return (a, t) => (N(), k("button", {
|
|
2024
2041
|
type: "button",
|
|
2025
2042
|
class: "sch-button",
|
|
2026
2043
|
"data-hierarchy": e.hierarchy,
|
|
@@ -2045,7 +2062,7 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2045
2062
|
}, Bn = ["aria-selected", "onClick"], _n = {
|
|
2046
2063
|
key: 0,
|
|
2047
2064
|
class: "fx-opt-text"
|
|
2048
|
-
}, Fn = { key: 0 },
|
|
2065
|
+
}, Fn = { key: 0 }, Go = /* @__PURE__ */ Oe({
|
|
2049
2066
|
inheritAttrs: !1,
|
|
2050
2067
|
__name: "ScheduleSelect",
|
|
2051
2068
|
props: {
|
|
@@ -2063,11 +2080,11 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2063
2080
|
},
|
|
2064
2081
|
emits: ["update:modelValue", "toggle"],
|
|
2065
2082
|
setup(e, { emit: a }) {
|
|
2066
|
-
const t = e, n = a,
|
|
2083
|
+
const t = e, n = a, o = da(), i = _(() => o.class ?? ""), l = P(!1), s = P(!1), d = P(null), v = P(null), g = P(null), A = _(() => t.teleport !== !1 && s.value);
|
|
2067
2084
|
Ie(() => {
|
|
2068
|
-
|
|
2085
|
+
s.value = typeof document < "u" && !!document.body;
|
|
2069
2086
|
});
|
|
2070
|
-
const
|
|
2087
|
+
const O = _(() => {
|
|
2071
2088
|
var u, y;
|
|
2072
2089
|
if (t.selectedLabel != null) return t.selectedLabel;
|
|
2073
2090
|
if (t.multiple) {
|
|
@@ -2076,78 +2093,78 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2076
2093
|
}
|
|
2077
2094
|
return ((y = t.options.find((c) => c.value === t.modelValue)) == null ? void 0 : y.label) ?? t.placeholder ?? "";
|
|
2078
2095
|
});
|
|
2079
|
-
function
|
|
2096
|
+
function $(u) {
|
|
2080
2097
|
var y;
|
|
2081
2098
|
return t.multiple ? !!((y = t.selected) != null && y.includes(u.value)) : t.selectedId != null ? u.id === t.selectedId : u.value === t.modelValue;
|
|
2082
2099
|
}
|
|
2083
|
-
const
|
|
2100
|
+
const x = _(() => !!t.menuTitle || t.options.some((u) => u.hint)), p = P(""), b = P(null), F = _(() => {
|
|
2084
2101
|
const u = p.value.trim().toLowerCase();
|
|
2085
2102
|
return !t.searchable || !u ? t.options : t.options.filter((y) => `${y.label} ${y.hint ?? ""}`.toLowerCase().includes(u));
|
|
2086
|
-
}), M =
|
|
2103
|
+
}), M = _(() => {
|
|
2087
2104
|
const u = [];
|
|
2088
2105
|
let y;
|
|
2089
|
-
for (const c of
|
|
2106
|
+
for (const c of F.value)
|
|
2090
2107
|
c.group !== y && (y = c.group, y && u.push({ heading: y })), u.push({ option: c });
|
|
2091
2108
|
return u;
|
|
2092
|
-
}),
|
|
2093
|
-
function
|
|
2094
|
-
const u =
|
|
2109
|
+
}), W = 5, L = 8;
|
|
2110
|
+
function K() {
|
|
2111
|
+
const u = g.value, y = v.value;
|
|
2095
2112
|
if (!u || !y) return;
|
|
2096
|
-
const c = y.getBoundingClientRect(),
|
|
2097
|
-
u.style.minWidth = `${Math.round(c.width)}px`, u.style.maxWidth = `${Math.max(180, Math.round(
|
|
2098
|
-
const ee = R - c.bottom -
|
|
2113
|
+
const c = y.getBoundingClientRect(), C = window.innerWidth || document.documentElement.clientWidth, R = window.innerHeight || document.documentElement.clientHeight;
|
|
2114
|
+
u.style.minWidth = `${Math.round(c.width)}px`, u.style.maxWidth = `${Math.max(180, Math.round(C - L * 2))}px`;
|
|
2115
|
+
const ee = R - c.bottom - W - L, ra = c.top - W - L;
|
|
2099
2116
|
u.style.maxHeight = `${Math.max(120, Math.min(320, Math.max(ee, ra)))}px`;
|
|
2100
2117
|
const me = u.offsetHeight, la = u.offsetWidth;
|
|
2101
|
-
let we = c.bottom +
|
|
2102
|
-
we + me > R - L && (we = c.top -
|
|
2103
|
-
const ua = Math.min(Math.max(L, c.left), Math.max(L,
|
|
2118
|
+
let we = c.bottom + W;
|
|
2119
|
+
we + me > R - L && (we = c.top - W - me >= L ? c.top - W - me : Math.max(L, R - me - L));
|
|
2120
|
+
const ua = Math.min(Math.max(L, c.left), Math.max(L, C - la - L));
|
|
2104
2121
|
u.style.top = `${Math.round(we)}px`, u.style.left = `${Math.round(ua)}px`, u.style.visibility = "visible";
|
|
2105
2122
|
}
|
|
2106
2123
|
function ue(u) {
|
|
2107
|
-
var c,
|
|
2124
|
+
var c, C;
|
|
2108
2125
|
const y = u.target;
|
|
2109
|
-
y && ((c = d.value) != null && c.contains(y) || (
|
|
2126
|
+
y && ((c = d.value) != null && c.contains(y) || (C = g.value) != null && C.contains(y)) || w();
|
|
2110
2127
|
}
|
|
2111
2128
|
function de(u) {
|
|
2112
|
-
const y =
|
|
2129
|
+
const y = g.value, c = u.target;
|
|
2113
2130
|
if (y && c && c !== document && y.contains(c)) return;
|
|
2114
|
-
const
|
|
2115
|
-
if (!
|
|
2116
|
-
const R =
|
|
2131
|
+
const C = v.value;
|
|
2132
|
+
if (!C) return;
|
|
2133
|
+
const R = C.getBoundingClientRect(), ee = window.innerHeight || document.documentElement.clientHeight;
|
|
2117
2134
|
if (R.bottom < 0 || R.top > ee) {
|
|
2118
2135
|
w();
|
|
2119
2136
|
return;
|
|
2120
2137
|
}
|
|
2121
|
-
|
|
2138
|
+
K();
|
|
2122
2139
|
}
|
|
2123
2140
|
function De() {
|
|
2124
2141
|
document.addEventListener("click", ue), document.addEventListener("scroll", de, !0), window.addEventListener("resize", w);
|
|
2125
2142
|
}
|
|
2126
|
-
function
|
|
2143
|
+
function h() {
|
|
2127
2144
|
document.removeEventListener("click", ue), document.removeEventListener("scroll", de, !0), window.removeEventListener("resize", w);
|
|
2128
2145
|
}
|
|
2129
|
-
async function
|
|
2146
|
+
async function E() {
|
|
2130
2147
|
var u, y, c;
|
|
2131
|
-
t.disabled ||
|
|
2148
|
+
t.disabled || l.value || (p.value = "", l.value = !0, await be(), K(), (u = b.value) == null || u.focus(), (c = (y = g.value) == null ? void 0 : y.querySelector(".fx-opt.is-on")) == null || c.scrollIntoView({ block: "nearest" }), De());
|
|
2132
2149
|
}
|
|
2133
2150
|
function w() {
|
|
2134
|
-
|
|
2151
|
+
l.value && (l.value = !1, p.value = "", h());
|
|
2135
2152
|
}
|
|
2136
2153
|
Re(p, async () => {
|
|
2137
|
-
|
|
2154
|
+
l.value && (await be(), K());
|
|
2138
2155
|
});
|
|
2139
2156
|
function T(u) {
|
|
2140
2157
|
var y;
|
|
2141
2158
|
if (u.key === "Escape")
|
|
2142
|
-
u.preventDefault(), w(), (y =
|
|
2159
|
+
u.preventDefault(), w(), (y = v.value) == null || y.focus();
|
|
2143
2160
|
else if (u.key === "Enter") {
|
|
2144
2161
|
u.preventDefault();
|
|
2145
|
-
const c =
|
|
2162
|
+
const c = F.value.find((C) => !C.disabled);
|
|
2146
2163
|
c && ce(c);
|
|
2147
2164
|
}
|
|
2148
2165
|
}
|
|
2149
|
-
function
|
|
2150
|
-
|
|
2166
|
+
function Y() {
|
|
2167
|
+
l.value ? w() : E();
|
|
2151
2168
|
}
|
|
2152
2169
|
function ce(u) {
|
|
2153
2170
|
if (!u.disabled) {
|
|
@@ -2162,67 +2179,67 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2162
2179
|
u.value !== t.modelValue && n("update:modelValue", u.value);
|
|
2163
2180
|
}
|
|
2164
2181
|
}
|
|
2165
|
-
const oa =
|
|
2182
|
+
const oa = _(() => t.options.filter((u) => !u.disabled));
|
|
2166
2183
|
function sa(u) {
|
|
2167
2184
|
const y = oa.value;
|
|
2168
2185
|
if (t.multiple || !y.length) {
|
|
2169
|
-
|
|
2186
|
+
E();
|
|
2170
2187
|
return;
|
|
2171
2188
|
}
|
|
2172
|
-
const c = y.findIndex((ee) => ee.value === t.modelValue),
|
|
2173
|
-
R && R.value !== t.modelValue ? n("update:modelValue", R.value) :
|
|
2189
|
+
const c = y.findIndex((ee) => ee.value === t.modelValue), C = u === "Home" ? 0 : u === "End" ? y.length - 1 : u === "ArrowDown" ? Math.min(y.length - 1, (c < 0 ? -1 : c) + 1) : Math.max(0, (c < 0 ? 1 : c) - 1), R = y[C];
|
|
2190
|
+
R && R.value !== t.modelValue ? n("update:modelValue", R.value) : E();
|
|
2174
2191
|
}
|
|
2175
2192
|
function ia(u) {
|
|
2176
2193
|
var y;
|
|
2177
2194
|
if (u.key === "Escape") {
|
|
2178
|
-
if (!
|
|
2179
|
-
u.preventDefault(), w(), (y =
|
|
2195
|
+
if (!l.value) return;
|
|
2196
|
+
u.preventDefault(), w(), (y = v.value) == null || y.focus();
|
|
2180
2197
|
return;
|
|
2181
2198
|
}
|
|
2182
2199
|
if (u.key === "Enter" || u.key === " ") {
|
|
2183
|
-
u.preventDefault(),
|
|
2200
|
+
u.preventDefault(), Y();
|
|
2184
2201
|
return;
|
|
2185
2202
|
}
|
|
2186
2203
|
u.key !== "ArrowDown" && u.key !== "ArrowUp" && u.key !== "Home" && u.key !== "End" || (u.preventDefault(), sa(u.key));
|
|
2187
2204
|
}
|
|
2188
|
-
return Te(
|
|
2205
|
+
return Te(h), (u, y) => (N(), k("div", {
|
|
2189
2206
|
ref_key: "rootEl",
|
|
2190
2207
|
ref: d,
|
|
2191
2208
|
class: pe(["fx-sel", i.value])
|
|
2192
2209
|
}, [
|
|
2193
|
-
|
|
2210
|
+
B("button", ma({
|
|
2194
2211
|
ref_key: "btnEl",
|
|
2195
|
-
ref:
|
|
2212
|
+
ref: v
|
|
2196
2213
|
}, u.$attrs, {
|
|
2197
2214
|
type: "button",
|
|
2198
|
-
class: ["sch-input fx-btn", { "is-open":
|
|
2215
|
+
class: ["sch-input fx-btn", { "is-open": l.value }],
|
|
2199
2216
|
disabled: e.disabled,
|
|
2200
2217
|
"aria-haspopup": "listbox",
|
|
2201
|
-
"aria-expanded":
|
|
2202
|
-
onClick: y[0] || (y[0] = (c) =>
|
|
2218
|
+
"aria-expanded": l.value,
|
|
2219
|
+
onClick: y[0] || (y[0] = (c) => Y()),
|
|
2203
2220
|
onKeydown: ia
|
|
2204
2221
|
}), [
|
|
2205
|
-
|
|
2222
|
+
B("span", In, G(O.value), 1)
|
|
2206
2223
|
], 16, Ln),
|
|
2207
|
-
(
|
|
2224
|
+
(N(), ca(ya, {
|
|
2208
2225
|
to: "body",
|
|
2209
|
-
disabled: !
|
|
2226
|
+
disabled: !A.value
|
|
2210
2227
|
}, [
|
|
2211
|
-
|
|
2212
|
-
|
|
2228
|
+
B("div", Tn, [
|
|
2229
|
+
l.value ? (N(), k("div", {
|
|
2213
2230
|
key: 0,
|
|
2214
2231
|
ref_key: "popEl",
|
|
2215
|
-
ref:
|
|
2216
|
-
class: pe(["fx-pop", { "fx-pop-rich":
|
|
2232
|
+
ref: g,
|
|
2233
|
+
class: pe(["fx-pop", { "fx-pop-rich": x.value }]),
|
|
2217
2234
|
role: "listbox",
|
|
2218
2235
|
"aria-multiselectable": e.multiple || void 0,
|
|
2219
2236
|
style: { visibility: "hidden" }
|
|
2220
2237
|
}, [
|
|
2221
|
-
e.menuTitle ? (
|
|
2222
|
-
e.searchable ? (
|
|
2223
|
-
pa(
|
|
2238
|
+
e.menuTitle ? (N(), k("div", On, G(e.menuTitle), 1)) : j("", !0),
|
|
2239
|
+
e.searchable ? (N(), k("div", $n, [
|
|
2240
|
+
pa(B("input", {
|
|
2224
2241
|
ref_key: "searchEl",
|
|
2225
|
-
ref:
|
|
2242
|
+
ref: b,
|
|
2226
2243
|
"onUpdate:modelValue": y[1] || (y[1] = (c) => p.value = c),
|
|
2227
2244
|
class: "sch-input fx-pop-q",
|
|
2228
2245
|
type: "search",
|
|
@@ -2234,33 +2251,33 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2234
2251
|
}, null, 544), [
|
|
2235
2252
|
[fa, p.value]
|
|
2236
2253
|
])
|
|
2237
|
-
])) :
|
|
2238
|
-
e.searchable && !M.value.length ? (
|
|
2239
|
-
(
|
|
2254
|
+
])) : j("", !0),
|
|
2255
|
+
e.searchable && !M.value.length ? (N(), k("div", xn, "No matches")) : j("", !0),
|
|
2256
|
+
(N(!0), k(Ae, null, ha(M.value, (c) => (N(), k(Ae, {
|
|
2240
2257
|
key: "heading" in c ? `heading:${c.heading}` : `option:${c.option.value}`
|
|
2241
2258
|
}, [
|
|
2242
|
-
"heading" in c ? (
|
|
2259
|
+
"heading" in c ? (N(), k("div", Yn, G(c.heading), 1)) : (N(), k("div", {
|
|
2243
2260
|
key: 1,
|
|
2244
2261
|
class: pe(["fx-opt", {
|
|
2245
|
-
"is-on":
|
|
2262
|
+
"is-on": $(c.option),
|
|
2246
2263
|
"is-off": c.option.disabled,
|
|
2247
2264
|
"is-new": c.option.command
|
|
2248
2265
|
}]),
|
|
2249
2266
|
role: "option",
|
|
2250
|
-
"aria-selected":
|
|
2251
|
-
onClick: (
|
|
2267
|
+
"aria-selected": $(c.option),
|
|
2268
|
+
onClick: (C) => ce(c.option)
|
|
2252
2269
|
}, [
|
|
2253
|
-
y[2] || (y[2] =
|
|
2270
|
+
y[2] || (y[2] = B("span", {
|
|
2254
2271
|
class: "fx-tick",
|
|
2255
2272
|
"aria-hidden": "true"
|
|
2256
2273
|
}, [
|
|
2257
|
-
|
|
2274
|
+
B("svg", {
|
|
2258
2275
|
width: "11",
|
|
2259
2276
|
height: "11",
|
|
2260
2277
|
viewBox: "0 0 16 16",
|
|
2261
2278
|
fill: "none"
|
|
2262
2279
|
}, [
|
|
2263
|
-
|
|
2280
|
+
B("path", {
|
|
2264
2281
|
d: "m3.5 8.4 3 3 6-7",
|
|
2265
2282
|
stroke: "currentColor",
|
|
2266
2283
|
"stroke-width": "2.2",
|
|
@@ -2269,20 +2286,20 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2269
2286
|
})
|
|
2270
2287
|
])
|
|
2271
2288
|
], -1)),
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
c.option.hint ? (
|
|
2275
|
-
])) : (
|
|
2276
|
-
va(
|
|
2289
|
+
x.value ? (N(), k("span", _n, [
|
|
2290
|
+
B("b", null, G(c.option.label), 1),
|
|
2291
|
+
c.option.hint ? (N(), k("small", Fn, G(c.option.hint), 1)) : j("", !0)
|
|
2292
|
+
])) : (N(), k(Ae, { key: 1 }, [
|
|
2293
|
+
va(G(c.option.label), 1)
|
|
2277
2294
|
], 64))
|
|
2278
2295
|
], 10, Bn))
|
|
2279
2296
|
], 64))), 128))
|
|
2280
|
-
], 10, Rn)) :
|
|
2297
|
+
], 10, Rn)) : j("", !0)
|
|
2281
2298
|
])
|
|
2282
2299
|
], 8, ["disabled"]))
|
|
2283
2300
|
], 2));
|
|
2284
2301
|
}
|
|
2285
|
-
}), Un = ["id", "aria-labelledby", "aria-label"], Ve = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',
|
|
2302
|
+
}), Un = ["id", "aria-labelledby", "aria-label"], Ve = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', jo = /* @__PURE__ */ Oe({
|
|
2286
2303
|
__name: "ScheduleModal",
|
|
2287
2304
|
props: {
|
|
2288
2305
|
open: { type: Boolean },
|
|
@@ -2294,43 +2311,43 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2294
2311
|
},
|
|
2295
2312
|
emits: ["close"],
|
|
2296
2313
|
setup(e, { emit: a }) {
|
|
2297
|
-
const t = e, n = a,
|
|
2314
|
+
const t = e, n = a, o = P(null);
|
|
2298
2315
|
let i = null;
|
|
2299
|
-
function
|
|
2316
|
+
function l() {
|
|
2300
2317
|
be(() => {
|
|
2301
|
-
const d =
|
|
2318
|
+
const d = o.value;
|
|
2302
2319
|
d && (d.querySelector(Ve) ?? d).focus();
|
|
2303
2320
|
});
|
|
2304
2321
|
}
|
|
2305
|
-
function
|
|
2322
|
+
function s(d) {
|
|
2306
2323
|
if (!t.open) return;
|
|
2307
2324
|
if (d.key === "Escape") {
|
|
2308
2325
|
d.preventDefault(), n("close");
|
|
2309
2326
|
return;
|
|
2310
2327
|
}
|
|
2311
|
-
if (d.key !== "Tab" || !
|
|
2312
|
-
const
|
|
2313
|
-
if (!
|
|
2314
|
-
const
|
|
2315
|
-
d.shiftKey && document.activeElement ===
|
|
2328
|
+
if (d.key !== "Tab" || !o.value) return;
|
|
2329
|
+
const v = Array.from(o.value.querySelectorAll(Ve));
|
|
2330
|
+
if (!v.length) return;
|
|
2331
|
+
const g = v[0], A = v[v.length - 1];
|
|
2332
|
+
d.shiftKey && document.activeElement === g ? (d.preventDefault(), A.focus()) : !d.shiftKey && document.activeElement === A && (d.preventDefault(), g.focus());
|
|
2316
2333
|
}
|
|
2317
2334
|
return Re(
|
|
2318
2335
|
() => t.open,
|
|
2319
2336
|
(d) => {
|
|
2320
|
-
d ? (i = document.activeElement instanceof HTMLElement ? document.activeElement : null,
|
|
2337
|
+
d ? (i = document.activeElement instanceof HTMLElement ? document.activeElement : null, l()) : (i == null || i.focus(), i = null);
|
|
2321
2338
|
},
|
|
2322
2339
|
{ immediate: !0 }
|
|
2323
|
-
), Ie(() => document.addEventListener("keydown",
|
|
2324
|
-
document.removeEventListener("keydown",
|
|
2325
|
-
}), (d,
|
|
2340
|
+
), Ie(() => document.addEventListener("keydown", s)), Te(() => {
|
|
2341
|
+
document.removeEventListener("keydown", s), i = null;
|
|
2342
|
+
}), (d, v) => e.open ? (N(), k("div", {
|
|
2326
2343
|
key: 0,
|
|
2327
2344
|
class: "modal-overlay open",
|
|
2328
|
-
onClick:
|
|
2345
|
+
onClick: v[0] || (v[0] = ga((g) => n("close"), ["self"]))
|
|
2329
2346
|
}, [
|
|
2330
|
-
|
|
2347
|
+
B("div", {
|
|
2331
2348
|
id: e.id,
|
|
2332
2349
|
ref_key: "panel",
|
|
2333
|
-
ref:
|
|
2350
|
+
ref: o,
|
|
2334
2351
|
class: pe(["schedule-modal-panel", e.panelClass]),
|
|
2335
2352
|
style: Da(e.panelStyle),
|
|
2336
2353
|
role: "dialog",
|
|
@@ -2341,99 +2358,100 @@ const Mn = ["data-hierarchy", "data-size", "data-icon"], Vo = /* @__PURE__ */ Oe
|
|
|
2341
2358
|
}, [
|
|
2342
2359
|
Ke(d.$slots, "default")
|
|
2343
2360
|
], 14, Un)
|
|
2344
|
-
])) :
|
|
2361
|
+
])) : j("", !0);
|
|
2345
2362
|
}
|
|
2346
2363
|
});
|
|
2347
2364
|
export {
|
|
2348
|
-
|
|
2349
|
-
|
|
2365
|
+
H as $,
|
|
2366
|
+
To as A,
|
|
2350
2367
|
Jn as B,
|
|
2351
2368
|
ao as C,
|
|
2352
2369
|
se as D,
|
|
2353
2370
|
Qe as E,
|
|
2354
|
-
|
|
2355
|
-
|
|
2371
|
+
ke as F,
|
|
2372
|
+
Na as G,
|
|
2356
2373
|
no as H,
|
|
2357
|
-
|
|
2358
|
-
|
|
2374
|
+
po as I,
|
|
2375
|
+
xo as J,
|
|
2359
2376
|
Pa as K,
|
|
2360
|
-
|
|
2361
|
-
|
|
2377
|
+
Co as L,
|
|
2378
|
+
So as M,
|
|
2362
2379
|
ko as N,
|
|
2363
2380
|
he as O,
|
|
2364
2381
|
Sa as P,
|
|
2365
2382
|
io as Q,
|
|
2366
2383
|
eo as R,
|
|
2367
|
-
|
|
2368
|
-
|
|
2384
|
+
Ro as S,
|
|
2385
|
+
z as T,
|
|
2369
2386
|
ta as U,
|
|
2370
2387
|
Ta as V,
|
|
2371
|
-
|
|
2388
|
+
Io as W,
|
|
2372
2389
|
_e as X,
|
|
2373
|
-
|
|
2390
|
+
Bo as Y,
|
|
2374
2391
|
to as Z,
|
|
2375
2392
|
Sn as _,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2393
|
+
Uo as a,
|
|
2394
|
+
le as a0,
|
|
2395
|
+
ie as a1,
|
|
2396
|
+
oe as a2,
|
|
2397
|
+
uo as a3,
|
|
2398
|
+
mo as a4,
|
|
2399
|
+
Le as a5,
|
|
2400
|
+
X as a6,
|
|
2401
|
+
lo as a7,
|
|
2385
2402
|
Ra as a8,
|
|
2386
|
-
|
|
2387
|
-
|
|
2403
|
+
yo as a9,
|
|
2404
|
+
re as aA,
|
|
2405
|
+
ho as aB,
|
|
2388
2406
|
Dn as aa,
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2407
|
+
V as ab,
|
|
2408
|
+
Ao as ac,
|
|
2409
|
+
wo as ad,
|
|
2410
|
+
Ho as ae,
|
|
2411
|
+
Yo as af,
|
|
2394
2412
|
Ya as ag,
|
|
2395
|
-
|
|
2413
|
+
Po as ah,
|
|
2396
2414
|
Ca as ai,
|
|
2397
2415
|
Xn as aj,
|
|
2398
|
-
|
|
2416
|
+
Do as ak,
|
|
2399
2417
|
Ye as al,
|
|
2400
|
-
|
|
2418
|
+
zo as am,
|
|
2401
2419
|
Be as an,
|
|
2402
2420
|
fe as ao,
|
|
2403
2421
|
Me as ap,
|
|
2404
|
-
|
|
2405
|
-
|
|
2422
|
+
bo as aq,
|
|
2423
|
+
ro as ar,
|
|
2406
2424
|
Ko as as,
|
|
2407
2425
|
Go as at,
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2426
|
+
jo as au,
|
|
2427
|
+
U as av,
|
|
2428
|
+
Qn as aw,
|
|
2429
|
+
Vo as ax,
|
|
2430
|
+
vo as ay,
|
|
2431
|
+
fo as az,
|
|
2432
|
+
S as b,
|
|
2433
|
+
Wo as c,
|
|
2434
|
+
J as d,
|
|
2435
|
+
Oo as e,
|
|
2418
2436
|
Zn as f,
|
|
2419
2437
|
pn as g,
|
|
2420
|
-
|
|
2438
|
+
Lo as h,
|
|
2421
2439
|
La as i,
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2440
|
+
go as j,
|
|
2441
|
+
_o as k,
|
|
2442
|
+
Eo as l,
|
|
2443
|
+
No as m,
|
|
2444
|
+
Mo as n,
|
|
2427
2445
|
m as o,
|
|
2428
|
-
|
|
2446
|
+
r as p,
|
|
2429
2447
|
Ce as q,
|
|
2430
|
-
|
|
2448
|
+
co as r,
|
|
2431
2449
|
ba as s,
|
|
2432
2450
|
so as t,
|
|
2433
|
-
|
|
2451
|
+
$o as u,
|
|
2434
2452
|
Se as v,
|
|
2435
2453
|
oo as w,
|
|
2436
2454
|
hn as x,
|
|
2437
2455
|
qn as y,
|
|
2438
|
-
|
|
2456
|
+
Fo as z
|
|
2439
2457
|
};
|