@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.80

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 (167) hide show
  1. package/dist/{App-DsB2o1oB.js → App-DievprEi.js} +853 -683
  2. package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-DrdqOhZL.js} +16 -13
  3. package/dist/{Bin-DMr7K8Kj.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/Broadcast-CpDMAG1o.js +306 -0
  5. package/dist/CampaignAnalytic-uRyGaLaN.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -5
  7. package/dist/Card-tb98Kyr-.js +1086 -0
  8. package/dist/{Collections-B0uGC2FE.js → Collections-P1S5WjnJ.js} +14 -13
  9. package/dist/Credit-DwK7JYf-.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js +4432 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +36 -36
  13. package/dist/Experience-BejtRlOj.js +288 -0
  14. package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-n8qL896g.js +356 -0
  17. package/dist/GiftCardSetup-Bgsfcu7N.js +736 -0
  18. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js +424 -0
  19. package/dist/Goals-BB8LJlq3.js +247 -0
  20. package/dist/{Grab-DmmwrGzk.js → Grab-COq3Ujst.js} +33 -32
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  22. package/dist/{Index-m7l4insz.js → Index-BdkIinaE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  25. package/dist/LoyaltyDashboard-D4Jtpw0n.js +2911 -0
  26. package/dist/MainLayout-Ca-Xm3eZ.js +143 -0
  27. package/dist/{Marketing-C9pSIdBU.js → Marketing-Cpe4s7NZ.js} +7 -6
  28. package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-nTeS9VVx.js} +15 -14
  29. package/dist/Member-DgGZ4Cdg.js +654 -0
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js +1281 -0
  31. package/dist/MemberImportHistory-rdlbDVWU.js +187 -0
  32. package/dist/MemberList-BC4aRJTt.js +334 -0
  33. package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-BFfdTttp.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +5928 -5644
  35. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js +40 -0
  36. package/dist/Mission-BWCNKTjU.js +363 -0
  37. package/dist/Overview--Q7vzhNK.js +1316 -0
  38. package/dist/{Overview-DOJj4XvO.js → Overview-i02Wnyjn.js} +23 -20
  39. package/dist/Point-CiWxqny5.js +297 -0
  40. package/dist/Promotion-B0G9qfBm.js +426 -0
  41. package/dist/{Queue-55G2gtP5.js → Queue-YfwgYmzH.js} +16 -13
  42. package/dist/{Record-DNPI02c6.js → Record-CCuwrPKW.js} +9 -9
  43. package/dist/Review-ymsfdh7Q.js +45 -0
  44. package/dist/ReviewFacebookCallback-DyDExWvP.js +238 -0
  45. package/dist/ReviewGoogleCallback-DNyg3n2S.js +213 -0
  46. package/dist/{Reward-CnP8R2pS.js → Reward-BKIb0ezH.js} +28 -28
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +26 -23
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +198 -186
  49. package/dist/{Segment-CxiQnnyj.js → Segment-D5_pp7fh.js} +278 -276
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +45 -42
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  52. package/dist/Setting-CD78gIMU.js +574 -0
  53. package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  54. package/dist/Settings-DI_tryQV.js +230 -0
  55. package/dist/Store-BV2JTRNZ.js +2615 -0
  56. package/dist/{StoreRewards-DILeipMG.js → StoreRewards-Bk55YXyO.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +1331 -0
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  59. package/dist/{Tier-BAZ1xuKL.js → Tier-CO2K30Ew.js} +2576 -757
  60. package/dist/{Title-CcNAt47f.js → Title-qProQh3T.js} +41 -37
  61. package/dist/Transaction-qL5L-fE_.js +45 -0
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +26 -26
  63. package/dist/Voucher-VFD1LY9Y.js +837 -0
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +118 -124
  65. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  66. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  67. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  68. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  70. package/dist/{app-Z-UKRG5V.js → app-BEYzXWZO.js} +50954 -42517
  71. package/dist/app.js +1 -1
  72. package/dist/base.export-S_82Elmg.js +75 -0
  73. package/dist/browser-BSAOEeIM.js +1478 -0
  74. package/dist/{business-C7EF6cKC.js → business-DH7djUl8.js} +5 -5
  75. package/dist/campaign-DlHDgoFX.js +100 -0
  76. package/dist/campaign-k_WHxsOR.js +400 -0
  77. package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  78. package/dist/{campaign.fn-Bd34dVnx.js → campaign.fn-B-4JRzft.js} +67 -67
  79. package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
  80. package/dist/collection.fn-zQwWDzZT.js +26 -0
  81. package/dist/currency-CQVHXBFe.js +7 -0
  82. package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-YTXMbJTj.js} +11 -11
  83. package/dist/{effect-BcB8IlTI.js → effect-CQkVLHWi.js} +1 -1
  84. package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-BIoVbPGC.js} +209 -201
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BSgrCJRv.js → helper-BCkTvF4m.js} +1 -1
  87. package/dist/{index-CoHWpylO.js → index-B-bQnb0_.js} +2115 -2557
  88. package/dist/index-BAJOC43K.js +14550 -0
  89. package/dist/{index-HXiYGO4_.js → index-BFIHEBnX.js} +6343 -7693
  90. package/dist/{index-VlFWaBrg.js → index-BJIQe3QJ.js} +1 -1
  91. package/dist/{index-BpI-BI4H.js → index-BJkRTH5T.js} +4 -4
  92. package/dist/index-BOJogkKQ.js +172 -0
  93. package/dist/{index-BoYEqLif.js → index-BRPajAkE.js} +1517 -263
  94. package/dist/{index-CsoBDon4.js → index-BTkxgos0.js} +1590 -1523
  95. package/dist/index-BUP4aHq8.js +32438 -0
  96. package/dist/index-BYvnqARr.js +902 -0
  97. package/dist/{index-hlyg-wxV.js → index-Bonq819P.js} +1 -1
  98. package/dist/{index-CIBPhxlC.js → index-C6mOI2Pp.js} +105 -123
  99. package/dist/{index-Bf6jNZit.js → index-CDIe15AY.js} +24 -9
  100. package/dist/index-CTrcdIkt.js +137 -0
  101. package/dist/index-C_H8jFYf.js +2743 -0
  102. package/dist/index-CpnchVe1.js +74 -0
  103. package/dist/index-D5AR7A5e.js +151 -0
  104. package/dist/index-D7-Q86HI.js +54 -0
  105. package/dist/index-DdOj8Hew.js +53 -0
  106. package/dist/{index-iMPtFp54.js → index-Dvqguh2B.js} +10 -9
  107. package/dist/{index-Bm0QPucw.js → index-hAKRfE-4.js} +14 -14
  108. package/dist/index-o2Ga_qaX.js +39 -0
  109. package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-D0fhMMPG.js} +128 -128
  110. package/dist/{loading-CSXr0Yqz.js → loading-C686AMVG.js} +1 -1
  111. package/dist/{lodash-Bh7XKI-R.js → lodash-CANlWUWW.js} +1 -1
  112. package/dist/member-import-UzJ6ByIS.js +188 -0
  113. package/dist/membership-DCVzFaFy.js +274 -0
  114. package/dist/{money-BZIST_m9.js → money-DuazwoX7.js} +1 -1
  115. package/dist/{number-DXLR2w95.js → number-B2HFiV0g.js} +1 -1
  116. package/dist/objectid-Bq-oVMdP.js +145 -0
  117. package/dist/onboarding-BxvNxz-9.js +131 -0
  118. package/dist/onboardingSetup-CcvKmyx8.js +17 -0
  119. package/dist/{plugins-4FlbwoES.js → plugins-C39O5j42.js} +13 -12
  120. package/dist/remy-Qz_pNsUS.js +13 -0
  121. package/dist/{reward-DUbl79bZ.js → reward-HYt-2nxt.js} +1 -1
  122. package/dist/{rule-BQUoZ4l_.js → rule-3xNIYM7z.js} +337 -275
  123. package/dist/style.css +1 -1
  124. package/dist/{template-BoiSG7G7.js → template-D37Z_b0m.js} +6 -6
  125. package/dist/timezone-JwnQgpaU.js +20 -0
  126. package/dist/transaction.fn-C5vswLI_.js +71 -0
  127. package/dist/{trigger-D5g5m6tT.js → trigger-Bc6s2cvq.js} +17 -17
  128. package/dist/useMarketingMaterialActions-DMGyAXcy.js +96 -0
  129. package/dist/{usePagination-DHePBBoR.js → usePagination-DLOOwiiY.js} +1 -1
  130. package/dist/{user-C_ToSo-g.js → user-CTIGugVF.js} +1 -1
  131. package/dist/{vue-i18n-BcYh6_51.js → vue-i18n-Dpic36zz.js} +287 -287
  132. package/dist/{xlsx-h4G1C-xj.js → xlsx-CT9_1SFr.js} +786 -786
  133. package/dist/{zod-CgigfJar.js → zod-CGVrMcDl.js} +1 -1
  134. package/package.json +10 -6
  135. package/dist/Broadcast-C9akM-TB.js +0 -266
  136. package/dist/Card-DRkIYs0M.js +0 -910
  137. package/dist/Credit-V5YA_hGx.js +0 -260
  138. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  139. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
  140. package/dist/Experience-WTWy5yY6.js +0 -259
  141. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  142. package/dist/Game-BwOfTCW5.js +0 -330
  143. package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
  144. package/dist/MainLayout-Du5kZOtA.js +0 -41
  145. package/dist/Member-DUV_vbPI.js +0 -280
  146. package/dist/MemberList-Ye4nOk-i.js +0 -1601
  147. package/dist/Mission-BBmCGpt8.js +0 -334
  148. package/dist/Point-Bzg6hi6o.js +0 -262
  149. package/dist/Promotion-BMXIp_ef.js +0 -397
  150. package/dist/Review-CYNPPxYU.js +0 -1141
  151. package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
  152. package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
  153. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
  154. package/dist/Setting-jHAjccod.js +0 -2047
  155. package/dist/Store-Cu-hKmVa.js +0 -1996
  156. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
  157. package/dist/Transaction-D7DO3dKQ.js +0 -39
  158. package/dist/Voucher-Cq-n1CaC.js +0 -421
  159. package/dist/campaign--MjoY1Mn.js +0 -219
  160. package/dist/campaign-DHBuP4UA.js +0 -277
  161. package/dist/export-CjB7qxZ9.js +0 -97
  162. package/dist/index-BIAjmMga.js +0 -85
  163. package/dist/index-Bv4MBLQ5.js +0 -52
  164. package/dist/index-hbyCVNa7.js +0 -30289
  165. package/dist/membership-CfredTm3.js +0 -255
  166. package/dist/objectid-Dg4ZodlT.js +0 -145
  167. package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
@@ -0,0 +1,654 @@
1
+ import { defineComponent as J, resolveComponent as y, unref as t, openBlock as n, createElementBlock as i, normalizeClass as W, renderSlot as ne, createElementVNode as s, createVNode as u, ref as g, computed as P, onMounted as xe, onBeforeUnmount as Se, Fragment as O, createStaticVNode as Le, withCtx as N, renderList as Q, createBlock as k, toDisplayString as r, createCommentVNode as d, createTextVNode as le, isRef as Ae, watch as Ne, createSlots as Me } from "vue";
2
+ import "./index-Bonq819P.js";
3
+ import { useDialog as de } from "@feedmepos/ui-library";
4
+ import { u as ue } from "./vue-i18n-Dpic36zz.js";
5
+ import { useCoreStore as Fe } from "@feedmepos/mf-common";
6
+ import { F as re } from "./FileSaver.min-C-hmBaHm.js";
7
+ import { u as V, w as Pe } from "./xlsx-CT9_1SFr.js";
8
+ import { u as De } from "./app-wDQR6dpb.js";
9
+ import { M as ie, a as Be } from "./member-import-UzJ6ByIS.js";
10
+ import { m as A } from "./index-CTrcdIkt.js";
11
+ import { useRouter as Oe } from "vue-router";
12
+ import { R as I } from "./app-BEYzXWZO.js";
13
+ const Ve = { class: "fm-typo-en-body-sm-400 justify-center flex items-center w-full" }, Ye = /* @__PURE__ */ J({
14
+ __name: "FmAdminBadge",
15
+ props: {
16
+ class: { default: void 0 },
17
+ selectable: { type: Boolean, default: !1 }
18
+ },
19
+ setup(G) {
20
+ const m = G, M = Fe();
21
+ return (D, f) => {
22
+ var e;
23
+ const E = y("FmIcon");
24
+ return (e = t(M).sessionUser.value) != null && e.role.isAdmin ? (n(), i("div", {
25
+ key: 0,
26
+ class: W([
27
+ "group gap-8 inline-flex items-center relative border-1 border-dashed rounded-md border-red-500 hover:border-opacity-30 transition-opacity",
28
+ { "select-none": !m.selectable }
29
+ ])
30
+ }, [
31
+ ne(D.$slots, "default"),
32
+ s("div", {
33
+ class: W([
34
+ "pointer-events-none opacity-90 flex items-center justify-center rounded-xxxl bg-red-500 text-white group-hover:opacity-20",
35
+ m.class,
36
+ {
37
+ absolute: !0,
38
+ "bottom-[-5px] right-[-8px] px-4 h-[25px] w-[25px] border-2 border-red-800": !0
39
+ }
40
+ ])
41
+ }, [
42
+ s("span", Ve, [
43
+ u(E, {
44
+ name: "support_agent",
45
+ size: "sm",
46
+ outline: ""
47
+ })
48
+ ])
49
+ ], 2)
50
+ ], 2)) : ne(D.$slots, "non-admin", { key: 1 });
51
+ };
52
+ }
53
+ }), $e = { class: "w-[800px] max-w-full space-y-24 pb-16" }, Ue = {
54
+ key: 0,
55
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
56
+ }, He = { class: "flex justify-end" }, Ge = {
57
+ key: 1,
58
+ class: "flex items-center rounded-md border border-fm-color-neutral-gray-300 p-16"
59
+ }, qe = { class: "fm-typo-en-body-lg-400 min-w-0 flex-1 truncate px-8" }, je = { class: "flex items-center justify-between" }, ze = { class: "fm-typo-en-title-sm-800" }, Qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, We = {
60
+ key: 0,
61
+ class: "rounded-md bg-fm-color-system-error-100 p-16 fm-typo-en-body-sm-400"
62
+ }, Je = {
63
+ key: 1,
64
+ class: "rounded-md bg-fm-color-system-info-100 p-16 fm-typo-en-body-md-400"
65
+ }, Ke = {
66
+ key: 2,
67
+ class: "space-y-16"
68
+ }, Xe = { class: "grid grid-cols-2 gap-8 md:grid-cols-4" }, Ze = { class: "fm-typo-en-title-sm-800" }, et = { class: "fm-typo-en-title-sm-800" }, tt = { class: "fm-typo-en-title-sm-800" }, at = { class: "fm-typo-en-title-sm-800" }, ot = {
69
+ key: 0,
70
+ class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
71
+ }, st = {
72
+ key: 1,
73
+ class: "rounded-md bg-fm-color-system-warning-100 p-16 fm-typo-en-body-sm-400"
74
+ }, nt = { class: "fm-typo-en-body-md-400" }, lt = { class: "fm-typo-en-body-md-600" }, rt = {
75
+ key: 4,
76
+ class: "rounded-md bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400"
77
+ }, it = {
78
+ key: 3,
79
+ class: "space-y-12"
80
+ }, dt = { class: "rounded-md bg-fm-color-system-error-100 p-16" }, ut = { class: "fm-typo-en-body-sm-400" }, ct = {
81
+ key: 4,
82
+ class: "rounded-md bg-fm-color-system-error-100 p-16"
83
+ }, mt = { class: "fm-typo-en-body-sm-400" }, pt = { class: "fm-typo-en-body-sm-400" }, ft = {
84
+ key: 5,
85
+ class: "rounded-md bg-fm-color-system-success-100 p-16"
86
+ }, vt = { class: "fm-typo-en-body-sm-400" }, yt = {
87
+ key: 6,
88
+ class: "rounded-md bg-fm-color-system-info-100 p-16"
89
+ }, bt = { class: "fm-typo-en-body-sm-400" }, _t = { class: "flex items-center justify-end gap-8" }, gt = /* @__PURE__ */ J({
90
+ __name: "ImportMemberDialog",
91
+ setup(G) {
92
+ const { t: m } = ue(), M = de(), D = De(), f = g(null), E = g(null), e = g(null), c = g(""), R = g(""), B = g(!1), T = g(!1), x = g(!1), S = g(!1), b = g(!1), h = g(!0);
93
+ let w, _ = 0;
94
+ const L = g({
95
+ mode: "UPSERT"
96
+ }), q = [
97
+ { label: "Create missing members only", value: "CREATE" },
98
+ { label: "Update existing members only", value: "UPDATE" },
99
+ { label: "Create and update members", value: "UPSERT" }
100
+ ], j = [
101
+ {
102
+ label: "CSV",
103
+ icon: "csv",
104
+ value: "csv"
105
+ /* csv */
106
+ },
107
+ {
108
+ label: "Excel",
109
+ icon: "description",
110
+ value: "xlsx"
111
+ /* xlsx */
112
+ }
113
+ ], z = P(
114
+ () => {
115
+ var o;
116
+ return ["UPLOADED", "VALIDATING", "QUEUED", "RUNNING", "CANCELLING"].includes(
117
+ ((o = e.value) == null ? void 0 : o.status) ?? ""
118
+ );
119
+ }
120
+ ), K = P(() => {
121
+ var o;
122
+ return !(((o = e.value) == null ? void 0 : o.status) !== "READY" || !e.value.file || R.value !== e.value.businessName || !S.value || e.value.summary.sharedProfiles > 0 && !T.value || e.value.summary.balanceRows > 0 && !x.value);
123
+ }), ce = P(() => {
124
+ const o = e.value, a = o == null ? void 0 : o.summary, p = !!o && R.value === o.businessName;
125
+ return [
126
+ {
127
+ label: "Status is READY",
128
+ passed: (o == null ? void 0 : o.status) === "READY",
129
+ value: (o == null ? void 0 : o.status) ?? "missing"
130
+ },
131
+ {
132
+ label: "Uploaded file exists",
133
+ passed: !!(o != null && o.file),
134
+ value: o != null && o.file ? "yes" : "no"
135
+ },
136
+ {
137
+ label: "Business name matches exactly",
138
+ passed: p,
139
+ value: `entered "${R.value}" / expected "${(o == null ? void 0 : o.businessName) ?? ""}"`
140
+ },
141
+ {
142
+ label: "Shared-profile acknowledgement",
143
+ passed: !(a != null && a.sharedProfiles) || T.value,
144
+ value: a != null && a.sharedProfiles ? `${T.value ? "checked" : "required"} (${a.sharedProfiles} rows)` : "not required"
145
+ },
146
+ {
147
+ label: "Balance-replacement acknowledgement",
148
+ passed: !(a != null && a.balanceRows) || x.value,
149
+ value: a != null && a.balanceRows ? `${x.value ? "checked" : "required"} (${a.balanceRows} rows)` : "not required"
150
+ },
151
+ {
152
+ label: "Import responsibility acknowledgement",
153
+ passed: S.value,
154
+ value: S.value ? "checked" : "required"
155
+ }
156
+ ];
157
+ });
158
+ function me(o) {
159
+ var a, p;
160
+ f.value = ((p = (a = o.target) == null ? void 0 : a.files) == null ? void 0 : p[0]) ?? null;
161
+ }
162
+ function pe() {
163
+ E.value && (E.value.value = "", E.value.click());
164
+ }
165
+ function fe(o) {
166
+ const a = [
167
+ [...ie],
168
+ [...Be]
169
+ ], p = V.aoa_to_sheet(a);
170
+ if (o === "csv") {
171
+ re.saveAs(
172
+ new Blob([V.sheet_to_csv(p)], {
173
+ type: "text/csv;charset=utf-8;"
174
+ }),
175
+ "ImportMemberTemplate.csv"
176
+ );
177
+ return;
178
+ }
179
+ const v = V.book_new();
180
+ for (let C = 0; C < ie.length; C++) {
181
+ const $ = p[V.encode_cell({ r: 1, c: C })];
182
+ $ && ($.z = "@");
183
+ }
184
+ V.book_append_sheet(v, p, "Members"), Pe(v, "ImportMemberTemplate.xlsx", { cellStyles: !0 });
185
+ }
186
+ async function ve() {
187
+ if (!f.value) {
188
+ c.value = "Please upload a file.";
189
+ return;
190
+ }
191
+ if (!B.value) {
192
+ c.value = "Please read and acknowledge the import warnings.";
193
+ return;
194
+ }
195
+ b.value = !0, c.value = "";
196
+ try {
197
+ const o = new FormData();
198
+ o.append("file", f.value), o.append("config", JSON.stringify(L.value)), e.value = await A.import(o), await F();
199
+ } catch (o) {
200
+ c.value = o instanceof Error ? o.message : String(o);
201
+ } finally {
202
+ b.value = !1;
203
+ }
204
+ }
205
+ async function ye(o) {
206
+ var p, v;
207
+ if (!e.value) return !1;
208
+ const a = e.value._id.toString();
209
+ try {
210
+ const C = await A.readImport(a);
211
+ return o !== _ || ((p = e.value) == null ? void 0 : p._id.toString()) !== a ? !1 : (e.value = C, !0);
212
+ } catch (C) {
213
+ if (o !== _ || ((v = e.value) == null ? void 0 : v._id.toString()) !== a)
214
+ return !1;
215
+ throw C;
216
+ }
217
+ }
218
+ async function F() {
219
+ var a;
220
+ Y();
221
+ const o = _;
222
+ try {
223
+ if (!await ye(o)) return;
224
+ } catch (p) {
225
+ if (o !== _) return;
226
+ c.value = p instanceof Error ? p.message : String(p), z.value && (w = setTimeout(F, 5e3));
227
+ return;
228
+ }
229
+ o === _ && z.value && (w = setTimeout(F, ((a = e.value) == null ? void 0 : a.status) === "RUNNING" ? 5e3 : 1500));
230
+ }
231
+ async function be() {
232
+ try {
233
+ e.value = await A.resumableImport(), e.value && await F();
234
+ } catch (o) {
235
+ c.value = o instanceof Error ? o.message : String(o);
236
+ } finally {
237
+ h.value = !1;
238
+ }
239
+ }
240
+ function Y() {
241
+ _ += 1, w && clearTimeout(w), w = void 0;
242
+ }
243
+ function _e() {
244
+ Y(), e.value = null, f.value = null, c.value = "", S.value = !1;
245
+ }
246
+ async function ge() {
247
+ if (!(!e.value || !K.value)) {
248
+ b.value = !0, c.value = "";
249
+ try {
250
+ e.value = await A.confirmImport(e.value._id.toString(), {
251
+ businessName: R.value,
252
+ fileHash: e.value.fileHash,
253
+ previewVersion: e.value.previewVersion,
254
+ acknowledgeSharedProfiles: T.value,
255
+ acknowledgeBalanceReplacement: x.value
256
+ }), await F();
257
+ } catch (o) {
258
+ c.value = o instanceof Error ? o.message : String(o);
259
+ } finally {
260
+ b.value = !1;
261
+ }
262
+ }
263
+ }
264
+ async function he() {
265
+ if (e.value) {
266
+ b.value = !0, c.value = "";
267
+ try {
268
+ e.value = await A.retryImport(e.value._id.toString()), await F();
269
+ } catch (o) {
270
+ c.value = o instanceof Error ? o.message : String(o);
271
+ } finally {
272
+ b.value = !1;
273
+ }
274
+ }
275
+ }
276
+ async function we() {
277
+ if (!(!e.value || ["COMPLETED", "CANCELLED", "INVALID", "CANCELLING"].includes(
278
+ e.value.status
279
+ ))) {
280
+ b.value = !0, c.value = "";
281
+ try {
282
+ const o = await A.cancelImport(e.value._id.toString());
283
+ Y(), e.value = o, e.value.status === "CANCELLING" && await F();
284
+ } catch (o) {
285
+ c.value = o instanceof Error ? o.message : String(o);
286
+ } finally {
287
+ b.value = !1;
288
+ }
289
+ }
290
+ }
291
+ async function ke() {
292
+ if (!e.value) return;
293
+ const o = await A.downloadImportResult(e.value._id.toString());
294
+ re.saveAs(o, `member-import-${e.value._id}.csv`);
295
+ }
296
+ return xe(be), Se(Y), (o, a) => {
297
+ var X, Z, ee, te, ae, oe, se;
298
+ const p = y("FmSelect"), v = y("FmButton"), C = y("FmMenuItem"), $ = y("FmMenu"), Ee = y("FmDropField"), U = y("FmCheckbox"), Ie = y("FmChip"), H = y("FmCard"), Re = y("FmTextField"), Ce = y("FmHelperText"), Te = y("FmSpacer");
299
+ return n(), i("div", $e, [
300
+ t(h) ? (n(), i("div", Ue, " Checking for an unfinished import… ")) : t(e) ? (n(), i(O, { key: 2 }, [
301
+ s("div", je, [
302
+ s("div", null, [
303
+ s("div", ze, r(((X = t(e).file) == null ? void 0 : X.originalName) ?? "Unknown file"), 1),
304
+ s("div", Qe, " Import " + r(t(e)._id) + " · " + r(t(e).status), 1)
305
+ ]),
306
+ u(Ie, {
307
+ label: t(e).status,
308
+ compact: ""
309
+ }, null, 8, ["label"])
310
+ ]),
311
+ t(e).file ? d("", !0) : (n(), i("div", We, " The saved import is missing its uploaded file. Cancel it and upload the file again. ")),
312
+ t(z) ? (n(), i("div", Je, r(t(e).status === "RUNNING" ? "Importing members…" : t(e).status === "CANCELLING" ? "Cancelling import…" : "Preparing import preview…"), 1)) : d("", !0),
313
+ t(e).status === "READY" ? (n(), i("div", Ke, [
314
+ s("div", Xe, [
315
+ u(H, {
316
+ variant: "outlined",
317
+ class: "p-12"
318
+ }, {
319
+ default: N(() => [
320
+ s("div", Ze, r(t(e).summary.total), 1),
321
+ a[9] || (a[9] = s("div", { class: "fm-typo-en-body-sm-400" }, "Rows", -1))
322
+ ]),
323
+ _: 1
324
+ }),
325
+ u(H, {
326
+ variant: "outlined",
327
+ class: "p-12"
328
+ }, {
329
+ default: N(() => [
330
+ s("div", et, r(t(e).summary.create), 1),
331
+ a[10] || (a[10] = s("div", { class: "fm-typo-en-body-sm-400" }, "Create", -1))
332
+ ]),
333
+ _: 1
334
+ }),
335
+ u(H, {
336
+ variant: "outlined",
337
+ class: "p-12"
338
+ }, {
339
+ default: N(() => [
340
+ s("div", tt, r(t(e).summary.update), 1),
341
+ a[11] || (a[11] = s("div", { class: "fm-typo-en-body-sm-400" }, "Update", -1))
342
+ ]),
343
+ _: 1
344
+ }),
345
+ u(H, {
346
+ variant: "outlined",
347
+ class: "p-12"
348
+ }, {
349
+ default: N(() => [
350
+ s("div", at, r(t(e).summary.balanceRows), 1),
351
+ a[12] || (a[12] = s("div", { class: "fm-typo-en-body-sm-400" }, "Balance rows", -1))
352
+ ]),
353
+ _: 1
354
+ })
355
+ ]),
356
+ t(e).summary.balanceRows ? (n(), i("div", ot, " Final target totals — Credit: " + r(t(e).summary.creditTargetTotal) + ", Experience: " + r(t(e).summary.experienceTargetTotal) + ", Points: " + r(t(e).summary.pointTargetTotal) + ". Tier changes: " + r(t(e).summary.tierRows) + ". ", 1)) : d("", !0),
357
+ t(e).summary.sharedProfiles ? (n(), i("div", st, r(t(e).summary.sharedProfiles) + " rows can update a shared profile used by another business. ", 1)) : d("", !0),
358
+ s("div", nt, [
359
+ a[13] || (a[13] = le(" To confirm your action, type ", -1)),
360
+ s("span", lt, r(t(e).businessName), 1),
361
+ a[14] || (a[14] = le(" in the text field ", -1))
362
+ ]),
363
+ u(Re, {
364
+ modelValue: t(R),
365
+ "onUpdate:modelValue": a[3] || (a[3] = (l) => Ae(R) ? R.value = l : null)
366
+ }, null, 8, ["modelValue"]),
367
+ t(e).summary.sharedProfiles ? (n(), k(U, {
368
+ key: 2,
369
+ "model-value": t(T),
370
+ value: "shared-profile",
371
+ label: "I understand that shared profile fields can affect other businesses.",
372
+ "onUpdate:modelValue": a[4] || (a[4] = (l) => T.value = l)
373
+ }, null, 8, ["model-value"])) : d("", !0),
374
+ t(e).summary.balanceRows ? (n(), k(U, {
375
+ key: 3,
376
+ "model-value": t(x),
377
+ value: "balance-replacement",
378
+ label: "I understand that populated balance cells replace final balances.",
379
+ "onUpdate:modelValue": a[5] || (a[5] = (l) => x.value = l)
380
+ }, null, 8, ["model-value"])) : d("", !0),
381
+ u(U, {
382
+ "model-value": t(S),
383
+ value: "import-responsibility",
384
+ label: "I acknowledge that I understand what data I import and will take the responsibility",
385
+ "onUpdate:modelValue": a[6] || (a[6] = (l) => S.value = l)
386
+ }, null, 8, ["model-value"]),
387
+ t(D).debugMode ? (n(), i("div", rt, [
388
+ a[15] || (a[15] = s("div", { class: "fm-typo-en-body-sm-600" }, "Start import checks", -1)),
389
+ (n(!0), i(O, null, Q(t(ce), (l) => (n(), i("div", {
390
+ key: l.label,
391
+ class: "flex gap-8"
392
+ }, [
393
+ s("span", {
394
+ class: W(l.passed ? "text-green-600" : "text-red-600")
395
+ }, r(l.passed ? "✓" : "✗"), 3),
396
+ s("span", null, r(l.label) + ": " + r(l.value), 1)
397
+ ]))), 128))
398
+ ])) : d("", !0)
399
+ ])) : d("", !0),
400
+ t(e).status === "INVALID" ? (n(), i("div", it, [
401
+ s("div", dt, [
402
+ a[16] || (a[16] = s("div", { class: "fm-typo-en-body-md-600" }, "The file is not importable", -1)),
403
+ s("div", ut, r(t(e).error), 1)
404
+ ]),
405
+ (n(!0), i(O, null, Q((Z = t(e).rowErrors) == null ? void 0 : Z.slice(0, 10), (l) => (n(), i("div", {
406
+ key: l.rowNumber,
407
+ class: "fm-typo-en-body-sm-400"
408
+ }, " Row " + r(l.rowNumber) + ": " + r(l.errors.join("; ")), 1))), 128))
409
+ ])) : d("", !0),
410
+ t(e).status === "STOPPED" ? (n(), i("div", ct, [
411
+ a[17] || (a[17] = s("div", { class: "fm-typo-en-body-md-600" }, "Import stopped", -1)),
412
+ s("div", mt, r(t(e).summary.completed) + " rows completed before the first runtime error. Fix the cause, then retry this same import safely. ", 1),
413
+ s("div", pt, r(t(e).error), 1)
414
+ ])) : d("", !0),
415
+ t(e).status === "COMPLETED" ? (n(), i("div", ft, [
416
+ a[18] || (a[18] = s("div", { class: "fm-typo-en-body-md-600" }, "Import completed", -1)),
417
+ s("div", vt, r(t(e).summary.completed) + " members were processed. ", 1)
418
+ ])) : d("", !0),
419
+ t(e).status === "CANCELLED" ? (n(), i("div", yt, [
420
+ a[19] || (a[19] = s("div", { class: "fm-typo-en-body-md-600" }, "Import cancelled", -1)),
421
+ s("div", bt, r(t(e).summary.completed) + " rows were completed before cancellation. ", 1)
422
+ ])) : d("", !0)
423
+ ], 64)) : (n(), i(O, { key: 1 }, [
424
+ a[8] || (a[8] = Le('<div class="rounded-md bg-fm-color-system-warning-100 p-16"><div class="fm-typo-en-title-sm-800"> Import changes production data </div><div class="fm-typo-en-body-md-400 text-fm-color-typo-secondary"><div class="grid grid-cols-[auto_1fr] gap-x-8 gap-y-8"><span aria-hidden="true">•</span><span>The file is fully validated before any member is changed.</span><span aria-hidden="true">•</span><span>Keep the sample row and paste your members from row 3 onward.</span><span aria-hidden="true">•</span><span>Blank cells keep existing values.</span><span aria-hidden="true">•</span><span>Use <code>__CLEAR__</code> to clear supported fields.</span><span aria-hidden="true">•</span><span>Use day/month/year for every date column; day and month may have one or two digits, for example <code>1/12/1989</code>. The sample row adds <code>(DD/MM/YYYY)</code> as a reminder; omit it in member rows.</span><span aria-hidden="true">•</span><span>Credit without CreditExpiryDate remains normal and non-expiring.</span><span aria-hidden="true">•</span><span> Each title requires one matching positional expiry. Quote both comma-separated fields in CSV, for example <code>&quot;VIP,VVIP,SVIP&quot;</code> and <code>&quot;05/09/2026,06/09/2026,07/09/2026&quot;</code>. </span></div></div></div>', 1)),
425
+ u(p, {
426
+ modelValue: t(L).mode,
427
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => t(L).mode = l),
428
+ label: "Import mode",
429
+ items: q
430
+ }, null, 8, ["modelValue"]),
431
+ s("div", He, [
432
+ u($, null, {
433
+ "menu-button": N(() => [
434
+ u(v, {
435
+ variant: "tertiary",
436
+ icon: "download",
437
+ label: "Download template"
438
+ })
439
+ ]),
440
+ default: N(() => [
441
+ (n(), i(O, null, Q(j, (l) => u(C, {
442
+ key: l.value,
443
+ icon: l.icon,
444
+ label: l.label,
445
+ selectable: "",
446
+ onClick: (wt) => fe(l.value)
447
+ }, null, 8, ["icon", "label", "onClick"])), 64))
448
+ ]),
449
+ _: 1
450
+ })
451
+ ]),
452
+ t(f) ? (n(), i("div", Ge, [
453
+ u(v, {
454
+ variant: "tertiary",
455
+ "prepend-icon": "attach_file"
456
+ }),
457
+ s("p", qe, r(t(f).name), 1),
458
+ u(v, {
459
+ variant: "plain",
460
+ label: t(m)("Replace File"),
461
+ onClick: pe
462
+ }, null, 8, ["label"]),
463
+ s("input", {
464
+ ref_key: "replaceFileInput",
465
+ ref: E,
466
+ id: "member-import-file",
467
+ accept: ".csv, .xlsx",
468
+ class: "hidden",
469
+ type: "file",
470
+ onChange: me
471
+ }, null, 544)
472
+ ])) : (n(), k(Ee, {
473
+ key: 0,
474
+ accept: ".csv, .xlsx",
475
+ "max-file-size": 5e6,
476
+ onFileUpload: a[1] || (a[1] = (l) => f.value = l)
477
+ })),
478
+ u(U, {
479
+ "model-value": t(B),
480
+ value: "import-warnings",
481
+ label: "I have read and understand these import rules.",
482
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => B.value = l)
483
+ }, null, 8, ["model-value"])
484
+ ], 64)),
485
+ t(c) ? (n(), k(Ce, {
486
+ key: 3,
487
+ state: "error",
488
+ text: t(c)
489
+ }, null, 8, ["text"])) : d("", !0),
490
+ s("div", _t, [
491
+ t(e) && ["INVALID", "STOPPED", "COMPLETED", "CANCELLED"].includes(t(e).status) ? (n(), k(v, {
492
+ key: 0,
493
+ variant: "tertiary",
494
+ icon: "download",
495
+ label: "Download result",
496
+ disabled: t(e).summary.total === 0,
497
+ onClick: ke
498
+ }, null, 8, ["disabled"])) : d("", !0),
499
+ ((ee = t(e)) == null ? void 0 : ee.status) === "INVALID" ? (n(), k(v, {
500
+ key: 1,
501
+ variant: "tertiary",
502
+ label: "Choose another file",
503
+ onClick: _e
504
+ })) : d("", !0),
505
+ u(Te),
506
+ u(v, {
507
+ variant: "secondary",
508
+ label: "Close",
509
+ disabled: t(b),
510
+ onClick: a[7] || (a[7] = (l) => t(M).close())
511
+ }, null, 8, ["disabled"]),
512
+ t(e) && !["COMPLETED", "CANCELLED", "INVALID"].includes(t(e).status) ? (n(), k(v, {
513
+ key: 2,
514
+ variant: "secondary",
515
+ label: ((te = t(e)) == null ? void 0 : te.status) === "CANCELLING" ? "Cancelling…" : "Cancel import",
516
+ disabled: t(b) || ((ae = t(e)) == null ? void 0 : ae.status) === "CANCELLING",
517
+ onClick: we
518
+ }, null, 8, ["label", "disabled"])) : d("", !0),
519
+ t(e) ? d("", !0) : (n(), k(v, {
520
+ key: 3,
521
+ label: "Validate file",
522
+ disabled: !t(f) || !t(B) || t(b),
523
+ onClick: ve
524
+ }, null, 8, ["disabled"])),
525
+ ((oe = t(e)) == null ? void 0 : oe.status) === "READY" ? (n(), k(v, {
526
+ key: 4,
527
+ label: "Start import",
528
+ disabled: !t(K) || t(b),
529
+ onClick: ge
530
+ }, null, 8, ["disabled"])) : d("", !0),
531
+ ((se = t(e)) == null ? void 0 : se.status) === "STOPPED" ? (n(), k(v, {
532
+ key: 5,
533
+ label: "Retry import",
534
+ disabled: t(b) || !t(e).file,
535
+ onClick: he
536
+ }, null, 8, ["disabled"])) : d("", !0)
537
+ ])
538
+ ]);
539
+ };
540
+ }
541
+ }), ht = { class: "px-24 flex flex-col gap-y-16 pb-24" }, Ft = /* @__PURE__ */ J({
542
+ __name: "Member",
543
+ setup(G) {
544
+ const m = Oe(), { t: M } = ue(), D = de(), f = [
545
+ {
546
+ label: M("connect.loyalty.member.tabs.member_list"),
547
+ value: I["$connect-LOYALTY_MEMBER_LIST"]
548
+ }
549
+ ], E = P(() => {
550
+ var w, _, L;
551
+ const h = m.currentRoute.value.name;
552
+ return h == I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"] ? {
553
+ title: "Import history",
554
+ description: void 0,
555
+ backButton: !0,
556
+ onBackButton: async () => {
557
+ await m.push({
558
+ name: I["$connect-LOYALTY_MEMBER_LIST"]
559
+ });
560
+ }
561
+ } : h != I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
562
+ title: e.value.label,
563
+ description: void 0
564
+ } : (e.value = f[1], {
565
+ backButton: !0,
566
+ title: M("connect.loyalty.member.title"),
567
+ description: `${(w = c.value) == null ? void 0 : w.name} (${(_ = c.value) == null ? void 0 : _._id}) (${(L = c.value) == null ? void 0 : L.phoneNumber})`,
568
+ onBackButton: async () => {
569
+ await m.push({ name: I["$connect-LOYALTY_MEMBER_LIST"] });
570
+ }
571
+ });
572
+ }), e = g(
573
+ f.find((h) => h.value === m.currentRoute.value.name) ?? f[0]
574
+ ), c = g(), R = P(
575
+ () => m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_TRANSACTIONS"] || m.currentRoute.value.name === I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
576
+ ), B = P(
577
+ () => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_TRANSACTIONS"]
578
+ ), T = P(
579
+ () => m.currentRoute.value.name !== I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
580
+ );
581
+ async function x(h) {
582
+ await m.push({ name: h });
583
+ }
584
+ async function S() {
585
+ D.open({
586
+ title: "Import members",
587
+ closeButton: !1,
588
+ dismissAway: !1,
589
+ maxHeight: "90vh",
590
+ contentComponent: gt
591
+ });
592
+ }
593
+ async function b() {
594
+ await m.push({
595
+ name: I["$connect-LOYALTY_MEMBER_IMPORT_HISTORY"]
596
+ });
597
+ }
598
+ return Ne(
599
+ () => m.currentRoute.value.name,
600
+ async (h) => {
601
+ e.value = f.find((_) => _.value === h) ?? f[0];
602
+ const w = m.currentRoute.value.params.id;
603
+ w && (c.value = await A.readById(w));
604
+ },
605
+ { immediate: !0 }
606
+ ), (h, w) => {
607
+ const _ = y("FmButton"), L = y("FmPageHead"), q = y("FmTabs"), j = y("RouterView");
608
+ return n(), i(O, null, [
609
+ u(L, {
610
+ title: t(E).title,
611
+ description: t(E).description,
612
+ "back-button": t(E).backButton,
613
+ "onClick:back": t(E).onBackButton
614
+ }, Me({ _: 2 }, [
615
+ t(B) ? {
616
+ name: "append",
617
+ fn: N(() => [
618
+ u(Ye, null, {
619
+ default: N(() => [
620
+ t(T) ? (n(), k(_, {
621
+ key: 0,
622
+ label: "Import history",
623
+ "prepend-icon": "work_history",
624
+ variant: "tertiary",
625
+ onClick: b
626
+ })) : d("", !0),
627
+ u(_, {
628
+ label: t(M)("connect.loyalty.member.import"),
629
+ "prepend-icon": "download",
630
+ onClick: S
631
+ }, null, 8, ["label"])
632
+ ]),
633
+ _: 1
634
+ })
635
+ ]),
636
+ key: "0"
637
+ } : void 0
638
+ ]), 1032, ["title", "description", "back-button", "onClick:back"]),
639
+ s("div", ht, [
640
+ t(R) ? d("", !0) : (n(), k(q, {
641
+ key: 0,
642
+ "model-value": t(e).value,
643
+ items: f,
644
+ "onUpdate:modelValue": x
645
+ }, null, 8, ["model-value"])),
646
+ u(j)
647
+ ])
648
+ ], 64);
649
+ };
650
+ }
651
+ });
652
+ export {
653
+ Ft as default
654
+ };