@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.60

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 (147) hide show
  1. package/dist/{App-CvJ0ASlp.js → App-BUwQLdzG.js} +812 -666
  2. package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-laNQB1ef.js} +14 -13
  3. package/dist/{Bin-ZSCDSioa.js → Bin-Bfboeea_.js} +8 -8
  4. package/dist/{Broadcast-BT0R11RB.js → Broadcast-CDz-_eDz.js} +40 -37
  5. package/dist/CampaignAnalytic-BiA-5XG3.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js} +6 -5
  7. package/dist/Card-CKHaW8N7.js +1084 -0
  8. package/dist/{Collections-H7zhe9zN.js → Collections-DRocQb1D.js} +14 -13
  9. package/dist/Credit-DWaoVhSP.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js +53 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js} +54 -52
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js} +35 -35
  13. package/dist/{Experience-CH5tg-tm.js → Experience-C1_LpneJ.js} +112 -86
  14. package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CWJ-6CFP.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-DtTYcSZk.js +356 -0
  17. package/dist/GiftCardSetup-B770Rl1Q.js +662 -0
  18. package/dist/{Grab-3s_sLewD.js → Grab-CN0gmIxT.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js} +1 -1
  20. package/dist/{Index-zTWZCiEo.js → Index-0F6aq3f9.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js} +1 -1
  23. package/dist/LoyaltyDashboard-CtXyDFqa.js +2865 -0
  24. package/dist/MainLayout-BSWLr3gE.js +143 -0
  25. package/dist/{Marketing-Bto1OvK1.js → Marketing-Ci2haxRd.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-Cw6R0bNM.js} +15 -14
  27. package/dist/Member-DEzSTAQy.js +649 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js +1287 -0
  29. package/dist/MemberImportHistory-BGfNLzma.js +187 -0
  30. package/dist/MemberList-Cq5Gsv3G.js +336 -0
  31. package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-BrUVZRtt.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js} +5434 -5279
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js +40 -0
  34. package/dist/Mission-Do4IonLo.js +360 -0
  35. package/dist/{Overview-mxGLyFvE.js → Overview-DA90l9Kb.js} +21 -20
  36. package/dist/Overview-DN-nJxw9.js +1316 -0
  37. package/dist/Point-DQ4w857n.js +288 -0
  38. package/dist/Promotion-Rgt9LcYi.js +423 -0
  39. package/dist/{Queue-DgaFyyyH.js → Queue-SzypUxgD.js} +14 -13
  40. package/dist/{Record-BRol__6_.js → Record-DYvPPhIW.js} +9 -9
  41. package/dist/Review-B0TERyHM.js +45 -0
  42. package/dist/ReviewFacebookCallback-BJ5jQ3Dv.js +238 -0
  43. package/dist/ReviewGoogleCallback-BKQD39dv.js +213 -0
  44. package/dist/{Reward-DQI0PvmR.js → Reward-BexlVT_C.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js} +103 -109
  47. package/dist/{Segment-DFaLx0QZ.js → Segment-CYa4GjtQ.js} +30 -29
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js} +31 -30
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js} +4 -4
  50. package/dist/{Setting-D2NjFJvq.js → Setting-Dmm5BKdF.js} +14 -14
  51. package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-cy4cRBop.js} +12 -12
  52. package/dist/Settings-DMQuLDM4.js +230 -0
  53. package/dist/Store-B7KflfSk.js +2612 -0
  54. package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-BKae8uZn.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js} +2 -2
  57. package/dist/{Tier-vaJoohiM.js → Tier-BeTz6LHH.js} +2296 -750
  58. package/dist/{Title-BqHC7-v9.js → Title-OEVVw5I-.js} +39 -37
  59. package/dist/Transaction-D-MZjntW.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js} +26 -26
  61. package/dist/{Voucher-DeN6C6DQ.js → Voucher-BJCf3pSa.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js} +115 -121
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js} +2 -2
  64. package/dist/{app-n4Y2jMee.js → app-J8VIC7-H.js} +29852 -25997
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-HYFFI4OS.js +75 -0
  67. package/dist/{business-jn-_l48y.js → business-BonuheMK.js} +5 -5
  68. package/dist/{campaign-rgDnocfT.js → campaign-7CI7gfS5.js} +74 -96
  69. package/dist/campaign-Ct7jhugP.js +100 -0
  70. package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-OzJ9IbAW.js} +1 -1
  71. package/dist/{campaign.fn-D21ettpH.js → campaign.fn-CDjxE9B2.js} +99 -99
  72. package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-Dw_tlI9E.js} +1 -1
  73. package/dist/collection.fn-CER0_NEn.js +26 -0
  74. package/dist/currency-CTUS4vS8.js +7 -0
  75. package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-CMQ-RMH-.js} +11 -11
  76. package/dist/{effect-DhpIv1L3.js → effect-DBeGoMNE.js} +1 -1
  77. package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BH3mQzan.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-WYHUnHVy.js → helper-DJe_JbKJ.js} +1 -1
  80. package/dist/{index-BdnHQSDd.js → index-B14H1rLW.js} +5 -4
  81. package/dist/{index-7HizF3GI.js → index-BOVnM3gL.js} +1588 -1522
  82. package/dist/{index-Cvfavr2M.js → index-BRCB6yJ6.js} +232 -200
  83. package/dist/{index-BPsofsGt.js → index-BZKKS7jO.js} +1933 -2560
  84. package/dist/{index-BuLfxJyC.js → index-BlwAgY_z.js} +105 -123
  85. package/dist/index-BmN_Qcw7.js +151 -0
  86. package/dist/index-Bnk3vdb-.js +72 -0
  87. package/dist/index-BzVTqlVH.js +137 -0
  88. package/dist/{index--fNMSXUf.js → index-CEDhjZzd.js} +1 -1
  89. package/dist/{index-BdqRrCt8.js → index-CM9GTQIo.js} +5 -5
  90. package/dist/index-CN8VyVEB.js +53 -0
  91. package/dist/{index-Cte6dHHy.js → index-COuceEFz.js} +14 -14
  92. package/dist/{index-BN-FP9kx.js → index-CWR2s6Nt.js} +1 -1
  93. package/dist/index-CrMBqkKk.js +897 -0
  94. package/dist/{index-xao4ggML.js → index-D9f3AIaO.js} +5 -5
  95. package/dist/index-Do36kJeb.js +51 -0
  96. package/dist/{index-C-5YgmkC.js → index-bGByr1XM.js} +7 -5
  97. package/dist/{index-DUTFNEn9.js → index-bJX4zgh0.js} +4 -4
  98. package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-BpCPgTjc.js} +128 -128
  99. package/dist/{loading-CojnK00V.js → loading-D_rPJ-Yc.js} +1 -1
  100. package/dist/{lodash-CLkg5jTT.js → lodash-BM976Z2I.js} +1 -1
  101. package/dist/member-import-C5rhD3f8.js +187 -0
  102. package/dist/membership-CIQCEKiL.js +274 -0
  103. package/dist/{money-CyaLaEKo.js → money-BrMT193t.js} +1 -1
  104. package/dist/{number-DEtI4bEX.js → number-DOcD1tqL.js} +1 -1
  105. package/dist/objectid-CAdRRoFu.js +145 -0
  106. package/dist/{plugins-MnP1vCcg.js → plugins-696Z9K6A.js} +3 -3
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-Dk3D26xC.js → reward-lSVIBiE9.js} +1 -1
  109. package/dist/{rule-B1Agad1n.js → rule-BUGAimk8.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-DpqLCq1p.js → template-01_h2Gac.js} +6 -6
  112. package/dist/timezone-okTdM2YU.js +20 -0
  113. package/dist/transaction.fn-Nz0T33ex.js +64 -0
  114. package/dist/{trigger-cwPN-4Ia.js → trigger-CKj1X6zs.js} +17 -17
  115. package/dist/useMarketingMaterialActions-yKqKaPpe.js +96 -0
  116. package/dist/{usePagination-D8zBMxdJ.js → usePagination-D6cYlfni.js} +1 -1
  117. package/dist/{user-EUGwaL2f.js → user-DX5qCQfz.js} +1 -1
  118. package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-DowpocqN.js} +204 -204
  119. package/dist/{xlsx-DiMIlKmu.js → xlsx-Dv4SuJbw.js} +1 -1
  120. package/dist/{zod-B1cU167C.js → zod-DVw24Ejy.js} +1 -1
  121. package/package.json +6 -5
  122. package/dist/Card-Wdh8lyUv.js +0 -910
  123. package/dist/Credit-BuKLrFtM.js +0 -260
  124. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  125. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  126. package/dist/Game-C9s4qZz4.js +0 -330
  127. package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
  128. package/dist/MainLayout-iWi1DzXS.js +0 -41
  129. package/dist/Member-BdgdT-sa.js +0 -280
  130. package/dist/MemberList-DBIE-RWC.js +0 -1601
  131. package/dist/Mission-CWR6FBvN.js +0 -334
  132. package/dist/Point-BIt82fJk.js +0 -262
  133. package/dist/Promotion-Cl1vPi0B.js +0 -397
  134. package/dist/Review-DmV2YnFd.js +0 -1076
  135. package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
  136. package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
  137. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
  138. package/dist/Store-DjUe8ady.js +0 -1996
  139. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
  140. package/dist/Transaction-BOmDOGnD.js +0 -39
  141. package/dist/campaign-BnI7-ceP.js +0 -219
  142. package/dist/export-CWAxYj7W.js +0 -97
  143. package/dist/index-B6EBgIUx.js +0 -85
  144. package/dist/index-CxR1baaG.js +0 -52
  145. package/dist/membership-CeX8E_I9.js +0 -255
  146. package/dist/objectid-CMau7CW-.js +0 -145
  147. package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
@@ -1,397 +0,0 @@
1
- import { defineComponent as Q, ref as w, resolveComponent as d, openBlock as f, createBlock as S, unref as a, isRef as te, withCtx as k, createElementVNode as i, createVNode as c, computed as ne, h as I, onMounted as ae, createElementBlock as L, Fragment as B, renderList as se, resolveDynamicComponent as ie, toDisplayString as h } from "vue";
2
- import { _ as re } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as le, components as N } from "@feedmepos/ui-library";
4
- import { p as $ } from "./plugins-MnP1vCcg.js";
5
- import { u as ce } from "./loading-CojnK00V.js";
6
- import { u as me } from "./business-jn-_l48y.js";
7
- import { c as y, u as ue } from "./campaign-BnI7-ceP.js";
8
- import { u as de } from "./vue-i18n-BBj45p9N.js";
9
- import { g as j, a as pe, b as q } from "./campaign-rgDnocfT.js";
10
- import { c as fe, p as ye } from "./duplicateCampaign-gzVwrnWb.js";
11
- import { e as K } from "./effect-DhpIv1L3.js";
12
- import { c as U } from "./string-Gcy5IM_H.js";
13
- import { _ as ge } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js";
14
- import { u as he } from "./template-DpqLCq1p.js";
15
- import { _ as E } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
16
- const _e = { class: "space-y-8" }, be = /* @__PURE__ */ Q({
17
- __name: "QueueSheet",
18
- emits: ["update:model-value"],
19
- setup(H, { expose: n, emit: R }) {
20
- const p = w(!1), _ = w([]);
21
- async function P() {
22
- p.value = !0;
23
- const r = await y.getPromotionQueue();
24
- console.log(r, "jobs"), _.value = r;
25
- }
26
- const v = [
27
- {
28
- header: "Started At",
29
- accessorFn: (r) => r.createdAt,
30
- enableSorting: !0
31
- },
32
- {
33
- header: "Campaigns",
34
- accessorFn: (r) => r.campaigns
35
- // cell(props) {
36
- // const r = props.row.original;
37
- // return h('div', {
38
- // innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
39
- // });
40
- // },
41
- }
42
- ];
43
- return n({
44
- showSheet: P
45
- }), (r, u) => {
46
- const b = d("FmTable"), T = d("FmSideSheet");
47
- return f(), S(T, {
48
- "max-width": 550,
49
- header: "Promotion Sync Queue",
50
- modelValue: a(p),
51
- "onUpdate:modelValue": [
52
- u[1] || (u[1] = (s) => te(p) ? p.value = s : null),
53
- u[2] || (u[2] = (s) => p.value = s)
54
- ]
55
- }, {
56
- default: k(() => [
57
- i("div", _e, [
58
- u[3] || (u[3] = i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
59
- c(b, {
60
- modelValue: r.tableRef,
61
- "onUpdate:modelValue": u[0] || (u[0] = (s) => r.tableRef = s),
62
- "column-filter": r.jobFilters,
63
- "column-defs": v,
64
- "row-data": a(_),
65
- "hide-footer": a(_).length <= 10
66
- }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
67
- ])
68
- ]),
69
- _: 1
70
- }, 8, ["modelValue"]);
71
- };
72
- }
73
- }), we = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Fe = { class: "flex w-full gap-4 items-center" }, Se = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "flex items-center gap-8" }, Oe = { class: "flex flex-col gap-16 text-center" }, Ie = { class: "fm-typo-en-title-sm-800" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = /* @__PURE__ */ Q({
74
- __name: "Promotion",
75
- setup(H) {
76
- const { t: n } = de(), R = {
77
- label: n("connect.promotion.createCampaign"),
78
- value: "create",
79
- isPrimary: !0,
80
- prependIcon: "add"
81
- }, p = {
82
- label: "Force sync",
83
- value: "sync",
84
- isPrimary: !1,
85
- prependIcon: "refresh"
86
- }, _ = {
87
- label: "Queue",
88
- value: "queue",
89
- isPrimary: !1,
90
- prependIcon: "work_history"
91
- }, P = he("PROMOTION", le()), v = me(), r = ue(), { global: u, minor: b } = ce, T = [
92
- {
93
- label: "Bill promotion",
94
- value: "BILL"
95
- },
96
- {
97
- label: "Item promotion",
98
- value: "ITEM"
99
- }
100
- ], s = w({
101
- searchKey: "",
102
- location: [],
103
- effectType: []
104
- });
105
- function z(e) {
106
- const o = s.value.location;
107
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
108
- var l;
109
- return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
110
- }) : e.targetLocation.includes(o);
111
- }
112
- function G(e) {
113
- var l, x;
114
- const o = s.value.effectType;
115
- if (!o || o.length === 0) return !0;
116
- const m = (x = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : x.target;
117
- return o.includes(m);
118
- }
119
- const g = ne(
120
- () => r.campaigns.promotion.filter(
121
- (e) => z(e) && G(e)
122
- )
123
- ), J = [
124
- {
125
- header: n("connect.promotion.promotionTitle"),
126
- accessorFn: (e) => e.name
127
- },
128
- {
129
- header: n("connect.promotion.campaignDate"),
130
- accessorFn: (e) => j(e)
131
- },
132
- {
133
- header: n("connect.promotion.status"),
134
- accessorFn: (e) => pe(e),
135
- cell(e) {
136
- return q(e.row.original);
137
- }
138
- },
139
- {
140
- header: n("connect.promotion.type"),
141
- accessorFn: (e) => `${U.title(e.effect.options.target)} promotion`
142
- },
143
- {
144
- header: n("connect.promotion.summary"),
145
- accessorFn: (e) => K(e.effect)
146
- },
147
- {
148
- header: n("connect.promotion.actions"),
149
- cell(e) {
150
- return I("div", { class: "flex items-center gap-8 justify-end" }, [
151
- I(N.FmButton, {
152
- variant: "tertiary",
153
- icon: "content_copy",
154
- iconColor: "neutral-gray-400",
155
- onClick: async (o) => {
156
- o.stopPropagation(), await M(e.row.original);
157
- }
158
- }),
159
- I(N.FmButton, {
160
- variant: "tertiary",
161
- icon: "delete",
162
- iconColor: "neutral-gray-400",
163
- onClick: (o) => {
164
- o.stopPropagation(), D(e.row.original);
165
- }
166
- })
167
- ]);
168
- }
169
- }
170
- ], V = w(), A = w();
171
- async function D(e) {
172
- await $.remove(
173
- n("connect.promotion.confirmRemove", { name: e.name })
174
- ) && await b(
175
- async () => {
176
- await y.delete(e._id), await r.read("PROMOTION");
177
- },
178
- {
179
- message: n("connect.promotion.removing", { name: e.name }),
180
- successMessage: n("connect.promotion.removedSuccessfully", {
181
- name: e.name
182
- })
183
- }
184
- );
185
- }
186
- async function C(e) {
187
- e ? await o() : P.open(async (m) => {
188
- await o(m);
189
- });
190
- async function o(m) {
191
- var l;
192
- (l = V.value) == null || l.showSheet(
193
- !0,
194
- "PROMOTION",
195
- e ? await y.readById(e._id) : void 0,
196
- m
197
- );
198
- }
199
- }
200
- async function M(e) {
201
- var l;
202
- if (!await fe(e.name))
203
- return;
204
- const o = await y.readById(e._id), m = ye(o);
205
- (l = V.value) == null || l.showSheet(
206
- !0,
207
- "PROMOTION",
208
- m,
209
- o.template
210
- );
211
- }
212
- async function W(e) {
213
- await b(
214
- async () => {
215
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await r.read("PROMOTION");
216
- },
217
- {
218
- message: n(
219
- e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
220
- ),
221
- successMessage: n(
222
- e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
223
- )
224
- }
225
- );
226
- }
227
- async function X(e) {
228
- var o;
229
- switch (e) {
230
- case "create":
231
- C();
232
- break;
233
- case "sync":
234
- await $.confirm(
235
- "Are you sure you want to synchronize all promotions to POS?",
236
- "Force sync"
237
- ) && b(
238
- async () => {
239
- await y.syncAllPromotion();
240
- },
241
- {
242
- message: "Syncing promotions...",
243
- successMessage: "All promotions synced"
244
- }
245
- );
246
- break;
247
- case "queue":
248
- (o = A.value) == null || o.showSheet();
249
- break;
250
- }
251
- }
252
- return ae(async () => {
253
- await u(async () => {
254
- await v.readLocations(), await r.read("PROMOTION");
255
- });
256
- }), (e, o) => {
257
- const m = d("FmPageHead"), l = d("FmSearch"), x = d("FmTable"), Y = d("FmChip"), O = d("FmButton"), Z = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
258
- return f(), L(B, null, [
259
- c(m, {
260
- title: a(n)("connect.promotion.title"),
261
- actions: a(g).length > 0 ? [R, p, _] : [],
262
- "onClick:action": X
263
- }, null, 8, ["title", "actions"]),
264
- i("div", we, [
265
- c(l, {
266
- modelValue: s.value.searchKey,
267
- "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
268
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
269
- placeholder: a(n)("connect.promotion.search"),
270
- collapsible: ""
271
- }, null, 8, ["modelValue", "placeholder"]),
272
- a(g) && a(g).length > 0 ? (f(), L(B, { key: 0 }, [
273
- i("div", ve, [
274
- i("div", Ce, [
275
- c(E, {
276
- label: `${a(n)("connect.common.location")}: `,
277
- "right-icon": "keyboard_arrow_down",
278
- modelValue: s.value.location,
279
- "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
280
- icon: "storefront",
281
- "show-item-label": !0,
282
- items: a(v).locationOptions
283
- }, null, 8, ["label", "modelValue", "items"]),
284
- c(E, {
285
- label: "Type:",
286
- "right-icon": "keyboard_arrow_down",
287
- modelValue: s.value.effectType,
288
- "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
289
- icon: "filter_list",
290
- "show-item-label": !0,
291
- items: T
292
- }, null, 8, ["modelValue"])
293
- ]),
294
- c(l, {
295
- modelValue: s.value.searchKey,
296
- "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
297
- class: "xs:hidden sm:hidden",
298
- placeholder: "search",
299
- collapsible: ""
300
- }, null, 8, ["modelValue"])
301
- ]),
302
- c(x, {
303
- class: "xs:hidden sm:hidden",
304
- "row-data": a(g),
305
- "column-defs": J,
306
- "search-value": s.value.searchKey,
307
- "column-filter": [],
308
- onRowClick: o[4] || (o[4] = (t) => C(t.original)),
309
- "hide-footer": a(g).length < 10
310
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
311
- c(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
312
- default: k(() => [
313
- (f(!0), L(B, null, se(a(g).filter(
314
- (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
315
- ), (t) => (f(), S(Z, {
316
- key: t._id.toString(),
317
- onClick: (F) => C(t),
318
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
319
- }, {
320
- default: k(() => [
321
- i("div", xe, [
322
- i("div", Fe, [
323
- (f(), S(ie(a(q)(t)))),
324
- c(Y, {
325
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
326
- compact: !0,
327
- label: `${a(U).title(t.effect.options.target)} promotion`
328
- }, null, 8, ["label"])
329
- ]),
330
- i("div", Se, [
331
- i("div", ke, h(t.name), 1),
332
- i("div", Pe, h(a(K)(t.effect)), 1),
333
- i("div", Te, h(a(n)("connect.promotion.campaignDate")) + ": " + h(a(j)(t)), 1)
334
- ])
335
- ]),
336
- i("div", Ve, [
337
- c(O, {
338
- icon: "content_copy",
339
- "icon-color": "neutral-gray-400",
340
- variant: "tertiary",
341
- onClick: async (F) => {
342
- F.stopPropagation(), await M(t);
343
- }
344
- }, null, 8, ["onClick"]),
345
- c(O, {
346
- icon: "delete",
347
- "icon-color": "neutral-gray-400",
348
- variant: "tertiary",
349
- onClick: (F) => (F.stopPropagation(), D(t))
350
- }, null, 8, ["onClick"])
351
- ])
352
- ]),
353
- _: 2
354
- }, 1032, ["onClick"]))), 128))
355
- ]),
356
- _: 1
357
- })
358
- ], 64)) : (f(), S(oe, {
359
- key: 1,
360
- variant: "outlined",
361
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
362
- }, {
363
- default: k(() => [
364
- o[6] || (o[6] = i("img", {
365
- src: re,
366
- class: "aspect-square w-[150px]"
367
- }, null, -1)),
368
- i("div", Oe, [
369
- i("div", Ie, h(a(n)("connect.promotion.createPromotionCampaign")), 1),
370
- i("div", Le, h(a(n)("connect.promotion.description")), 1)
371
- ]),
372
- c(O, {
373
- variant: "primary",
374
- label: a(n)("connect.promotion.createPromotionCampaign"),
375
- icon: "add",
376
- onClick: o[5] || (o[5] = (t) => C())
377
- }, null, 8, ["label"])
378
- ]),
379
- _: 1
380
- }))
381
- ]),
382
- c(ge, {
383
- ref_key: "sheetRef",
384
- ref: V,
385
- "onSubmit:modelValue": W
386
- }, null, 512),
387
- c(be, {
388
- ref_key: "queueSheetRef",
389
- ref: A
390
- }, null, 512)
391
- ], 64);
392
- };
393
- }
394
- });
395
- export {
396
- Ge as default
397
- };