@feedmepos/mf-order-setting 0.0.43 → 0.0.45

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 (91) hide show
  1. package/dist/{KioskDevicesView-KBpXQJmy.js → KioskDevicesView-CZ9B7VmM.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-taf41a-7.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B9mM8Vcl.js} +101 -96
  3. package/dist/{KioskSettingView-DG12ZvfT.js → KioskSettingView-CJAw9osg.js} +1 -1
  4. package/dist/KioskView-CN-Dk8fn.js +448 -0
  5. package/dist/{OrderSettingsView-CoAGawQi.js → OrderSettingsView-B0shsMTu.js} +33664 -34726
  6. package/dist/{app-Db1lhCv7.js → app-BK8d3ff5.js} +115 -43
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-D9bsUd57.js → dayjs.min-DgWdPF1p.js} +1 -1
  9. package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +2 -2
  10. package/dist/frontend/mf-order/src/api/restaurant-setting/index.d.ts +2 -1
  11. package/dist/frontend/mf-order/src/app.d.ts +72 -0
  12. package/dist/frontend/mf-order/src/main.d.ts +72 -0
  13. package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +1 -0
  14. package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +3 -0
  15. package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +111 -1
  16. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +291 -288
  17. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +20 -173
  18. package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +12 -114
  19. package/dist/frontend/mf-order/src/views/order-settings/delivery/delivery.data.d.ts +2 -2
  20. package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +2 -2
  21. package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +4 -4
  22. package/dist/frontend/mf-order/src/views/order-settings/queue/PresetRemarksSheet.vue.d.ts +19 -0
  23. package/dist/frontend/mf-order/src/views/order-settings/queue/QueueSetting.vue.d.ts +2 -0
  24. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  25. package/dist/{index-D_Tmm1qL.js → index-DHbH8gKt.js} +2 -2
  26. package/dist/{menu.dto-BY9dVf93.js → menu.dto-Cua9zYpc.js} +54753 -57698
  27. package/dist/package/entity/booking/booking.do.d.ts +168 -2368
  28. package/dist/package/entity/delivery/delivery.dto.d.ts +33 -473
  29. package/dist/package/entity/food-court/food-court.dto.d.ts +44 -44
  30. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +23 -0
  31. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +432 -60
  32. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +670 -628
  33. package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +2 -2
  34. package/dist/package/entity/index.d.ts +2 -0
  35. package/dist/package/entity/kiosk/kiosk.do.d.ts +16 -0
  36. package/dist/package/entity/kiosk/kiosk.dto.d.ts +19 -0
  37. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +201 -2031
  38. package/dist/package/entity/order/order-item/order-item.dto.d.ts +129 -16
  39. package/dist/package/entity/order/order.do.d.ts +8 -0
  40. package/dist/package/entity/order/order.dto.d.ts +390 -974
  41. package/dist/package/entity/order/order.enum.d.ts +2 -0
  42. package/dist/package/entity/order-platform/external/menu/external-master-menu.do.d.ts +367 -18
  43. package/dist/package/entity/order-platform/external/menu/external-menu.do.d.ts +48 -8
  44. package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +1 -0
  45. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +33 -473
  46. package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +672 -0
  47. package/dist/package/entity/order-platform/grabfood/grabfood-omni.dto.d.ts +9 -0
  48. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +90 -508
  49. package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +3 -0
  50. package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +1130 -0
  51. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +34 -47
  52. package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +8 -2
  53. package/dist/package/entity/order-platform/menu.dto.d.ts +46 -12
  54. package/dist/package/entity/order-platform/order-platform.dto.d.ts +8 -5
  55. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +33 -473
  56. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +3 -0
  57. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +3 -0
  58. package/dist/package/entity/order-setting/customization/color.do.d.ts +3 -0
  59. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +18 -18
  60. package/dist/package/entity/order-setting/order-setting.do.d.ts +72 -88
  61. package/dist/package/entity/order-setting/order-setting.dto.d.ts +724 -1036
  62. package/dist/package/entity/order-setting/queue/queue.do.d.ts +22 -0
  63. package/dist/package/entity/order-setting/queue/queue.dto.d.ts +12 -0
  64. package/dist/package/entity/order-setting/reservation/reservation.do.d.ts +4 -51
  65. package/dist/package/entity/order-setting/reservation/reservation.dto.d.ts +248 -585
  66. package/dist/package/entity/pubsub/ably/ably.enum.d.ts +10 -1
  67. package/dist/package/entity/queue/queue.dto.d.ts +76 -14
  68. package/dist/package/entity/restaurant/restaurant.dto.d.ts +41 -26
  69. package/dist/package/entity/websocket/websocket.dto.d.ts +22 -22
  70. package/package.json +3 -3
  71. package/src/api/remoteOrder/index.ts +13 -2
  72. package/src/api/restaurant-setting/index.ts +6 -0
  73. package/src/locales/en-US.json +24 -0
  74. package/src/locales/th-TH.json +24 -0
  75. package/src/locales/zh-CN.json +24 -0
  76. package/src/modules/kiosk/interface.ts +1 -0
  77. package/src/stores/kiosk/mapper.ts +1 -0
  78. package/src/stores/order-setting/mapper.ts +20 -33
  79. package/src/stores/restaurant/index.ts +7 -3
  80. package/src/views/all-orders/FilterStatus.vue +1 -1
  81. package/src/views/kiosk/devices/KioskDeviceCard.vue +6 -0
  82. package/src/views/order-settings/OrderSettingsView.vue +13 -5
  83. package/src/views/order-settings/delivery/DeliverySetting.vue +10 -5
  84. package/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue +9 -7
  85. package/src/views/order-settings/delivery/delivery.data.ts +7 -4
  86. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +2 -2
  87. package/src/views/order-settings/dine-in/DineInSetting.vue +18 -2
  88. package/src/views/order-settings/general/GeneralSetting.vue +2 -2
  89. package/src/views/order-settings/queue/PresetRemarksSheet.vue +103 -0
  90. package/src/views/order-settings/queue/QueueSetting.vue +358 -0
  91. package/dist/KioskView-KNiT-upH.js +0 -453
@@ -0,0 +1,448 @@
1
+ import { defineComponent as S, computed as h, createElementBlock as f, openBlock as u, normalizeClass as Z, createCommentVNode as b, createElementVNode as s, toDisplayString as m, unref as d, Fragment as ee, renderList as te, ref as g, defineAsyncComponent as ae, onMounted as ne, watch as oe, resolveComponent as I, createVNode as T, withCtx as se, withDirectives as le, vShow as re, createBlock as V } from "vue";
2
+ import { u as de, _ as ce } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-B9mM8Vcl.js";
3
+ import { useI18n as U, useCoreStore as ue } from "@feedmepos/mf-common";
4
+ import { F as B, a as ie, b as pe } from "./menu.dto-Cua9zYpc.js";
5
+ import { useDialog as ye, useSnackbar as me, useBreakpoints as fe } from "@feedmepos/ui-library";
6
+ import { defineStore as ve } from "pinia";
7
+ import { O as E, c as M } from "./index-DHbH8gKt.js";
8
+ const _e = {
9
+ key: 0,
10
+ class: "fm-typo-en-title-sm-600"
11
+ }, be = {
12
+ key: 1,
13
+ class: "my-[0.25rem]"
14
+ }, he = { class: "flex flex-col gap-1" }, Pe = { class: "flex flex-col gap-1" }, we = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xe = { class: "fm-typo-en-body-lg-600" }, Te = { key: 0 }, Ce = { key: 1 }, Ie = { key: 0 }, ge = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ae = { class: "fm-typo-en-body-lg-600 block" }, Oe = { key: 1 }, Ke = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Se = { class: "fm-typo-en-body-lg-600 block" }, Ue = { key: 2 }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fe = { class: "fm-typo-en-body-lg-600 block" }, qe = { key: 3 }, Re = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, De = { class: "fm-typo-en-body-lg-600 block" }, Ve = { key: 0 }, N = /* @__PURE__ */ S({
15
+ __name: "KioskSummary",
16
+ props: {
17
+ restaurantId: {},
18
+ devices: {},
19
+ kioskOrderSetting: {},
20
+ dialogType: { type: Boolean }
21
+ },
22
+ setup(t) {
23
+ const { t: e } = U(), l = t, r = h(() => {
24
+ var a;
25
+ return (a = l.kioskOrderSetting) != null && a.dineIn.enabled ? e("order.activated") : e("order.deactivated");
26
+ }), n = h(() => {
27
+ var a;
28
+ return (a = l.kioskOrderSetting) != null && a.takeaway.enabled ? e("order.activated") : e("order.deactivated");
29
+ }), o = h(() => {
30
+ var a, p;
31
+ return (a = l.kioskOrderSetting) != null && a.dineIn.displayStand ? e("order.tableService") : (p = l.kioskOrderSetting) != null && p.dineIn && !l.kioskOrderSetting.dineIn.displayStand ? e("order.pickAtCounter") : e("order.unknown");
32
+ }), i = h(() => {
33
+ var a;
34
+ return ((a = l.kioskOrderSetting) == null ? void 0 : a.paymentSetting.paymentTypes.includes(B.enum.cash)) ?? !1;
35
+ }), c = h(() => {
36
+ var p, v;
37
+ const a = [];
38
+ if ((p = l.kioskOrderSetting) == null || p.paymentSetting.paymentTypes.forEach((_) => {
39
+ _ === B.enum.ePayment && a.push(e("order.ePayment"));
40
+ }), a.length > 0 && Object.keys(l.kioskOrderSetting.paymentSetting.ePaymentTypes).length !== 0) {
41
+ const _ = (v = l.kioskOrderSetting) == null ? void 0 : v.paymentSetting.ePaymentTypes;
42
+ (_.card.terminal || _.card.nfc) && a.push(e("order.bankCard")), (_.eWallet.scanPay || _.eWallet.qrPay) && a.push(e("order.eWallet"));
43
+ }
44
+ return a.join(", ");
45
+ });
46
+ return (a, p) => (u(), f("div", {
47
+ class: Z(a.dialogType ? "" : ["p-[1.5rem] border fm-corner-radius-lg flex flex-col gap-5 fixed ml-40 w-[320px]"])
48
+ }, [
49
+ a.dialogType ? b("", !0) : (u(), f("span", _e, m(d(e)("order.kioskSummary")), 1)),
50
+ a.dialogType ? b("", !0) : (u(), f("hr", be)),
51
+ s("div", he, [
52
+ s("div", Pe, [
53
+ s("span", we, m(d(e)("order.kioskDisplay")), 1),
54
+ s("div", xe, [
55
+ a.devices.length > 0 ? (u(), f("div", Te, [
56
+ (u(!0), f(ee, null, te(a.devices, (v) => (u(), f("li", {
57
+ class: "block",
58
+ key: v.machineId
59
+ }, m(v.name), 1))), 128))
60
+ ])) : (u(), f("div", Ce, "-"))
61
+ ]),
62
+ r.value === d(e)("order.activated") ? (u(), f("div", Ie, [
63
+ s("span", ge, m(d(e)("order.dineIn")), 1),
64
+ s("div", Ae, [
65
+ s("div", null, m(r.value), 1)
66
+ ])
67
+ ])) : b("", !0),
68
+ r.value === d(e)("order.activated") && o.value !== d(e)("order.unknown") ? (u(), f("div", Oe, [
69
+ s("span", Ke, m(d(e)("order.dineInType")), 1),
70
+ s("div", Se, [
71
+ s("div", null, m(o.value), 1)
72
+ ])
73
+ ])) : b("", !0),
74
+ n.value === d(e)("order.activated") ? (u(), f("div", Ue, [
75
+ s("span", $e, m(d(e)("order.takeaway")), 1),
76
+ s("div", Fe, [
77
+ s("div", null, m(n.value), 1)
78
+ ])
79
+ ])) : b("", !0),
80
+ c.value || i.value ? (u(), f("div", qe, [
81
+ s("span", Re, m(d(e)("order.acceptedPayment")), 1),
82
+ s("div", De, [
83
+ i.value ? (u(), f("div", Ve, m(d(e)("order.offlinePayment")), 1)) : b("", !0),
84
+ s("div", null, m(c.value), 1)
85
+ ])
86
+ ])) : b("", !0)
87
+ ])
88
+ ])
89
+ ], 2));
90
+ }
91
+ }), Be = { class: "flex flex-col gap-5 pb-6" }, Ee = { class: "fm-typo-en-body-md-400 block" }, Me = { class: "fm-typo-en-title-md-600" }, Ne = /* @__PURE__ */ S({
92
+ __name: "KioskOtpDialog",
93
+ props: {
94
+ otp: {}
95
+ },
96
+ setup(t) {
97
+ const { t: e } = U();
98
+ return (l, r) => (u(), f("div", Be, [
99
+ s("span", Ee, m(d(e)("order.bindDeviceMessage")), 1),
100
+ s("div", Me, m(l.otp), 1)
101
+ ]));
102
+ }
103
+ }), k = {
104
+ enabled: !1,
105
+ prefix: null,
106
+ padDigit: 0,
107
+ standSlotRange: {
108
+ min: 1,
109
+ max: 10
110
+ },
111
+ enablePaxDialog: !1,
112
+ submitOrderInstruction: {
113
+ payAtCounter: null,
114
+ paid: null
115
+ }
116
+ }, We = {
117
+ enabled: !1,
118
+ submitOrderInstruction: {
119
+ payAtCounter: null,
120
+ paid: null
121
+ }
122
+ }, j = {
123
+ enabled: !1,
124
+ submitOrderInstruction: {
125
+ payAtCounter: null,
126
+ paid: null
127
+ },
128
+ enablePaxDialog: !1
129
+ }, ke = {
130
+ dineIn: {
131
+ enabled: !1,
132
+ pickUp: j,
133
+ sequenceNumber: ie.parse({}),
134
+ displayStand: k
135
+ },
136
+ takeaway: We,
137
+ paymentSetting: {
138
+ paymentTypes: [],
139
+ offlinePaymentTypes: [],
140
+ ePaymentTypes: {
141
+ card: {
142
+ terminal: !1,
143
+ nfc: !1
144
+ },
145
+ eWallet: {
146
+ terminalQrPay: !1,
147
+ terminalScanPay: !1,
148
+ qrPay: !1,
149
+ scanPay: !1
150
+ }
151
+ }
152
+ },
153
+ menuItem: {
154
+ showAllOnly: !1
155
+ }
156
+ }, K = {
157
+ payAtCounter: null,
158
+ paid: null
159
+ }, je = (t) => {
160
+ var e;
161
+ return {
162
+ kiosk: He(t.kioskSettings, (e = t.sequenceSettings) == null ? void 0 : e.kioskDineIn)
163
+ };
164
+ }, He = (t, e) => {
165
+ var l, r, n, o, i, c, a, p, v, _, w;
166
+ return {
167
+ dineIn: Le(e ?? {
168
+ current: 0,
169
+ prefix: "#K"
170
+ }, (t == null ? void 0 : t.dineIn) ?? void 0),
171
+ takeaway: {
172
+ enabled: (t == null ? void 0 : t.canTakeaway) ?? !1,
173
+ submitOrderInstruction: (l = t == null ? void 0 : t.takeaway) != null && l.submitOrderInstruction ? {
174
+ payAtCounter: ((o = (n = (r = t == null ? void 0 : t.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : o.en) ?? null,
175
+ paid: ((a = (c = (i = t == null ? void 0 : t.takeaway) == null ? void 0 : i.submitOrderInstruction) == null ? void 0 : c.paid) == null ? void 0 : a.en) ?? null
176
+ } : K
177
+ },
178
+ paymentSetting: {
179
+ paymentTypes: ((p = t == null ? void 0 : t.paymentSetting) == null ? void 0 : p.paymentTypes) ?? [],
180
+ offlinePaymentTypes: ((v = t == null ? void 0 : t.paymentSetting) == null ? void 0 : v.offlinePaymentTypes) ?? [],
181
+ ePaymentTypes: ((_ = t == null ? void 0 : t.paymentSetting) == null ? void 0 : _.ePaymentTypes) ?? pe.parse({
182
+ card: {
183
+ terminal: !1,
184
+ nfc: !1
185
+ },
186
+ eWallet: {
187
+ qrPay: !1,
188
+ scanPay: !1
189
+ }
190
+ })
191
+ },
192
+ menuItem: {
193
+ showAllOnly: ((w = t == null ? void 0 : t.menuItem) == null ? void 0 : w.showAllOnly) ?? !1
194
+ }
195
+ };
196
+ }, Le = (t, e) => {
197
+ var l, r, n, o, i, c, a, p;
198
+ return {
199
+ enabled: !!e,
200
+ sequenceNumber: t,
201
+ pickUp: e != null && e.pickUp ? {
202
+ ...e.pickUp,
203
+ submitOrderInstruction: e.pickUp.submitOrderInstruction ? {
204
+ payAtCounter: ((r = (l = e.pickUp.submitOrderInstruction) == null ? void 0 : l.payAtCounter) == null ? void 0 : r.en) ?? null,
205
+ paid: ((o = (n = e.pickUp.submitOrderInstruction) == null ? void 0 : n.paid) == null ? void 0 : o.en) ?? null
206
+ } : K,
207
+ enablePaxDialog: e.pickUp.enablePaxDialog ? e.pickUp.enablePaxDialog : !1
208
+ } : j,
209
+ displayStand: e != null && e.displayStand ? {
210
+ enabled: e.displayStand.enabled,
211
+ standSlotRange: e.displayStand.standSlotRange,
212
+ prefix: e.displayStand.prefix,
213
+ padDigit: e.displayStand.padDigit,
214
+ enablePaxDialog: e.displayStand.enablePaxDialog ?? !1,
215
+ submitOrderInstruction: e.displayStand.submitOrderInstruction ? {
216
+ payAtCounter: ((c = (i = e.displayStand.submitOrderInstruction) == null ? void 0 : i.payAtCounter) == null ? void 0 : c.en) ?? null,
217
+ paid: ((p = (a = e.displayStand.submitOrderInstruction) == null ? void 0 : a.paid) == null ? void 0 : p.en) ?? null
218
+ } : K
219
+ } : k
220
+ };
221
+ }, Ye = (t) => {
222
+ const e = (n) => {
223
+ var o, i, c, a;
224
+ return {
225
+ requiredSlot: !!n.displayStand,
226
+ displayStand: {
227
+ ...n.displayStand,
228
+ submitOrderInstruction: {
229
+ payAtCounter: (o = n.displayStand.submitOrderInstruction) != null && o.payAtCounter ? {
230
+ en: n.displayStand.submitOrderInstruction.payAtCounter
231
+ } : null,
232
+ paid: (i = n.displayStand.submitOrderInstruction) != null && i.paid ? {
233
+ en: n.displayStand.submitOrderInstruction.paid
234
+ } : null
235
+ }
236
+ },
237
+ pickUp: {
238
+ ...n.pickUp,
239
+ submitOrderInstruction: {
240
+ payAtCounter: (c = n.pickUp.submitOrderInstruction) != null && c.payAtCounter ? {
241
+ en: n.pickUp.submitOrderInstruction.payAtCounter
242
+ } : null,
243
+ paid: (a = n.pickUp.submitOrderInstruction) != null && a.paid ? {
244
+ en: n.pickUp.submitOrderInstruction.paid
245
+ } : null
246
+ }
247
+ }
248
+ };
249
+ }, l = (n) => ({
250
+ canTakeaway: t.takeaway.enabled,
251
+ dineIn: n,
252
+ menuItem: t.menuItem,
253
+ paymentSetting: r(t.paymentSetting),
254
+ takeaway: t.takeaway.submitOrderInstruction ? {
255
+ submitOrderInstruction: {
256
+ payAtCounter: t.takeaway.submitOrderInstruction.payAtCounter ? {
257
+ en: t.takeaway.submitOrderInstruction.payAtCounter
258
+ } : null,
259
+ paid: t.takeaway.submitOrderInstruction.paid ? {
260
+ en: t.takeaway.submitOrderInstruction.paid
261
+ } : null
262
+ }
263
+ } : void 0
264
+ }), r = (n) => ({
265
+ paymentTypes: n.paymentTypes,
266
+ offlinePaymentTypes: n.offlinePaymentTypes,
267
+ ePaymentTypes: n.ePaymentTypes
268
+ });
269
+ return t.dineIn.enabled ? {
270
+ kioskSettings: l(e(t.dineIn)),
271
+ kioskDineIn: t.dineIn.sequenceNumber
272
+ } : {
273
+ kioskSettings: l()
274
+ };
275
+ }, W = {
276
+ convertOrderSettingDto: je,
277
+ toOrderKioskSettingsDto: Ye
278
+ }, ze = ve("orderSetting", () => {
279
+ const t = g({});
280
+ async function e() {
281
+ const o = await E.getOrderSetting();
282
+ r(o);
283
+ }
284
+ async function l() {
285
+ if (t.value.orderSetting && t.value.kiosk) {
286
+ const { _id: o, ...i } = t.value.orderSetting, c = W.toOrderKioskSettingsDto(t.value.kiosk), a = {
287
+ ...i,
288
+ kioskSettings: c.kioskSettings
289
+ }, p = await E.updateOrderSetting(a);
290
+ r(p);
291
+ }
292
+ }
293
+ function r(o) {
294
+ t.value.orderSetting = o, t.value.kiosk = W.convertOrderSettingDto(o).kiosk;
295
+ }
296
+ function n(o) {
297
+ t.value.kiosk = o;
298
+ }
299
+ return {
300
+ state: t.value,
301
+ getSetting: e,
302
+ updateKioskSetting: l,
303
+ setKioskOrderSetting: n
304
+ };
305
+ }), Qe = { class: "py-[1.5rem]" }, Ge = { class: "flex px-[1.5rem]" }, Je = { class: "flex-[2_2_0%]" }, Xe = { class: "pt-[1.5rem]" }, Ze = { class: "flex flex-col gap-10" }, et = { class: "flex flex-col gap-2" }, tt = { class: "fm-typo-en-title-sm-600" }, at = { class: "fm-typo-en-title-sm-400" }, nt = {
306
+ key: 0,
307
+ class: "flex-[1_1_0%]"
308
+ }, it = /* @__PURE__ */ S({
309
+ __name: "KioskView",
310
+ setup(t) {
311
+ var R, D;
312
+ const { t: e } = U(), l = ae(
313
+ () => import("./KioskSettingView-CJAw9osg.js")
314
+ ), r = g("device"), n = de(), o = ze(), i = ye(), { currentRestaurant: c, restaurants: a, changeRestaurant: p } = ue(), v = me(), _ = fe(), w = h(() => _.breakpoints.value.xs), C = g(((R = c.value) == null ? void 0 : R._id) ?? void 0), H = h(() => a.value.map((y) => ({
315
+ label: y.profile.name,
316
+ value: y._id
317
+ }))), x = g(((D = c.value) == null ? void 0 : D._id) ?? "");
318
+ function L() {
319
+ var y;
320
+ i.open({
321
+ title: M(e("order.kioskSummary")),
322
+ contentComponent: N,
323
+ contentComponentProps: {
324
+ restaurantId: (y = c.value) == null ? void 0 : y._id,
325
+ devices: n.state.devices,
326
+ kioskOrderSetting: o.state.kiosk,
327
+ dialogType: !0
328
+ }
329
+ });
330
+ }
331
+ async function $(y) {
332
+ const P = a.value.find((A) => A._id == y);
333
+ await p(P), await F(), C.value = y, x.value = y;
334
+ }
335
+ async function F() {
336
+ await o.getSetting(), await n.getDevices();
337
+ }
338
+ const Y = h(() => [
339
+ {
340
+ label: e("order.deviceBinding"),
341
+ value: "device"
342
+ },
343
+ {
344
+ label: e("order.settings"),
345
+ value: "setting"
346
+ }
347
+ ]), q = h(() => n.state.devices);
348
+ async function z() {
349
+ await n.requestOtp(), i.open({
350
+ title: M(e("order.bindDevice")),
351
+ contentComponent: Ne,
352
+ contentComponentProps: {
353
+ otp: n.state.otp
354
+ }
355
+ });
356
+ }
357
+ async function Q(y) {
358
+ try {
359
+ o.setKioskOrderSetting(y), await o.updateKioskSetting(), v.open({
360
+ title: e("order.kioskSettingSuccess"),
361
+ type: "success"
362
+ });
363
+ } catch {
364
+ v.open({
365
+ title: e("order.kioskSettingFailed"),
366
+ type: "error"
367
+ });
368
+ }
369
+ }
370
+ return ne(async () => {
371
+ var y;
372
+ (y = c.value) != null && y._id && (x.value = c.value._id, await F());
373
+ }), oe(
374
+ () => a.value.length,
375
+ async (y) => {
376
+ C.value === void 0 && a.value.length > 0 && await $(a.value[0]._id);
377
+ },
378
+ { immediate: !0 }
379
+ ), (y, P) => {
380
+ const A = I("FmButton"), G = I("FmPageHead"), J = I("FmTabs"), X = I("FmSelect");
381
+ return u(), f("div", Qe, [
382
+ T(G, {
383
+ title: d(e)("order.kiosk")
384
+ }, {
385
+ append: se(() => [
386
+ le(T(A, {
387
+ icon: "info",
388
+ variant: "tertiary",
389
+ onClick: L
390
+ }, null, 512), [
391
+ [re, w.value]
392
+ ])
393
+ ]),
394
+ _: 1
395
+ }, 8, ["title"]),
396
+ s("div", Ge, [
397
+ s("div", Je, [
398
+ T(J, {
399
+ "model-value": r.value,
400
+ "onUpdate:modelValue": P[0] || (P[0] = (O) => r.value = O),
401
+ items: Y.value
402
+ }, null, 8, ["model-value", "items"]),
403
+ s("div", Xe, [
404
+ s("div", Ze, [
405
+ s("div", et, [
406
+ s("span", tt, m(d(e)("order.activateLocation")), 1),
407
+ s("span", at, m(d(e)("order.selectRestaurant")) + ": ", 1),
408
+ T(X, {
409
+ class: "w-1/2",
410
+ modelValue: C.value,
411
+ "onUpdate:modelValue": [
412
+ P[1] || (P[1] = (O) => C.value = O),
413
+ $
414
+ ],
415
+ items: H.value,
416
+ placeholder: d(e)("order.selectItem")
417
+ }, null, 8, ["modelValue", "items", "placeholder"])
418
+ ]),
419
+ r.value == "device" ? (u(), V(ce, {
420
+ key: 0,
421
+ devices: q.value,
422
+ "request-otp": z
423
+ }, null, 8, ["devices"])) : b("", !0),
424
+ r.value == "setting" ? (u(), V(d(l), {
425
+ key: `KioskSettingView-${x.value}`,
426
+ "restaurant-id": x.value,
427
+ onUpdateKioskOrderSetting: Q,
428
+ form: d(o).state.kiosk ?? d(ke)
429
+ }, null, 8, ["restaurant-id", "form"])) : b("", !0)
430
+ ])
431
+ ])
432
+ ]),
433
+ w.value ? b("", !0) : (u(), f("div", nt, [
434
+ T(N, {
435
+ "restaurant-id": x.value,
436
+ devices: q.value,
437
+ "kiosk-order-setting": d(o).state.kiosk,
438
+ dialogType: !1
439
+ }, null, 8, ["restaurant-id", "devices", "kiosk-order-setting"])
440
+ ]))
441
+ ])
442
+ ]);
443
+ };
444
+ }
445
+ });
446
+ export {
447
+ it as default
448
+ };