@feedmepos/mf-connect 0.1.115-dev → 0.1.115-prod

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 (154) hide show
  1. package/README.md +1 -66
  2. package/dist/{App-43mZfFAr.js → App-CvtSY8ZO.js} +618 -652
  3. package/dist/{Bin-CA7v180Y.js → Bin-B3gS9QVZ.js} +8 -8
  4. package/dist/{Broadcast-qmdifF2Y.js → Broadcast-DAeb-HaN.js} +21 -22
  5. package/dist/{CampaignAnalytic-xnrDxqaH.js → CampaignAnalytic-BfTaHVem.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zsei4OfG.js} +9 -9
  7. package/dist/{Card-D8icsk7L.js → Card-JFeVIwFs.js} +24 -25
  8. package/dist/{Collections--THcD-E_.js → Collections-xcDpEhIm.js} +185 -197
  9. package/dist/{Credit-JrbtVMBp.js → Credit-C9HJZjDS.js} +20 -21
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DSqVY91w.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D_jXVE2I.js +3494 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js → EffectSheet.vue_vue_type_style_index_0_lang-C3J0rCTt.js} +32 -32
  13. package/dist/{Experience-CFeRqBoj.js → Experience-DszS8gto.js} +31 -32
  14. package/dist/{FileSaver.min-CCXIBm58.js → FileSaver.min-CFVQKaC-.js} +1 -1
  15. package/dist/{Game-CPxq6Ex3.js → Game-DhgeN7E2.js} +18 -19
  16. package/dist/{GiftCardSetup-D0esVZDp.js → GiftCardSetup-CWm6IhrS.js} +75 -75
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BuKADvmK.js} +7 -7
  18. package/dist/{Goals-DaKI6uXt.js → Goals-DtRVierH.js} +4 -4
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js → ImageInput.vue_vue_type_script_setup_true_lang-DlEFyu6h.js} +1 -1
  20. package/dist/{Index-2kENoaZm.js → Index-DFRcu_qE.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js → LocationPicker.vue_vue_type_script_setup_true_lang-B3Br4Xvi.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CjNJj3qj.js} +1 -1
  23. package/dist/{LoyaltyDashboard-CB93Fz8u.js → LoyaltyDashboard-BWHKDPzk.js} +15 -15
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js → MainLayout-BmpNNAiE.js} +4 -5
  25. package/dist/Marketing-BKK45Eve.js +236 -0
  26. package/dist/{remy-icon-BhUGu2NI.js → MarketingMaterialEdit-x3c_N7Gs.js} +1031 -2
  27. package/dist/{Member-B--nYyr0.js → Member-xEzrBW_p.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DRoC-I0t.js} +50 -43
  29. package/dist/{MemberImportHistory-D52Y4RTC.js → MemberImportHistory-CEQpBBF8.js} +7 -7
  30. package/dist/{MemberList-13Owa1fj.js → MemberList-CCvzkHv8.js} +105 -103
  31. package/dist/{MemberTransactions-CpXEWNbq.js → MemberTransactions-Bmh39J2W.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js → MessageInput.vue_vue_type_script_setup_true_lang-D3Pmk80l.js} +14 -14
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DIBKAwHP.js} +1 -1
  34. package/dist/{Mission-Ci-UzXSu.js → Mission-CpUo2Bgw.js} +21 -22
  35. package/dist/{Overview-CKxSfAGF.js → Overview-CwQqQ1Tn.js} +144 -145
  36. package/dist/{Overview-CXen9Ram.js → Overview-DcDZmDXA.js} +22 -23
  37. package/dist/{Point-CR3YOaag.js → Point-CUNQsQIx.js} +21 -22
  38. package/dist/{Promotion-tw3J4ul-.js → Promotion-Cqdim7aW.js} +131 -137
  39. package/dist/{Queue-BZGA5ZXt.js → Queue-CNBVh1UG.js} +45 -46
  40. package/dist/{Record-BTevVXnT.js → Record-BYwz4l4o.js} +9 -9
  41. package/dist/{Review-BU7c8ZF0.js → Review-CqLcZFj8.js} +2 -2
  42. package/dist/ReviewFacebookCallback-DbSCILNN.js +238 -0
  43. package/dist/{ReviewGoogleCallback-xpdPHSdg.js → ReviewGoogleCallback-Dg8R7QlO.js} +5 -5
  44. package/dist/{Reward-jlA_7cxz.js → Reward-M8GZ8eHq.js} +29 -29
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js → RewardGroup.vue_vue_type_script_setup_true_lang-BkM9-Sx-.js} +15 -16
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CnaL93TF.js +1883 -0
  47. package/dist/{Segment-C1Bwm--Q.js → Segment-CrMi6xrp.js} +305 -304
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DKH5_9db.js} +30 -31
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyeAQ-hg.js} +4 -4
  50. package/dist/Setting-BnFRI0Se.js +2037 -0
  51. package/dist/{SettingAdvertisements-4XEAJzlL.js → SettingAdvertisements-Dh7v4c1D.js} +12 -12
  52. package/dist/Settings-BvT8_tkQ.js +179 -0
  53. package/dist/{Store-C56dXtc4.js → Store-CV-BmK5b.js} +30 -31
  54. package/dist/{StoreRewards-DQ1Q6WS6.js → StoreRewards-DPhSLvSZ.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDu1QySl.js +1264 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Dqz6jTlH.js +142 -0
  57. package/dist/{Tier-D4CPZqw7.js → Tier-ChvYps23.js} +687 -2576
  58. package/dist/{Title-DCbwhUic.js → Title-v-Ivswr1.js} +92 -94
  59. package/dist/{Transaction-C5LrasXr.js → Transaction-CRqE1Ix0.js} +2 -2
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B0Uh9iuj.js} +26 -26
  61. package/dist/{Voucher-rrVbNZKR.js → Voucher-Bg8FOuzD.js} +19 -19
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js → VoucherEditor.vue_vue_type_script_setup_true_lang-HKxivQMF.js} +16 -16
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js → ZodTextField.vue_vue_type_script_setup_true_lang-8d290Dcp.js} +2 -2
  64. package/dist/{app-CgimGODl.js → app-DdNKsn2Q.js} +7107 -8874
  65. package/dist/app.js +3 -4
  66. package/dist/{base.export-D2P6HFvo.js → base.export-R97FrSQL.js} +2 -2
  67. package/dist/{business-Bu5TqSA0.js → business-Ce8vq3wQ.js} +1 -1
  68. package/dist/{campaign-zJxttSIk.js → campaign-BTllt2LH.js} +25 -31
  69. package/dist/{campaign-BFIXSgdJ.js → campaign-C19If7bW.js} +94 -121
  70. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-9CCbalR4.js} +2 -3
  71. package/dist/{campaign.fn-gvjlcEfe.js → campaign.fn-B4g03h0A.js} +78 -78
  72. package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-MvqF7mSg.js} +1 -1
  73. package/dist/{collection.fn-DOm0HsSh.js → collection.fn-CR0bD33S.js} +2 -2
  74. package/dist/{currency-BpbQvbm8.js → currency-DmlguGIM.js} +1 -1
  75. package/dist/{effect-D-GtNB3n.js → effect-Dx3zfl28.js} +1 -1
  76. package/dist/{email-addresses-BKMoAtMi.js → email-addresses-De5PGOY4.js} +2 -2
  77. package/dist/{feature-flag-BJ_eyKsq.js → feature-flag-CD9V1V0h.js} +74 -74
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-CkfjBgMM.js → helper-CEiv7SaO.js} +1 -1
  80. package/dist/{index-zTvr2GR4.js → index-649OZ_e1.js} +2 -2
  81. package/dist/{index-feCrYhi6.js → index-B8meeQoD.js} +1 -1
  82. package/dist/{index-CIej31pF.js → index-B8yWVB8P.js} +3 -4
  83. package/dist/{index-BKsxIwbi.js → index-BAXKd9Gg.js} +198 -198
  84. package/dist/{index-BAtUrtqM.js → index-BDPnyro2.js} +6 -19
  85. package/dist/{index-DUAZOMVJ.js → index-BR9h5DTI.js} +1 -1
  86. package/dist/{index-DwU3fsLW.js → index-BVdYxi3l.js} +15 -29
  87. package/dist/{index-D0JK99Ko.js → index-BW6eb3n6.js} +252 -611
  88. package/dist/{index-LygS9WsG.js → index-BYI9ttxy.js} +10767 -8028
  89. package/dist/{index-BdEXUNoG.js → index-BquSqx6K.js} +4 -4
  90. package/dist/{index-BpTIulTX.js → index-CBJy9bxB.js} +1 -1
  91. package/dist/{index-B6kU3PkV.js → index-CPODug8b.js} +2613 -2700
  92. package/dist/{index-CfQuYqXn.js → index-CWUrODxL.js} +1 -1
  93. package/dist/{index-DKxN1mMS.js → index-CqOCJTeR.js} +232 -390
  94. package/dist/{index-CuREApMc.js → index-D4d3l0gw.js} +7 -8
  95. package/dist/{index-Bhl5IRXy.js → index-DT3S00_Y.js} +10 -11
  96. package/dist/{index-DqGs6RJG.js → index-IZRfmmde.js} +581 -683
  97. package/dist/{index-CQ8XFbBk.js → index-__UT3_Ey.js} +2 -2
  98. package/dist/{index-CCEXSPxk.js → index-xct3mnu8.js} +7 -7
  99. package/dist/{index.esm2017-DZi9IQPS.js → index.esm2017-AVbZ9btd.js} +177 -177
  100. package/dist/{loading-Brid2wnu.js → loading-BvHm1m3K.js} +1 -1
  101. package/dist/{lodash-C1epw3Kv.js → lodash-Dvrceo7x.js} +1 -1
  102. package/dist/{member-import-DAIxTIiu.js → member-import-c9avpiSS.js} +5 -6
  103. package/dist/{membership-BZmljFhF.js → membership-D-pZS634.js} +3 -3
  104. package/dist/{money-cLcyGcSZ.js → money-D4skwMkD.js} +1 -1
  105. package/dist/{number-C2jPLJr2.js → number-DJ6ncfT6.js} +1 -1
  106. package/dist/objectid-DEMM_jdR.js +145 -0
  107. package/dist/{onboarding-oRfy_g05.js → onboarding-t7R1d3h-.js} +25 -25
  108. package/dist/{onboardingSetup-BLD6m8HY.js → onboardingSetup-lTaJc0oT.js} +2 -2
  109. package/dist/{plugins-CUsr9vB0.js → plugins-DQNOWwRC.js} +3 -3
  110. package/dist/{reward-UOT03odb.js → reward-BK150pjm.js} +1 -1
  111. package/dist/{rule-BgJnPjkI.js → rule-COcdAnUu.js} +492 -572
  112. package/dist/rule-builder-Deufb6h_.js +102 -0
  113. package/dist/style.css +1 -1
  114. package/dist/template-DeebIqJ_.js +236 -0
  115. package/dist/{timezone-BXA4wq7Y.js → timezone-BP6UC4KL.js} +1 -1
  116. package/dist/{transaction.fn-CQ4fpRt3.js → transaction.fn-BY0hzon0.js} +2 -2
  117. package/dist/{trigger-DXJCGT0q.js → trigger-DVBjVPbN.js} +8 -8
  118. package/dist/useMarketingMaterialActions-DpQCQHFI.js +96 -0
  119. package/dist/{usePagination-Pp4okWr8.js → usePagination-QT552XyF.js} +1 -1
  120. package/dist/{user-B3gXcAIy.js → user-CmAxNc7T.js} +1 -1
  121. package/dist/vue-i18n-Cze706-f.js +2365 -0
  122. package/dist/{xlsx-CCaDUTgW.js → xlsx-DAczoc8y.js} +224 -224
  123. package/dist/{zod-CPwjOxvW.js → zod-Aj-GuVQL.js} +1 -1
  124. package/package.json +2 -6
  125. package/dist/AuditLogs-BPpdm96t.js +0 -2016
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js +0 -4442
  127. package/dist/Grab-BWzdN_cd.js +0 -301
  128. package/dist/MainLayout-DwnjGXh6.js +0 -4
  129. package/dist/Marketing-DCco__2F.js +0 -273
  130. package/dist/MarketingMaterialEdit-BbgFtrYP.js +0 -1037
  131. package/dist/ReviewFacebookCallback-BnMF6Arh.js +0 -225
  132. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js +0 -1923
  133. package/dist/Setting-CDM4RhLW.js +0 -574
  134. package/dist/Settings-D-0tvZRr.js +0 -286
  135. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js +0 -1319
  136. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js +0 -7007
  137. package/dist/WhatsappAccount-oJDo5zTr.js +0 -159
  138. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js +0 -39
  139. package/dist/WhatsappBot-Cl64wG_F.js +0 -876
  140. package/dist/WhatsappBotLogs-D3uT4EiB.js +0 -372
  141. package/dist/WhatsappBotSettings-Cs1lLxh-.js +0 -705
  142. package/dist/WhatsappLayout-C639d2HP.js +0 -21
  143. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js +0 -253
  144. package/dist/browser-BSAOEeIM.js +0 -1478
  145. package/dist/duplicateCampaign-CvsvjRE9.js +0 -51
  146. package/dist/feature-flag-Bo-k5sIG.js +0 -50
  147. package/dist/google-BQK68wbe.js +0 -5
  148. package/dist/index-C-iwb2Ln.js +0 -109
  149. package/dist/index-C_H8jFYf.js +0 -2743
  150. package/dist/index-DQ8JJhxs.js +0 -74
  151. package/dist/objectid-C-wocWKI.js +0 -145
  152. package/dist/template-BZyFhr73.js +0 -188
  153. package/dist/useMarketingMaterialActions-B-Wib5ga.js +0 -125
  154. package/dist/vue-i18n-DWGiC_vs.js +0 -2365
@@ -1,301 +0,0 @@
1
- import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
- import { p as P } from "./plugins-CUsr9vB0.js";
5
- import { u as oe } from "./loading-Brid2wnu.js";
6
- import { u as ne } from "./business-Bu5TqSA0.js";
7
- import { u as ae } from "./campaign-zJxttSIk.js";
8
- import { u as re } from "./vue-i18n-DWGiC_vs.js";
9
- import { h as d } from "./moment-D7p2TMB-.js";
10
- import { a as se, b as V } from "./campaign-BFIXSgdJ.js";
11
- import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js";
12
- import { u as le } from "./template-BZyFhr73.js";
13
- import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
14
- import { c as C } from "./index-zTvr2GR4.js";
15
- const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
16
- __name: "Grab",
17
- setup(_e) {
18
- const { t: o } = re(), I = {
19
- label: o("connect.grab.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
24
- {
25
- label: "Bill promotion",
26
- value: "BILL"
27
- },
28
- {
29
- label: "Item promotion",
30
- value: "ITEM"
31
- }
32
- ], c = L({
33
- searchKey: "",
34
- location: [],
35
- effectType: []
36
- });
37
- function E(e) {
38
- const t = c.value.location;
39
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
40
- var s;
41
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
42
- }) : e.targetLocation.includes(t);
43
- }
44
- function j(e) {
45
- var s, r;
46
- const t = c.value.effectType;
47
- if (!t || t.length === 0) return !0;
48
- const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
49
- return t.includes(a);
50
- }
51
- const p = z(
52
- () => g.campaigns.grab.filter(
53
- (e) => E(e) && j(e)
54
- )
55
- ), G = [
56
- {
57
- header: o("connect.grab.promotionTitle"),
58
- accessorFn: (e) => e.name
59
- },
60
- {
61
- header: o("connect.grab.period"),
62
- accessorFn: (e) => {
63
- const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
64
- return `${t} - ${a}`;
65
- }
66
- },
67
- {
68
- header: o("connect.grab.status"),
69
- accessorFn: (e) => se(e),
70
- cell(e) {
71
- return V(e.row.original);
72
- }
73
- },
74
- {
75
- header: o("connect.grab.summary"),
76
- cell(e) {
77
- const t = ie(e.row.original.discount);
78
- return t ? `${t.type} - ${t.adjustment}` : "-";
79
- }
80
- },
81
- {
82
- header: o("connect.grab.actions"),
83
- cell(e) {
84
- return J(te.FmButton, {
85
- variant: "tertiary",
86
- icon: "delete",
87
- iconColor: "neutral-gray-400",
88
- onClick: (t) => {
89
- t.stopPropagation(), D(e.row.original);
90
- }
91
- });
92
- }
93
- }
94
- ], B = L();
95
- async function D(e) {
96
- await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
97
- async () => {
98
- await C.delete(e._id), await g.read("PROMOTION");
99
- },
100
- {
101
- message: o("connect.grab.removing", { name: e.name }),
102
- successMessage: o("connect.grab.removedSuccessfully", {
103
- name: e.name
104
- })
105
- }
106
- );
107
- }
108
- async function b(e) {
109
- e ? await t() : A.open(async (a) => {
110
- await t(a);
111
- });
112
- async function t(a) {
113
- var s;
114
- (s = B.value) == null || s.showSheet(
115
- !0,
116
- "GRAB",
117
- e ? await C.readById(e._id) : void 0,
118
- a
119
- );
120
- }
121
- }
122
- async function N(e) {
123
- var a;
124
- const t = await U(e.campaign);
125
- if (t.length > 0) {
126
- const s = t.map(
127
- (r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
128
- ).join(`
129
- `);
130
- return await ((a = P.dialog) == null ? void 0 : a.open({
131
- title: o("connect.grab.conflictDetected"),
132
- message: o("connect.grab.conflictMessage", {
133
- conflicts: s
134
- }),
135
- closeButton: !0,
136
- overlay: !0,
137
- primaryActions: {
138
- close: !0,
139
- text: "OK"
140
- }
141
- })), !1;
142
- }
143
- await T(
144
- async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
145
- {
146
- message: o(
147
- e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
148
- ),
149
- successMessage: o(
150
- e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
151
- )
152
- }
153
- );
154
- }
155
- async function U(e) {
156
- const t = g.campaigns.grab, a = [], s = !!e._id;
157
- for (const r of t) {
158
- if (s && r._id === e._id) continue;
159
- const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
160
- if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
161
- const n = e.discount, w = r.discount;
162
- n.scope.type === w.scope.type && a.push(r);
163
- }
164
- }
165
- return a;
166
- }
167
- async function H(e) {
168
- switch (e) {
169
- case "create":
170
- b();
171
- break;
172
- }
173
- }
174
- return Q(async () => {
175
- await R(async () => {
176
- await S.readLocations(), await g.read("PROMOTION");
177
- });
178
- }), (e, t) => {
179
- const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
180
- return f(), k(F, null, [
181
- l(s, {
182
- title: i(o)("connect.grab.title"),
183
- actions: i(p).length > 0 ? [I] : [],
184
- "onClick:action": H
185
- }, {
186
- prepend: x(() => [
187
- l(a, { variant: "beta" }),
188
- l(a, { variant: "premium" })
189
- ]),
190
- _: 1
191
- }, 8, ["title", "actions"]),
192
- m("div", me, [
193
- l(r, {
194
- modelValue: c.value.searchKey,
195
- "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
196
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
197
- placeholder: i(o)("connect.grab.search"),
198
- collapsible: ""
199
- }, null, 8, ["modelValue", "placeholder"]),
200
- i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
201
- m("div", ue, [
202
- m("div", de, [
203
- l($, {
204
- label: `${i(o)("connect.common.location")}: `,
205
- "right-icon": "keyboard_arrow_down",
206
- modelValue: c.value.location,
207
- "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
208
- icon: "storefront",
209
- "show-item-label": !0,
210
- items: i(S).locationOptions
211
- }, null, 8, ["label", "modelValue", "items"]),
212
- l($, {
213
- label: "Type:",
214
- "right-icon": "keyboard_arrow_down",
215
- modelValue: c.value.effectType,
216
- "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
217
- icon: "filter_list",
218
- "show-item-label": !0,
219
- items: K
220
- }, null, 8, ["modelValue"])
221
- ]),
222
- l(r, {
223
- modelValue: c.value.searchKey,
224
- "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
225
- class: "xs:hidden",
226
- placeholder: "search",
227
- collapsible: ""
228
- }, null, 8, ["modelValue"])
229
- ]),
230
- l(_, {
231
- class: "xs:hidden",
232
- "row-data": i(p),
233
- "column-defs": G,
234
- "search-value": c.value.searchKey,
235
- "column-filter": [],
236
- onRowClick: t[4] || (t[4] = (n) => b(n.original)),
237
- "hide-footer": i(p).length < 10
238
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
239
- l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
240
- default: x(() => [
241
- (f(!0), k(F, null, W(i(p).filter(
242
- (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
243
- ), (n) => (f(), O(h, {
244
- key: n._id.toString(),
245
- onClick: (w) => b(n),
246
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
247
- }, {
248
- default: x(() => [
249
- m("div", pe, [
250
- m("div", fe, [
251
- (f(), O(X(i(V)(n))))
252
- ])
253
- ]),
254
- l(y, {
255
- icon: "delete",
256
- "icon-color": "neutral-gray-400",
257
- variant: "tertiary",
258
- onClick: (w) => (w.stopPropagation(), D(n))
259
- }, null, 8, ["onClick"])
260
- ]),
261
- _: 2
262
- }, 1032, ["onClick"]))), 128))
263
- ]),
264
- _: 1
265
- })
266
- ], 64)) : (f(), O(M, {
267
- key: 1,
268
- variant: "outlined",
269
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
270
- }, {
271
- default: x(() => [
272
- t[6] || (t[6] = m("img", {
273
- src: Z,
274
- class: "aspect-square w-[150px]"
275
- }, null, -1)),
276
- m("div", ge, [
277
- m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
278
- m("div", be, Y(i(o)("connect.grab.description")), 1)
279
- ]),
280
- l(y, {
281
- variant: "primary",
282
- label: i(o)("connect.grab.createPromotionCampaign"),
283
- icon: "add",
284
- onClick: t[5] || (t[5] = (n) => b())
285
- }, null, 8, ["label"])
286
- ]),
287
- _: 1
288
- }))
289
- ]),
290
- l(ce, {
291
- ref_key: "sheetRef",
292
- ref: B,
293
- "onSubmit:modelValue": N
294
- }, null, 512)
295
- ], 64);
296
- };
297
- }
298
- });
299
- export {
300
- Pe as default
301
- };
@@ -1,4 +0,0 @@
1
- import { a as f } from "./MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js";
2
- export {
3
- f as default
4
- };
@@ -1,273 +0,0 @@
1
- import { defineComponent as M, resolveComponent as p, openBlock as d, createBlock as N, unref as c, ref as _, watch as L, createElementBlock as f, createVNode as l, withCtx as k, createElementVNode as r, toDisplayString as w, withModifiers as P, createStaticVNode as H, computed as V, onMounted as j, nextTick as z, onUnmounted as G, Fragment as $, renderList as B, createCommentVNode as q } from "vue";
2
- import { _ as K } from "./campaign-CpzFl8Vr.js";
3
- import { u as b } from "./vue-i18n-DWGiC_vs.js";
4
- import { u as Z, m as J } from "./useMarketingMaterialActions-B-Wib5ga.js";
5
- import { u as O } from "./remy-Qz_pNsUS.js";
6
- import { useRouter as Q } from "vue-router";
7
- import "./index-feCrYhi6.js";
8
- import { R as W } from "./app-CgimGODl.js";
9
- const X = /* @__PURE__ */ M({
10
- __name: "GenerateMaterialButton",
11
- setup(u) {
12
- const { t: m } = b(), i = O();
13
- function a() {
14
- i.activate({
15
- command: "generateMarketingMaterial",
16
- fullscreen: !0,
17
- forceNewConversation: !0
18
- });
19
- }
20
- return (e, n) => {
21
- const v = p("FmButton");
22
- return d(), N(v, {
23
- label: c(m)("connect.marketing.emptyState.action"),
24
- "prepend-icon": "wand_stars",
25
- onClick: a
26
- }, null, 8, ["label"]);
27
- };
28
- }
29
- }), Y = { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, ee = /* @__PURE__ */ M({
30
- __name: "MarketingMaterialItemActionButton",
31
- props: {
32
- material: {}
33
- },
34
- emits: ["update:menuOpened", "deleted"],
35
- setup(u, { emit: m }) {
36
- const i = u, a = m, { t: e } = b(), n = _(!1);
37
- L(n, (o) => {
38
- a("update:menuOpened", o);
39
- });
40
- const {
41
- shareMaterial: v,
42
- downloadMaterialImage: t,
43
- copyMaterialLink: s,
44
- deleteMaterial: C
45
- } = Z();
46
- async function F() {
47
- n.value = !1, await v(i.material);
48
- }
49
- async function x() {
50
- n.value = !1, await t(i.material.imageUrl);
51
- }
52
- async function I() {
53
- n.value = !1, await s(i.material.imageUrl);
54
- }
55
- async function A() {
56
- n.value = !1, await C(i.material) && a("deleted", i.material._id);
57
- }
58
- return (o, g) => {
59
- const S = p("FmButton"), y = p("FmMenuItem"), h = p("FmMenuDivider"), R = p("FmIcon"), T = p("FmMenu");
60
- return d(), f("div", null, [
61
- l(T, {
62
- placement: "right-start",
63
- shift: !0,
64
- "model-value": n.value,
65
- onMenuChanged: g[0] || (g[0] = (U) => n.value = U)
66
- }, {
67
- "menu-button": k(() => [
68
- l(S, {
69
- icon: "more_vert",
70
- variant: "tertiary",
71
- size: "md"
72
- })
73
- ]),
74
- default: k(() => [
75
- l(y, {
76
- icon: "share",
77
- label: c(e)("connect.marketing.actions.share"),
78
- onClick: F
79
- }, null, 8, ["label"]),
80
- l(y, {
81
- icon: "download",
82
- label: c(e)("connect.marketing.actions.download"),
83
- onClick: x
84
- }, null, 8, ["label"]),
85
- l(y, {
86
- icon: "content_copy",
87
- label: c(e)("connect.marketing.actions.copyLink"),
88
- onClick: I
89
- }, null, 8, ["label"]),
90
- l(h),
91
- l(y, { onClick: A }, {
92
- prepend: k(() => [
93
- l(R, {
94
- name: "delete",
95
- size: "md",
96
- color: "typo-error",
97
- outline: ""
98
- })
99
- ]),
100
- label: k(() => [
101
- r("div", Y, w(c(e)("connect.common.delete")), 1)
102
- ]),
103
- _: 1
104
- })
105
- ]),
106
- _: 1
107
- }, 8, ["model-value"])
108
- ]);
109
- };
110
- }
111
- }), te = { class: "h-[205.5px] w-full overflow-hidden bg-fm-color-neutral-gray-100" }, ne = ["src", "alt"], ae = { class: "p-3" }, oe = { class: "flex items-start justify-between gap-2" }, le = { class: "space-y-1 overflow-hidden" }, re = { class: "font-semibold text-sm text-gray-900 truncate" }, ie = { class: "text-xs text-gray-500 line-clamp-2" }, se = {
112
- key: 1,
113
- class: "rounded-lg overflow-hidden border border-transparent fm-shadow-light-100 animate-pulse bg-white"
114
- }, D = /* @__PURE__ */ M({
115
- __name: "MarketingMaterialItem",
116
- props: {
117
- material: {}
118
- },
119
- emits: ["deleted"],
120
- setup(u, { emit: m }) {
121
- const i = m, { t: a } = b(), e = Q(), n = _(!1);
122
- return (v, t) => u.material ? (d(), f("div", {
123
- key: 0,
124
- class: "group rounded-lg overflow-hidden cursor-pointer border border-transparent hover:border-blue-500 hover:bg-blue-50 transition-[border-color,background-color] fm-shadow-light-100 hover:fm-shadow-light-300",
125
- onClick: t[3] || (t[3] = () => {
126
- n.value || c(e).push({
127
- name: c(W)["$connect-MARKETING_MATERIAL_EDIT"],
128
- query: { id: u.material._id }
129
- });
130
- })
131
- }, [
132
- r("div", te, [
133
- r("img", {
134
- src: u.material.imageUrl,
135
- alt: c(a)("connect.marketing.title"),
136
- class: "w-full h-full object-cover"
137
- }, null, 8, ne)
138
- ]),
139
- r("div", ae, [
140
- r("div", oe, [
141
- r("div", le, [
142
- r("p", re, w(u.material.headline), 1),
143
- r("p", ie, w(u.material.caption), 1)
144
- ]),
145
- l(ee, {
146
- material: u.material,
147
- "onUpdate:menuOpened": t[0] || (t[0] = (s) => n.value = s),
148
- onDeleted: t[1] || (t[1] = (s) => i("deleted", s)),
149
- onClick: t[2] || (t[2] = P(() => {
150
- }, ["stop"]))
151
- }, null, 8, ["material"])
152
- ])
153
- ])
154
- ])) : (d(), f("div", se, [...t[4] || (t[4] = [
155
- H('<div class="h-[205.5px] w-full bg-fm-color-neutral-gray-100"></div><div class="p-3 space-y-2"><div class="h-[16px] w-3/4 rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-full rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-2/3 rounded bg-fm-color-neutral-gray-100"></div></div>', 2)
156
- ])]));
157
- }
158
- }), ce = {
159
- key: 0,
160
- class: "px-24 xs:px-12 flex flex-col gap-y-16 py-24 xs:py-16"
161
- }, ue = { class: "fm-typo-en-title-sm-800 text-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 xs:w-full text-center" }, de = {
162
- key: 1,
163
- class: "px-24 xs:px-12 flex flex-col gap-y-24 xs:gap-y-16 pt-24 xs:pt-16"
164
- }, pe = { class: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-16" }, E = 20, we = /* @__PURE__ */ M({
165
- __name: "Marketing",
166
- setup(u) {
167
- const { t: m } = b(), i = O(), a = _([]), e = _(!0), n = _(!0), v = _(null), t = _(null);
168
- let s = null;
169
- const C = V(() => ({
170
- label: m("connect.marketing.emptyState.action"),
171
- value: "generate",
172
- isPrimary: !0,
173
- prependIcon: "wand_stars"
174
- }));
175
- function F(o) {
176
- o === "generate" && i.activate({
177
- command: "generateMarketingMaterial",
178
- fullscreen: !0,
179
- forceNewConversation: !0
180
- });
181
- }
182
- async function x() {
183
- const o = await J.listMarketingMaterials(
184
- v.value,
185
- E
186
- );
187
- a.value.push(...o.resources), v.value = o.meta.nextCursor, n.value = !!o.meta.nextCursor;
188
- }
189
- async function I(o) {
190
- if (a.value = a.value.filter((g) => g._id !== o), !(a.value.length > 0 || !n.value || e.value)) {
191
- e.value = !0;
192
- try {
193
- await x();
194
- } catch {
195
- } finally {
196
- e.value = !1;
197
- }
198
- }
199
- }
200
- function A() {
201
- s = new IntersectionObserver(
202
- async ([o]) => {
203
- if (!(!o.isIntersecting || !n.value || e.value)) {
204
- e.value = !0;
205
- try {
206
- await x();
207
- } catch {
208
- } finally {
209
- e.value = !1;
210
- }
211
- }
212
- },
213
- { rootMargin: "200px" }
214
- ), t.value && s.observe(t.value);
215
- }
216
- return j(async () => {
217
- try {
218
- await x();
219
- } catch {
220
- } finally {
221
- e.value = !1, await z(), A();
222
- }
223
- }), G(() => {
224
- s == null || s.disconnect();
225
- }), (o, g) => {
226
- const S = p("FmPageHead"), y = p("FmCard");
227
- return d(), f($, null, [
228
- l(S, {
229
- title: c(m)("connect.marketing.title"),
230
- actions: a.value.length > 0 ? [C.value] : [],
231
- "onClick:action": F
232
- }, null, 8, ["title", "actions"]),
233
- !e.value && a.value.length === 0 ? (d(), f("div", ce, [
234
- l(y, {
235
- variant: "outlined",
236
- class: "w-full justify-center items-center flex flex-col p-[24px] xs:p-16 gap-[24px] xs:gap-16"
237
- }, {
238
- default: k(() => [
239
- g[0] || (g[0] = r("img", {
240
- src: K,
241
- class: "w-[150px]"
242
- }, null, -1)),
243
- r("p", ue, w(c(m)("connect.marketing.emptyState.title")), 1),
244
- r("p", me, w(c(m)("connect.marketing.emptyState.description")), 1),
245
- l(X)
246
- ]),
247
- _: 1
248
- })
249
- ])) : (d(), f("div", de, [
250
- r("div", pe, [
251
- (d(!0), f($, null, B(a.value, (h) => (d(), N(D, {
252
- key: h._id,
253
- material: h,
254
- onDeleted: I
255
- }, null, 8, ["material"]))), 128)),
256
- e.value ? (d(), f($, { key: 0 }, B(E, (h) => l(D, {
257
- key: `skeleton-${h}`,
258
- material: null
259
- })), 64)) : q("", !0)
260
- ]),
261
- r("div", {
262
- ref_key: "sentinel",
263
- ref: t,
264
- class: "h-1"
265
- }, null, 512)
266
- ]))
267
- ], 64);
268
- };
269
- }
270
- });
271
- export {
272
- we as default
273
- };