@feedmepos/mf-order-setting 0.0.95 → 0.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/{DisplaySystemView-rCw3DE0u.js → DisplaySystemView-BH8SkCOF.js} +4 -4
  2. package/dist/FoodCourtInvitationsView-3cA0Z-5m.js +383 -0
  3. package/dist/FoodCourtOrderSettingsView-DysrLZJD.js +294 -0
  4. package/dist/FoodCourtOrdersView-CbZqHIXO.js +544 -0
  5. package/dist/FoodCourtStallsView-CTZzPUQ6.js +635 -0
  6. package/dist/FoodCourtStatusView-C71y7ghx.js +113 -0
  7. package/dist/{KioskDevicesView-B4dgvMq_.js → KioskDevicesView-BJpbuSzp.js} +1 -1
  8. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-B-Oi8ZLq.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CQFpwn28.js} +7 -6
  9. package/dist/{KioskSettingView-DXx6wQQQ.js → KioskSettingView-CJxhMf7N.js} +3 -3
  10. package/dist/{KioskView-BmSHCl13.js → KioskView-BZsdRID1.js} +6 -6
  11. package/dist/{OrderSettingsView-9NOSAxLf.js → OrderSettingsView-gnyXaJjf.js} +10631 -10601
  12. package/dist/{app-y20uA-tu.js → app-CeEFBB-w.js} +4484 -3672
  13. package/dist/app.js +1 -1
  14. package/dist/dayjs.min-zBHHlxAP.js +285 -0
  15. package/dist/{featureFlag-GHmH1G2d.js → featureFlag-BTY_R78k.js} +1 -1
  16. package/dist/food-court-member-piX3gesl.js +212 -0
  17. package/dist/frontend/mf-order/src/api/food-court/index.d.ts +269 -0
  18. package/dist/frontend/mf-order/src/api/food-court/invitation.d.ts +55 -0
  19. package/dist/frontend/mf-order/src/app.d.ts +676 -0
  20. package/dist/frontend/mf-order/src/main.d.ts +676 -0
  21. package/dist/frontend/mf-order/src/stores/business/index.d.ts +3 -3
  22. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +6 -0
  23. package/dist/frontend/mf-order/src/utils/constants/route.d.ts +4 -0
  24. package/dist/frontend/mf-order/src/views/food-court/FoodCourtInvitationsView.vue.d.ts +2 -0
  25. package/dist/frontend/mf-order/src/views/food-court/FoodCourtOrdersView.vue.d.ts +2 -0
  26. package/dist/frontend/mf-order/src/views/food-court/FoodCourtStallsView.vue.d.ts +2 -0
  27. package/dist/frontend/mf-order/src/views/food-court/FoodCourtStatusView.vue.d.ts +2 -0
  28. package/dist/frontend/mf-order/src/views/food-court/food-court-member.d.ts +150 -0
  29. package/dist/frontend/mf-order/src/views/food-court/food-court-order.d.ts +66 -0
  30. package/dist/frontend/mf-order/src/views/food-court/invitations/JoinFoodCourtCard.vue.d.ts +13 -0
  31. package/dist/frontend/mf-order/src/views/food-court/invitations/MembershipRowActions.vue.d.ts +11 -0
  32. package/dist/frontend/mf-order/src/views/food-court/orders/FoodCourtOrderSheet.vue.d.ts +16 -0
  33. package/dist/frontend/mf-order/src/views/food-court/stalls/EditStallSheet.vue.d.ts +15 -0
  34. package/dist/frontend/mf-order/src/views/food-court/stalls/GenerateJoinCodeSheet.vue.d.ts +21 -0
  35. package/dist/frontend/mf-order/src/views/food-court/stalls/StallAssignmentFields.vue.d.ts +16 -0
  36. package/dist/frontend/mf-order/src/views/food-court/stalls/StallRowActions.vue.d.ts +11 -0
  37. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{index-CmdP_QXF.js → index-601eG3_R.js} +1 -1
  39. package/dist/index-BeBZTUcq.js +122 -0
  40. package/dist/index-BtudnkMi.js +1065 -0
  41. package/dist/{index-BlG6mIU4.js → index-CGiWgTn1.js} +38 -37
  42. package/dist/{index-wMygvJpP.js → index-D5nv3ncu.js} +2 -2
  43. package/dist/index-DLDihONy.js +25142 -0
  44. package/dist/order.dto-JM_fmWnQ.js +14842 -0
  45. package/dist/package/entity/food-court/food-court.do.d.ts +1 -1
  46. package/dist/package/entity/food-court/food-court.dto.d.ts +7 -7
  47. package/dist/package/entity/food-court/order-v2.dto.d.ts +4 -4
  48. package/dist/package/entity/order-platform/order-platform.dto.d.ts +190 -92
  49. package/dist/package/entity/order-setting/order-setting.do.d.ts +10 -0
  50. package/dist/package/entity/order-setting/order-setting.dto.d.ts +20 -0
  51. package/dist/package/entity/order-setting/queue/queue.do.d.ts +22 -0
  52. package/dist/package/entity/order-setting/queue/queue.dto.d.ts +7 -0
  53. package/dist/package/entity/queue/queue.do.d.ts +1 -0
  54. package/dist/package/entity/queue/queue.dto.d.ts +8 -8
  55. package/dist/package/entity/restaurant/restaurant.dto.d.ts +20 -0
  56. package/dist/search-BAPEUu1R.js +15 -0
  57. package/dist/useFoodCourtContext-2p5sJMcB.js +16 -0
  58. package/package.json +3 -3
  59. package/src/api/food-court/index.ts +357 -0
  60. package/src/api/food-court/invitation.ts +81 -0
  61. package/src/locales/en-US.json +171 -2
  62. package/src/locales/ja-JP.json +171 -2
  63. package/src/locales/th-TH.json +171 -2
  64. package/src/locales/zh-CN.json +171 -2
  65. package/src/router/routes.ts +44 -0
  66. package/src/utils/constants/route.ts +8 -0
  67. package/src/views/food-court/FoodCourtInvitationsView.vue +187 -0
  68. package/src/views/food-court/FoodCourtOrdersView.vue +263 -0
  69. package/src/views/food-court/FoodCourtStallsView.vue +369 -0
  70. package/src/views/food-court/FoodCourtStatusView.vue +111 -0
  71. package/src/views/food-court/food-court-member.spec.ts +339 -0
  72. package/src/views/food-court/food-court-member.ts +397 -0
  73. package/src/views/food-court/food-court-order.spec.ts +137 -0
  74. package/src/views/food-court/food-court-order.ts +206 -0
  75. package/src/views/food-court/invitations/JoinFoodCourtCard.vue +201 -0
  76. package/src/views/food-court/invitations/MembershipRowActions.vue +19 -0
  77. package/src/views/food-court/orders/FoodCourtOrderSheet.vue +226 -0
  78. package/src/views/food-court/stalls/EditStallSheet.vue +91 -0
  79. package/src/views/food-court/stalls/GenerateJoinCodeSheet.vue +281 -0
  80. package/src/views/food-court/stalls/StallAssignmentFields.vue +36 -0
  81. package/src/views/food-court/stalls/StallRowActions.vue +31 -0
  82. package/src/views/order-settings/OrderSettingsView.vue +2 -4
  83. package/src/views/order-settings/dine-in/DineInSetting.vue +1 -4
  84. package/src/views/order-settings/queue/QueueSetting.vue +27 -0
  85. package/src/views/order-settings/reservation/ReservationSetting.vue +8 -0
  86. package/dist/FoodCourtOrderSettingsView-DUQXCKzB.js +0 -323
  87. package/dist/index-CUI1lL9F.js +0 -1347
  88. package/dist/order.dto-CyHtvyly.js +0 -38829
package/dist/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as e, x as r, y as o } from "./app-y20uA-tu.js";
1
+ import { _ as e, x as r, y as o } from "./app-CeEFBB-w.js";
2
2
  export {
3
3
  e as FmApp,
4
4
  r as i18nMessages,
@@ -0,0 +1,285 @@
1
+ import { c as R, g as K } from "./app-CeEFBB-w.js";
2
+ var N = { exports: {} }, E;
3
+ function X() {
4
+ return E || (E = 1, function(V, et) {
5
+ (function(W, Y) {
6
+ V.exports = Y();
7
+ })(R, function() {
8
+ var W = 1e3, Y = 6e4, U = 36e5, A = "millisecond", S = "second", w = "minute", O = "hour", M = "day", H = "week", m = "month", J = "quarter", y = "year", _ = "date", Z = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, G = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, P = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
9
+ var n = ["th", "st", "nd", "rd"], t = s % 100;
10
+ return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
11
+ } }, I = function(s, n, t) {
12
+ var r = String(s);
13
+ return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
14
+ }, Q = { s: I, z: function(s) {
15
+ var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
16
+ return (n <= 0 ? "+" : "-") + I(r, 2, "0") + ":" + I(e, 2, "0");
17
+ }, m: function s(n, t) {
18
+ if (n.date() < t.date()) return -s(t, n);
19
+ var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, m), i = t - e < 0, u = n.clone().add(r + (i ? -1 : 1), m);
20
+ return +(-(r + (t - e) / (i ? e - u : u - e)) || 0);
21
+ }, a: function(s) {
22
+ return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
23
+ }, p: function(s) {
24
+ return { M: m, y, w: H, d: M, D: _, h: O, m: w, s: S, ms: A, Q: J }[s] || String(s || "").toLowerCase().replace(/s$/, "");
25
+ }, u: function(s) {
26
+ return s === void 0;
27
+ } }, x = "en", D = {};
28
+ D[x] = P;
29
+ var q = "$isDayjsObject", F = function(s) {
30
+ return s instanceof C || !(!s || !s[q]);
31
+ }, T = function s(n, t, r) {
32
+ var e;
33
+ if (!n) return x;
34
+ if (typeof n == "string") {
35
+ var i = n.toLowerCase();
36
+ D[i] && (e = i), t && (D[i] = t, e = i);
37
+ var u = n.split("-");
38
+ if (!e && u.length > 1) return s(u[0]);
39
+ } else {
40
+ var o = n.name;
41
+ D[o] = n, e = o;
42
+ }
43
+ return !r && e && (x = e), e || !r && x;
44
+ }, f = function(s, n) {
45
+ if (F(s)) return s.clone();
46
+ var t = typeof n == "object" ? n : {};
47
+ return t.date = s, t.args = arguments, new C(t);
48
+ }, a = Q;
49
+ a.l = T, a.i = F, a.w = function(s, n) {
50
+ return f(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
51
+ };
52
+ var C = function() {
53
+ function s(t) {
54
+ this.$L = T(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[q] = !0;
55
+ }
56
+ var n = s.prototype;
57
+ return n.parse = function(t) {
58
+ this.$d = function(r) {
59
+ var e = r.date, i = r.utc;
60
+ if (e === null) return /* @__PURE__ */ new Date(NaN);
61
+ if (a.u(e)) return /* @__PURE__ */ new Date();
62
+ if (e instanceof Date) return new Date(e);
63
+ if (typeof e == "string" && !/Z$/i.test(e)) {
64
+ var u = e.match(B);
65
+ if (u) {
66
+ var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
67
+ return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
68
+ }
69
+ }
70
+ return new Date(e);
71
+ }(t), this.init();
72
+ }, n.init = function() {
73
+ var t = this.$d;
74
+ this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
75
+ }, n.$utils = function() {
76
+ return a;
77
+ }, n.isValid = function() {
78
+ return this.$d.toString() !== Z;
79
+ }, n.isSame = function(t, r) {
80
+ var e = f(t);
81
+ return this.startOf(r) <= e && e <= this.endOf(r);
82
+ }, n.isAfter = function(t, r) {
83
+ return f(t) < this.startOf(r);
84
+ }, n.isBefore = function(t, r) {
85
+ return this.endOf(r) < f(t);
86
+ }, n.$g = function(t, r, e) {
87
+ return a.u(t) ? this[r] : this.set(e, t);
88
+ }, n.unix = function() {
89
+ return Math.floor(this.valueOf() / 1e3);
90
+ }, n.valueOf = function() {
91
+ return this.$d.getTime();
92
+ }, n.startOf = function(t, r) {
93
+ var e = this, i = !!a.u(r) || r, u = a.p(t), o = function(p, $) {
94
+ var v = a.w(e.$u ? Date.UTC(e.$y, $, p) : new Date(e.$y, $, p), e);
95
+ return i ? v : v.endOf(M);
96
+ }, c = function(p, $) {
97
+ return a.w(e.toDate()[p].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
98
+ }, h = this.$W, d = this.$M, l = this.$D, b = "set" + (this.$u ? "UTC" : "");
99
+ switch (u) {
100
+ case y:
101
+ return i ? o(1, 0) : o(31, 11);
102
+ case m:
103
+ return i ? o(1, d) : o(0, d + 1);
104
+ case H:
105
+ var g = this.$locale().weekStart || 0, k = (h < g ? h + 7 : h) - g;
106
+ return o(i ? l - k : l + (6 - k), d);
107
+ case M:
108
+ case _:
109
+ return c(b + "Hours", 0);
110
+ case O:
111
+ return c(b + "Minutes", 1);
112
+ case w:
113
+ return c(b + "Seconds", 2);
114
+ case S:
115
+ return c(b + "Milliseconds", 3);
116
+ default:
117
+ return this.clone();
118
+ }
119
+ }, n.endOf = function(t) {
120
+ return this.startOf(t, !1);
121
+ }, n.$set = function(t, r) {
122
+ var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[_] = u + "Date", e[m] = u + "Month", e[y] = u + "FullYear", e[O] = u + "Hours", e[w] = u + "Minutes", e[S] = u + "Seconds", e[A] = u + "Milliseconds", e)[i], c = i === M ? this.$D + (r - this.$W) : r;
123
+ if (i === m || i === y) {
124
+ var h = this.clone().set(_, 1);
125
+ h.$d[o](c), h.init(), this.$d = h.set(_, Math.min(this.$D, h.daysInMonth())).$d;
126
+ } else o && this.$d[o](c);
127
+ return this.init(), this;
128
+ }, n.set = function(t, r) {
129
+ return this.clone().$set(t, r);
130
+ }, n.get = function(t) {
131
+ return this[a.p(t)]();
132
+ }, n.add = function(t, r) {
133
+ var e, i = this;
134
+ t = Number(t);
135
+ var u = a.p(r), o = function(d) {
136
+ var l = f(i);
137
+ return a.w(l.date(l.date() + Math.round(d * t)), i);
138
+ };
139
+ if (u === m) return this.set(m, this.$M + t);
140
+ if (u === y) return this.set(y, this.$y + t);
141
+ if (u === M) return o(1);
142
+ if (u === H) return o(7);
143
+ var c = (e = {}, e[w] = Y, e[O] = U, e[S] = W, e)[u] || 1, h = this.$d.getTime() + t * c;
144
+ return a.w(h, this);
145
+ }, n.subtract = function(t, r) {
146
+ return this.add(-1 * t, r);
147
+ }, n.format = function(t) {
148
+ var r = this, e = this.$locale();
149
+ if (!this.isValid()) return e.invalidDate || Z;
150
+ var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, g = function($, v, j, L) {
151
+ return $ && ($[v] || $(r, i)) || j[v].slice(0, L);
152
+ }, k = function($) {
153
+ return a.s(o % 12 || 12, $, "0");
154
+ }, p = b || function($, v, j) {
155
+ var L = $ < 12 ? "AM" : "PM";
156
+ return j ? L.toLowerCase() : L;
157
+ };
158
+ return i.replace(G, function($, v) {
159
+ return v || function(j) {
160
+ switch (j) {
161
+ case "YY":
162
+ return String(r.$y).slice(-2);
163
+ case "YYYY":
164
+ return a.s(r.$y, 4, "0");
165
+ case "M":
166
+ return h + 1;
167
+ case "MM":
168
+ return a.s(h + 1, 2, "0");
169
+ case "MMM":
170
+ return g(e.monthsShort, h, l, 3);
171
+ case "MMMM":
172
+ return g(l, h);
173
+ case "D":
174
+ return r.$D;
175
+ case "DD":
176
+ return a.s(r.$D, 2, "0");
177
+ case "d":
178
+ return String(r.$W);
179
+ case "dd":
180
+ return g(e.weekdaysMin, r.$W, d, 2);
181
+ case "ddd":
182
+ return g(e.weekdaysShort, r.$W, d, 3);
183
+ case "dddd":
184
+ return d[r.$W];
185
+ case "H":
186
+ return String(o);
187
+ case "HH":
188
+ return a.s(o, 2, "0");
189
+ case "h":
190
+ return k(1);
191
+ case "hh":
192
+ return k(2);
193
+ case "a":
194
+ return p(o, c, !0);
195
+ case "A":
196
+ return p(o, c, !1);
197
+ case "m":
198
+ return String(c);
199
+ case "mm":
200
+ return a.s(c, 2, "0");
201
+ case "s":
202
+ return String(r.$s);
203
+ case "ss":
204
+ return a.s(r.$s, 2, "0");
205
+ case "SSS":
206
+ return a.s(r.$ms, 3, "0");
207
+ case "Z":
208
+ return u;
209
+ }
210
+ return null;
211
+ }($) || u.replace(":", "");
212
+ });
213
+ }, n.utcOffset = function() {
214
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
215
+ }, n.diff = function(t, r, e) {
216
+ var i, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * Y, d = this - c, l = function() {
217
+ return a.m(u, c);
218
+ };
219
+ switch (o) {
220
+ case y:
221
+ i = l() / 12;
222
+ break;
223
+ case m:
224
+ i = l();
225
+ break;
226
+ case J:
227
+ i = l() / 3;
228
+ break;
229
+ case H:
230
+ i = (d - h) / 6048e5;
231
+ break;
232
+ case M:
233
+ i = (d - h) / 864e5;
234
+ break;
235
+ case O:
236
+ i = d / U;
237
+ break;
238
+ case w:
239
+ i = d / Y;
240
+ break;
241
+ case S:
242
+ i = d / W;
243
+ break;
244
+ default:
245
+ i = d;
246
+ }
247
+ return e ? i : a.a(i);
248
+ }, n.daysInMonth = function() {
249
+ return this.endOf(m).$D;
250
+ }, n.$locale = function() {
251
+ return D[this.$L];
252
+ }, n.locale = function(t, r) {
253
+ if (!t) return this.$L;
254
+ var e = this.clone(), i = T(t, r, !0);
255
+ return i && (e.$L = i), e;
256
+ }, n.clone = function() {
257
+ return a.w(this.$d, this);
258
+ }, n.toDate = function() {
259
+ return new Date(this.valueOf());
260
+ }, n.toJSON = function() {
261
+ return this.isValid() ? this.toISOString() : null;
262
+ }, n.toISOString = function() {
263
+ return this.$d.toISOString();
264
+ }, n.toString = function() {
265
+ return this.$d.toUTCString();
266
+ }, s;
267
+ }(), z = C.prototype;
268
+ return f.prototype = z, [["$ms", A], ["$s", S], ["$m", w], ["$H", O], ["$W", M], ["$M", m], ["$y", y], ["$D", _]].forEach(function(s) {
269
+ z[s[1]] = function(n) {
270
+ return this.$g(n, s[0], s[1]);
271
+ };
272
+ }), f.extend = function(s, n) {
273
+ return s.$i || (s(n, C, f), s.$i = !0), f;
274
+ }, f.locale = T, f.isDayjs = F, f.unix = function(s) {
275
+ return f(1e3 * s);
276
+ }, f.en = D[x], f.Ls = D, f.p = {}, f;
277
+ });
278
+ }(N)), N.exports;
279
+ }
280
+ var tt = X();
281
+ const rt = /* @__PURE__ */ K(tt);
282
+ export {
283
+ rt as d,
284
+ X as r
285
+ };
@@ -2,7 +2,7 @@ var le = Object.defineProperty;
2
2
  var ue = (S, c, v) => c in S ? le(S, c, { enumerable: !0, configurable: !0, writable: !0, value: v }) : S[c] = v;
3
3
  var ot = (S, c, v) => ue(S, typeof c != "symbol" ? c + "" : c, v);
4
4
  import { readonly as Pt, ref as Ut } from "vue";
5
- import { c as st } from "./app-y20uA-tu.js";
5
+ import { c as st } from "./app-CeEFBB-w.js";
6
6
  const _e = (S, c) => {
7
7
  const v = S.__vccOpts || S;
8
8
  for (const [d, s] of c)
@@ -0,0 +1,212 @@
1
+ function N(t) {
2
+ switch (t.status) {
3
+ case "ACTIVE":
4
+ return t.visible === !1 ? "INACTIVE" : "ACTIVE";
5
+ case "INVITED":
6
+ return "INVITED";
7
+ case "DECLINED":
8
+ return "DECLINED";
9
+ default:
10
+ return null;
11
+ }
12
+ }
13
+ function C(t) {
14
+ switch (t) {
15
+ case "PENDING":
16
+ return "PENDING_APPROVAL";
17
+ case "OPEN":
18
+ return "CODE_ISSUED";
19
+ default:
20
+ return null;
21
+ }
22
+ }
23
+ function I(t) {
24
+ var n, s;
25
+ const o = [];
26
+ for (const { member: e, restaurant: a } of t) {
27
+ const r = N(e);
28
+ r && o.push({
29
+ kind: "member",
30
+ key: `member:${e._id}`,
31
+ memberId: e._id,
32
+ restaurantId: e.restaurantId,
33
+ restaurantName: (a == null ? void 0 : a.name) || null,
34
+ status: e.status,
35
+ listStatus: r,
36
+ unitNo: ((n = e.stall) == null ? void 0 : n.unitNo) ?? null,
37
+ displayName: ((s = e.stall) == null ? void 0 : s.displayName) ?? null
38
+ });
39
+ }
40
+ return o;
41
+ }
42
+ function f(t) {
43
+ var n, s;
44
+ const o = [];
45
+ for (const { joinCode: e, restaurant: a } of t) {
46
+ const r = C(e.status);
47
+ r && o.push({
48
+ kind: "joinCode",
49
+ key: `joinCode:${e._id}`,
50
+ joinCodeId: e._id,
51
+ status: e.status === "PENDING" ? "PENDING" : "OPEN",
52
+ listStatus: r,
53
+ restaurantId: e.restaurantId ?? (a == null ? void 0 : a._id) ?? null,
54
+ restaurantName: (a == null ? void 0 : a.name) || null,
55
+ businessName: (a == null ? void 0 : a.businessName) || null,
56
+ unitNo: ((n = e.stall) == null ? void 0 : n.unitNo) ?? null,
57
+ displayName: ((s = e.stall) == null ? void 0 : s.displayName) ?? null,
58
+ expiresAt: e.expiresAt
59
+ });
60
+ }
61
+ return [
62
+ ...o.filter((e) => e.status === "PENDING"),
63
+ ...o.filter((e) => e.status === "OPEN")
64
+ ];
65
+ }
66
+ function v(t, o = []) {
67
+ return [...f(o), ...I(t)];
68
+ }
69
+ const S = {
70
+ ACTIVE: { variant: "success", labelKey: "order.foodCourt.stalls.statusActive" },
71
+ INACTIVE: { variant: "neutral", labelKey: "order.foodCourt.stalls.statusInactive" },
72
+ INVITED: { variant: "neutral", labelKey: "order.foodCourt.stalls.statusInvited" },
73
+ DECLINED: { variant: "critical", labelKey: "order.foodCourt.stalls.statusDeclined" },
74
+ PENDING_APPROVAL: {
75
+ variant: "warning",
76
+ labelKey: "order.foodCourt.stalls.statusPendingApproval"
77
+ },
78
+ CODE_ISSUED: { variant: "info", labelKey: "order.foodCourt.stalls.statusCodeIssued" }
79
+ };
80
+ function O(t) {
81
+ return t.displayName || t.restaurantName || t.restaurantId || "";
82
+ }
83
+ function L(t) {
84
+ const o = t.restaurantName || t.restaurantId || "";
85
+ return t.businessName && t.businessName !== o ? `${o} (${t.businessName})` : o;
86
+ }
87
+ const y = {
88
+ ACTIVE: ["edit", "deactivate", "remove"],
89
+ INACTIVE: ["edit", "activate", "remove"],
90
+ INVITED: ["edit", "cancelInvite"],
91
+ DECLINED: [],
92
+ PENDING_APPROVAL: ["approve", "decline"],
93
+ CODE_ISSUED: ["cancelCode"]
94
+ }, p = {
95
+ edit: "order.edit",
96
+ deactivate: "order.foodCourt.stalls.actionDeactivate",
97
+ activate: "order.foodCourt.stalls.actionActivate",
98
+ remove: "order.foodCourt.stalls.actionRemove",
99
+ cancelInvite: "order.foodCourt.stalls.actionCancelInvite",
100
+ approve: "order.foodCourt.stalls.actionApprove",
101
+ decline: "order.foodCourt.stalls.actionDecline",
102
+ cancelCode: "order.foodCourt.stalls.actionCancelCode"
103
+ }, D = "ABCDEFGHJKMNPQRSTUVWXYZ23456789", u = 10;
104
+ function E(t) {
105
+ return (t ?? "").toUpperCase().replace(/[\s-]/g, "");
106
+ }
107
+ function P(t) {
108
+ const o = E(t);
109
+ return o.length === u && [...o].every((n) => D.includes(n));
110
+ }
111
+ function m(t) {
112
+ const o = E(t);
113
+ if (o.length !== u) return o;
114
+ const n = u / 2;
115
+ return `${o.slice(0, n)}-${o.slice(n)}`;
116
+ }
117
+ const l = { min: 1, max: 50 };
118
+ function b(t) {
119
+ return typeof t != "number" || Number.isNaN(t) ? l.min : Math.min(l.max, Math.max(l.min, Math.trunc(t)));
120
+ }
121
+ function V(t) {
122
+ return t.map((o) => m(o)).filter(Boolean).join(`
123
+ `);
124
+ }
125
+ const d = {
126
+ JOIN_CODE_INVALID: "order.foodCourt.joinErrors.invalid",
127
+ JOIN_CODE_EXPIRED: "order.foodCourt.joinErrors.expired",
128
+ JOIN_CODE_USED: "order.foodCourt.joinErrors.used",
129
+ TOO_MANY_ATTEMPTS: "order.foodCourt.joinErrors.tooManyAttempts",
130
+ MEMBER_EXISTS: "order.foodCourt.joinErrors.memberExists",
131
+ JOIN_REQUEST_EXISTS: "order.foodCourt.joinErrors.requestExists",
132
+ RESTAURANT_NOT_MANAGEABLE: "order.foodCourt.joinErrors.notManageable"
133
+ };
134
+ function j(t) {
135
+ const o = typeof t == "object" && t !== null ? t.code : void 0;
136
+ return typeof o == "string" && Object.prototype.hasOwnProperty.call(d, o) ? d[o] : null;
137
+ }
138
+ const A = {
139
+ INVITED: "INVITED",
140
+ ACTIVE: "JOINED",
141
+ DECLINED: "DECLINED",
142
+ REVOKED: "CANCELLED",
143
+ REMOVED: "LEFT"
144
+ };
145
+ function T(t) {
146
+ const o = [t == null ? void 0 : t.line1, t == null ? void 0 : t.city, t == null ? void 0 : t.state].map((n) => (n ?? "").trim()).filter(Boolean);
147
+ return o.length ? o.reduce((n, s) => `${n}${n.endsWith(",") ? " " : ", "}${s}`) : null;
148
+ }
149
+ function M(t) {
150
+ const o = t.map(({ foodCourtId: s, profile: e, member: a }) => {
151
+ var r, c;
152
+ return {
153
+ foodCourtId: s,
154
+ memberId: a._id,
155
+ courtName: (e == null ? void 0 : e.name) || null,
156
+ courtAddress: T(e == null ? void 0 : e.address),
157
+ status: A[a.status] ?? "CANCELLED",
158
+ unitNo: ((r = a.stall) == null ? void 0 : r.unitNo) ?? null,
159
+ displayName: ((c = a.stall) == null ? void 0 : c.displayName) ?? null,
160
+ joinedAt: a.joinedAt ?? null,
161
+ since: a.joinedAt ?? a.invitedAt ?? null
162
+ };
163
+ }), n = (s) => s.since && Date.parse(s.since) || 0;
164
+ return o.sort((s, e) => n(e) - n(s));
165
+ }
166
+ const R = {
167
+ JOINED: { variant: "success", labelKey: "order.foodCourt.invitations.statusJoined" },
168
+ INVITED: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusInvited" },
169
+ DECLINED: { variant: "critical", labelKey: "order.foodCourt.invitations.statusDeclined" },
170
+ CANCELLED: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusCancelled" },
171
+ LEFT: { variant: "neutral", labelKey: "order.foodCourt.invitations.statusLeft" }
172
+ }, J = 60;
173
+ function i(t) {
174
+ const o = (t ?? "").trim();
175
+ return o || null;
176
+ }
177
+ function _(t, o) {
178
+ const n = i(t);
179
+ return n === i(o) ? null : n;
180
+ }
181
+ function K(t, o, n) {
182
+ return { unitNo: i(t), displayName: _(o, n) };
183
+ }
184
+ function h(t, o) {
185
+ const n = { unitNo: i(t), displayName: i(o) };
186
+ return n.unitNo || n.displayName ? n : null;
187
+ }
188
+ function g(t) {
189
+ return t instanceof Error && t.message ? t.message : String(t);
190
+ }
191
+ export {
192
+ l as J,
193
+ R as M,
194
+ y as S,
195
+ p as a,
196
+ J as b,
197
+ b as c,
198
+ h as d,
199
+ g as e,
200
+ m as f,
201
+ O as g,
202
+ S as h,
203
+ T as i,
204
+ V as j,
205
+ P as k,
206
+ j as l,
207
+ M as m,
208
+ E as n,
209
+ L as r,
210
+ K as s,
211
+ v as t
212
+ };