@feedmepos/mf-connect 0.1.38-beta.9 → 0.1.38-beta.91

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 (162) hide show
  1. package/dist/{Analytic-3MN2saaU.js → Analytic-Drbkm5By.js} +31 -32
  2. package/dist/{App-Co8X5Wdy.js → App-C0cdcG5i.js} +741 -728
  3. package/dist/AuditLogs-BZZLtf2u.js +2013 -0
  4. package/dist/{Bin-8a56ZDib.js → Bin-DRV5lRmj.js} +10 -10
  5. package/dist/Broadcast-C90FN2LB.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVXlfq31.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsdxwjCn.js} +6 -6
  7. package/dist/{Card-B8_09LJu.js → Card-CWF84A1O.js} +145 -140
  8. package/dist/Collections-ja0gMaFf.js +540 -0
  9. package/dist/Credit-D8U2AJgq.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-YR62BvBG.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVbhDMqH.js +351 -0
  15. package/dist/Experience-DDXLGizu.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Dng61jiL.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-CMOilzsW.js +330 -0
  20. package/dist/Grab-tPVQB39R.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-BbtEXO4b.js} +49 -48
  22. package/dist/{Index-DLF71mx_.js → Index-Ch7wiShF.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DLO0jj6Z.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CplyhUFF.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-BMqnfxHh.js} +1 -1
  26. package/dist/Marketing-C0weDg-u.js +236 -0
  27. package/dist/MarketingMaterialEdit-BD-SyXVQ.js +1036 -0
  28. package/dist/{Member-Bkw4aqtv.js → Member-Bpf0amjr.js} +38 -37
  29. package/dist/{MemberList-a3PdVYB3.js → MemberList-cWYPEpL4.js} +485 -489
  30. package/dist/{MemberTransactions-CPDBd-n3.js → MemberTransactions-vzRUVwpO.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-pbN8pN1m.js → MessageInput.vue_vue_type_script_setup_true_lang-DY3L9CvB.js} +10392 -9967
  32. package/dist/Mission-HRwIp1QY.js +334 -0
  33. package/dist/{Overview-De97NDoe.js → Overview-D9cfX4Kr.js} +34 -34
  34. package/dist/Point-Dz-Z0_m9.js +262 -0
  35. package/dist/Promotion-Csb0bdI6.js +397 -0
  36. package/dist/{Queue-ISVZxCE2.js → Queue-CAVKh9bK.js} +18 -18
  37. package/dist/{Record-2FMByNC6.js → Record-bPnIoHnT.js} +15 -14
  38. package/dist/Review-D2DfvLqJ.js +621 -0
  39. package/dist/ReviewFacebookCallback-CI7V3xbp.js +243 -0
  40. package/dist/ReviewGoogleCallback-LA2S8FLZ.js +213 -0
  41. package/dist/{Reward-DPRyQ37x.js → Reward-DdHF5Pr7.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Ba7-3bL-.js → RewardGroup.vue_vue_type_script_setup_true_lang-DyZhWnI4.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B0OSLJVN.js +1912 -0
  44. package/dist/Segment-DV1zcWF7.js +1015 -0
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DZbyDVid.js → SelectItems.vue_vue_type_script_setup_true_lang-Df1HE9sL.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ioMFYIwK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0K9giqI.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzJL8Xl0.js +226 -0
  48. package/dist/Setting-DZiZy8A5.js +2039 -0
  49. package/dist/SettingAdvertisements-Bb9shWVJ.js +264 -0
  50. package/dist/Store-mymtMyho.js +1996 -0
  51. package/dist/StoreRewards-jcjZfSv7.js +537 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B-b5_TFL.js +1130 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-sCa1J_hq.js +7007 -0
  54. package/dist/{Tier-CwRj0oJ1.js → Tier-Ba6aHC3R.js} +562 -480
  55. package/dist/{Title-EII5OxSP.js → Title-C4uKD8E1.js} +151 -149
  56. package/dist/{Transaction-1MTkAfej.js → Transaction-Bf2uG6co.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlQVWQHJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C3ttU-bw.js} +7 -7
  58. package/dist/Voucher-Lsc2pKCk.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-MA7tsTm-.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CTeGK4bk.js → ZodTextField.vue_vue_type_script_setup_true_lang-DEDavbCx.js} +2 -2
  61. package/dist/app-BRrGcz9U.js +59647 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-DjnN-J4U.js → business-TBSvPv65.js} +11 -8
  64. package/dist/campaign-CL95CZkI.js +219 -0
  65. package/dist/campaign-DxcuYXB7.js +254 -0
  66. package/dist/campaign.enum-DRydaoy9.js +26 -0
  67. package/dist/campaign.fn-BsoUwQ5N.js +776 -0
  68. package/dist/{collectible.enum-r6N115Lu.js → collectible.enum-CpTbpumt.js} +1 -1
  69. package/dist/{collection.fn-CSsfVv26.js → collection.fn-BNrPdDIr.js} +2 -2
  70. package/dist/dto-BGrkIVqX.js +222 -0
  71. package/dist/duplicateCampaign-DBaFROXd.js +51 -0
  72. package/dist/effect-fonU-1xO.js +89 -0
  73. package/dist/{email-addresses-D8uheCCF.js → email-addresses-WeV5Gvxa.js} +2 -2
  74. package/dist/{export-Ver6WiX6.js → export-DDXf8yf_.js} +4 -4
  75. package/dist/{helper-Bg4xoFbh.js → helper-DwnzJKxo.js} +22 -7
  76. package/dist/index-10x-WMiS.js +30289 -0
  77. package/dist/index-9Wt89ReU.js +3625 -0
  78. package/dist/{index-Bb0CHeNx.js → index-Brh5FXQ7.js} +3 -3
  79. package/dist/index-BxxNZQUc.js +8910 -0
  80. package/dist/{index-hJUxCNsF.js → index-CDAMmPIn.js} +1 -1
  81. package/dist/{index-CNhr0_Zx.js → index-Cg1vzNzf.js} +617 -191
  82. package/dist/{index-BZZ4iF4-.js → index-Cl7QnFc4.js} +23 -12
  83. package/dist/index-CuvNtC_M.js +61 -0
  84. package/dist/{index-BPQyQc4q.js → index-Cvw-xFek.js} +1 -1
  85. package/dist/index-DCJ_r_e2.js +85 -0
  86. package/dist/{index-Dn_bmcns.js → index-DLG8B-TK.js} +3 -3
  87. package/dist/{index-D4JOeJJJ.js → index-DWhh_u0L.js} +1 -1
  88. package/dist/index-DsQJTvKe.js +28900 -0
  89. package/dist/index-oR7xhhIt.js +48 -0
  90. package/dist/{index.esm2017-hK1Mi9yY.js → index.esm2017-CFvohTUs.js} +122 -122
  91. package/dist/{loading-kIQFOTwH.js → loading-DiD8J1Jc.js} +4 -3
  92. package/dist/{lodash-B5I3zXaY.js → lodash-BJgKlNEt.js} +1 -1
  93. package/dist/{membership--xR-HZoa.js → membership-C8HuK9_K.js} +38 -18
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-c-ITXnlg.js → money-DXl1-c0l.js} +1 -1
  96. package/dist/{number-DfZSBLOY.js → number-C6RGu6qp.js} +1 -1
  97. package/dist/objectid-8Boc1xMT.js +145 -0
  98. package/dist/{campaign-BpJ1O6KS.js → plugins-CxBcRdUi.js} +677 -699
  99. package/dist/remy-D_Deb3ue.js +13 -0
  100. package/dist/{reward-CE0ifMHS.js → reward-CEh2CA9Z.js} +1 -1
  101. package/dist/{rule-DrjdmpaB.js → rule-DEfU8NOO.js} +505 -487
  102. package/dist/rule-builder-BZIx2IzX.js +102 -0
  103. package/dist/string-Gcy5IM_H.js +32 -0
  104. package/dist/style.css +11 -2
  105. package/dist/template-Ba8NxY41.js +188 -0
  106. package/dist/timezone-DUqMvcwo.js +1156 -0
  107. package/dist/trigger-KQ-DPHv-.js +213 -0
  108. package/dist/useMarketingMaterialActions-DSI7Fpu9.js +96 -0
  109. package/dist/usePagination-BeTADCIt.js +220 -0
  110. package/dist/{user-Cl3IotYV.js → user-DN6_QE2j.js} +15 -14
  111. package/dist/vue-i18n-B4dOYJz4.js +2365 -0
  112. package/dist/{xlsx-BDBzdOuM.js → xlsx-BDFTkXYe.js} +1 -1
  113. package/dist/{zod-Bg2FbC-D.js → zod-B8WJKIxe.js} +32 -31
  114. package/package.json +14 -6
  115. package/dist/AuditLogs-DTq6IAuc.js +0 -1887
  116. package/dist/Broadcast-UreS5Kiq.js +0 -227
  117. package/dist/Collections-B0I5ULxR.js +0 -465
  118. package/dist/Credit-B4Ad8DWP.js +0 -222
  119. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  120. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js +0 -2185
  121. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-y5JnuIev.js +0 -347
  122. package/dist/Experience-xO5KpTTm.js +0 -223
  123. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  124. package/dist/Game-ChgrVvz5.js +0 -278
  125. package/dist/Marketing-BlmRXSGl.js +0 -20073
  126. package/dist/Mission-B07wK0HX.js +0 -296
  127. package/dist/Point-Ckj9QIeH.js +0 -226
  128. package/dist/Promotion-aGNCOeRN.js +0 -289
  129. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DWj-421v.js +0 -1751
  130. package/dist/Segment-CRMNJ11X.js +0 -882
  131. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js +0 -147
  132. package/dist/Setting-c0FWRZsD.js +0 -1936
  133. package/dist/Store-Bm1_15s8.js +0 -1842
  134. package/dist/StoreRewards-BCQHHfay.js +0 -423
  135. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfTF2l-D.js +0 -1029
  136. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-rvhoxo0w.js +0 -139
  137. package/dist/Voucher-CYvjCb-v.js +0 -384
  138. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-63Jr71dJ.js +0 -419
  139. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  140. package/dist/app-BJLHk8ao.js +0 -33357
  141. package/dist/app-BzIk1ojT.js +0 -7086
  142. package/dist/campaign-BHNS5kXt.js +0 -96
  143. package/dist/campaign.enum-CJDWE_Om.js +0 -20
  144. package/dist/campaign.fn-C0HQE9uh.js +0 -758
  145. package/dist/dto-Byq51uVH.js +0 -214
  146. package/dist/effect-Do3yTM-_.js +0 -78
  147. package/dist/index-B1V9UnI9.js +0 -76
  148. package/dist/index-BM9CWjC6.js +0 -38
  149. package/dist/index-CsaQJMAR.js +0 -66
  150. package/dist/index-D6VxioBg.js +0 -30038
  151. package/dist/index-DGKlRWn3.js +0 -32260
  152. package/dist/index-DLKyOu7W.js +0 -8861
  153. package/dist/index-DyYF6HYL.js +0 -121
  154. package/dist/index-UXtH44XQ.js +0 -3120
  155. package/dist/objectid-DKbha9-x.js +0 -145
  156. package/dist/plugins-DtakupKW.js +0 -208
  157. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  158. package/dist/rule-builder-B_hCyq3x.js +0 -89
  159. package/dist/template-WI4a-lFY.js +0 -190
  160. package/dist/trigger-DieDHht3.js +0 -144
  161. package/dist/usePagination-BeF5K3M7.js +0 -223
  162. package/dist/vue-i18n-DKh0SMhL.js +0 -2365
@@ -1,139 +0,0 @@
1
- import { defineComponent as N, ref as C, computed as L, watch as E, resolveComponent as g, openBlock as o, createElementBlock as i, Fragment as y, toDisplayString as I, createCommentVNode as A, createElementVNode as M, createVNode as v, unref as u, renderList as S, createBlock as b, isRef as U, withCtx as F } from "vue";
2
- import { u as T } from "./business-DjnN-J4U.js";
3
- function j(l, s, n) {
4
- return l.some(
5
- n instanceof Function ? n : (a) => a === s
6
- ) || l.push(s), l;
7
- }
8
- function q(l, s, n) {
9
- return l.filter(
10
- n instanceof Function ? (a) => !n(a) : (a) => a !== s
11
- );
12
- }
13
- const D = {
14
- key: 0,
15
- class: "fm-typo-en-body-lg-400"
16
- }, K = {
17
- key: 1,
18
- class: "space-y-4"
19
- }, O = { key: 0 }, R = { key: 1 }, z = { key: 2 }, J = /* @__PURE__ */ N({
20
- __name: "TargetLocationInput",
21
- props: {
22
- label: {
23
- type: String
24
- },
25
- type: {
26
- type: String,
27
- default: "select"
28
- },
29
- modelValue: {
30
- type: Object,
31
- required: !0
32
- }
33
- },
34
- emits: ["update:model-value"],
35
- setup(l, { emit: s }) {
36
- const n = T(), a = l, c = C(""), w = L(() => n.locations.filter(
37
- (d) => {
38
- var t;
39
- return d.name.toLowerCase().includes(c.value.toLowerCase()) || ((t = d == null ? void 0 : d.code) == null ? void 0 : t.toLowerCase().includes(c.value.toLowerCase()));
40
- }
41
- )), p = s;
42
- function k(d, t) {
43
- const m = d ? j(a.modelValue || [], t.toString()) : q(
44
- a.modelValue || n.locations.map((V) => V._id.toString()),
45
- t.toString()
46
- );
47
- return p("update:model-value", m);
48
- }
49
- const r = C(!1), $ = L(() => {
50
- var m, V;
51
- const t = ((m = a.modelValue) == null ? void 0 : m.slice(0, 5).map((h) => {
52
- var f;
53
- return ((f = n.locationById(h)) == null ? void 0 : f.name) || h;
54
- })) || [];
55
- return a.modelValue && ((V = a.modelValue) == null ? void 0 : V.length) > 5 && t.push(`+${a.modelValue.length - 5} more`), t;
56
- });
57
- return E(r, (d) => {
58
- d && (c.value = "");
59
- }), (d, t) => {
60
- const m = g("FmCheckbox"), V = g("FmChip"), h = g("FmField"), f = g("FmTextField"), B = g("FmMenu");
61
- return o(), i(y, null, [
62
- l.label ? (o(), i("div", D, I(l.label), 1)) : A("", !0),
63
- l.type === "checkbox" ? (o(), i("div", K, [
64
- M("div", null, [
65
- v(m, {
66
- value: null,
67
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < u(n).locations.length,
68
- label: "All locations",
69
- "model-value": l.modelValue == null || l.modelValue.length === u(n).locations.length,
70
- "onUpdate:modelValue": t[0] || (t[0] = (e) => p("update:model-value", e ? null : []))
71
- }, null, 8, ["indeterminate", "model-value"])
72
- ]),
73
- (o(!0), i(y, null, S(u(n).locations, (e) => (o(), i("div", {
74
- key: e._id.toString()
75
- }, [
76
- v(m, {
77
- value: e._id.toString(),
78
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
79
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
80
- "onUpdate:modelValue": (x) => k(x, e._id.toString())
81
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"])
82
- ]))), 128))
83
- ])) : (o(), b(B, {
84
- key: 2,
85
- modelValue: u(r),
86
- "onUpdate:modelValue": t[3] || (t[3] = (e) => U(r) ? r.value = e : null),
87
- onMenuChanged: t[4] || (t[4] = (e) => r.value = e),
88
- placement: "top-end"
89
- }, {
90
- "menu-button": F(() => [
91
- v(h, {
92
- "append-icon": u(r) ? "expand_more" : "expand_less",
93
- class: "!h-auto"
94
- }, {
95
- default: F(() => [
96
- !l.modelValue || l.modelValue.length == u(n).locations.length ? (o(), i("div", O, " All Locations ")) : l.modelValue.length ? (o(), i("div", z, [
97
- (o(!0), i(y, null, S(u($), (e) => (o(), b(V, {
98
- key: e,
99
- label: e,
100
- class: "max-w-[130px] text-ellipsis"
101
- }, null, 8, ["label"]))), 128))
102
- ])) : (o(), i("div", R, "No Locations"))
103
- ]),
104
- _: 1
105
- }, 8, ["append-icon"])
106
- ]),
107
- default: F(() => [
108
- v(f, {
109
- modelValue: u(c),
110
- "onUpdate:modelValue": t[1] || (t[1] = (e) => U(c) ? c.value = e : null),
111
- placeholder: "Search locations",
112
- class: "my-8"
113
- }, null, 8, ["modelValue"]),
114
- v(m, {
115
- class: "my-8",
116
- value: null,
117
- indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < u(n).locations.length,
118
- label: "All locations",
119
- "model-value": l.modelValue == null || l.modelValue.length === u(n).locations.length,
120
- "onUpdate:modelValue": t[2] || (t[2] = (e) => p("update:model-value", e ? null : []))
121
- }, null, 8, ["indeterminate", "model-value"]),
122
- (o(!0), i(y, null, S(u(w), (e) => (o(), b(m, {
123
- class: "my-8",
124
- key: e._id.toString(),
125
- value: e._id.toString(),
126
- label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
127
- "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
128
- "onUpdate:modelValue": (x) => k(x, e._id.toString())
129
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
130
- ]),
131
- _: 1
132
- }, 8, ["modelValue"]))
133
- ], 64);
134
- };
135
- }
136
- });
137
- export {
138
- J as _
139
- };
@@ -1,384 +0,0 @@
1
- import { defineComponent as Y, ref as x, computed as ee, h as m, onMounted as oe, resolveComponent as d, openBlock as u, createElementBlock as V, Fragment as S, createVNode as l, unref as t, createElementVNode as c, withCtx as F, renderList as te, createBlock as h, resolveDynamicComponent as ne, toDisplayString as g, createCommentVNode as E } from "vue";
2
- import { _ as ae } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as re, components as f } from "@feedmepos/ui-library";
4
- import { _ as M } from "./FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js";
5
- import { p as A, a as ce } from "./plugins-DtakupKW.js";
6
- import { useCoreStore as ie } from "@feedmepos/mf-common";
7
- import { u as se } from "./loading-kIQFOTwH.js";
8
- import { u as le } from "./business-DjnN-J4U.js";
9
- import { u as me } from "./campaign-BHNS5kXt.js";
10
- import { g as ue, a as O, b as B } from "./campaign-BpJ1O6KS.js";
11
- import "./index-D4JOeJJJ.js";
12
- import { u as de } from "./template-WI4a-lFY.js";
13
- import { _ as pe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js";
14
- import { _ as fe } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js";
15
- import { u as ye } from "./vue-i18n-DKh0SMhL.js";
16
- import { T as he } from "./trigger-DieDHht3.js";
17
- import { useRouter as ge } from "vue-router";
18
- import { c as w } from "./index-DyYF6HYL.js";
19
- import { R as H } from "./app-BzIk1ojT.js";
20
- var _e = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
21
- const ve = { class: "px-24 flex flex-col gap-y-16" }, Ce = { class: "flex items-center justify-between w-full" }, we = { class: "flex gap-8 overflow-x-auto" }, be = { class: "space-y-8" }, ke = { class: "flex w-full gap-4 items-center" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "space-y-4" }, Se = { class: "fm-typo-en-body-lg-600" }, Fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = { class: "flex gap-8 items-center" }, Te = { class: "flex flex-col gap-16 text-center" }, Ue = { class: "fm-typo-en-title-sm-800" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Je = /* @__PURE__ */ Y({
22
- __name: "Voucher",
23
- setup(Ie) {
24
- const { t: a } = ye(), $ = {
25
- label: a("connect.voucher.createCampaign"),
26
- value: "create",
27
- isPrimary: !0,
28
- prependIcon: "add"
29
- }, L = re(), K = de("VOUCHER", L), N = le(), p = me(), { global: D, minor: T } = se, U = ge(), i = x({
30
- searchKey: "",
31
- location: [],
32
- triggerType: []
33
- }), _ = ee(
34
- () => p.campaigns.voucher.filter(
35
- (e) => q(e) && G(e)
36
- )
37
- ), j = he.VOUCHER.map((e) => ({
38
- label: e.name,
39
- value: e.value
40
- }));
41
- function q(e) {
42
- const o = i.value.location;
43
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
44
- (r) => {
45
- var s;
46
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(r);
47
- }
48
- ) : e.targetLocation.includes(o);
49
- }
50
- function G(e) {
51
- const o = i.value.triggerType;
52
- if (!o || o.length === 0) return !0;
53
- const r = e.event.type;
54
- return o.includes(r);
55
- }
56
- const X = [
57
- {
58
- header: a("connect.voucher.voucherTitle"),
59
- accessorFn: (e) => e.name
60
- },
61
- {
62
- header: a("connect.voucher.status"),
63
- accessorFn: (e) => ue(e),
64
- cell(e) {
65
- return O(e.row.original);
66
- }
67
- },
68
- {
69
- header: a("connect.voucher.summary"),
70
- accessorFn: (e) => B(e)
71
- },
72
- {
73
- header: a("connect.voucher.quota"),
74
- accessorFn: (e) => {
75
- var o;
76
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
77
- }
78
- },
79
- {
80
- header: a("connect.voucher.claimed"),
81
- accessorFn: (e) => {
82
- var o;
83
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
84
- }
85
- },
86
- {
87
- header: a("connect.voucher.actions"),
88
- cell(e) {
89
- return m("div", { class: "flex items-center justify-end" }, [
90
- m(f.FmButton, {
91
- icon: "visibility",
92
- variant: "tertiary",
93
- iconColor: "neutral-gray-400",
94
- onClick: async (o) => {
95
- o.stopPropagation(), await U.push({
96
- name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
97
- params: { id: e.row.original._id }
98
- });
99
- }
100
- }),
101
- m(
102
- f.FmMenu,
103
- {
104
- placement: "bottom-end",
105
- onClick: (o) => {
106
- o.stopPropagation();
107
- }
108
- },
109
- {
110
- "menu-button": () => m(f.FmButton, {
111
- icon: "more_vert",
112
- iconColor: "neutral-gray-400",
113
- variant: "tertiary"
114
- }),
115
- default: () => {
116
- const o = [
117
- m(
118
- f.FmMenuItem,
119
- {
120
- onClick: async (r) => {
121
- r.stopPropagation(), I(e.row.original);
122
- }
123
- },
124
- {
125
- label: m(
126
- "div",
127
- {
128
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
129
- },
130
- a("connect.voucher.remove")
131
- )
132
- }
133
- )
134
- ];
135
- return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
136
- m(f.FmMenuItem, {
137
- label: a("connect.voucher.send"),
138
- onClick: async (r) => {
139
- var s;
140
- r.stopPropagation(), (s = b.value) == null || s.showSheet({
141
- campaignId: e.row.original._id
142
- });
143
- }
144
- })
145
- ), o.unshift(
146
- m(f.FmMenuItem, {
147
- label: a("connect.voucher.share"),
148
- onClick: async (r) => {
149
- if (r.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
150
- return await A.confirm(
151
- "Cannot share a voucher that is not a simple claim.",
152
- "Share Voucher",
153
- "OK"
154
- );
155
- await ce(
156
- `https://${ie().currentBusiness.value._id}.${_e.appUrl}/vouchers/${e.row.original._id}`,
157
- {
158
- successMessage: "Voucher link copied to clipboard"
159
- }
160
- );
161
- }
162
- })
163
- )), o;
164
- }
165
- }
166
- )
167
- ]);
168
- }
169
- }
170
- ], P = x(), b = x();
171
- async function I(e) {
172
- await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await T(
173
- async () => {
174
- await w.delete(e._id), await p.read("VOUCHER");
175
- },
176
- {
177
- message: a("connect.voucher.removing", { name: e.name }),
178
- successMessage: a("connect.voucher.removedSuccessfully", {
179
- name: e.name
180
- })
181
- }
182
- );
183
- }
184
- async function v(e) {
185
- e ? await o() : K.open(async (r) => {
186
- await o(r);
187
- });
188
- async function o(r) {
189
- var s;
190
- (s = P.value) == null || s.showSheet(
191
- !0,
192
- "VOUCHER",
193
- e ? await w.readById(e._id) : void 0,
194
- r
195
- );
196
- }
197
- }
198
- async function W(e) {
199
- e.campaign._id && await new Promise((o) => {
200
- L.open({
201
- title: "Confirmation",
202
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
203
- primaryActions: { text: "Update all", close: !0 },
204
- secondaryActions: { text: "Update future only", close: !0 }
205
- }).onPrimary(async () => {
206
- var r;
207
- e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
208
- }).onSecondary(async () => {
209
- o();
210
- });
211
- }), await T(
212
- async () => {
213
- e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
214
- },
215
- {
216
- message: a(
217
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
218
- ),
219
- successMessage: a(
220
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
221
- )
222
- }
223
- );
224
- }
225
- return oe(async () => {
226
- await D(async () => {
227
- await p.read("VOUCHER");
228
- });
229
- }), (e, o) => {
230
- const r = d("FmPageHead"), s = d("FmSearch"), z = d("FmTable"), C = d("FmButton"), Q = d("FmListItem"), Z = d("FmList"), J = d("FmCard");
231
- return u(), V(S, null, [
232
- l(r, {
233
- title: t(a)("connect.voucher.title"),
234
- actions: t(_).length > 0 ? [$] : [],
235
- "onClick:action": o[0] || (o[0] = () => v())
236
- }, null, 8, ["title", "actions"]),
237
- c("div", ve, [
238
- l(s, {
239
- modelValue: t(i).searchKey,
240
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
241
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
242
- placeholder: t(a)("connect.voucher.search"),
243
- collapsible: ""
244
- }, null, 8, ["modelValue", "placeholder"]),
245
- t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), V(S, { key: 0 }, [
246
- c("div", Ce, [
247
- c("div", we, [
248
- l(M, {
249
- label: `${t(a)("connect.common.location")}: `,
250
- "right-icon": "keyboard_arrow_down",
251
- modelValue: t(i).location,
252
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
253
- icon: "storefront",
254
- "show-item-label": !0,
255
- items: t(N).locationOptions
256
- }, null, 8, ["label", "modelValue", "items"]),
257
- l(M, {
258
- label: "Type:",
259
- "right-icon": "keyboard_arrow_down",
260
- modelValue: t(i).triggerType,
261
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).triggerType = n),
262
- icon: "filter_list",
263
- "show-item-label": !0,
264
- items: t(j)
265
- }, null, 8, ["modelValue", "items"])
266
- ]),
267
- l(s, {
268
- modelValue: t(i).searchKey,
269
- "onUpdate:modelValue": o[4] || (o[4] = (n) => t(i).searchKey = n),
270
- class: "xs:hidden",
271
- placeholder: t(a)("connect.voucher.search"),
272
- collapsible: ""
273
- }, null, 8, ["modelValue", "placeholder"])
274
- ]),
275
- l(z, {
276
- class: "xs:hidden",
277
- "row-data": t(_),
278
- "column-defs": X,
279
- "search-value": t(i).searchKey,
280
- "column-filter": [],
281
- onRowClick: o[5] || (o[5] = (n) => v(n.original)),
282
- "hide-footer": t(_).length < 10
283
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
284
- l(Z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
285
- default: F(() => [
286
- (u(!0), V(S, null, te(t(_).filter(
287
- (n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
288
- ), (n) => (u(), h(Q, {
289
- key: n._id.toString(),
290
- onClick: (k) => v(n),
291
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
292
- }, {
293
- default: F(() => {
294
- var k;
295
- return [
296
- c("div", be, [
297
- c("div", ke, [
298
- (u(), h(ne(t(O)(n)))),
299
- c("div", xe, g(((k = n.pf_collectible) == null ? void 0 : k.currentReceive) ?? 0) + " claimed ", 1)
300
- ]),
301
- c("div", Ve, [
302
- c("div", Se, g(n.name), 1),
303
- c("div", Fe, g(t(B)(n)), 1)
304
- ])
305
- ]),
306
- c("div", Le, [
307
- n.event.type === "SIMPLE_CLAIM" ? (u(), h(C, {
308
- key: 0,
309
- icon: "visibility",
310
- "icon-color": "neutral-gray-400",
311
- variant: "tertiary",
312
- onClick: async (y) => {
313
- y.stopPropagation(), await t(U).push({
314
- name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
315
- params: { id: n._id }
316
- });
317
- }
318
- }, null, 8, ["onClick"])) : E("", !0),
319
- n.event.type === "SIMPLE_CLAIM" ? (u(), h(C, {
320
- key: 1,
321
- icon: "send",
322
- "icon-color": "neutral-gray-400",
323
- variant: "tertiary",
324
- onClick: (y) => {
325
- var R;
326
- y.stopPropagation(), (R = t(b)) == null || R.showSheet({
327
- campaignId: n._id
328
- });
329
- }
330
- }, null, 8, ["onClick"])) : E("", !0),
331
- l(C, {
332
- icon: "delete",
333
- "icon-color": "neutral-gray-400",
334
- variant: "tertiary",
335
- onClick: (y) => (y.stopPropagation(), I(n))
336
- }, null, 8, ["onClick"])
337
- ])
338
- ];
339
- }),
340
- _: 2
341
- }, 1032, ["onClick"]))), 128))
342
- ]),
343
- _: 1
344
- })
345
- ], 64)) : (u(), h(J, {
346
- key: 1,
347
- variant: "outlined",
348
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
349
- }, {
350
- default: F(() => [
351
- o[7] || (o[7] = c("img", {
352
- src: ae,
353
- class: "aspect-square w-[150px]"
354
- }, null, -1)),
355
- c("div", Te, [
356
- c("div", Ue, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
357
- c("div", Pe, g(t(a)("connect.voucher.description")), 1)
358
- ]),
359
- l(C, {
360
- variant: "primary",
361
- label: t(a)("connect.voucher.createVoucherCampaign"),
362
- icon: "add",
363
- onClick: o[6] || (o[6] = (n) => v())
364
- }, null, 8, ["label"])
365
- ]),
366
- _: 1
367
- })),
368
- l(pe, {
369
- ref_key: "sheetRef",
370
- ref: P,
371
- "onSubmit:modelValue": W
372
- }, null, 512),
373
- l(fe, {
374
- ref_key: "sendVoucherSheetRef",
375
- ref: b
376
- }, null, 512)
377
- ])
378
- ], 64);
379
- };
380
- }
381
- });
382
- export {
383
- Je as default
384
- };