@feedmepos/mf-hrm-portal 2.3.2-dev.7 → 2.3.2-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{ApprovalCodeList-Bw0E-hZl.js → ApprovalCodeList-DIYhVMGW.js} +7 -7
  2. package/dist/{AuditLogList-CA-_t77n.js → AuditLogList-DIc3Jgpr.js} +795 -719
  3. package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-LtjNCAFN.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js} +2 -2
  4. package/dist/{EmployeeList-D_bX0EhQ.js → EmployeeList-iVg4pI9Y.js} +8 -8
  5. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-CyZxQa-b.js → FormSection.vue_vue_type_script_setup_true_lang-C9AE0EHw.js} +1 -1
  6. package/dist/{GrantUserList-Cg7ITk_M.js → GrantUserList-8zmzFk9z.js} +8 -8
  7. package/dist/{Main-D5wi42fp.js → Main-ClJox3pV.js} +10 -10
  8. package/dist/{Main-Bl-Ocx1G.js → Main-DYzFd_qa.js} +5 -5
  9. package/dist/{Main-BaB4vgI5.js → Main-gRu17-N6.js} +1005 -999
  10. package/dist/{MyPosProfile-CUG_201f.js → MyPosProfile-ARRrolbz.js} +1 -1
  11. package/dist/{PermissionSetList-kgG9H3DX.js → PermissionSetList-CL42jQY4.js} +13 -12
  12. package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-y1YcZpGA.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DkA0XbZw.js} +648 -647
  13. package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-fQyCtDXM.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js} +1 -1
  14. package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-3Q8udk43.js → RoleForm.vue_vue_type_script_setup_true_lang-B3N3hTcU.js} +9 -9
  15. package/dist/{RoleList-Cmz97HHP.js → RoleList-F9ZORhgE.js} +7 -7
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CggEy3OI.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-B39k3SQH.js → ScheduleGeneralPage-751cEUwS.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-C5j3D4eF.js → ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js} +4 -4
  19. package/dist/{SchedulePage-AVmRkFi1.js → SchedulePage-C-NcbGIl.js} +189 -201
  20. package/dist/{SchedulePositionPage-3rE-O8CG.js → SchedulePositionPage-Ba0iiSRg.js} +3 -3
  21. package/dist/{SelectFilter-R7ry_GEg.js → SelectFilter-Dpsq165k.js} +1 -1
  22. package/dist/{TeamMemberList-CvDnIILn.js → TeamMemberList-DZ0aRbxg.js} +28 -27
  23. package/dist/TimesheetList-DO5T__dL.js +437 -0
  24. package/dist/{app-DKUCzcrc.js → app-DXkKrcRn.js} +38 -10
  25. package/dist/app.js +1 -1
  26. package/dist/{approval-code-nsETgIry.js → approval-code-D2pGW-sI.js} +4 -4
  27. package/dist/{dayjs.min-CtULWW1N.js → dayjs.min-BAz84JAQ.js} +1 -1
  28. package/dist/employee-yYhuhc9L.js +172 -0
  29. package/dist/{grant-user-Dpa_Rl6j.js → grant-user-B95RDjkR.js} +2 -2
  30. package/dist/{iteration-DpHBtiyr.js → index-TrBkLxJe.js} +698 -726
  31. package/dist/iteration-CcXrOMQe.js +30 -0
  32. package/dist/{lodash-YaHCUo_F.js → lodash-DXRsZpTB.js} +1 -1
  33. package/dist/{member-grant-CEokFI3_.js → member-grant-ByAQ1Qja.js} +2 -2
  34. package/dist/{restaurant-CDFKqEFm.js → restaurant-COSpCpTQ.js} +2 -2
  35. package/dist/{role-DyBVVlEA.js → role-ZmCd2yG4.js} +8 -7
  36. package/dist/{rule-xErZqYmH.js → rule-Bty9eoI3.js} +38 -37
  37. package/dist/src/api/audit-log/index.d.ts +2 -0
  38. package/dist/src/api/employee/index.d.ts +1 -2
  39. package/dist/src/stores/approval-code.d.ts +1 -1
  40. package/dist/src/stores/employee.d.ts +3 -9
  41. package/dist/src/stores/grant-user.d.ts +1 -1
  42. package/dist/src/stores/permission-assignment.d.ts +2 -2
  43. package/dist/src/stores/permission-set.d.ts +2 -2
  44. package/dist/src/stores/restaurant.d.ts +2 -2
  45. package/dist/src/stores/role.d.ts +2 -2
  46. package/dist/src/stores/team.d.ts +1 -1
  47. package/dist/src/stores/timesheet.d.ts +62 -47
  48. package/dist/src/types/timesheet.d.ts +3 -0
  49. package/dist/src/views/audit-log/locales/index.d.ts +28 -0
  50. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
  51. package/dist/style.css +1 -1
  52. package/dist/timesheet-CFD6XPiG.js +76 -0
  53. package/dist/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/{useAppStore-BqsvPsPB.js → useAppStore-7O0GMkXY.js} +1 -1
  55. package/dist/{useLoading-BS1bnZg1.js → useLoading-BZXydjer.js} +1 -1
  56. package/dist/useMessage-_ywT_N9X.js +17 -0
  57. package/dist/{useReportPermissions-DJEhkyGc.js → useReportPermissions-Cn3ntCJ9.js} +3 -3
  58. package/package.json +3 -3
  59. package/dist/TimesheetList-DYoglTi8.js +0 -401
  60. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_d0c6fd51_lang-DBpzyQ17.js +0 -63
  61. package/dist/employee-DlsSqR3i.js +0 -210
@@ -1,52 +1,53 @@
1
1
  import { reactive as Xe, watch as Ct, computed as L, ref as Y, onUnmounted as To, shallowRef as Gs, onBeforeUnmount as qt, onMounted as tn, nextTick as Xt, defineComponent as ze, createElementBlock as p, openBlock as m, unref as a, createElementVNode as t, Fragment as G, renderList as pe, createStaticVNode as Tt, createCommentVNode as U, normalizeClass as te, createVNode as W, toDisplayString as i, withCtx as se, createTextVNode as F, normalizeStyle as We, withModifiers as Ze, withKeys as Zt, createBlock as Qe, withDirectives as at, vModelText as vt, vModelCheckbox as Rn, vShow as Js, resolveComponent as Xs, isRef as Vo } from "vue";
2
2
  import { useRouter as Ma, onBeforeRouteLeave as Qs } from "vue-router";
3
- import { useSnackbar as bn, SnackbarPosition as jo, components as Zs } from "@feedmepos/ui-library";
3
+ import { useSnackbar as Dn, SnackbarPosition as jo, components as Zs } from "@feedmepos/ui-library";
4
4
  import { useCoreStore as Oo, useI18n as me } from "@feedmepos/mf-common";
5
- import { d as Ln, p as Dt, w as Ta, o as Nt, i as Sn, c as _s, a as Oa, P as rn, R as In, b as Me, s as Et, e as on, f as el, h as tl, g as Aa, j as Ra, r as en, k as zt, l as so, m as La, n as nl, q as It, S as ol, t as qn, u as al, v as fo, x as kt, y as qo, z as mn, A as Qn, U as Ia, C as sl, W as Ge, B as Hn, D as ll, E as il, F as pn, G as Ao, H as an, I as qe, J as En, K as Ha, L as Ut, M as Lt, N as lo, O as io, Q as Yo, T as Yn, V as rl, X as yo, Y as dl, Z as Gn, _ as bo, $ as ro, a0 as ko, a1 as Na, a2 as Ko, a3 as Go, a4 as xn, a5 as Jo, a6 as Xo, a7 as Fa, a8 as wo, a9 as ul, aa as Ba, ab as cl, ac as vn, ad as hl, ae as ml, af as vl, ag as pl, ah as Ua, ai as Jn, aj as gl, ak as _t, al as Xn, am as Qo, an as Ro, ao as Lo, ap as $o, aq as fl, ar as Io, as as yl, at as bl, au as kl, av as re, aw as wl, ax as wt, ay as Pn, az as Wa, aA as $l, aB as Sl, aC as Zo } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-C5j3D4eF.js";
6
- import "./iteration-DpHBtiyr.js";
7
- import { t as So, b as xo } from "./rule-xErZqYmH.js";
8
- import { E as Va, u as xl } from "./employee-DlsSqR3i.js";
5
+ import { d as Ln, p as Dt, w as Ta, o as Nt, i as $n, c as _s, a as Oa, P as rn, R as In, b as Me, s as Et, e as on, f as el, h as tl, g as Aa, j as Ra, r as en, k as zt, l as so, m as La, n as nl, q as It, S as ol, t as qn, u as al, v as fo, x as kt, y as qo, z as mn, A as Qn, U as Ia, C as sl, W as Ge, B as Hn, D as ll, E as il, F as pn, G as Ao, H as an, I as qe, J as Cn, K as Ha, L as Ut, M as Lt, N as lo, O as io, Q as Yo, T as Yn, V as rl, X as yo, Y as dl, Z as Gn, _ as bo, $ as ro, a0 as ko, a1 as Na, a2 as Ko, a3 as Go, a4 as Sn, a5 as Jo, a6 as Xo, a7 as Fa, a8 as wo, a9 as ul, aa as Ba, ab as cl, ac as vn, ad as hl, ae as ml, af as vl, ag as pl, ah as Ua, ai as Jn, aj as gl, ak as _t, al as Xn, am as Qo, an as Ro, ao as Lo, ap as $o, aq as fl, ar as Io, as as yl, at as bl, au as kl, av as re, aw as wl, ax as wt, ay as Pn, az as Wa, aA as $l, aB as Sl, aC as Zo } from "./ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js";
6
+ import "./index-TrBkLxJe.js";
7
+ import { t as So, b as xo } from "./rule-Bty9eoI3.js";
8
+ import { E as Va, u as xl } from "./employee-yYhuhc9L.js";
9
9
  import { c as Cl } from "./object-Dwyg2LgX.js";
10
- import { R as ja, n as El, a as Un } from "./app-DKUCzcrc.js";
10
+ import { R as ja, n as El, a as Un } from "./app-DXkKrcRn.js";
11
11
  import { u as Dl } from "./useDiscardConfirm-CzZSPyvh.js";
12
- import { u as Co } from "./role-DyBVVlEA.js";
13
- import { u as Pl } from "./restaurant-CDFKqEFm.js";
14
- import { u as zl } from "./useLoading-BS1bnZg1.js";
15
- import { useAppStore as Ml } from "@feedmepos/mf-remy-panel";
16
- import { u as Tl, _ as Ol, a as Al } from "./ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CggEy3OI.js";
17
- function Rl(e) {
12
+ import { u as Co } from "./role-ZmCd2yG4.js";
13
+ import { u as Pl } from "./restaurant-COSpCpTQ.js";
14
+ import { u as zl } from "./useLoading-BZXydjer.js";
15
+ import { u as Ml } from "./useMessage-_ywT_N9X.js";
16
+ import { useAppStore as Tl } from "@feedmepos/mf-remy-panel";
17
+ import { u as Ol, _ as Al, a as Rl } from "./ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js";
18
+ function Ll(e) {
18
19
  return {
19
20
  employees: Oa(e),
20
21
  openShifts: _s()
21
22
  };
22
23
  }
23
- const Ll = 16, cn = /* @__PURE__ */ new Map();
24
+ const Il = 16, cn = /* @__PURE__ */ new Map();
24
25
  let _o = -1, ea;
25
26
  function uo(e, n) {
26
27
  (_o !== Ln.value || ea !== Dt.value) && (cn.clear(), _o = Ln.value, ea = Dt.value);
27
- const o = Ta(e, n), s = o[0], l = `${Nt.value ?? "unselected"}:${Sn(s)}`;
28
+ const o = Ta(e, n), s = o[0], l = `${Nt.value ?? "unselected"}:${$n(s)}`;
28
29
  let r = cn.get(l);
29
- for (r ? cn.delete(l) : r = Rl(o), cn.set(l, r); cn.size > Ll; ) {
30
+ for (r ? cn.delete(l) : r = Ll(o), cn.set(l, r); cn.size > Il; ) {
30
31
  const u = cn.keys().next().value;
31
32
  if (!u) break;
32
33
  cn.delete(u);
33
34
  }
34
35
  return r;
35
36
  }
36
- function Il(e) {
37
+ function Hl(e) {
37
38
  return !!e && !Array.isArray(e) && "start" in e;
38
39
  }
39
40
  function xt(e) {
40
41
  return !!e && !Array.isArray(e) && "timeOff" in e;
41
42
  }
42
43
  function Ie(e) {
43
- return e ? Array.isArray(e) ? e : Il(e) ? [e] : [] : [];
44
+ return e ? Array.isArray(e) ? e : Hl(e) ? [e] : [] : [];
44
45
  }
45
46
  function qa(e, n) {
46
47
  const [o, s] = Et(e.start, e.end), [l, r] = Et(n.start, n.end);
47
48
  return o < r && l < s;
48
49
  }
49
- function Dn(e, n) {
50
+ function En(e, n) {
50
51
  return e.some((o) => o !== n && qa(o, n));
51
52
  }
52
53
  function Ht(e) {
@@ -73,10 +74,10 @@ function Eo(e) {
73
74
  var n;
74
75
  return Me.coverage.full && e in Me.coverage.full ? e : ((n = In[e]) == null ? void 0 : n[0]) ?? e;
75
76
  }
76
- function Cn(e) {
77
+ function xn(e) {
77
78
  return e.contractHours ?? 0;
78
79
  }
79
- function Hl(e) {
80
+ function Nl(e) {
80
81
  return e.pct < 100;
81
82
  }
82
83
  const ta = [1, 2, 4, 5, 6, 7];
@@ -85,10 +86,10 @@ function fn(e) {
85
86
  const o = [...rn].sort((l, r) => l.localeCompare(r)).indexOf(e);
86
87
  return `sc-p${ta[Math.max(0, o) % ta.length]}`;
87
88
  }
88
- function Nl() {
89
+ function Fl() {
89
90
  return ((/* @__PURE__ */ new Date()).getDay() + 6) % 7;
90
91
  }
91
- function Fl(e, n) {
92
+ function Bl(e, n) {
92
93
  const o = Oo(), { t: s, locale: l } = me(), r = Xe({}), u = Xe({});
93
94
  Ct(
94
95
  Dt,
@@ -174,7 +175,7 @@ function Fl(e, n) {
174
175
  isHoliday: A
175
176
  };
176
177
  }
177
- function Bl(e) {
178
+ function Ul(e) {
178
179
  const { t: n } = me();
179
180
  async function o(u, d) {
180
181
  var v;
@@ -261,7 +262,7 @@ function Bl(e) {
261
262
  }
262
263
  return { persistSlot: s, persistRemoval: l, persistMove: r, recoverPersistFailure: o };
263
264
  }
264
- function Ul(e) {
265
+ function Wl(e) {
265
266
  const { t: n } = me();
266
267
  async function o(s) {
267
268
  const l = s.map((r) => r.slot.assignmentId);
@@ -284,7 +285,7 @@ function Ul(e) {
284
285
  }
285
286
  return { persistPublish: o };
286
287
  }
287
- function Wl(e) {
288
+ function Vl(e) {
288
289
  const { t: n, locale: o } = me(), s = L(() => It(o == null ? void 0 : o.value)), l = Y([]), r = Y(ol.map((_) => ({ ..._ }))), u = Y([]), d = Y(qn(/* @__PURE__ */ new Date())), c = L(() => al(qn(/* @__PURE__ */ new Date()), d.value)), v = L(() => fo(d.value, -c.value * kt));
289
290
  Ct(
290
291
  [c, Ln],
@@ -342,13 +343,13 @@ function Wl(e) {
342
343
  }
343
344
  function k(_) {
344
345
  const ne = R.value[_];
345
- return ne ? Sn(ne) : null;
346
+ return ne ? $n(ne) : null;
346
347
  }
347
348
  function P(_, ne) {
348
349
  const j = Ta(_, v.value)[ne];
349
- return j ? Sn(j) : null;
350
+ return j ? $n(j) : null;
350
351
  }
351
- const O = Fl(k, e);
352
+ const O = Bl(k, e);
352
353
  function h(_ = c.value) {
353
354
  return _ < 0;
354
355
  }
@@ -374,7 +375,7 @@ function Wl(e) {
374
375
  ne.setDate(ne.getDate() + _ * kt), d.value = ne;
375
376
  }
376
377
  function H() {
377
- d.value = qn(/* @__PURE__ */ new Date()), S.value === "day" && (A.value = Nl());
378
+ d.value = qn(/* @__PURE__ */ new Date()), S.value === "day" && (A.value = Fl());
378
379
  }
379
380
  function B(_) {
380
381
  _ !== S.value && (S.value = _, _ === "day" && (A.value = x() ?? 0));
@@ -426,7 +427,7 @@ function Wl(e) {
426
427
  kind: "add",
427
428
  label: `${le}
428
429
  ${N.role || n("scheduling.common.anyPosition")}${Te ? ` · ${n("scheduling.status.splitShift")}` : ""}`,
429
- conflict: N.conflict || He(ne, N.role) || Dn(ge, N)
430
+ conflict: N.conflict || He(ne, N.role) || En(ge, N)
430
431
  });
431
432
  });
432
433
  });
@@ -460,7 +461,7 @@ ${N.role || n("scheduling.common.anyPosition")}${Te ? ` · ${n("scheduling.statu
460
461
  return $.value.reduce(
461
462
  (_, ne) => _ + l.value.reduce(
462
463
  (j, X) => j + Ie(X.shifts[ne]).filter(
463
- (ge, Te, N) => ge.status === "pending" && (ge.conflict || He(X, ge.role) || Dn(N, ge))
464
+ (ge, Te, N) => ge.status === "pending" && (ge.conflict || He(X, ge.role) || En(N, ge))
464
465
  ).length,
465
466
  0
466
467
  ),
@@ -494,12 +495,12 @@ ${N.role || n("scheduling.common.anyPosition")}${Te ? ` · ${n("scheduling.statu
494
495
  function ct(_, ne) {
495
496
  return _ === c.value ? ee(ne) : uo(_, v.value).employees.find((j) => j.id === ne);
496
497
  }
497
- const { persistSlot: Le, persistRemoval: it, persistMove: mt, recoverPersistFailure: Re } = Bl({
498
+ const { persistSlot: Le, persistRemoval: it, persistMove: mt, recoverPersistFailure: Re } = Ul({
498
499
  dateFor: P,
499
500
  employeeAt: ct,
500
501
  currentOffset: () => c.value,
501
502
  onPersistError: e == null ? void 0 : e.onPersistError
502
- }), { persistPublish: Be } = Ul({
503
+ }), { persistPublish: Be } = Wl({
503
504
  recoverPersistFailure: Re
504
505
  });
505
506
  function ke(_, ne, j, X, ge, Te = 1) {
@@ -758,8 +759,8 @@ ${N.role || n("scheduling.common.anyPosition")}${Te ? ` · ${n("scheduling.statu
758
759
  ...O
759
760
  };
760
761
  }
761
- function Vl(e) {
762
- const n = bn(), { t: o } = me(), s = Y(null), l = Y(null);
762
+ function jl(e) {
763
+ const n = Dn(), { t: o } = me(), s = Y(null), l = Y(null);
763
764
  function r(z, E, b, D = 0) {
764
765
  var T;
765
766
  const y = e.employeeById(z), S = y == null ? void 0 : y.shifts[E];
@@ -822,7 +823,7 @@ function Vl(e) {
822
823
  function Nn(e, n) {
823
824
  return Ao(e, n) / 60;
824
825
  }
825
- function jl(e, n) {
826
+ function ql(e, n) {
826
827
  const { locale: o } = me(), s = L(() => It(o == null ? void 0 : o.value)), l = Y(!0);
827
828
  function r(R, T) {
828
829
  var C;
@@ -931,7 +932,7 @@ function jl(e, n) {
931
932
  (C, g) => C + Ie(g).reduce((k, P) => k + pn(P) / 60, 0),
932
933
  0
933
934
  ) * 10
934
- ) / 10, $ = Cn(R);
935
+ ) / 10, $ = xn(R);
935
936
  return {
936
937
  empId: R.id,
937
938
  name: R.name,
@@ -955,7 +956,7 @@ function jl(e, n) {
955
956
  otRisk: A
956
957
  };
957
958
  }
958
- function ql(e, n) {
959
+ function Yl(e, n) {
959
960
  let o = 0, s = 0, l = 0, r = 0;
960
961
  const u = Math.max(0, (e.contractHours ?? e.maxHours ?? 0) * 60);
961
962
  for (const { slot: d, multiplier: c } of n) {
@@ -970,7 +971,7 @@ function ql(e, n) {
970
971
  totalCost: l + r
971
972
  };
972
973
  }
973
- function Yl(e, n) {
974
+ function Kl(e, n) {
974
975
  const o = Math.round(e * 60), s = Math.floor(o / 60), l = o % 60;
975
976
  return l ? n("scheduling.stats.hoursMinutes", { h: s, m: l }) : n("scheduling.stats.hours", { h: s });
976
977
  }
@@ -994,19 +995,19 @@ function nn(e, n = []) {
994
995
  o += D, l.push({ slot: b, multiplier: 1 }), b.status === "pending" && (s += D);
995
996
  });
996
997
  });
997
- let r = ql(e, l).totalCost;
998
+ let r = Yl(e, l).totalCost;
998
999
  const u = o;
999
1000
  n.forEach((E) => {
1000
1001
  const b = E.end === E.start ? 0 : Nn(E.start, E.end);
1001
1002
  o += b, r += b * e.rate;
1002
1003
  }), o = Math.round(o * 10) / 10;
1003
- const d = Cn(e), c = d > 0 ? Math.max(d, o) : o, v = c > 0 ? o / c : 0, w = c > 0 ? u / c : 0, z = d <= 0 ? o > 0 ? "var(--fm-green-300)" : "var(--border-md)" : o > d ? "var(--fm-red-300)" : v >= 0.9 ? "var(--fm-orange-300)" : "var(--fm-green-300)";
1004
+ const d = xn(e), c = d > 0 ? Math.max(d, o) : o, v = c > 0 ? o / c : 0, w = c > 0 ? u / c : 0, z = d <= 0 ? o > 0 ? "var(--fm-green-300)" : "var(--border-md)" : o > d ? "var(--fm-red-300)" : v >= 0.9 ? "var(--fm-orange-300)" : "var(--fm-green-300)";
1004
1005
  return {
1005
1006
  emp: e,
1006
1007
  hours: o,
1007
1008
  cost: r,
1008
1009
  contract: d,
1009
- partTime: Hl(e),
1010
+ partTime: Nl(e),
1010
1011
  pct: v,
1011
1012
  barColor: z,
1012
1013
  otHours: d > 0 ? Math.round(Math.max(0, o - d) * 10) / 10 : 0,
@@ -1038,10 +1039,10 @@ function Vn(e) {
1038
1039
  const n = an(e) % 1440, o = qe(e);
1039
1040
  return n % 60 ? o : `${o.replace(/(am|pm)$/, "")}:00${o.slice(-2)}`;
1040
1041
  }
1041
- function Kl(e) {
1042
+ function Gl(e) {
1042
1043
  return e ? e === 30 || e === 60 || e === 90 || e === 120 ? { choice: e } : { choice: "custom", customMins: e, customUnit: "mins" } : { choice: 0 };
1043
1044
  }
1044
- function Gl(e, n, o) {
1045
+ function Jl(e, n, o) {
1045
1046
  if (e === "custom") {
1046
1047
  const s = n || 0;
1047
1048
  return Math.round(o === "hrs" ? s * 60 : s);
@@ -1051,24 +1052,24 @@ function Gl(e, n, o) {
1051
1052
  function hn(e, n) {
1052
1053
  return Math.max(0, Ao(e.start, e.end) - n) / 60;
1053
1054
  }
1054
- let Jl = 1;
1055
- function Xl() {
1056
- const e = En.find((n) => n.active) ?? En[0];
1055
+ let Xl = 1;
1056
+ function Ql() {
1057
+ const e = Cn.find((n) => n.active) ?? Cn[0];
1057
1058
  return { start: (e == null ? void 0 : e.start) ?? Me.openFrom, end: (e == null ? void 0 : e.end) ?? Me.openTo };
1058
1059
  }
1059
- function Ql(e) {
1060
+ function Zl(e) {
1060
1061
  return { position: e, count: 1, sen: "" };
1061
1062
  }
1062
- function Zl() {
1063
+ function _l() {
1063
1064
  const e = Y(!1), n = Y(null), o = Y(null), s = Y(null), l = Y(null), r = Y(!0), u = Y(0), d = Y(1), c = Y(void 0), v = Y(!1), w = Y(""), z = Y([{ start: "08:00", end: "17:00" }]), E = Y(""), b = Y(void 0), D = Y(1), y = Y(""), S = Y(""), A = Y([]), R = Y(0), T = Y(30), $ = Y("hrs"), C = Y("duration"), g = Y("12:00"), k = Y("12:30"), P = Y(Array(kt).fill(!1)), O = Y(null), h = Y(null), f = Y(!0), x = Y(!1);
1064
1065
  function I(he) {
1065
1066
  n.value = he, w.value = "";
1066
- const de = Xl();
1067
+ const de = Ql();
1067
1068
  z.value = [{ start: de.start, end: de.end }], y.value = "", S.value = "", R.value = 0, T.value = 30, $.value = "hrs", C.value = "duration", g.value = "12:00", k.value = "12:30", P.value = Array(kt).fill(!1), O.value = null, h.value = null, f.value = !0, x.value = !1, v.value = !1;
1068
1069
  }
1069
1070
  function M(he) {
1070
1071
  C.value = "duration";
1071
- const de = Kl(he);
1072
+ const de = Gl(he);
1072
1073
  R.value = de.choice, de.customMins !== void 0 && (T.value = de.customMins), de.customUnit !== void 0 && ($.value = de.customUnit);
1073
1074
  }
1074
1075
  function H(he, de) {
@@ -1085,7 +1086,7 @@ function Zl() {
1085
1086
  xe < 0 && (xe += 24 * 60), T.value = xe, $.value = "mins";
1086
1087
  }
1087
1088
  function B() {
1088
- return Gl(R.value, T.value, $.value);
1089
+ return Jl(R.value, T.value, $.value);
1089
1090
  }
1090
1091
  function Q() {
1091
1092
  if (C.value === "time")
@@ -1112,7 +1113,7 @@ function Zl() {
1112
1113
  breaks: de
1113
1114
  }));
1114
1115
  if (oe.length > 1) {
1115
- const ue = c.value ?? `split-${++Jl}`;
1116
+ const ue = c.value ?? `split-${++Xl}`;
1116
1117
  oe.forEach(($e) => $e.splitGroupId = ue);
1117
1118
  }
1118
1119
  return oe.length === 1 ? oe[0] : oe;
@@ -1124,7 +1125,7 @@ function Zl() {
1124
1125
  z.value.splice(he, 1);
1125
1126
  }
1126
1127
  function ee() {
1127
- A.value.push(Ql(""));
1128
+ A.value.push(Zl(""));
1128
1129
  }
1129
1130
  function ye(he) {
1130
1131
  A.value.length > 1 && A.value.splice(he, 1);
@@ -1175,7 +1176,7 @@ function Zl() {
1175
1176
  segmentHoursOf: Ee
1176
1177
  };
1177
1178
  }
1178
- function _l(e, n) {
1179
+ function ei(e, n) {
1179
1180
  if (e.positions.includes(n)) return;
1180
1181
  e.positions.push(n);
1181
1182
  const o = zt(e.id);
@@ -1193,7 +1194,7 @@ function _l(e, n) {
1193
1194
  }).catch(() => {
1194
1195
  });
1195
1196
  }
1196
- function ei(e, n) {
1197
+ function ti(e, n) {
1197
1198
  const { draft: o, saveDisabled: s, showGrantSkill: l } = n, { t: r } = me();
1198
1199
  function u() {
1199
1200
  const v = o.dayIdx.value;
@@ -1223,7 +1224,7 @@ function ei(e, n) {
1223
1224
  ) : e.commitShift(E, y, b);
1224
1225
  }), l.value && o.grantSkill.value) {
1225
1226
  const y = e.employeeById(E);
1226
- y && _l(y, o.role.value);
1227
+ y && ei(y, o.role.value);
1227
1228
  }
1228
1229
  } else o.originalEmpId.value != null && e.removeShift(
1229
1230
  o.originalEmpId.value,
@@ -1245,20 +1246,20 @@ function ei(e, n) {
1245
1246
  }
1246
1247
  return { save: d, remove: c };
1247
1248
  }
1248
- const ti = {
1249
+ const ni = {
1249
1250
  ANNUAL: "scheduling.leave.type.annual",
1250
1251
  MEDICAL: "scheduling.leave.type.medical",
1251
1252
  EMERGENCY: "scheduling.leave.type.emergency",
1252
1253
  UNPAID: "scheduling.leave.type.unpaid"
1253
1254
  };
1254
1255
  function sn(e) {
1255
- return e.type === "OFF_DAY" ? "scheduling.leave.type.offDay" : ti[e.leaveType ?? "ANNUAL"];
1256
+ return e.type === "OFF_DAY" ? "scheduling.leave.type.offDay" : ni[e.leaveType ?? "ANNUAL"];
1256
1257
  }
1257
1258
  function na(e, n) {
1258
1259
  const o = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
1259
1260
  return o.setUTCDate(o.getUTCDate() + n), o.toISOString().slice(0, 10);
1260
1261
  }
1261
- function ni(e, n) {
1262
+ function oi(e, n) {
1262
1263
  if (e.startDate === e.endDate) return [];
1263
1264
  const o = {
1264
1265
  employeeId: e.employeeId,
@@ -1292,15 +1293,15 @@ function ni(e, n) {
1292
1293
  const Ka = {
1293
1294
  MY: { label: "RM", position: "before" },
1294
1295
  TH: { label: "บาท", position: "after" }
1295
- }, oi = Ka.MY;
1296
- function ai(e) {
1297
- return Ka[(e ?? "").toUpperCase()] ?? oi;
1296
+ }, ai = Ka.MY;
1297
+ function si(e) {
1298
+ return Ka[(e ?? "").toUpperCase()] ?? ai;
1298
1299
  }
1299
1300
  function oa(e, n) {
1300
1301
  return n.position === "after" ? `${e} ${n.label}` : `${n.label} ${e}`;
1301
1302
  }
1302
1303
  function Wt() {
1303
- const e = Oo(), n = L(() => ai(e.currentCountry.value));
1304
+ const e = Oo(), n = L(() => si(e.currentCountry.value));
1304
1305
  function o(s, l) {
1305
1306
  const r = l == null ? Math.round(s).toLocaleString() : s.toLocaleString(void 0, {
1306
1307
  minimumFractionDigits: l,
@@ -1318,7 +1319,7 @@ function Wt() {
1318
1319
  function aa(e) {
1319
1320
  return { position: e, count: 1, sen: "" };
1320
1321
  }
1321
- function si(e, n, o = {}) {
1322
+ function li(e, n, o = {}) {
1322
1323
  const { t: s, locale: l } = me(), { formatMoney: r } = Wt();
1323
1324
  function u(j, X, ge = []) {
1324
1325
  const Te = Object.fromEntries(Object.keys(X).map((N) => [N, `${N}`]));
@@ -1337,7 +1338,7 @@ function si(e, n, o = {}) {
1337
1338
  { name: j.name }
1338
1339
  ) : null;
1339
1340
  }
1340
- const c = Zl(), v = Y(!1), w = Y(null), {
1341
+ const c = _l(), v = Y(!1), w = Y(null), {
1341
1342
  open: z,
1342
1343
  dayIdx: E,
1343
1344
  empId: b,
@@ -1395,7 +1396,7 @@ function si(e, n, o = {}) {
1395
1396
  }
1396
1397
  return J + ft.value > ge;
1397
1398
  });
1398
- }), ct = L(() => ht.value && b.value == null), Le = ei(e, {
1399
+ }), ct = L(() => ht.value && b.value == null), Le = ti(e, {
1399
1400
  draft: c,
1400
1401
  saveDisabled: ct,
1401
1402
  showGrantSkill: xe,
@@ -1641,7 +1642,7 @@ function St(e) {
1641
1642
  const [n, o] = String(e || "0:0").split(":"), s = ((Number(n) || 0) % 24 + 24) % 24, l = Math.max(0, Math.min(59, Number(o) || 0)), r = s < 12 ? "AM" : "PM";
1642
1643
  return `${s % 12 === 0 ? 12 : s % 12}:${String(l).padStart(2, "0")} ${r}`;
1643
1644
  }
1644
- function li(e) {
1645
+ function ii(e) {
1645
1646
  const n = e.trim().toLowerCase();
1646
1647
  if (!n) return null;
1647
1648
  const o = n.match(/(am|pm|a|p)$/), s = o == null ? void 0 : o[1], l = (s ? n.slice(0, -s.length) : n).trim();
@@ -1665,7 +1666,7 @@ function li(e) {
1665
1666
  return null;
1666
1667
  return `${String(r).padStart(2, "0")}:${String(u).padStart(2, "0")}`;
1667
1668
  }
1668
- function ii() {
1669
+ function ri() {
1669
1670
  const e = Xe({
1670
1671
  open: !1,
1671
1672
  value: "",
@@ -1692,7 +1693,7 @@ function ii() {
1692
1693
  function r() {
1693
1694
  return o ? o.getBoundingClientRect() : null;
1694
1695
  }
1695
- const u = L(() => li(e.query)), d = L(() => {
1696
+ const u = L(() => ii(e.query)), d = L(() => {
1696
1697
  const E = /* @__PURE__ */ new Set();
1697
1698
  for (let y = 0; y < 24; y++)
1698
1699
  E.add(`${String(y).padStart(2, "0")}:00`), E.add(`${String(y).padStart(2, "0")}:30`);
@@ -1730,14 +1731,14 @@ function ii() {
1730
1731
  function Ga(e, n) {
1731
1732
  return `${qe(Lt(e % 1440))} – ${qe(Lt(n % 1440))}`;
1732
1733
  }
1733
- const ri = (e) => Math.max(0, ((e == null ? void 0 : e.n) ?? 0) | 0);
1734
- function di(e) {
1734
+ const di = (e) => Math.max(0, ((e == null ? void 0 : e.n) ?? 0) | 0);
1735
+ function ui(e) {
1735
1736
  return (e.roles ?? []).reduce((n, o) => n + Math.max(0, o.n | 0), 0);
1736
1737
  }
1737
1738
  function sa(e) {
1738
- return ri(e) - di(e);
1739
+ return di(e) - ui(e);
1739
1740
  }
1740
- function ui(e, n, o) {
1741
+ function ci(e, n, o) {
1741
1742
  const s = (c, v) => {
1742
1743
  var w, z;
1743
1744
  return ((w = c.positions) == null ? void 0 : w[0]) === v || c.role === v ? 0 : c.role && ((z = c.positions) != null && z.length) ? 1 : 2;
@@ -1765,7 +1766,7 @@ const Ja = [
1765
1766
  { value: "EMERGENCY", label: "Emergency Leave", labelKey: "scheduling.leave.type.emergency" },
1766
1767
  { value: "UNPAID", label: "Unpaid Leave", labelKey: "scheduling.leave.type.unpaid" }
1767
1768
  ];
1768
- function ci(e, n = {}) {
1769
+ function hi(e, n = {}) {
1769
1770
  const { t: o, locale: s } = me(), l = Xe({
1770
1771
  open: !1,
1771
1772
  empId: null,
@@ -1844,7 +1845,7 @@ function ci(e, n = {}) {
1844
1845
  }
1845
1846
  function g() {
1846
1847
  if (l.empId == null || l.dayIdx == null) return null;
1847
- const M = zt(l.empId), H = Sn(e.dayDates.value[l.dayIdx]);
1848
+ const M = zt(l.empId), H = $n(e.dayDates.value[l.dayIdx]);
1848
1849
  return !M || !H ? null : {
1849
1850
  employeeId: M,
1850
1851
  type: l.selection === "OFF_DAY" ? "OFF_DAY" : "LEAVE",
@@ -1887,7 +1888,7 @@ function ci(e, n = {}) {
1887
1888
  var Z;
1888
1889
  const Q = (Z = Dt.value) == null ? void 0 : Z.timeOff.find((q) => q.id === M), V = [];
1889
1890
  if (!Q) return V;
1890
- for (const q of ni(Q, H)) {
1891
+ for (const q of oi(Q, H)) {
1891
1892
  let ee = await Yo(q);
1892
1893
  B.push(ee.id), Q.status === "APPROVED" && (ee = await io(ee.id, {
1893
1894
  expectedStatus: "PENDING",
@@ -1901,7 +1902,7 @@ function ci(e, n = {}) {
1901
1902
  var ee, ye;
1902
1903
  const V = (ye = (ee = r.value) == null ? void 0 : ee.timeOff) == null ? void 0 : ye[Q];
1903
1904
  if ((V == null ? void 0 : V.requestId) !== M) return;
1904
- const Z = Sn(B), q = H.find((Ee) => Ee.startDate <= Z && Z <= Ee.endDate);
1905
+ const Z = $n(B), q = H.find((Ee) => Ee.startDate <= Z && Z <= Ee.endDate);
1905
1906
  q && (V.requestId = q.id);
1906
1907
  });
1907
1908
  }
@@ -1939,7 +1940,7 @@ function ci(e, n = {}) {
1939
1940
  const M = r.value, H = l.dayIdx, B = (V = u.value) == null ? void 0 : V.requestId, Q = [];
1940
1941
  try {
1941
1942
  if (B) {
1942
- const q = Sn(e.dayDates.value[H]), ee = await P(B, q, Q);
1943
+ const q = $n(e.dayDates.value[H]), ee = await P(B, q, Q);
1943
1944
  await lo(B), O(B, ee);
1944
1945
  }
1945
1946
  M != null && M.timeOff && (M.timeOff[H] = null), c();
@@ -1990,7 +1991,7 @@ function Xa() {
1990
1991
  }
1991
1992
  return { state: e, ask: n, confirm: o, close: s };
1992
1993
  }
1993
- function hi() {
1994
+ function mi() {
1994
1995
  const e = Ma(), n = Y(!1), o = Y(!1), s = (z) => `hrm-schedule-onboarding-welcome-dismissed:${z}`;
1995
1996
  function l(z) {
1996
1997
  return !z || typeof sessionStorage > "u" ? !1 : sessionStorage.getItem(s(z)) === "1";
@@ -2025,7 +2026,7 @@ function hi() {
2025
2026
  }
2026
2027
  return { open: d, start: c, dismiss: v, welcomeOpen: u, dismissWelcome: w };
2027
2028
  }
2028
- function mi(e) {
2029
+ function vi(e) {
2029
2030
  const n = Y(""), o = Y([]), s = (c) => c.employmentType === "FULLTIME" ? 0 : 1;
2030
2031
  function l(c, v, w) {
2031
2032
  return w ? c.toLowerCase().includes(w) || v.some((z) => z.toLowerCase().includes(w)) : !0;
@@ -2068,7 +2069,7 @@ function mi(e) {
2068
2069
  }
2069
2070
  return { search: n, filteredEmployees: u, orderedEmployees: r, order: o, reorder: d };
2070
2071
  }
2071
- const vi = 173;
2072
+ const pi = 173;
2072
2073
  function Zn() {
2073
2074
  return { from: "00:00", to: "23:59" };
2074
2075
  }
@@ -2119,16 +2120,16 @@ function la(e, n) {
2119
2120
  const s = Number(o);
2120
2121
  return Number.isFinite(s) && s >= 0 ? Math.min(n, Math.round(s)) : void 0;
2121
2122
  }
2122
- function pi(e) {
2123
+ function gi(e) {
2123
2124
  return e.trim().split(/\s+/).map((n) => n[0]).slice(0, 2).join("").toUpperCase();
2124
2125
  }
2125
- function gi(e) {
2126
+ function fi(e) {
2126
2127
  return e.employment === "part";
2127
2128
  }
2128
2129
  function gn(e, n) {
2129
2130
  return !!e.availDays[n];
2130
2131
  }
2131
- function fi(e) {
2132
+ function yi(e) {
2132
2133
  return e.availDays.map((n, o) => o).filter((n) => gn(e, n)).map((n) => ({
2133
2134
  dayOfWeek: bo(n),
2134
2135
  start: e.availHours[n].from,
@@ -2160,14 +2161,14 @@ function co(e, n, o, s) {
2160
2161
  } : null,
2161
2162
  primaryPosition: on(e.primaryPosition) ?? null,
2162
2163
  secondaryPositions: e.secondaryPositions.map((b) => on(b)).filter((b) => !!b),
2163
- availability: fi(e)
2164
+ availability: yi(e)
2164
2165
  };
2165
2166
  }
2166
- function yi(e) {
2167
+ function bi(e) {
2167
2168
  const { t: n } = me(), o = Y(!1), s = Y(!1), l = Y(null), r = Y(!1), u = Y([]), d = Y(0), c = Y(1), v = Y(0), w = 200, z = /* @__PURE__ */ new Map();
2168
2169
  let E = 0;
2169
2170
  function b($, C, g) {
2170
- const k = new Set(e.board.employees.value.map((f) => f.sourceId)), P = Nt.value, O = (f) => xn[f] ?? "", h = $.filter((f) => {
2171
+ const k = new Set(e.board.employees.value.map((f) => f.sourceId)), P = Nt.value, O = (f) => Sn[f] ?? "", h = $.filter((f) => {
2171
2172
  if (k.has(String(f._id))) return !1;
2172
2173
  if (!f.isMasterUser) return !0;
2173
2174
  if (!g) return !1;
@@ -2302,7 +2303,7 @@ function yi(e) {
2302
2303
  pickExisting: T
2303
2304
  };
2304
2305
  }
2305
- function bi(e) {
2306
+ function ki(e) {
2306
2307
  const { form: n, submitAttempted: o, passcodeOk: s } = e, l = L(() => o.value && !n.name.trim()), r = L(() => o.value && !s.value), u = L(
2307
2308
  () => !n.posAccessEnabled || n.posRoles.length > 0 && new Set(n.posRoles.map((w) => w.outlet)).size === n.posRoles.length && n.posRoles.every((w) => !!w.outlet && !!w.roleId)
2308
2309
  ), d = L(() => o.value && !u.value), c = L(
@@ -2321,7 +2322,7 @@ function bi(e) {
2321
2322
  availabilityError: v
2322
2323
  };
2323
2324
  }
2324
- function ki(e) {
2325
+ function wi(e) {
2325
2326
  const { form: n, currentLocationLabel: o, positions: s, locOpen: l, secOpen: r } = e;
2326
2327
  function u(b) {
2327
2328
  b === "loc" ? l.value = !l.value : r.value = !r.value;
@@ -2349,7 +2350,7 @@ function ki(e) {
2349
2350
  }
2350
2351
  return { secondaryOptions: L(() => s.filter((b) => b !== n.primaryPosition)), toggleMulti: u, toggleLocation: d, removeLocation: c, toggleSecondary: v, removeSecondary: w, setPrimaryPosition: z };
2351
2352
  }
2352
- function wi(e) {
2353
+ function $i(e) {
2353
2354
  const { t: n } = me();
2354
2355
  function o(u) {
2355
2356
  e.payBasis = u;
@@ -2358,11 +2359,11 @@ function wi(e) {
2358
2359
  const u = Number(e.payAmount);
2359
2360
  return Number.isFinite(u) && u > 0 ? Math.round(u * 100) / 100 : 0;
2360
2361
  }), r = L(
2361
- () => e.payBasis === "monthly" ? Math.round(l.value / vi * 100) / 100 : l.value
2362
+ () => e.payBasis === "monthly" ? Math.round(l.value / pi * 100) / 100 : l.value
2362
2363
  );
2363
2364
  return { setPayBasis: o, payUnit: s, payAmountNumber: l, effectiveRate: r };
2364
2365
  }
2365
- function $i(e, n) {
2366
+ function Si(e, n) {
2366
2367
  const { t: o } = me();
2367
2368
  function s(E) {
2368
2369
  return n.value ? gn(e, E) : !gn(e, E);
@@ -2397,10 +2398,10 @@ function $i(e, n) {
2397
2398
  }
2398
2399
  function ho(e) {
2399
2400
  var n;
2400
- return (n = Object.entries(xn).find(([, o]) => o === e)) == null ? void 0 : n[0];
2401
+ return (n = Object.entries(Sn).find(([, o]) => o === e)) == null ? void 0 : n[0];
2401
2402
  }
2402
- function Si(e, n = {}) {
2403
- const { t: o } = me(), s = Y(void 0), l = Y(void 0), r = L(() => e.passcode.join("")), u = Y(!1), d = zl(bn()), c = L(() => !e.posAccessEnabled || /^\d{4}$/.test(r.value));
2403
+ function xi(e, n = {}) {
2404
+ const { t: o } = me(), s = Y(void 0), l = Y(void 0), r = L(() => e.passcode.join("")), u = Y(!1), d = zl(Dn()), c = L(() => !e.posAccessEnabled || /^\d{4}$/.test(r.value));
2404
2405
  function v(P, O) {
2405
2406
  e.passcode[P] = O.replace(/\D/g, "").slice(-1);
2406
2407
  }
@@ -2444,7 +2445,7 @@ function Si(e, n = {}) {
2444
2445
  O && (e.posRoles.push({ outlet: O, roleId: "" }), z(O));
2445
2446
  }
2446
2447
  function D(P) {
2447
- const O = e.posRoles[P], h = xn[Nt.value];
2448
+ const O = e.posRoles[P], h = Sn[Nt.value];
2448
2449
  return !!O && !!h && O.outlet === h;
2449
2450
  }
2450
2451
  function y(P) {
@@ -2508,11 +2509,11 @@ function Si(e, n = {}) {
2508
2509
  posRolesHint: T
2509
2510
  };
2510
2511
  }
2511
- function $n(e, n) {
2512
+ function wn(e, n) {
2512
2513
  var l, r;
2513
2514
  if (typeof e == "string")
2514
2515
  try {
2515
- return $n(JSON.parse(e), n);
2516
+ return wn(JSON.parse(e), n);
2516
2517
  } catch {
2517
2518
  return e || n;
2518
2519
  }
@@ -2532,7 +2533,7 @@ function $n(e, n) {
2532
2533
  };
2533
2534
  return s((l = o.response) == null ? void 0 : l.data) ?? s((r = o.response) == null ? void 0 : r.body) ?? s(o.data) ?? s(o.body) ?? (typeof o.message == "string" && o.message ? o.message : void 0) ?? (e instanceof Error ? e.message : void 0) ?? n;
2534
2535
  }
2535
- function xi(e) {
2536
+ function Ci(e) {
2536
2537
  const { t: n } = me();
2537
2538
  async function o(r) {
2538
2539
  var d, c, v;
@@ -2570,7 +2571,7 @@ function xi(e) {
2570
2571
  ...co(e.form, r, e.payAmountNumber.value, n)
2571
2572
  }), await Ba(u, !0)), e.close(), (c = e.notify) == null || c.call(e, n("scheduling.addEmployee.added"), "success"), !0;
2572
2573
  } catch (w) {
2573
- return e.saveError.value = $n(w, n("scheduling.addEmployee.errors.addFailed")), (v = e.notify) == null || v.call(e, e.saveError.value, "error"), !1;
2574
+ return e.saveError.value = wn(w, n("scheduling.addEmployee.errors.addFailed")), (v = e.notify) == null || v.call(e, e.saveError.value, "error"), !1;
2574
2575
  } finally {
2575
2576
  e.saving.value = !1;
2576
2577
  }
@@ -2599,7 +2600,7 @@ function xi(e) {
2599
2600
  ...co(e.form, r, e.payAmountNumber.value, n)
2600
2601
  }), await Fa(), e.close(), (u = e.notify) == null || u.call(e, n("scheduling.addEmployee.added"), "success"), !0;
2601
2602
  } catch (c) {
2602
- return e.saveError.value = $n(c, n("scheduling.addEmployee.errors.createFailed")), (d = e.notify) == null || d.call(e, e.saveError.value, "error"), !1;
2603
+ return e.saveError.value = wn(c, n("scheduling.addEmployee.errors.createFailed")), (d = e.notify) == null || d.call(e, e.saveError.value, "error"), !1;
2603
2604
  } finally {
2604
2605
  e.saving.value = !1;
2605
2606
  }
@@ -2628,7 +2629,7 @@ function xi(e) {
2628
2629
  roles: z
2629
2630
  });
2630
2631
  } catch (T) {
2631
- return e.saveError.value = $n(T, n("scheduling.addEmployee.errors.posRoleFailed")), (y = e.notify) == null || y.call(e, e.saveError.value, "error"), e.saving.value = !1, !1;
2632
+ return e.saveError.value = wn(T, n("scheduling.addEmployee.errors.posRoleFailed")), (y = e.notify) == null || y.call(e, e.saveError.value, "error"), e.saving.value = !1, !1;
2632
2633
  }
2633
2634
  if (c && !e.deferScheduleWrites.value)
2634
2635
  try {
@@ -2637,7 +2638,7 @@ function xi(e) {
2637
2638
  co(e.form, r, e.payAmountNumber.value, n)
2638
2639
  );
2639
2640
  } catch (T) {
2640
- return e.saveError.value = $n(T, n("scheduling.addEmployee.errors.saveFailed")), (S = e.notify) == null || S.call(e, e.saveError.value, "error"), e.saving.value = !1, !1;
2641
+ return e.saveError.value = wn(T, n("scheduling.addEmployee.errors.saveFailed")), (S = e.notify) == null || S.call(e, e.saveError.value, "error"), e.saving.value = !1, !1;
2641
2642
  }
2642
2643
  if (e.originalLocations.value.filter((T) => !e.form.locations.includes(T)).map(e.restaurantIdOfLabel).filter((T) => !!T).includes(Nt.value))
2643
2644
  return e.close(), (A = e.notify) == null || A.call(e, n("scheduling.addEmployee.saved"), "success"), e.saving.value = !1, !0;
@@ -2648,7 +2649,7 @@ function xi(e) {
2648
2649
  return Object.assign(d, {
2649
2650
  name: r,
2650
2651
  role: Qa(e.form.primaryPosition),
2651
- initials: pi(r),
2652
+ initials: gi(r),
2652
2653
  pct: e.form.employment === "full" ? 100 : d.pct < 100 ? d.pct : 60,
2653
2654
  rate: e.effectiveRate.value,
2654
2655
  positions: b,
@@ -2679,7 +2680,7 @@ function xi(e) {
2679
2680
  }
2680
2681
  return { createExisting: o, createNew: s, updateExisting: l };
2681
2682
  }
2682
- function Ci(e, n = {}) {
2683
+ function Ei(e, n = {}) {
2683
2684
  const { t: o } = me(), { formatMoney: s } = Wt(), l = Y(!1), r = Y("mode"), u = Y("new"), d = Xe(Tn()), c = Y(e.UNASSIGNED), v = Y(null), w = L(() => v.value != null), z = Y(!1), E = Y(!1), b = Y([]), D = Y([]);
2684
2685
  async function y(ae, Pe) {
2685
2686
  if (!ae) return;
@@ -2703,7 +2704,7 @@ function Ci(e, n = {}) {
2703
2704
  }
2704
2705
  } catch {
2705
2706
  }
2706
- const tt = Oe.restaurantRole.filter((nt) => nt.roleId).map((nt) => ({ outlet: xn[nt.restaurantId] ?? "", roleId: nt.roleId })).filter((nt) => nt.outlet);
2707
+ const tt = Oe.restaurantRole.filter((nt) => nt.roleId).map((nt) => ({ outlet: Sn[nt.restaurantId] ?? "", roleId: nt.roleId })).filter((nt) => nt.outlet);
2707
2708
  D.value = tt;
2708
2709
  const $t = [.../* @__PURE__ */ new Set([...d.locations, ...tt.map((nt) => nt.outlet)])], ft = new Map(tt.map((nt) => [nt.outlet, nt.roleId]));
2709
2710
  d.locations = $t, d.posRoles = $t.map((nt) => ({
@@ -2711,7 +2712,7 @@ function Ci(e, n = {}) {
2711
2712
  roleId: ft.get(nt) ?? ""
2712
2713
  }));
2713
2714
  }
2714
- const A = Y(!1), R = Y(null), T = Y(null), $ = Y(!1), C = Y(null), g = Y(!1), k = Y(!1), P = Y(""), O = () => JSON.stringify(d), h = () => !k.value && P.value !== O(), f = L(() => xn[Nt.value] ?? ""), x = yi({
2715
+ const A = Y(!1), R = Y(null), T = Y(null), $ = Y(!1), C = Y(null), g = Y(!1), k = Y(!1), P = Y(""), O = () => JSON.stringify(d), h = () => !k.value && P.value !== O(), f = L(() => Sn[Nt.value] ?? ""), x = bi({
2715
2716
  board: e,
2716
2717
  form: d,
2717
2718
  currentLocationLabel: f,
@@ -2797,17 +2798,17 @@ function Ci(e, n = {}) {
2797
2798
  function ye() {
2798
2799
  C.value = null, A.value = !1, r.value = "mode";
2799
2800
  }
2800
- const Ee = ki({
2801
+ const Ee = wi({
2801
2802
  form: d,
2802
2803
  currentLocationLabel: f,
2803
2804
  positions: rn,
2804
2805
  locOpen: z,
2805
2806
  secOpen: E
2806
- }), he = wi(d), { payUnit: de, payAmountNumber: oe, effectiveRate: ue } = he, $e = L(() => gi(d)), Se = $i(d, $e);
2807
+ }), he = $i(d), { payUnit: de, payAmountNumber: oe, effectiveRate: ue } = he, $e = L(() => fi(d)), Se = Si(d, $e);
2807
2808
  function Ae() {
2808
2809
  d.overtimeEnabled = !d.overtimeEnabled, d.overtimeEnabled || (d.maxHoursPerMonth = "");
2809
2810
  }
2810
- const xe = Si(d, {
2811
+ const xe = xi(d, {
2811
2812
  excludePosUserId: L(
2812
2813
  () => R.value ?? (v.value != null ? zt(v.value) : void 0)
2813
2814
  )
@@ -2817,11 +2818,11 @@ function Ci(e, n = {}) {
2817
2818
  () => d.primaryPosition ? Qa(d.primaryPosition) : ""
2818
2819
  ), Le = L(() => d.locations.length ? d.locations.length === 1 ? d.locations[0] : `${d.locations[0]} +${d.locations.length - 1}` : ""), it = L(
2819
2820
  () => ue.value > 0 ? `${s(ue.value, 2)}/h` : ""
2820
- ), mt = L(() => u.value === "new" && !w.value), Re = bi({
2821
+ ), mt = L(() => u.value === "new" && !w.value), Re = ki({
2821
2822
  form: d,
2822
2823
  submitAttempted: A,
2823
2824
  passcodeOk: ht
2824
- }), Be = xi({
2825
+ }), Be = Ci({
2825
2826
  form: d,
2826
2827
  pickedEmployeeId: R,
2827
2828
  selectedBusinessEmployee: T,
@@ -2841,7 +2842,7 @@ function Ci(e, n = {}) {
2841
2842
  });
2842
2843
  function ke(ae) {
2843
2844
  var Pe;
2844
- return (Pe = Object.entries(xn).find(([, Oe]) => Oe === ae)) == null ? void 0 : Pe[0];
2845
+ return (Pe = Object.entries(Sn).find(([, Oe]) => Oe === ae)) == null ? void 0 : Pe[0];
2845
2846
  }
2846
2847
  async function De(ae) {
2847
2848
  return Be.createNew(ae);
@@ -2963,7 +2964,7 @@ function Ci(e, n = {}) {
2963
2964
  create: Ne
2964
2965
  };
2965
2966
  }
2966
- function Ei(e) {
2967
+ function Di(e) {
2967
2968
  const n = Xe({ open: !1, empId: null }), o = L(
2968
2969
  () => n.empId != null ? e.employeeById(n.empId) ?? null : null
2969
2970
  );
@@ -2975,7 +2976,7 @@ function Ei(e) {
2975
2976
  }
2976
2977
  return { state: n, employee: o, openFor: s, close: l };
2977
2978
  }
2978
- function Di(e) {
2979
+ function Pi(e) {
2979
2980
  const { locale: n } = me(), o = L(() => It(n == null ? void 0 : n.value, "en-GB")), s = Y(!1), l = Y(new Date(e.rangeStart.value)), r = Xe({ left: 0, top: 0 });
2980
2981
  function u(C) {
2981
2982
  if (!s.value) {
@@ -3040,7 +3041,7 @@ function Di(e) {
3040
3041
  presetNextWeek: $
3041
3042
  };
3042
3043
  }
3043
- function Pi(e) {
3044
+ function zi(e) {
3044
3045
  const { t: n } = me(), o = L(() => Object.keys(Me.coverage.full ?? {}));
3045
3046
  function s(d) {
3046
3047
  return o.value.map((c) => {
@@ -3051,7 +3052,7 @@ function Pi(e) {
3051
3052
  function l(d) {
3052
3053
  return s(d).some((c) => c.short);
3053
3054
  }
3054
- const r = L(() => En.filter((d) => d.active).length);
3055
+ const r = L(() => Cn.filter((d) => d.active).length);
3055
3056
  function u(d) {
3056
3057
  const c = s(d).reduce(
3057
3058
  (w, z) => ({ scheduled: w.scheduled + z.scheduled, required: w.required + z.required }),
@@ -3070,8 +3071,8 @@ ${n("scheduling.legend.dayCardHint")}`;
3070
3071
  function Do(e) {
3071
3072
  return Number(e).toFixed(1);
3072
3073
  }
3073
- const zi = 330;
3074
- function Mi(e, n = {}) {
3074
+ const Mi = 330;
3075
+ function Ti(e, n = {}) {
3075
3076
  const { t: o, locale: s } = me(), l = Xe({ open: !1, dayIdx: null, left: 0, top: 0 }), r = Y(""), u = Y(""), d = Y(!1);
3076
3077
  function c($, C) {
3077
3078
  if (l.open && l.dayIdx === $) {
@@ -3081,7 +3082,7 @@ function Mi(e, n = {}) {
3081
3082
  const g = e.dayNote($);
3082
3083
  r.value = (g == null ? void 0 : g.title) ?? "", u.value = (g == null ? void 0 : g.desc) ?? "", d.value = e.holidayRateApplies($);
3083
3084
  const k = C.getBoundingClientRect();
3084
- l.dayIdx = $, l.left = Math.min(k.left, Math.max(8, window.innerWidth - zi - 8)), l.top = Math.min(k.bottom + 4, Math.max(8, window.innerHeight - 440)), l.open = !0;
3085
+ l.dayIdx = $, l.left = Math.min(k.left, Math.max(8, window.innerWidth - Mi - 8)), l.top = Math.min(k.bottom + 4, Math.max(8, window.innerHeight - 440)), l.open = !0;
3085
3086
  }
3086
3087
  function v() {
3087
3088
  l.open = !1, l.dayIdx = null, r.value = "", u.value = "", d.value = !1;
@@ -3155,11 +3156,11 @@ function Mi(e, n = {}) {
3155
3156
  remove: T
3156
3157
  };
3157
3158
  }
3158
- function Ti(e) {
3159
+ function Oi(e) {
3159
3160
  var n;
3160
3161
  return ((n = e[0]) == null ? void 0 : n.role) ?? "";
3161
3162
  }
3162
- function Oi(e, n) {
3163
+ function Ai(e, n) {
3163
3164
  if (!n || !e.role || !e.positions.length || e.positions.includes(Qn))
3164
3165
  return !0;
3165
3166
  const o = In[n];
@@ -3172,7 +3173,7 @@ function mo(e, n, o) {
3172
3173
  l && (l.filledBy = o);
3173
3174
  });
3174
3175
  }
3175
- function Ai(e, n = {}) {
3176
+ function Ri(e, n = {}) {
3176
3177
  const { t: o } = me(), s = Xe({
3177
3178
  open: !1,
3178
3179
  empId: null,
@@ -3221,8 +3222,8 @@ function Ai(e, n = {}) {
3221
3222
  return P ? [P] : [];
3222
3223
  }), z = L(() => {
3223
3224
  if (l.empId == null || l.dayIdx == null) return [];
3224
- const g = Ti(w.value);
3225
- return g ? e.employees.value.filter((k) => k.id !== l.empId).filter((k) => Oi(k, g)).filter((k) => !k.shifts[l.dayIdx]).sort((k, P) => nn(k).hours - nn(P).hours) : [];
3225
+ const g = Oi(w.value);
3226
+ return g ? e.employees.value.filter((k) => k.id !== l.empId).filter((k) => Ai(k, g)).filter((k) => !k.shifts[l.dayIdx]).sort((k, P) => nn(k).hours - nn(P).hours) : [];
3226
3227
  });
3227
3228
  function E(g) {
3228
3229
  var h;
@@ -3335,7 +3336,7 @@ function Po(e, n) {
3335
3336
  const [o, s, l] = e.split("-").map(Number);
3336
3337
  return vn(new Date(o, s - 1, l + n));
3337
3338
  }
3338
- function Ri(e, n, o, s, l) {
3339
+ function Li(e, n, o, s, l) {
3339
3340
  const r = /* @__PURE__ */ new Map();
3340
3341
  for (let d = 0; d < kt; d++) {
3341
3342
  const c = o(d);
@@ -3362,7 +3363,7 @@ function Ri(e, n, o, s, l) {
3362
3363
  }
3363
3364
  return u;
3364
3365
  }
3365
- function Li(e, n, o = "DRAFT") {
3366
+ function Ii(e, n, o = "DRAFT") {
3366
3367
  return {
3367
3368
  allowOvertime: n,
3368
3369
  ...o === "PUBLISHED" ? { status: o } : {},
@@ -3376,16 +3377,16 @@ function Li(e, n, o = "DRAFT") {
3376
3377
  };
3377
3378
  }
3378
3379
  const ia = "Would reject ", ra = "AI: ";
3379
- function Ii(e) {
3380
+ function Hi(e) {
3380
3381
  return e.startsWith(ia) ? { kind: "reject", text: e.slice(ia.length) } : e.startsWith(ra) ? { kind: "ai", text: e.slice(ra.length) } : { kind: "plain", text: e };
3381
3382
  }
3382
3383
  function Za(e) {
3383
3384
  return e instanceof El && e.status > 0 && e.status < 500;
3384
3385
  }
3385
- function Hi(e, n) {
3386
+ function Ni(e, n) {
3386
3387
  return Za(e) ? e.message : n("scheduling.autoSchedule.errors.generateFailed");
3387
3388
  }
3388
- function Ni(e, n, o, s) {
3389
+ function Fi(e, n, o, s) {
3389
3390
  return {
3390
3391
  proposals: [],
3391
3392
  unfilledCount: 0,
@@ -3415,7 +3416,7 @@ function Ni(e, n, o, s) {
3415
3416
  timing: { totalMs: 0, modelMs: null }
3416
3417
  };
3417
3418
  }
3418
- function Fi(e, n) {
3419
+ function Bi(e, n) {
3419
3420
  const o = e / 1e3;
3420
3421
  if (o < 60) {
3421
3422
  const r = o < 10 ? 1 : 0;
@@ -3424,8 +3425,8 @@ function Fi(e, n) {
3424
3425
  let s = Math.floor(o / 60), l = Math.round(o - s * 60);
3425
3426
  return l === 60 && (s += 1, l = 0), n("scheduling.autoSchedule.duration.minutes", { minutes: s, seconds: l });
3426
3427
  }
3427
- function Bi(e, n, o) {
3428
- const s = e.solver === "none" ? o("scheduling.autoSchedule.done.nothing") : o("scheduling.autoSchedule.done.generatedIn", { duration: Fi(n, o) }), l = e.proposals.length, r = e.unfilledCount > 0 ? o("scheduling.autoSchedule.done.proposedWithGaps", { count: l, gaps: e.unfilledCount }) : o("scheduling.autoSchedule.done.proposed", { count: l });
3428
+ function Ui(e, n, o) {
3429
+ const s = e.solver === "none" ? o("scheduling.autoSchedule.done.nothing") : o("scheduling.autoSchedule.done.generatedIn", { duration: Bi(n, o) }), l = e.proposals.length, r = e.unfilledCount > 0 ? o("scheduling.autoSchedule.done.proposedWithGaps", { count: l, gaps: e.unfilledCount }) : o("scheduling.autoSchedule.done.proposed", { count: l });
3429
3430
  return [s, r].join(" · ");
3430
3431
  }
3431
3432
  const _a = "Any position";
@@ -3437,7 +3438,7 @@ function ln(e, n) {
3437
3438
  const o = e.positions ?? [];
3438
3439
  return o.includes(Qn) || !o.length ? !0 : o.includes(n);
3439
3440
  }
3440
- function Ui(e) {
3441
+ function Wi(e) {
3441
3442
  const n = L(() => {
3442
3443
  const u = /* @__PURE__ */ new Set([
3443
3444
  ...rn,
@@ -3488,23 +3489,10 @@ function Ui(e) {
3488
3489
  positionWeekMeta: r
3489
3490
  };
3490
3491
  }
3491
- function Wi() {
3492
- const e = bn();
3493
- function n(s, l) {
3494
- e.open({ title: s, type: "success", position: l == null ? void 0 : l.position });
3495
- }
3496
- function o(s, l) {
3497
- e.open({ title: s, type: "error", position: l == null ? void 0 : l.position });
3498
- }
3499
- return {
3500
- success: n,
3501
- error: o
3502
- };
3503
- }
3504
3492
  let Vi = 0;
3505
3493
  const ji = () => ++Vi;
3506
3494
  function qi(e, n) {
3507
- const o = Wi(), { t: s, locale: l } = me(), r = Y(!1), u = Y("options"), d = Xe({
3495
+ const o = Ml(), { t: s, locale: l } = me(), r = Y(!1), u = Y("options"), d = Xe({
3508
3496
  fillGaps: !0,
3509
3497
  objective: "BALANCED",
3510
3498
  allowOvertime: !1,
@@ -3594,21 +3582,21 @@ function qi(e, n) {
3594
3582
  objective: d.objective,
3595
3583
  allowOvertime: d.allowOvertime,
3596
3584
  planner: "AUTO"
3597
- }) : Ni({ from: Ke, to: Ne }, d.objective, d.allowOvertime, s);
3585
+ }) : Fi({ from: Ke, to: Ne }, d.objective, d.allowOvertime, s);
3598
3586
  if (!De()) return;
3599
- const st = Ri(
3587
+ const st = Li(
3600
3588
  Oe.proposals,
3601
3589
  Pe,
3602
3590
  (tt) => Po(Pe, tt),
3603
3591
  ji,
3604
3592
  (tt) => !!e.employeeById(tt)
3605
3593
  );
3606
- w.value = Oe, $.value = [...$.value.filter((tt) => tt.weekKey !== Pe), ...st], M.value = Oe.unfilledCount, r.value = !1, console.info("[auto-schedule] ran solver=%s model=%s", Oe.solver, Oe.model ?? "none"), o.success(Bi(Oe, performance.now() - ae, s), {
3594
+ w.value = Oe, $.value = [...$.value.filter((tt) => tt.weekKey !== Pe), ...st], M.value = Oe.unfilledCount, r.value = !1, console.info("[auto-schedule] ran solver=%s model=%s", Oe.solver, Oe.model ?? "none"), o.success(Ui(Oe, performance.now() - ae, s), {
3607
3595
  position: jo.BOTTOM
3608
3596
  });
3609
3597
  } catch (Pe) {
3610
3598
  if (!De()) return;
3611
- const Oe = Hi(Pe, s);
3599
+ const Oe = Ni(Pe, s);
3612
3600
  v.value = Oe, o.error(Oe, { position: jo.BOTTOM });
3613
3601
  } finally {
3614
3602
  De() && (c.value = !1);
@@ -3667,7 +3655,7 @@ function qi(e, n) {
3667
3655
  z.value = !0;
3668
3656
  try {
3669
3657
  const ae = await ml(
3670
- Li(Ke, ((Ne = w.value) == null ? void 0 : Ne.allowOvertime) ?? d.allowOvertime, De)
3658
+ Ii(Ke, ((Ne = w.value) == null ? void 0 : Ne.allowOvertime) ?? d.allowOvertime, De)
3671
3659
  );
3672
3660
  return ae.rejected.length ? (S.value = ae.rejected.map((Pe) => {
3673
3661
  var st;
@@ -3870,7 +3858,7 @@ function Rt(e) {
3870
3858
  const [n, o] = e.split(":").map(Number);
3871
3859
  return (n || 0) * 60 + (o || 0);
3872
3860
  }
3873
- function wn(e) {
3861
+ function kn(e) {
3874
3862
  const n = Math.max(0, Math.min(1439, Math.round(e)));
3875
3863
  return `${String(Math.floor(n / 60)).padStart(2, "0")}:${String(n % 60).padStart(2, "0")}`;
3876
3864
  }
@@ -3907,7 +3895,7 @@ function Zi(e, n, o, s, l) {
3907
3895
  }), z = L(() => {
3908
3896
  const x = [];
3909
3897
  for (let I = w.value.from; I < w.value.to; I += 60)
3910
- x.push({ m: I, clock: wn(I % 1440) });
3898
+ x.push({ m: I, clock: kn(I % 1440) });
3911
3899
  return x;
3912
3900
  }), E = L(() => Rt(Me.openFrom)), b = L(() => Rt(Me.openTo));
3913
3901
  function D(x) {
@@ -3981,7 +3969,7 @@ function Zi(e, n, o, s, l) {
3981
3969
  function C(x) {
3982
3970
  if (!x.half) return { start: Me.openFrom, end: Me.openTo, allDay: !0 };
3983
3971
  if (x.from && x.to) return { start: x.from, end: x.to, allDay: !1 };
3984
- const I = wn(
3972
+ const I = kn(
3985
3973
  Math.round((E.value + (b.value - E.value) / 2) / 30) * 30
3986
3974
  );
3987
3975
  return x.halfPart === "AM" ? { start: Me.openFrom, end: I, allDay: !1 } : { start: I, end: Me.openTo, allDay: !1 };
@@ -4001,7 +3989,7 @@ function Zi(e, n, o, s, l) {
4001
3989
  Q.push(Se.bar), V.push(Se);
4002
3990
  }
4003
3991
  const Z = !B && ((de = x.availDays) == null ? void 0 : de[c.value]) === !1, q = Ie(I).map((oe, ue) => {
4004
- const $e = oe.role || r("scheduling.common.anyPosition"), Se = Jt(oe), Ae = !!B || Z || oe.conflict || !ln(x, oe.role) || Dn(Ie(I), oe), xe = T(`shift-${x.id}-${ue}`, oe.start, oe.end, oe.breakMins, {
3992
+ const $e = oe.role || r("scheduling.common.anyPosition"), Se = Jt(oe), Ae = !!B || Z || oe.conflict || !ln(x, oe.role) || En(Ie(I), oe), xe = T(`shift-${x.id}-${ue}`, oe.start, oe.end, oe.breakMins, {
4005
3993
  cls: `${fn(oe.role)} ${ha(oe.status)}`.trim(),
4006
3994
  sub: `${$e}${Ae ? ` · ${r("scheduling.board.conflict")}` : ""}`,
4007
3995
  conflict: Ae,
@@ -4030,16 +4018,16 @@ function Zi(e, n, o, s, l) {
4030
4018
  name: x.name,
4031
4019
  sub: r("scheduling.dayTimeline.hoursOfCap", {
4032
4020
  hours: Math.round($(x) * 10) / 10,
4033
- cap: Cn(x)
4021
+ cap: xn(x)
4034
4022
  }),
4035
4023
  availabilityDay: Z,
4036
4024
  availabilityLabel: ee,
4037
4025
  roleLabel: x.positions[0] || r("scheduling.common.anyPosition"),
4038
4026
  hoursLabel: `${r("scheduling.dayTimeline.hoursOfCap", {
4039
4027
  hours: Math.round(Ee * 10) / 10,
4040
- cap: Cn(x)
4028
+ cap: xn(x)
4041
4029
  })}${x.pct < 100 ? ` ${r("scheduling.dayTimeline.partTimeShort")}` : ""}`,
4042
- hoursPct: Math.min(100, Ee / Math.max(1, Cn(x)) * 100),
4030
+ hoursPct: Math.min(100, Ee / Math.max(1, xn(x)) * 100),
4043
4031
  onMenu: (oe) => l.onOpenEmployeeMenu(x.id, oe),
4044
4032
  bars: Q,
4045
4033
  pastDay: M,
@@ -4054,7 +4042,7 @@ function Zi(e, n, o, s, l) {
4054
4042
  () => o.positionRows.value.map((x) => {
4055
4043
  const I = Ft(e.dayDates.value[c.value]), M = e.isStandingClosedWeekday(c.value), B = o.assignedOn(c.value, x).map(({ emp: q, slot: ee, slotIndex: ye }, Ee) => {
4056
4044
  var Ae, xe;
4057
- const he = Jt(ee), de = Ie(q.shifts[c.value]), oe = ((Ae = q.timeOff) == null ? void 0 : Ae[c.value]) ?? (xt(q.shifts[c.value]) ? q.shifts[c.value] : null), ue = !oe && ((xe = q.availDays) == null ? void 0 : xe[c.value]) === !1, $e = !!oe || ue || ee.conflict || !ln(q, ee.role) || Dn(de, ee), Se = T(`shift-${q.id}-${Ee}`, ee.start, ee.end, ee.breakMins, {
4045
+ const he = Jt(ee), de = Ie(q.shifts[c.value]), oe = ((Ae = q.timeOff) == null ? void 0 : Ae[c.value]) ?? (xt(q.shifts[c.value]) ? q.shifts[c.value] : null), ue = !oe && ((xe = q.availDays) == null ? void 0 : xe[c.value]) === !1, $e = !!oe || ue || ee.conflict || !ln(q, ee.role) || En(de, ee), Se = T(`shift-${q.id}-${Ee}`, ee.start, ee.end, ee.breakMins, {
4058
4046
  cls: `${fn(Ot(x))} ${ha(ee.status)}`.trim(),
4059
4047
  sub: `${q.name}${$e ? ` · ${r("scheduling.board.conflict")}` : ""}`,
4060
4048
  conflict: $e,
@@ -4090,7 +4078,7 @@ function Zi(e, n, o, s, l) {
4090
4078
  })
4091
4079
  );
4092
4080
  function P(x, I) {
4093
- return En.filter((M) => M.active).reduce((M, H) => {
4081
+ return Cn.filter((M) => M.active).reduce((M, H) => {
4094
4082
  const B = Rt(H.start);
4095
4083
  let Q = Rt(H.end);
4096
4084
  if (Q <= B && (Q += 1440), !(Math.min(Q, I) - Math.max(B, x) > 0)) return M;
@@ -4128,11 +4116,11 @@ function Zi(e, n, o, s, l) {
4128
4116
  const ee = D(q.m), ye = q.req ? q.n < q.req ? "short" : q.n > q.req ? "over" : "met" : "";
4129
4117
  return {
4130
4118
  m: q.m,
4131
- clock: wn(q.m % 1440),
4119
+ clock: kn(q.m % 1440),
4132
4120
  open: ee,
4133
4121
  state: ye,
4134
4122
  barHeightPct: Math.round(q.n / I * 100),
4135
- title: `${wn(q.m)}–${wn(q.m + 60)} · ${r("scheduling.dayTimeline.onDuty", { count: q.n })} · ${r("scheduling.stats.hours", { h: q.hours.toFixed(1) })} · ${d(q.wages)}`,
4123
+ title: `${kn(q.m)}–${kn(q.m + 60)} · ${r("scheduling.dayTimeline.onDuty", { count: q.n })} · ${r("scheduling.stats.hours", { h: q.hours.toFixed(1) })} · ${d(q.wages)}`,
4136
4124
  n: q.n
4137
4125
  };
4138
4126
  }),
@@ -4155,7 +4143,7 @@ function Zi(e, n, o, s, l) {
4155
4143
  openDemand: S,
4156
4144
  openDemandSegment: A,
4157
4145
  footer: f,
4158
- minToHHMM: wn
4146
+ minToHHMM: kn
4159
4147
  };
4160
4148
  }
4161
4149
  function _i(e, n) {
@@ -4313,7 +4301,7 @@ function dr(e, n, o) {
4313
4301
  }
4314
4302
  const c = L(() => rr(r.value)), v = L(() => /^off(\s*day)?$/i.test(r.value.trim())), w = L(() => {
4315
4303
  const C = r.value.trim().toLowerCase();
4316
- return En.filter((g) => g.active).filter(
4304
+ return Cn.filter((g) => g.active).filter(
4317
4305
  (g) => pa(`${g.start} ${g.end} ${g.label}`, C)
4318
4306
  );
4319
4307
  }), z = L(() => {
@@ -4361,7 +4349,7 @@ function dr(e, n, o) {
4361
4349
  g && D(g.start, g.end, { role: g.role });
4362
4350
  }
4363
4351
  function S(C) {
4364
- const g = En.find((k) => k.key === C);
4352
+ const g = Cn.find((k) => k.key === C);
4365
4353
  g && D(g.start, g.end, { breakMins: g.breakMins, name: g.label });
4366
4354
  }
4367
4355
  function A(C, g) {
@@ -4511,7 +4499,7 @@ function hr(e) {
4511
4499
  };
4512
4500
  }
4513
4501
  function mr(e, n) {
4514
- const o = bn(), { t: s } = me(), l = Y(!1);
4502
+ const o = Dn(), { t: s } = me(), l = Y(!1);
4515
4503
  function r(y) {
4516
4504
  const S = new Date(e.dayDates.value[0]);
4517
4505
  return S.setDate(S.getDate() + (y - e.weekOffset.value) * 7), S;
@@ -4718,7 +4706,7 @@ function gr(e) {
4718
4706
  const ye = e.membersOf(ee.id);
4719
4707
  ye.length && ye.forEach((Ee) => {
4720
4708
  let he = 0, de = 0;
4721
- const oe = Cn(Ee);
4709
+ const oe = xn(Ee);
4722
4710
  let ue = 0;
4723
4711
  const $e = H.map(({ dayIdx: Se }, Ae) => {
4724
4712
  const xe = Ee.shifts[Se], He = xe && xt(xe) ? xe : null, ht = Ie(xe).filter((it) => it.status === "confirmed");
@@ -5018,7 +5006,7 @@ function yr(e) {
5018
5006
  return Ee >= ke && Ee < De;
5019
5007
  }).map((Be) => Be.role)
5020
5008
  ])
5021
- ), Ae = (Re, Be) => (Se.get(Re.id) ?? []).some((ke) => ke === Be || !ke && ln(Re, Be)), xe = $e.map((Re, Be) => ({ i: Be, pool: oe.filter((ke) => Ae(ke, Re.position)).length })).sort((Re, Be) => Re.pool - Be.pool).map(({ i: Re }) => Re), { got: He, spent: ht } = ui(
5009
+ ), Ae = (Re, Be) => (Se.get(Re.id) ?? []).some((ke) => ke === Be || !ke && ln(Re, Be)), xe = $e.map((Re, Be) => ({ i: Be, pool: oe.filter((ke) => Ae(ke, Re.position)).length })).sort((Re, Be) => Re.pool - Be.pool).map(({ i: Re }) => Re), { got: He, spent: ht } = ci(
5022
5010
  xe.map((Re) => $e[Re]),
5023
5011
  oe,
5024
5012
  Ae
@@ -5223,7 +5211,7 @@ function wr(e, n) {
5223
5211
  return `for ${e} on ${o}`;
5224
5212
  }
5225
5213
  function $r() {
5226
- const e = Ml();
5214
+ const e = Tl();
5227
5215
  return {
5228
5216
  store: e,
5229
5217
  async activate(n) {
@@ -6360,7 +6348,7 @@ function Lr(e, n, o) {
6360
6348
  weekday: "short",
6361
6349
  day: "numeric",
6362
6350
  month: "short"
6363
- }), v = Y(!1), w = Y(!1), z = Rr(), { step: E, stepIndex: b, isFirstStep: D, isLastStep: y, totalSteps: S, steps: A, isSkippable: R } = z, T = Tl({ deferWrites: !0 }), $ = Xe(wa()), {
6351
+ }), v = Y(!1), w = Y(!1), z = Rr(), { step: E, stepIndex: b, isFirstStep: D, isLastStep: y, totalSteps: S, steps: A, isSkippable: R } = z, T = Ol({ deferWrites: !0 }), $ = Xe(wa()), {
6364
6352
  hours: C,
6365
6353
  profileSnapshot: g,
6366
6354
  hoursSnapshot: k,
@@ -6720,7 +6708,7 @@ function Lr(e, n, o) {
6720
6708
  ...dt.filter((Je) => Je.closed).map((Je) => (Je.dayOfWeek + 6) % 7)
6721
6709
  ), g.value = k(), !0;
6722
6710
  } catch (ce) {
6723
- return H.value = $n(ce, s("scheduling.onboarding.validation.createFailed")), Z.value = !1, !1;
6711
+ return H.value = wn(ce, s("scheduling.onboarding.validation.createFailed")), Z.value = !1, !1;
6724
6712
  }
6725
6713
  }
6726
6714
  const Uo = L(() => e.employees.value.length), Is = L(
@@ -6803,18 +6791,18 @@ function Lr(e, n, o) {
6803
6791
  await (o == null ? void 0 : o()), Yn.value = !0, n.deferScheduleWrites.value = !1, v.value = !1, w.value = !0, Z.value = !1;
6804
6792
  return;
6805
6793
  }
6806
- kn(jt[b.value + 1]);
6794
+ bn(jt[b.value + 1]);
6807
6795
  }
6808
6796
  function Vs() {
6809
- E.value === "availability" && (ao.value = !0), kn(jt[b.value + 1] ?? jt[b.value]);
6797
+ E.value === "availability" && (ao.value = !0), bn(jt[b.value + 1] ?? jt[b.value]);
6810
6798
  }
6811
6799
  function js(ce) {
6812
- kn(ce);
6800
+ bn(ce);
6813
6801
  }
6814
6802
  function qs(ce) {
6815
6803
  if (jt[ce]) {
6816
6804
  if (ce <= b.value) {
6817
- kn(jt[ce]);
6805
+ bn(jt[ce]);
6818
6806
  return;
6819
6807
  }
6820
6808
  for (; b.value < ce; ) {
@@ -6823,15 +6811,15 @@ function Lr(e, n, o) {
6823
6811
  H.value = be;
6824
6812
  return;
6825
6813
  }
6826
- kn(jt[b.value + 1]);
6814
+ bn(jt[b.value + 1]);
6827
6815
  }
6828
6816
  }
6829
6817
  }
6830
- function kn(ce) {
6818
+ function bn(ce) {
6831
6819
  H.value = "", ce === "staffing" && (Ae(), ee(V.value) && !ye[V.value] && Ee(V.value) === 0 && (V.value = ue.value[0] ?? V.value)), ce === "review" && (Ae(), Ue(!0), to(), oo(!0)), ce === "employees" && (Ue(!1), to()), ce === "availability" && (Ue(!0), to(), oo(!1)), E.value = ce;
6832
6820
  }
6833
6821
  function Ys() {
6834
- D.value || kn(jt[b.value - 1]);
6822
+ D.value || bn(jt[b.value - 1]);
6835
6823
  }
6836
6824
  Ct(
6837
6825
  () => e.employees.value.length,
@@ -7938,7 +7926,7 @@ const Jr = ["aria-label"], Xr = { class: "sk-row sk-head" }, Qr = { class: "sk-r
7938
7926
  setup(e) {
7939
7927
  const n = e, { t: o } = me(), { currency: s, currencyAfter: l, formatMoney: r } = Wt();
7940
7928
  function u(E) {
7941
- return Yl(E, o);
7929
+ return Kl(E, o);
7942
7930
  }
7943
7931
  function d(E, b) {
7944
7932
  n.stats.setDayForecast(E, b.target.value);
@@ -8839,7 +8827,7 @@ const Jr = ["aria-label"], Xr = { class: "sk-row sk-head" }, Qr = { class: "sk-r
8839
8827
  return !!f && !!h.role && !ln(f, h.role);
8840
8828
  }
8841
8829
  function g(h) {
8842
- return Dn(c.value, h);
8830
+ return En(c.value, h);
8843
8831
  }
8844
8832
  function k(h) {
8845
8833
  return Ut(h.role, h.positionId);
@@ -9381,7 +9369,7 @@ const Jr = ["aria-label"], Xr = { class: "sk-row sk-head" }, Qr = { class: "sk-r
9381
9369
  return !ln(C, Ot(g));
9382
9370
  }
9383
9371
  function w(C, g, k) {
9384
- return Dn(Ie(C.shifts[g]), k);
9372
+ return En(Ie(C.shifts[g]), k);
9385
9373
  }
9386
9374
  function z(C, g) {
9387
9375
  var k, P;
@@ -12730,7 +12718,7 @@ const Kh = { class: "topbar" }, Gh = { class: "page-title" }, Jh = { class: "pag
12730
12718
  positions: [...a(rn)],
12731
12719
  "time-picker": e.timePicker
12732
12720
  }, null, 8, ["sheet", "positions", "time-picker"]),
12733
- W(Ol, { modal: e.positionModal }, null, 8, ["modal"]),
12721
+ W(Al, { modal: e.positionModal }, null, 8, ["modal"]),
12734
12722
  W(bf, { "time-picker": e.timePicker }, null, 8, ["time-picker"]),
12735
12723
  W(Rf, { gap: e.gap }, null, 8, ["gap"])
12736
12724
  ], 64));
@@ -15183,7 +15171,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
15183
15171
  const n = e, { t: o } = me(), s = L(() => n.autoSchedule.result.value), l = L(() => {
15184
15172
  var z;
15185
15173
  return ((z = s.value) == null ? void 0 : z.explanations) ?? [];
15186
- }), r = L(() => l.value.map(Ii)), u = L(() => n.autoSchedule.detailsOpen.value && l.value.length > 0), d = L(
15174
+ }), r = L(() => l.value.map(Hi)), u = L(() => n.autoSchedule.detailsOpen.value && l.value.length > 0), d = L(
15187
15175
  () => {
15188
15176
  var z;
15189
15177
  return ((z = s.value) == null ? void 0 : z.solver) === "llm-v1" ? o("scheduling.autoSchedule.details.aiPlanner") : o("scheduling.autoSchedule.details.ruleBased");
@@ -17913,7 +17901,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
17913
17901
  timePicker: {}
17914
17902
  },
17915
17903
  setup(e) {
17916
- const n = e, { t: o } = me(), s = bn(), l = Y(!1), r = L(() => [
17904
+ const n = e, { t: o } = me(), s = Dn(), l = Y(!1), r = L(() => [
17917
17905
  { value: "", label: o("scheduling.shiftEditor.more.empTypeAny") },
17918
17906
  { value: "full", label: o("scheduling.shiftEditor.more.empTypeFull") },
17919
17907
  { value: "part", label: o("scheduling.shiftEditor.more.empTypePart") }
@@ -18819,7 +18807,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
18819
18807
  leave: {}
18820
18808
  },
18821
18809
  setup(e) {
18822
- const n = e, { t: o } = me(), s = bn(), l = Y(!1), r = L(
18810
+ const n = e, { t: o } = me(), s = Dn(), l = Y(!1), r = L(
18823
18811
  () => Ja.map((E) => ({
18824
18812
  value: E.value,
18825
18813
  label: o(E.labelKey)
@@ -19041,26 +19029,26 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19041
19029
  class: "schedule-copy-loading",
19042
19030
  role: "status",
19043
19031
  "aria-live": "polite"
19044
- }, G8 = { class: "schedule-copy-loading-card" }, cE = /* @__PURE__ */ ze({
19032
+ }, G8 = { class: "schedule-copy-loading-card" }, hE = /* @__PURE__ */ ze({
19045
19033
  __name: "SchedulePage",
19046
19034
  setup(e) {
19047
19035
  const n = Y(null);
19048
19036
  $l(n);
19049
- const o = bn(), { t: s } = me();
19037
+ const o = Dn(), { t: s } = me();
19050
19038
  Zo(s);
19051
- const l = Wl({
19039
+ const l = Vl({
19052
19040
  onPersistError: (ie) => o.open({ message: ie, type: "error" })
19053
- }), r = yr(l), u = Sl(), d = Ur(l, r, u), { clearKind: c, clearCopy: v, clearing: w, onConfirmClear: z } = jr(l, r, o), E = Xa(), b = Vl(l), D = si(l, r, {
19041
+ }), r = yr(l), u = Sl(), d = Ur(l, r, u), { clearKind: c, clearCopy: v, clearing: w, onConfirmClear: z } = jr(l, r, o), E = Xa(), b = jl(l), D = li(l, r, {
19054
19042
  onToast: (ie, ve) => o.open({ message: ie, type: ve }),
19055
19043
  onAvailabilityWarning: (ie, ve) => E.ask(ie, ve, {
19056
19044
  title: s("scheduling.page.restDayTitle"),
19057
19045
  confirmLabel: s("scheduling.page.restDayConfirm")
19058
19046
  })
19059
- }), y = ii(), S = ci(l, {
19047
+ }), y = ri(), S = hi(l, {
19060
19048
  notify: (ie, ve) => o.open({ message: ie, type: ve })
19061
- }), A = jl(l, () => he.proposalAt), R = mi(l), T = Y(null), $ = Ci(l, {
19049
+ }), A = ql(l, () => he.proposalAt), R = vi(l), T = Y(null), $ = Ei(l, {
19062
19050
  notify: (ie, ve) => o.open({ message: ie, type: ve })
19063
- }), C = Ei(l), g = Yr({
19051
+ }), C = Di(l), g = Yr({
19064
19052
  board: l,
19065
19053
  employeeProfile: C,
19066
19054
  addEmployee: $,
@@ -19073,7 +19061,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19073
19061
  onClearAllShifts: O,
19074
19062
  onRemoveEmployee: h,
19075
19063
  onConfirmRemoveEmployee: f
19076
- } = g, x = Di(l), I = Pi(l), M = Ai(l, {
19064
+ } = g, x = Pi(l), I = zi(l), M = Ri(l, {
19077
19065
  onToast: (ie, ve) => o.open({ message: ie, type: ve })
19078
19066
  }), H = L(
19079
19067
  () => {
@@ -19093,7 +19081,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19093
19081
  }), Q = Yi(l), V = Ki(l, A, I, {
19094
19082
  onPersistError: (ie) => o.open({ message: ie, type: "error" }),
19095
19083
  onPersistSuccess: (ie) => o.open({ message: ie, type: "success" })
19096
- }), Z = Ui(l);
19084
+ }), Z = Wi(l);
19097
19085
  let q = () => {
19098
19086
  }, ee = () => {
19099
19087
  };
@@ -19160,9 +19148,9 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19160
19148
  title: s("scheduling.page.replaceTitle"),
19161
19149
  confirmLabel: s("scheduling.page.replaceConfirm")
19162
19150
  })
19163
- }), ae = gr(l), Pe = Mi(l, {
19151
+ }), ae = gr(l), Pe = Ti(l, {
19164
19152
  onToast: (ie, ve) => o.open({ message: ie, type: ve })
19165
- }), Oe = hi(), st = L(
19153
+ }), Oe = mi(), st = L(
19166
19154
  () => {
19167
19155
  var ie;
19168
19156
  return ((ie = u.options.value.find((ve) => ve.value === u.outletId.value)) == null ? void 0 : ie.label) ?? s("scheduling.page.thisOutlet");
@@ -19176,7 +19164,7 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19176
19164
  }
19177
19165
  }), $t = Ir(Oe, tt), ft = br(l, r);
19178
19166
  let nt = null, pt = -1, Pt = null, _ = null;
19179
- const ne = Al(
19167
+ const ne = Rl(
19180
19168
  (ie) => {
19181
19169
  _ && _(ie), _ = null, Pt === "primary" ? $.setPrimaryPosition(ie) : Pt === "secondary" && $.toggleSecondary(ie), Pt = null, nt !== null && (pt >= 0 ? j.setRolePosition(nt, pt, ie) : j.addRoleNamed(nt, ie)), nt = null, pt = -1;
19182
19170
  },
@@ -19454,5 +19442,5 @@ const If = { class: "dp-head" }, Hf = { class: "dp-emp-av" }, Nf = { class: "dp-
19454
19442
  }
19455
19443
  });
19456
19444
  export {
19457
- cE as default
19445
+ hE as default
19458
19446
  };