@feedmepos/mf-connect 0.1.98-beta.40 → 0.1.98-beta.41

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 (151) hide show
  1. package/dist/App-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  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-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js";
3
+ import { u as C } from "./vue-i18n-BYz7XAr_.js";
4
+ const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
5
+ __name: "Transaction",
6
+ setup(V) {
7
+ const { t: n } = C(), a = [
8
+ {
9
+ label: n("connect.transaction.tabs.collection"),
10
+ value: "collection"
11
+ },
12
+ {
13
+ label: n("connect.transaction.tabs.store"),
14
+ value: "store"
15
+ }
16
+ ], e = f(a[0]);
17
+ return (B, c) => {
18
+ const i = s("FmPageHead"), u = s("FmTabs");
19
+ return t(), v(b, null, [
20
+ r(i, {
21
+ title: o(n)("connect.transaction.title")
22
+ }, null, 8, ["title"]),
23
+ k("div", T, [
24
+ r(u, {
25
+ "model-value": o(e).value,
26
+ items: a,
27
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => e.value = a.find((_) => _.value === p))
28
+ }, null, 8, ["model-value"]),
29
+ (t(), l(x, null, [
30
+ o(e).value == "collection" ? (t(), l(m(g), { key: 0 })) : o(e).value == "store" ? (t(), l(m(y), { key: 1 })) : F("", !0)
31
+ ], 1024))
32
+ ])
33
+ ], 64);
34
+ };
35
+ }
36
+ });
37
+ export {
38
+ P as default
39
+ };
@@ -0,0 +1,130 @@
1
+ import { defineComponent as y, computed as b, openBlock as i, createBlock as R, unref as l, ref as E, watch as k, resolveComponent as h, createElementBlock as g, createElementVNode as B, Fragment as O, renderList as T, createVNode as V, isRef as U, createCommentVNode as v } from "vue";
2
+ import "./index-CSVhIZSY.js";
3
+ import { i as C, R as e } from "./rule-builder-gC9LH2AC.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js";
5
+ import { p as N } from "./plugins-ur-FAoye.js";
6
+ import { u as S } from "./membership-BWaK-9FY.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
+ import { u as x } from "./vue-i18n-BYz7XAr_.js";
9
+ const A = /* @__PURE__ */ y({
10
+ __name: "SegmentConfigurator",
11
+ props: {
12
+ modelValue: {
13
+ type: Object,
14
+ required: !0
15
+ }
16
+ },
17
+ emits: ["update:model-value"],
18
+ setup(n, { emit: f }) {
19
+ const o = n, m = b(() => {
20
+ var s;
21
+ const [u] = C(o.modelValue) ? Object.values(((s = o.modelValue) == null ? void 0 : s.rules) ?? {}) : [null];
22
+ return (u ?? e.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
23
+ }), r = f;
24
+ return (u, c) => (i(), R(j, {
25
+ multiselect: !0,
26
+ items: l(S)().segmentOptions,
27
+ "model-value": l(m),
28
+ "onUpdate:modelValue": c[0] || (c[0] = (s) => r(
29
+ "update:model-value",
30
+ l(e).setRuleToGroup(
31
+ l(e).scaffoldGroup("g_segment"),
32
+ l(e).constructEntry("user.segment", "_hasAny", s)
33
+ )
34
+ )),
35
+ label: "Select segment(s) to match"
36
+ }, null, 8, ["items", "model-value"]));
37
+ }
38
+ }), F = { class: "space-y-16" }, M = { key: 0 }, z = /* @__PURE__ */ y({
39
+ __name: "UserRuleGroup",
40
+ props: {
41
+ modelValue: {
42
+ type: Object,
43
+ default: () => {
44
+ }
45
+ }
46
+ },
47
+ emits: ["update:model-value"],
48
+ setup(n, { emit: f }) {
49
+ const { t: o } = x(), m = n, r = f, u = E(
50
+ m.modelValue ? e.getRules(m.modelValue.rules.g_user).length > 0 ? "custom" : e.getRules(m.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
51
+ ), c = [
52
+ {
53
+ value: "all_users",
54
+ label: o("connect.template.rule.audience.all")
55
+ },
56
+ {
57
+ value: "segment",
58
+ label: o("connect.template.rule.audience.member_segment")
59
+ },
60
+ {
61
+ value: "custom",
62
+ label: o("connect.template.rule.audience.custom_audience")
63
+ }
64
+ ];
65
+ return k(u, async (s, t) => {
66
+ var p;
67
+ if (t != "all_users" && t != s && e.getRules(
68
+ (p = m.modelValue) == null ? void 0 : p.rules[t == "custom" ? "g_user" : "g_segment"]
69
+ ).length > 0) {
70
+ const d = await N.confirm(
71
+ o("connect.template.rule.audience.confirm_remove"),
72
+ o("connect.common.confirm"),
73
+ o("connect.common.confirm"),
74
+ o("connect.common.cancel")
75
+ );
76
+ d && r(
77
+ "update:model-value",
78
+ e.setRuleToGroup(
79
+ m.modelValue ?? e.scaffoldGroup(),
80
+ e.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
81
+ )
82
+ ), u.value = d ? s : t;
83
+ }
84
+ }), (s, t) => {
85
+ var d, _;
86
+ const p = h("FmRadio");
87
+ return i(), g("div", F, [
88
+ B("div", null, [
89
+ (i(), g(O, null, T(c, (a) => V(p, {
90
+ key: a.value,
91
+ value: a.value,
92
+ label: a.label,
93
+ modelValue: l(u),
94
+ "onUpdate:modelValue": t[0] || (t[0] = (G) => U(u) ? u.value = G : null)
95
+ }, null, 8, ["value", "label", "modelValue"])), 64))
96
+ ]),
97
+ l(u) == "segment" ? (i(), g("div", M, [
98
+ V(A, {
99
+ modelValue: ((d = n.modelValue) == null ? void 0 : d.rules.g_segment) ?? l(e).scaffoldGroup("g_segment"),
100
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => r(
101
+ "update:model-value",
102
+ l(e).setRuleToGroup(
103
+ n.modelValue ?? l(e).scaffoldGroup(),
104
+ a,
105
+ "&&"
106
+ )
107
+ ))
108
+ }, null, 8, ["modelValue"])
109
+ ])) : v("", !0),
110
+ l(u) == "custom" ? (i(), R(I, {
111
+ key: 1,
112
+ "include-only": "user",
113
+ "trigger-type": "MEMBERSHIP_JOINED",
114
+ "model-value": ((_ = n.modelValue) == null ? void 0 : _.rules.g_user) ?? l(e).scaffoldGroup("g_user"),
115
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => r(
116
+ "update:model-value",
117
+ l(e).setRuleToGroup(
118
+ n.modelValue ?? l(e).scaffoldGroup(),
119
+ a,
120
+ "&&"
121
+ )
122
+ ))
123
+ }, null, 8, ["model-value"])) : v("", !0)
124
+ ]);
125
+ };
126
+ }
127
+ });
128
+ export {
129
+ z as _
130
+ };
@@ -0,0 +1,444 @@
1
+ import { defineComponent as ne, ref as T, computed as ae, h as m, onMounted as re, resolveComponent as f, openBlock as d, createElementBlock as P, Fragment as R, createVNode as s, unref as t, createElementVNode as i, withCtx as I, renderList as ie, createBlock as g, resolveDynamicComponent as ce, createCommentVNode as L, toDisplayString as _ } from "vue";
2
+ import { _ as se } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as le, components as p } from "@feedmepos/ui-library";
4
+ import { _ as N } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
+ import { c as me, p as ue } from "./plugins-ur-FAoye.js";
6
+ import { useCoreStore as de } from "@feedmepos/mf-common";
7
+ import { u as pe } from "./loading-NY-FPxVY.js";
8
+ import { u as fe } from "./business-CE_4siXc.js";
9
+ import { u as ye } from "./campaign-CXQtKpeb.js";
10
+ import { a as he, b as D, c as K } from "./campaign-BP6rvSpg.js";
11
+ import { c as ge, p as _e } from "./duplicateCampaign-DbtVAGsT.js";
12
+ import "./index-Dx9h0FNH.js";
13
+ import { u as ve } from "./template-CUV3AMFI.js";
14
+ import { _ as Ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js";
15
+ import { _ as we } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js";
16
+ import { u as be } from "./vue-i18n-BYz7XAr_.js";
17
+ import { T as ke } from "./trigger-CbjiuoSo.js";
18
+ import { useRouter as xe } from "vue-router";
19
+ import { c as v } from "./index-D06n1h1b.js";
20
+ import { R as A } from "./app-CE5hQ4Uq.js";
21
+ var Fe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
22
+ const Ve = { class: "px-24 flex flex-col gap-y-16" }, Se = { class: "flex items-center justify-between w-full" }, Ue = { class: "flex gap-8 overflow-x-auto" }, Te = { class: "space-y-8" }, Pe = { class: "flex w-full gap-4 items-center" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = { class: "space-y-4" }, Le = { class: "fm-typo-en-body-lg-600" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Be = { class: "flex flex-col gap-16 text-center" }, Oe = { class: "fm-typo-en-title-sm-800" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, io = /* @__PURE__ */ ne({
23
+ __name: "Voucher",
24
+ setup(He) {
25
+ const { t: a } = be(), j = {
26
+ label: a("connect.voucher.createCampaign"),
27
+ value: "create",
28
+ isPrimary: !0,
29
+ prependIcon: "add"
30
+ }, E = le(), q = ve("VOUCHER", E), G = fe(), y = ye(), { global: X, minor: B } = pe, k = xe(), l = T({
31
+ searchKey: "",
32
+ location: [],
33
+ triggerType: []
34
+ }), C = ae(
35
+ () => y.campaigns.voucher.filter(
36
+ (e) => z(e) && Q(e)
37
+ )
38
+ ), W = ke.VOUCHER.map((e) => ({
39
+ label: e.name,
40
+ value: e.value
41
+ }));
42
+ function z(e) {
43
+ const o = l.value.location;
44
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
45
+ (r) => {
46
+ var c;
47
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(r);
48
+ }
49
+ ) : e.targetLocation.includes(o);
50
+ }
51
+ function x(e) {
52
+ return e.hideInApp === !1;
53
+ }
54
+ function F(e) {
55
+ return e.event.type === "SIMPLE_CLAIM" && !x(e);
56
+ }
57
+ function Q(e) {
58
+ const o = l.value.triggerType;
59
+ if (!o || o.length === 0) return !0;
60
+ const r = e.event.type;
61
+ return o.includes(r);
62
+ }
63
+ const Y = [
64
+ {
65
+ header: a("connect.voucher.voucherTitle"),
66
+ accessorFn: (e) => e.name,
67
+ cell(e) {
68
+ const o = [e.row.original.name];
69
+ return x(e.row.original) && o.push(
70
+ m(p.FmChip, {
71
+ label: "Feedvibe",
72
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
73
+ compact: !0
74
+ })
75
+ ), m("div", { class: "flex items-center gap-4" }, o);
76
+ }
77
+ },
78
+ {
79
+ header: a("connect.voucher.status"),
80
+ accessorFn: (e) => he(e),
81
+ cell(e) {
82
+ return D(e.row.original);
83
+ }
84
+ },
85
+ {
86
+ header: a("connect.voucher.summary"),
87
+ accessorFn: (e) => K(e)
88
+ },
89
+ {
90
+ header: a("connect.voucher.quota"),
91
+ accessorFn: (e) => {
92
+ var o;
93
+ return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
94
+ }
95
+ },
96
+ {
97
+ header: a("connect.voucher.claimed"),
98
+ accessorFn: (e) => {
99
+ var o;
100
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
101
+ }
102
+ },
103
+ {
104
+ header: a("connect.voucher.actions"),
105
+ cell(e) {
106
+ return m("div", { class: "flex items-center justify-end" }, [
107
+ m(p.FmButton, {
108
+ icon: "insights",
109
+ variant: "tertiary",
110
+ iconColor: "neutral-gray-400",
111
+ onClick: async (o) => {
112
+ o.stopPropagation(), await M(e.row.original);
113
+ }
114
+ }),
115
+ m(p.FmButton, {
116
+ icon: "visibility",
117
+ variant: "tertiary",
118
+ iconColor: "neutral-gray-400",
119
+ onClick: async (o) => {
120
+ o.stopPropagation(), await k.push({
121
+ name: A["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
122
+ params: { id: e.row.original._id }
123
+ });
124
+ }
125
+ }),
126
+ m(
127
+ p.FmMenu,
128
+ {
129
+ placement: "bottom-end",
130
+ onClick: (o) => {
131
+ o.stopPropagation();
132
+ }
133
+ },
134
+ {
135
+ "menu-button": () => m(p.FmButton, {
136
+ icon: "more_vert",
137
+ iconColor: "neutral-gray-400",
138
+ variant: "tertiary"
139
+ }),
140
+ default: () => {
141
+ const o = [
142
+ m(p.FmMenuItem, {
143
+ label: a("connect.voucher.duplicate"),
144
+ onClick: async (r) => {
145
+ r.stopPropagation(), await H(e.row.original);
146
+ }
147
+ }),
148
+ m(
149
+ p.FmMenuItem,
150
+ {
151
+ onClick: async (r) => {
152
+ r.stopPropagation(), O(e.row.original);
153
+ }
154
+ },
155
+ {
156
+ label: m(
157
+ "div",
158
+ {
159
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
160
+ },
161
+ a("connect.voucher.remove")
162
+ )
163
+ }
164
+ )
165
+ ];
166
+ return F(e.row.original) && (o.unshift(
167
+ m(p.FmMenuItem, {
168
+ label: a("connect.voucher.send"),
169
+ onClick: async (r) => {
170
+ var c;
171
+ r.stopPropagation(), (c = S.value) == null || c.showSheet({
172
+ campaignId: e.row.original._id
173
+ });
174
+ }
175
+ })
176
+ ), o.unshift(
177
+ m(p.FmMenuItem, {
178
+ label: a("connect.voucher.share"),
179
+ onClick: async (r) => {
180
+ r.stopPropagation(), await me(
181
+ `https://${de().currentBusiness.value._id}.${Fe.appUrl}/vouchers/${e.row.original._id}`,
182
+ {
183
+ successMessage: "Voucher link copied to clipboard"
184
+ }
185
+ );
186
+ }
187
+ })
188
+ )), o;
189
+ }
190
+ }
191
+ )
192
+ ]);
193
+ }
194
+ }
195
+ ], V = T(), S = T();
196
+ async function O(e) {
197
+ await ue.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await B(
198
+ async () => {
199
+ await v.delete(e._id), await y.read("VOUCHER");
200
+ },
201
+ {
202
+ message: a("connect.voucher.removing", { name: e.name }),
203
+ successMessage: a("connect.voucher.removedSuccessfully", {
204
+ name: e.name
205
+ })
206
+ }
207
+ );
208
+ }
209
+ async function w(e) {
210
+ e ? await o(await v.readById(e._id)) : q.open(async (r) => {
211
+ await o(void 0, r);
212
+ });
213
+ async function o(r, c) {
214
+ var b;
215
+ (b = V.value) == null || b.showSheet(!0, "VOUCHER", r, c);
216
+ }
217
+ }
218
+ async function M(e) {
219
+ await k.push({
220
+ name: A["$connect-CAMPAIGN_VOUCHER_ANALYTIC"],
221
+ params: { id: e._id }
222
+ });
223
+ }
224
+ async function H(e) {
225
+ var c;
226
+ if (!await ge(e.name))
227
+ return;
228
+ const o = await v.readById(e._id), r = _e(o);
229
+ (c = V.value) == null || c.showSheet(
230
+ !0,
231
+ "VOUCHER",
232
+ r,
233
+ o.template
234
+ );
235
+ }
236
+ async function Z(e) {
237
+ e.campaign._id && await new Promise((o) => {
238
+ E.open({
239
+ title: "Confirmation",
240
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
241
+ primaryActions: { text: "Update all", close: !0 },
242
+ secondaryActions: { text: "Update future only", close: !0 }
243
+ }).onPrimary(async () => {
244
+ var r;
245
+ e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
246
+ }).onSecondary(async () => {
247
+ o();
248
+ });
249
+ }), await B(
250
+ async () => {
251
+ e.campaign._id ? await v.update(e.campaign._id, e) : await v.create(e), await y.read("VOUCHER");
252
+ },
253
+ {
254
+ message: a(
255
+ e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
256
+ ),
257
+ successMessage: a(
258
+ e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
259
+ )
260
+ }
261
+ );
262
+ }
263
+ return re(async () => {
264
+ await X(async () => {
265
+ await y.read("VOUCHER");
266
+ });
267
+ }), (e, o) => {
268
+ const r = f("FmPageHead"), c = f("FmSearch"), b = f("FmTable"), J = f("FmChip"), h = f("FmButton"), ee = f("FmListItem"), oe = f("FmList"), te = f("FmCard");
269
+ return d(), P(R, null, [
270
+ s(r, {
271
+ title: t(a)("connect.voucher.title"),
272
+ actions: t(C).length > 0 ? [j] : [],
273
+ "onClick:action": o[0] || (o[0] = () => w())
274
+ }, null, 8, ["title", "actions"]),
275
+ i("div", Ve, [
276
+ s(c, {
277
+ modelValue: t(l).searchKey,
278
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(l).searchKey = n),
279
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
280
+ placeholder: t(a)("connect.voucher.search"),
281
+ collapsible: ""
282
+ }, null, 8, ["modelValue", "placeholder"]),
283
+ t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (d(), P(R, { key: 0 }, [
284
+ i("div", Se, [
285
+ i("div", Ue, [
286
+ s(N, {
287
+ label: `${t(a)("connect.common.location")}: `,
288
+ "right-icon": "keyboard_arrow_down",
289
+ modelValue: t(l).location,
290
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(l).location = n),
291
+ icon: "storefront",
292
+ "show-item-label": !0,
293
+ items: t(G).locationOptions
294
+ }, null, 8, ["label", "modelValue", "items"]),
295
+ s(N, {
296
+ label: "Type:",
297
+ "right-icon": "keyboard_arrow_down",
298
+ modelValue: t(l).triggerType,
299
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(l).triggerType = n),
300
+ icon: "filter_list",
301
+ "show-item-label": !0,
302
+ items: t(W)
303
+ }, null, 8, ["modelValue", "items"])
304
+ ]),
305
+ s(c, {
306
+ modelValue: t(l).searchKey,
307
+ "onUpdate:modelValue": o[4] || (o[4] = (n) => t(l).searchKey = n),
308
+ class: "xs:hidden sm:hidden",
309
+ placeholder: t(a)("connect.voucher.search"),
310
+ collapsible: ""
311
+ }, null, 8, ["modelValue", "placeholder"])
312
+ ]),
313
+ s(b, {
314
+ class: "xs:hidden sm:hidden",
315
+ "row-data": t(C),
316
+ "column-defs": Y,
317
+ "search-value": t(l).searchKey,
318
+ "column-filter": [],
319
+ onRowClick: o[5] || (o[5] = (n) => w(n.original)),
320
+ "hide-footer": t(C).length < 10
321
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
322
+ s(oe, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
323
+ default: I(() => [
324
+ (d(!0), P(R, null, ie(t(C).filter(
325
+ (n) => n.name.toLowerCase().includes(t(l).searchKey.toLowerCase())
326
+ ), (n) => (d(), g(ee, {
327
+ key: n._id.toString(),
328
+ onClick: (U) => w(n),
329
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
330
+ }, {
331
+ default: I(() => {
332
+ var U;
333
+ return [
334
+ i("div", Te, [
335
+ i("div", Pe, [
336
+ (d(), g(ce(t(D)(n)))),
337
+ x(n) ? (d(), g(J, {
338
+ key: 0,
339
+ label: "Feedvibe",
340
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
341
+ compact: ""
342
+ })) : L("", !0),
343
+ i("div", Re, _(((U = n.pf_collectible) == null ? void 0 : U.currentReceive) ?? 0) + " claimed ", 1)
344
+ ]),
345
+ i("div", Ie, [
346
+ i("div", Le, _(n.name), 1),
347
+ i("div", Ae, _(t(K)(n)), 1)
348
+ ])
349
+ ]),
350
+ i("div", Ee, [
351
+ s(h, {
352
+ icon: "insights",
353
+ "icon-color": "neutral-gray-400",
354
+ variant: "tertiary",
355
+ onClick: async (u) => {
356
+ u.stopPropagation(), await M(n);
357
+ }
358
+ }, null, 8, ["onClick"]),
359
+ s(h, {
360
+ icon: "content_copy",
361
+ "icon-color": "neutral-gray-400",
362
+ variant: "tertiary",
363
+ onClick: async (u) => {
364
+ u.stopPropagation(), await H(n);
365
+ }
366
+ }, null, 8, ["onClick"]),
367
+ F(n) ? (d(), g(h, {
368
+ key: 0,
369
+ icon: "visibility",
370
+ "icon-color": "neutral-gray-400",
371
+ variant: "tertiary",
372
+ onClick: async (u) => {
373
+ u.stopPropagation(), await t(k).push({
374
+ name: t(A)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
375
+ params: { id: n._id }
376
+ });
377
+ }
378
+ }, null, 8, ["onClick"])) : L("", !0),
379
+ F(n) ? (d(), g(h, {
380
+ key: 1,
381
+ icon: "send",
382
+ "icon-color": "neutral-gray-400",
383
+ variant: "tertiary",
384
+ onClick: (u) => {
385
+ var $;
386
+ u.stopPropagation(), ($ = t(S)) == null || $.showSheet({
387
+ campaignId: n._id
388
+ });
389
+ }
390
+ }, null, 8, ["onClick"])) : L("", !0),
391
+ s(h, {
392
+ icon: "delete",
393
+ "icon-color": "neutral-gray-400",
394
+ variant: "tertiary",
395
+ onClick: (u) => (u.stopPropagation(), O(n))
396
+ }, null, 8, ["onClick"])
397
+ ])
398
+ ];
399
+ }),
400
+ _: 2
401
+ }, 1032, ["onClick"]))), 128))
402
+ ]),
403
+ _: 1
404
+ })
405
+ ], 64)) : (d(), g(te, {
406
+ key: 1,
407
+ variant: "outlined",
408
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
409
+ }, {
410
+ default: I(() => [
411
+ o[7] || (o[7] = i("img", {
412
+ src: se,
413
+ class: "aspect-square w-[150px]"
414
+ }, null, -1)),
415
+ i("div", Be, [
416
+ i("div", Oe, _(t(a)("connect.voucher.createVoucherCampaign")), 1),
417
+ i("div", Me, _(t(a)("connect.voucher.description")), 1)
418
+ ]),
419
+ s(h, {
420
+ variant: "primary",
421
+ label: t(a)("connect.voucher.createVoucherCampaign"),
422
+ icon: "add",
423
+ onClick: o[6] || (o[6] = (n) => w())
424
+ }, null, 8, ["label"])
425
+ ]),
426
+ _: 1
427
+ })),
428
+ s(Ce, {
429
+ ref_key: "sheetRef",
430
+ ref: V,
431
+ "onSubmit:modelValue": Z
432
+ }, null, 512),
433
+ s(we, {
434
+ ref_key: "sendVoucherSheetRef",
435
+ ref: S
436
+ }, null, 512)
437
+ ])
438
+ ], 64);
439
+ };
440
+ }
441
+ });
442
+ export {
443
+ io as default
444
+ };