@feedmepos/mf-connect 0.1.0-beta.17 → 0.1.0-beta.19

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 (87) hide show
  1. package/dist/{Analytic-BvsvVIaJ.js → Analytic-C_VhRLv6.js} +8 -8
  2. package/dist/{App-B6i-kTvi.js → App-BfRWtnHD.js} +6 -6
  3. package/dist/{Broadcast-BMNY7jfz.js → Broadcast-CkP0D5Q0.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cl-VwkQw.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-NtvMAKVf.js} +8 -9
  5. package/dist/{Card-BUxMxMv3.js → Card-B3LUbgFG.js} +16 -16
  6. package/dist/{Collections-fJ4dAA8O.js → Collections-auS6nQgP.js} +4 -4
  7. package/dist/{Credit-DeLJMW7U.js → Credit-DFCzt7yb.js} +8 -8
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-KB_zk3f0.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BI0BX8t8.js} +27 -28
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dy2q_1Kh.js → EffectSheet.vue_vue_type_style_index_0_lang-BrjVcauR.js} +6 -6
  11. package/dist/{Experience-DNlf2fYa.js → Experience-CVb3L3Nz.js} +8 -8
  12. package/dist/{Game-BXj3DErV.js → Game-CVtfz6Hq.js} +8 -8
  13. package/dist/{Index-FMFz2f9Z.js → Index-DFcZ4uTO.js} +7 -7
  14. package/dist/{Marketing-C8OjZOr2.js → Marketing-DLF6iuTD.js} +5 -5
  15. package/dist/{Member-BgwbYQrK.js → Member-CYtrF8IE.js} +4 -4
  16. package/dist/{MemberList-DMQUG_Kt.js → MemberList-CrUHnX69.js} +14 -14
  17. package/dist/{MemberTransactions-CQO2cHn6.js → MemberTransactions-DJGj_aav.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ds_BwKa6.js → MessageInput.vue_vue_type_script_setup_true_lang-BEXdm4kC.js} +2 -2
  19. package/dist/{Mission-rHomcJXG.js → Mission-_LSdgxEz.js} +8 -8
  20. package/dist/Overview-CuIPJALM.js +879 -0
  21. package/dist/{Point-Du07BO13.js → Point-CVMEXAZ5.js} +23 -23
  22. package/dist/{Promotion-B1gbbfk2.js → Promotion-DSfbCLAe.js} +9 -9
  23. package/dist/{Record-0GtBWXRO.js → Record-BNzcMcpH.js} +4 -4
  24. package/dist/Reward-BCN44pw_.js +399 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-By5HgODg.js +151 -0
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-E7ADhGR7.js → RuleGroup.vue_vue_type_script_setup_true_lang-X24tGtbC.js} +15 -15
  27. package/dist/{Segment-Ci4BDnan.js → Segment-MSDomTz2.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-I2KT0px7.js → SelectItems.vue_vue_type_script_setup_true_lang-DyeY1fV7.js} +2 -2
  29. package/dist/{Setting-Dc9rLPuI.js → Setting-BOLu10II.js} +8 -8
  30. package/dist/Store-CtJ9sJol.js +1729 -0
  31. package/dist/{StoreRewards-Cho91MDd.js → StoreRewards-B5HCIRFt.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-QNn_cpIj.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BmEP5mI5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-arVZw_Lq.js} +1 -1
  34. package/dist/{Tier-DO9pTl_C.js → Tier-C3Y6q17j.js} +15 -15
  35. package/dist/{Title-CgQD-_3y.js → Title-_fk7AbId.js} +15 -15
  36. package/dist/{Transaction-DPmvpR7n.js → Transaction-D9CM1V_f.js} +2 -2
  37. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CJa-Tkws.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BIpPKUWx.js} +7 -7
  38. package/dist/{Voucher-Bq5Ev_fv.js → Voucher-Bo5QWYT0.js} +11 -11
  39. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DeQTAvCe.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CjxmRY5U.js} +10 -10
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DLFDd3Y3.js → ZodTextField.vue_vue_type_script_setup_true_lang-BK28WW3q.js} +1 -1
  41. package/dist/{app-BT6qeigc.js → app-C_djUlXx.js} +28 -28
  42. package/dist/{app-CtaeuBcs.js → app-ChpdgMfQ.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-Db2WFn9o.js → business-DJIj4b8e.js} +1 -1
  45. package/dist/{campaign-Bo2jmBiD.js → campaign-NrE6WI9q.js} +2 -2
  46. package/dist/{collectible.enum-BR9zmyJv.js → collectible.enum-BzLkFq1w.js} +1 -1
  47. package/dist/{collection.fn-Drj_6HD1.js → collection.fn-DQ71Nfut.js} +2 -2
  48. package/dist/{dto-BH8EtK7z.js → dto-12HT7-EA.js} +51 -51
  49. package/dist/{effect-l8oNjQBm.js → effect-CobPZ4Rb.js} +1 -1
  50. package/dist/{email-addresses-CBqWAs9Z.js → email-addresses-DiWLZMlA.js} +1 -1
  51. package/dist/{export-D6S3dr04.js → export-BrJSwHlS.js} +3 -3
  52. package/dist/{helper-CS2Hx33Q.js → helper-CCRX-fvI.js} +1 -1
  53. package/dist/{index-D2d2rTPz.js → index--wa67pRl.js} +1 -1
  54. package/dist/{index-CATw-eQI.js → index-BBkLSHsJ.js} +2 -2
  55. package/dist/{index-C7kr1TMO.js → index-BCyJY05i.js} +135 -229
  56. package/dist/{index-CXEJbUAO.js → index-BS_AxWZH.js} +1 -1
  57. package/dist/{index-Z61r-lWj.js → index-B__nVNTt.js} +1 -1
  58. package/dist/{index-5mZIFDhm.js → index-Bt2_f4Oi.js} +3 -3
  59. package/dist/index-CC2lo_Wb.js +1067 -0
  60. package/dist/{index-XoOcBFvx.js → index-C_KMGXv9.js} +4 -4
  61. package/dist/index-Ct8B2VHH.js +53 -0
  62. package/dist/{index-BsfC7C2D.js → index-DtnUFcfv.js} +1 -1
  63. package/dist/{index-BfhjAqeE.js → index-DwU8LaVM.js} +3 -3
  64. package/dist/{index-Bj5M_at2.js → index-DzJUULpT.js} +7 -1
  65. package/dist/{index-DVryx2wz.js → index-bsRZyOPx.js} +1 -1
  66. package/dist/{index.esm2017-Dg7M2BO7.js → index.esm2017-B_FgkPTh.js} +1 -1
  67. package/dist/{loading-DxWIhKJX.js → loading-fHk0Jjet.js} +4 -4
  68. package/dist/{membership-Df7gtzWJ.js → membership-BW1NS-Ql.js} +3 -3
  69. package/dist/{money-Ck4ZGH4F.js → money-CmeLOjIj.js} +1 -1
  70. package/dist/{number-D8umDJ-5.js → number-D0Hk2ezY.js} +1 -1
  71. package/dist/{objectid-BGnepAUg.js → objectid-hW6Oa6sR.js} +1 -1
  72. package/dist/{reward-5b5G4KYr.js → reward-BRZhngDm.js} +3 -3
  73. package/dist/{rule-BcLntzKp.js → rule-CECp9iUW.js} +3 -3
  74. package/dist/{rule-builder-B_RDlrnZ.js → rule-builder-BQpTUVhb.js} +1 -1
  75. package/dist/{template-C-myFW3k.js → template-CLAh7Qcz.js} +4 -4
  76. package/dist/{trigger-CAK3-5M9.js → trigger-BTbRRpH9.js} +4 -4
  77. package/dist/{vue-i18n-BC0lAbnG.js → vue-i18n-BQqGhLq-.js} +248 -248
  78. package/dist/{xlsx-DNZb1t3l.js → xlsx-BxwhyUvM.js} +1 -1
  79. package/package.json +3 -3
  80. package/dist/Overview-CmwJjXeT.js +0 -864
  81. package/dist/Reward-aH7S8WL3.js +0 -375
  82. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-XdyqSqlC.js +0 -138
  83. package/dist/Store-B94H-jff.js +0 -1531
  84. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDiZz1AW.js +0 -890
  85. package/dist/index-CVfN0Gmc.js +0 -298
  86. package/dist/index-CmN2dQk5.js +0 -774
  87. package/dist/index-Ct847l9G.js +0 -50
@@ -1,15 +1,15 @@
1
- import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as w, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as b, resolveDynamicComponent as q } from "vue";
1
+ import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as w, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as x, resolveDynamicComponent as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-DxWIhKJX.js";
5
- import { u as X } from "./business-Db2WFn9o.js";
6
- import { u as Y } from "./campaign-Bo2jmBiD.js";
7
- import { g as I, a as P } from "./dto-BH8EtK7z.js";
4
+ import { p as Q, u as W } from "./loading-fHk0Jjet.js";
5
+ import { u as X } from "./business-DJIj4b8e.js";
6
+ import { u as Y } from "./campaign-NrE6WI9q.js";
7
+ import { g as V, a as I } from "./dto-12HT7-EA.js";
8
8
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-KB_zk3f0.js";
10
- import { u as te } from "./template-C-myFW3k.js";
11
- import { u as oe } from "./vue-i18n-BC0lAbnG.js";
12
- import { c as _ } from "./index-DVryx2wz.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BI0BX8t8.js";
10
+ import { u as te } from "./template-CLAh7Qcz.js";
11
+ import { u as oe } from "./vue-i18n-BQqGhLq-.js";
12
+ import { c as _ } from "./index-bsRZyOPx.js";
13
13
  const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
14
14
  __name: "Point",
15
15
  setup(he) {
@@ -20,7 +20,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
20
20
  value: "create",
21
21
  isPrimary: !0,
22
22
  prependIcon: "add"
23
- }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
23
+ }, $ = te("COIN", G()), h = X(), m = Y(), { global: K, minor: C } = W, i = P({
24
24
  searchKey: "",
25
25
  location: null
26
26
  }), u = A(
@@ -35,12 +35,12 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
35
35
  {
36
36
  header: s("connect.program.common.table.status"),
37
37
  cell(e) {
38
- return I(e.row.original);
38
+ return V(e.row.original);
39
39
  }
40
40
  },
41
41
  {
42
42
  header: s("connect.program.common.table.summary"),
43
- accessorFn: (e) => P(e)
43
+ accessorFn: (e) => I(e)
44
44
  },
45
45
  {
46
46
  header: s("connect.program.common.table.actions"),
@@ -55,7 +55,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
55
55
  });
56
56
  }
57
57
  }
58
- ], v = V();
58
+ ], v = P();
59
59
  async function F(e) {
60
60
  await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
61
61
  async () => {
@@ -98,10 +98,10 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
98
98
  });
99
99
  }), (e, o) => {
100
100
  const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
101
- return d(), h(w, null, [
101
+ return d(), w(b, null, [
102
102
  r(y, {
103
103
  title: t(s)("connect.program.point.title"),
104
- actions: t(u).length > 0 ? [B] : [],
104
+ actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
105
105
  "onClick:action": o[0] || (o[0] = () => f())
106
106
  }, {
107
107
  title: g(() => [
@@ -120,7 +120,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
120
120
  placeholder: "search",
121
121
  collapsible: ""
122
122
  }, null, 8, ["modelValue"]),
123
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(w, { key: 0 }, [
123
+ t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), w(b, { key: 0 }, [
124
124
  n("div", ie, [
125
125
  n("div", re, [
126
126
  r(Z, {
@@ -130,7 +130,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
130
130
  "show-item-label": !0,
131
131
  icon: "storefront",
132
132
  placement: "bottom-start",
133
- items: t(x).locationItems
133
+ items: t(h).locationItems
134
134
  }, null, 8, ["modelValue", "items"])
135
135
  ]),
136
136
  r(k, {
@@ -152,9 +152,9 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
152
152
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
153
  r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
154
  default: g(() => [
155
- (d(!0), h(w, null, H(t(u).filter(
155
+ (d(!0), w(b, null, H(t(u).filter(
156
156
  (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
157
- ), (a) => (d(), b(U, {
157
+ ), (a) => (d(), x(U, {
158
158
  key: a._id.toString(),
159
159
  onClick: (L) => f(a),
160
160
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
@@ -162,12 +162,12 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
162
162
  default: g(() => [
163
163
  n("div", le, [
164
164
  n("div", ce, [
165
- (d(), b(q(t(I)(a)))),
165
+ (d(), x(q(t(V)(a)))),
166
166
  n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
167
167
  ]),
168
168
  n("div", de, [
169
169
  n("div", pe, c(a.name), 1),
170
- n("div", ue, c(t(P)(a)), 1)
170
+ n("div", ue, c(t(I)(a)), 1)
171
171
  ]),
172
172
  n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
173
173
  ]),
@@ -183,7 +183,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
183
183
  ]),
184
184
  _: 1
185
185
  })
186
- ], 64)) : (d(), b(T, {
186
+ ], 64)) : (d(), x(T, {
187
187
  key: 1,
188
188
  variant: "outlined",
189
189
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
@@ -200,7 +200,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
200
200
  r(S, {
201
201
  variant: "primary",
202
202
  label: "Create point program",
203
- disabled: !t(x).isPremium,
203
+ disabled: !t(h).isPremium,
204
204
  icon: "add",
205
205
  onClick: o[5] || (o[5] = (a) => f())
206
206
  }, null, 8, ["disabled"])
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
2
  import { _ as W } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-DxWIhKJX.js";
5
- import { u as ee } from "./business-Db2WFn9o.js";
6
- import { u as oe } from "./campaign-Bo2jmBiD.js";
7
- import { u as te } from "./vue-i18n-BC0lAbnG.js";
8
- import { g as V } from "./dto-BH8EtK7z.js";
9
- import { e as L } from "./effect-l8oNjQBm.js";
4
+ import { c as O, p as I, u as Z } from "./loading-fHk0Jjet.js";
5
+ import { u as ee } from "./business-DJIj4b8e.js";
6
+ import { u as oe } from "./campaign-NrE6WI9q.js";
7
+ import { u as te } from "./vue-i18n-BQqGhLq-.js";
8
+ import { g as V } from "./dto-12HT7-EA.js";
9
+ import { e as L } from "./effect-CobPZ4Rb.js";
10
10
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-KB_zk3f0.js";
12
- import { u as se } from "./template-C-myFW3k.js";
13
- import { c as u } from "./index-DVryx2wz.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BI0BX8t8.js";
12
+ import { u as se } from "./template-CLAh7Qcz.js";
13
+ import { c as u } from "./index-bsRZyOPx.js";
14
14
  const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
15
15
  __name: "Promotion",
16
16
  setup(_e) {
@@ -2,12 +2,12 @@ import { defineComponent as v, ref as w, resolveComponent as x, openBlock as b,
2
2
  import { u as V, _ as $ } from "./usePagination-BeF5K3M7.js";
3
3
  import { g as y } from "./user-Bm4KttFq.js";
4
4
  import { components as h } from "@feedmepos/ui-library";
5
- import { u as N } from "./loading-DxWIhKJX.js";
6
- import { u as B } from "./vue-i18n-BC0lAbnG.js";
5
+ import { u as N } from "./loading-fHk0Jjet.js";
6
+ import { u as B } from "./vue-i18n-BQqGhLq-.js";
7
7
  import { useCoreStore as U } from "@feedmepos/mf-common";
8
- import { r as R } from "./index-D2d2rTPz.js";
8
+ import { r as R } from "./index--wa67pRl.js";
9
9
  import { c as E, a as L } from "./object-qECH92oz.js";
10
- import { u as T } from "./membership-Df7gtzWJ.js";
10
+ import { u as T } from "./membership-BW1NS-Ql.js";
11
11
  const j = { class: "flex flex-col space-y-16 pr-12" }, K = /* @__PURE__ */ v({
12
12
  __name: "UpdateCriteriaProgressSheet",
13
13
  setup(F, { expose: u }) {
@@ -0,0 +1,399 @@
1
+ import { defineComponent as N, ref as C, computed as K, resolveComponent as p, openBlock as y, createBlock as V, unref as t, isRef as q, withCtx as h, createElementVNode as c, createVNode as i, createCommentVNode as U, createElementBlock as I, Fragment as H, h as x, onMounted as W, toDisplayString as $ } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as G, components as Y } from "@feedmepos/ui-library";
4
+ import { f as B, u as X, p as Q } from "./loading-fHk0Jjet.js";
5
+ import { u as J, C as ee } from "./membership-BW1NS-Ql.js";
6
+ import { u as te } from "./vue-i18n-BQqGhLq-.js";
7
+ import { c as oe } from "./object-qECH92oz.js";
8
+ import { Z as O } from "./zod-Bg2FbC-D.js";
9
+ import "./index-BBkLSHsJ.js";
10
+ import { a as ae } from "./index-Ct8B2VHH.js";
11
+ import { useCoreStore as ne } from "@feedmepos/mf-common";
12
+ import { _ as le, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CjxmRY5U.js";
13
+ import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-BrjVcauR.js";
14
+ import { J as j } from "./JsonViewer-v8_C7l5N.js";
15
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BK28WW3q.js";
16
+ import { i as de } from "./helper-CCRX-fvI.js";
17
+ import { u as me, r as D } from "./reward-BRZhngDm.js";
18
+ import { useRouter as ce } from "vue-router";
19
+ const pe = { class: "flex gap-8 items-center justify-start" }, ue = /* @__PURE__ */ N({
20
+ __name: "EditRewardSheet",
21
+ props: {},
22
+ emits: ["update"],
23
+ setup(Z, { expose: n, emit: k }) {
24
+ const u = J(), { minor: g } = X, f = C(!1), a = C({}), w = C(), v = ae, m = K(() => {
25
+ const o = v.safeParse(a.value);
26
+ return o.success ? [] : o.error.errors;
27
+ });
28
+ function b(o, e) {
29
+ o && (a.value = e), f.value = o;
30
+ }
31
+ const T = k;
32
+ async function R() {
33
+ const o = v.safeParse(a.value);
34
+ !o.success || !o.data || (await g(
35
+ async () => {
36
+ var e;
37
+ o.data.option.type === "VOUCHER" && w.value && (o.data.option.collectibleConfig.image = await B.update(
38
+ ((e = o.data.option.collectibleConfig) == null ? void 0 : e.image) || B.collectibleImagePath(void 0, w.value),
39
+ w.value
40
+ ));
41
+ },
42
+ {
43
+ message: "Uploading reward image",
44
+ successMessage: "Reward image updated"
45
+ }
46
+ ), T("update", o.data));
47
+ }
48
+ function E(o) {
49
+ o === "VOUCHER" ? a.value.option = {
50
+ collectible: null,
51
+ type: "VOUCHER",
52
+ collectibleConfig: de("VOUCHER", {
53
+ business: ne().currentBusiness.value._id
54
+ }),
55
+ earningOption: {
56
+ amount: 1,
57
+ type: "FIXED"
58
+ },
59
+ validityOption: {
60
+ validForDay: 30
61
+ }
62
+ } : a.value.option = {
63
+ collectible: u.loyaltyRewards.raw[0]._id,
64
+ collecitbleType: u.loyaltyRewards.raw[0].type,
65
+ type: "LOYALTY",
66
+ earningOption: {
67
+ amount: 1,
68
+ type: "FIXED"
69
+ },
70
+ validityOption: {
71
+ validForDay: 30
72
+ }
73
+ };
74
+ }
75
+ function F(o) {
76
+ a.value.option.collectible = o;
77
+ }
78
+ const L = C();
79
+ return n({
80
+ showSheet: b
81
+ }), (o, e) => {
82
+ const d = p("FmSelect"), A = p("FmForm"), S = p("FmButton"), P = p("FmSideSheet");
83
+ return y(), V(P, {
84
+ "max-width": 560,
85
+ modelValue: t(f),
86
+ "onUpdate:modelValue": [
87
+ e[8] || (e[8] = (s) => q(f) ? f.value = s : null),
88
+ e[9] || (e[9] = (s) => f.value = s)
89
+ ],
90
+ header: "Edit reward"
91
+ }, {
92
+ "side-sheet-footer": h(() => [
93
+ c("div", pe, [
94
+ i(S, {
95
+ variant: "primary",
96
+ type: "button",
97
+ label: "Confirm",
98
+ disabled: t(m).length > 0,
99
+ onClick: e[6] || (e[6] = (s) => R())
100
+ }, null, 8, ["disabled"]),
101
+ i(S, {
102
+ variant: "secondary",
103
+ type: "button",
104
+ label: "Cancel",
105
+ onClick: e[7] || (e[7] = (s) => f.value = !1)
106
+ })
107
+ ])
108
+ ]),
109
+ default: h(() => [
110
+ i(j, { json: t(a) }, null, 8, ["json"]),
111
+ i(A, {
112
+ class: "flex flex-col gap-y-24",
113
+ ref_key: "formRef",
114
+ ref: L,
115
+ onValidationSuccess: e[5] || (e[5] = (s) => R())
116
+ }, {
117
+ default: h(() => {
118
+ var s, r, M;
119
+ return [
120
+ i(se, {
121
+ modelValue: t(a).name,
122
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => t(a).name = l),
123
+ label: "Reward Name",
124
+ schema: t(O).typeAtPath(t(v), "name", [])
125
+ }, null, 8, ["modelValue", "schema"]),
126
+ i(d, {
127
+ label: "Reward Type",
128
+ items: [
129
+ { label: "Voucher", value: "VOUCHER" },
130
+ { label: "Loyalty", value: "LOYALTY" }
131
+ ],
132
+ "model-value": t(a).option.type,
133
+ "onUpdate:modelValue": E
134
+ }, null, 8, ["model-value"]),
135
+ t(a).option.type == "LOYALTY" ? (y(), V(d, {
136
+ key: 0,
137
+ label: "Loyalty type",
138
+ items: t(u).loyaltyRewards.items,
139
+ "model-value": t(a).option.collectible,
140
+ "onUpdate:modelValue": F
141
+ }, null, 8, ["items", "model-value"])) : U("", !0),
142
+ t(a).option.type === "LOYALTY" ? (y(), I(H, { key: 1 }, [
143
+ e[10] || (e[10] = c("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
144
+ ((s = t(u).loyaltyRewards.items.find(
145
+ (l) => {
146
+ var _;
147
+ return l.value === ((_ = t(a)) == null ? void 0 : _.option.collectible);
148
+ }
149
+ )) == null ? void 0 : s.raw.type) !== "TITLE" ? (y(), V(le, {
150
+ key: 0,
151
+ class: "mt-[-8px]",
152
+ rules: [
153
+ t(O).ruleAtPath(t(v), "option.earningOption", [
154
+ t(a).option.type
155
+ ])
156
+ ],
157
+ "helper-state": t(O).helperState(t(m), "option.earningOption"),
158
+ "error-text": t(O).helperText(t(m), "option.earningOption"),
159
+ "fixed-type": !0,
160
+ "model-value": t(a).option.earningOption,
161
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => t(a).option.earningOption = l)
162
+ }, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : U("", !0),
163
+ i(re, {
164
+ class: "!gap-24",
165
+ "for-credit": t(a).option.type === "LOYALTY" && ((r = t(u).loyaltyRewards.items.find(
166
+ (l) => {
167
+ var _;
168
+ return l.value === ((_ = t(a).option) == null ? void 0 : _.collectible);
169
+ }
170
+ )) == null ? void 0 : r.raw.type) === "CREDIT",
171
+ rules: [
172
+ t(O).ruleAtPath(t(v), "option.validityOption", [
173
+ t(a).option.type
174
+ ])
175
+ ],
176
+ "model-value": t(a).option.validityOption,
177
+ "onUpdate:modelValue": e[2] || (e[2] = (l) => t(a).option.validityOption = l)
178
+ }, null, 8, ["for-credit", "rules", "model-value"])
179
+ ], 64)) : U("", !0),
180
+ t(a).option.type === "VOUCHER" ? (y(), V(ie, {
181
+ key: 2,
182
+ "reward-image": t(w),
183
+ "model-value": ((M = t(a)) == null ? void 0 : M.option.collectibleConfig) ?? void 0,
184
+ "onUpdate:modelValue": e[3] || (e[3] = (l) => t(a).option.collectibleConfig = l),
185
+ "onUpdate:rewardImage": e[4] || (e[4] = (l) => w.value = l)
186
+ }, null, 8, ["reward-image", "model-value"])) : U("", !0),
187
+ i(j, { json: t(m) }, null, 8, ["json"])
188
+ ];
189
+ }),
190
+ _: 1
191
+ }, 512)
192
+ ]),
193
+ _: 1
194
+ }, 8, ["modelValue"]);
195
+ };
196
+ }
197
+ }), fe = { class: "px-24 flex flex-col gap-y-16" }, ye = { class: "flex items-center justify-between w-full" }, we = { class: "flex flex-col gap-16 text-center" }, ve = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, De = /* @__PURE__ */ N({
198
+ __name: "Reward",
199
+ setup(Z) {
200
+ const { t: n } = te(), k = {
201
+ label: n("connect.storeRewards.create"),
202
+ value: "create",
203
+ isPrimary: !0,
204
+ prependIcon: "add"
205
+ }, u = J(), g = me(), { global: f, minor: a } = X, w = ce(), v = G(), m = C({
206
+ searchKey: "",
207
+ columnFilters: []
208
+ }), b = K(() => g.rewards), T = [
209
+ {
210
+ header: n("connect.storeRewards.table.name"),
211
+ accessorFn: (o) => o.name
212
+ },
213
+ {
214
+ header: n("connect.storeRewards.table.type"),
215
+ cell(o) {
216
+ return o.row.original.collectibleConfig ? ee[o.row.original.collectibleConfig.type].chip() : "N/A";
217
+ }
218
+ },
219
+ {
220
+ header: n("connect.storeRewards.table.actions"),
221
+ cell(o) {
222
+ return x("div", { class: "flex items-center justify-end gap-4" }, [
223
+ x(
224
+ Y.FmMenu,
225
+ {
226
+ placement: "bottom-end",
227
+ onClick: (e) => {
228
+ e.stopPropagation();
229
+ }
230
+ },
231
+ {
232
+ "menu-button": () => x(Y.FmButton, {
233
+ icon: "more_vert",
234
+ iconColor: "neutral-gray-400",
235
+ variant: "tertiary"
236
+ }),
237
+ default: () => [
238
+ // h(components.FmMenuItem, {
239
+ // label: 'View collections',
240
+ // onClick: async (event: Event) => {
241
+ // event.stopPropagation();
242
+ // onViewCollection(props.row.original._id as string);
243
+ // },
244
+ // }),
245
+ x(
246
+ Y.FmMenuItem,
247
+ {
248
+ onClick: async (e) => {
249
+ e.stopPropagation(), E(o.row.original);
250
+ }
251
+ },
252
+ {
253
+ label: x(
254
+ "div",
255
+ {
256
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
257
+ },
258
+ "Delete"
259
+ )
260
+ }
261
+ )
262
+ ]
263
+ }
264
+ )
265
+ ]);
266
+ }
267
+ }
268
+ ], R = C();
269
+ async function E(o) {
270
+ await Q.remove(
271
+ n("connect.storeRewards.delete.confirm"),
272
+ n("connect.storeRewards.delete.title")
273
+ ) && await a(
274
+ async () => {
275
+ await D.deleteReward(o._id), await g.readRewards();
276
+ },
277
+ {
278
+ message: n("connect.storeRewards.delete.message"),
279
+ successMessage: n("connect.storeRewards.delete.success")
280
+ }
281
+ );
282
+ }
283
+ async function F(o) {
284
+ var e;
285
+ o || (o = {
286
+ name: "",
287
+ option: {
288
+ type: "LOYALTY",
289
+ collectible: u.loyaltyRewards.items[0].value,
290
+ validityOption: {
291
+ validForDay: 7
292
+ },
293
+ earningOption: {
294
+ type: "FIXED",
295
+ amount: 1
296
+ }
297
+ }
298
+ }), (e = R.value) == null || e.showSheet(!0, oe(o));
299
+ }
300
+ async function L(o) {
301
+ let e = !1;
302
+ o._id && o.option.type === "VOUCHER" && await new Promise((d) => {
303
+ v.open({
304
+ title: "Confirmation",
305
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
306
+ primaryActions: { text: "Update all", close: !0 },
307
+ secondaryActions: { text: "Update future only", close: !0 }
308
+ }).onPrimary(async () => {
309
+ e = !0, d();
310
+ }).onSecondary(async () => {
311
+ d();
312
+ });
313
+ }), await a(
314
+ async () => {
315
+ var d;
316
+ o.collectibleConfig = void 0, o._id ? await D.updateReward(o._id, {
317
+ ...o,
318
+ updateCollection: e
319
+ }) : await D.createReward(o), await g.readRewards(), (d = R.value) == null || d.showSheet(!1);
320
+ },
321
+ {
322
+ message: "Updating reward",
323
+ successMessage: "Reward updated successfully"
324
+ }
325
+ );
326
+ }
327
+ return W(async () => {
328
+ await f(async () => {
329
+ await u.readRewards(), await g.readRewards();
330
+ });
331
+ }), (o, e) => {
332
+ const d = p("FmPageHead"), A = p("FmSearch"), S = p("FmTable"), P = p("FmButton"), s = p("FmCard");
333
+ return y(), I(H, null, [
334
+ i(d, {
335
+ title: t(n)("connect.reward.title"),
336
+ actions: [k],
337
+ "back-button": !0,
338
+ "onClick:action": e[0] || (e[0] = () => F()),
339
+ "onClick:back": e[1] || (e[1] = () => {
340
+ var r;
341
+ return (r = t(w)) == null ? void 0 : r.back();
342
+ })
343
+ }, null, 8, ["title", "actions"]),
344
+ c("div", fe, [
345
+ t(b) && t(b).length > 0 ? (y(), I(H, { key: 0 }, [
346
+ c("div", ye, [
347
+ e[6] || (e[6] = c("div", { class: "flex gap-8" }, null, -1)),
348
+ i(A, {
349
+ modelValue: t(m).searchKey,
350
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => t(m).searchKey = r),
351
+ class: "",
352
+ placeholder: "search",
353
+ collapsible: ""
354
+ }, null, 8, ["modelValue"])
355
+ ]),
356
+ i(S, {
357
+ "row-data": t(b),
358
+ "column-defs": T,
359
+ "search-value": t(m).searchKey,
360
+ "column-filter": t(m).columnFilters,
361
+ onRowClick: e[3] || (e[3] = (r) => F(r.original)),
362
+ "hide-footer": t(b).length < 10
363
+ }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
364
+ ], 64)) : (y(), V(s, {
365
+ key: 1,
366
+ variant: "outlined",
367
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
368
+ }, {
369
+ default: h(() => [
370
+ e[7] || (e[7] = c("img", {
371
+ src: z,
372
+ class: "aspect-square w-[150px]"
373
+ }, null, -1)),
374
+ c("div", we, [
375
+ c("div", ve, $(t(n)("connect.storeRewards.empty.title")), 1),
376
+ c("div", ge, $(t(n)("connect.storeRewards.empty.description")), 1)
377
+ ]),
378
+ i(P, {
379
+ variant: "primary",
380
+ label: t(n)("connect.storeRewards.empty.action"),
381
+ onClick: e[4] || (e[4] = (r) => F()),
382
+ icon: "add"
383
+ }, null, 8, ["label"])
384
+ ]),
385
+ _: 1
386
+ })),
387
+ i(ue, {
388
+ ref_key: "rewardSheetRef",
389
+ ref: R,
390
+ onUpdate: e[5] || (e[5] = (r) => L(r))
391
+ }, null, 512)
392
+ ])
393
+ ], 64);
394
+ };
395
+ }
396
+ });
397
+ export {
398
+ De as default
399
+ };