@feedmepos/mf-connect 0.1.122-dev → 0.1.122-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 (148) hide show
  1. package/dist/{App-Otfhp3H1.js → App-BKnL7b6M.js} +493 -502
  2. package/dist/{Bin-B5aee7-4.js → Bin-BqqQF1h_.js} +8 -8
  3. package/dist/{Broadcast-BAQl4nEs.js → Broadcast-U5rJmhdd.js} +21 -22
  4. package/dist/{CampaignAnalytic-mc0rWnt4.js → CampaignAnalytic-ClwXxxzE.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C06IzthB.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DyeoWFcd.js} +9 -8
  6. package/dist/{Card-CoeclAye.js → Card-DKikDYES.js} +22 -22
  7. package/dist/{Collections-DIamDQDK.js → Collections-CD0xjFqI.js} +185 -197
  8. package/dist/{Credit-CoIPdhRy.js → Credit-BWcvFlb2.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-nI2oXZiR.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B2RizWP8.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D38JB0FV.js +3493 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZ42IxXy.js → EffectSheet.vue_vue_type_style_index_0_lang-Hr10pgqD.js} +16 -16
  12. package/dist/{Experience-bJSkl9Xm.js → Experience-dqXYj1Fv.js} +31 -32
  13. package/dist/{FileSaver.min-CFKCOdNt.js → FileSaver.min-DdJMn696.js} +1 -1
  14. package/dist/{Game-DMoyicRl.js → Game-BGQXqzck.js} +18 -19
  15. package/dist/{GiftCardSetup-B28jebxX.js → GiftCardSetup-C3MR25fp.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-il1_TmfZ.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-9dL1kVPG.js} +7 -7
  17. package/dist/{Goals-B9XRX-to.js → Goals-DA2jHEZa.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZH5In2V.js → ImageInput.vue_vue_type_script_setup_true_lang-_rlsNocb.js} +1 -1
  19. package/dist/{Index-BgGZBhf8.js → Index-WOvryalE.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-M6eRk_nC.js → LocationPicker.vue_vue_type_script_setup_true_lang-Bu1DjV9M.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DQCpH8dV.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DiLtSIXt.js} +1 -1
  22. package/dist/{LoyaltyDashboard-B-vMpAdx.js → LoyaltyDashboard-BKN2vBqc.js} +15 -15
  23. package/dist/{MainLayout-rv2xd7Yc.js → MainLayout-DizL-dxl.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BMwNt98l.js → MainLayout.vue_vue_type_script_setup_true_lang-El0YeLnE.js} +3 -3
  25. package/dist/{Marketing-Wu2M2xPV.js → Marketing-B77EoiCf.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-C5s0grZF.js → MarketingMaterialEdit-C_qFEur7.js} +211 -214
  27. package/dist/{Member-D02_98Yo.js → Member-TYDrU3Tk.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DGVDww0P.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BuzMeXR9.js} +47 -39
  29. package/dist/{MemberImportHistory-ZqjppSHQ.js → MemberImportHistory-l7dVJdEH.js} +7 -7
  30. package/dist/{MemberList-DpWX6mT9.js → MemberList-DiuyeJx_.js} +105 -103
  31. package/dist/{MemberTransactions-BiE7FtKT.js → MemberTransactions-BJ27Gd5P.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DUtNRTNB.js → MessageInput.vue_vue_type_script_setup_true_lang-so7LWtlv.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DD5GkLoA.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DgE7HPsT.js} +1 -1
  34. package/dist/{Mission-D3uyaxrt.js → Mission-C63hh8Ra.js} +21 -22
  35. package/dist/{Overview-C80up9Cz.js → Overview-CVdvQK6q.js} +20 -20
  36. package/dist/{Overview-Dzs2l9dt.js → Overview-DP-4Kpuj.js} +144 -145
  37. package/dist/{Point-CtyqLefg.js → Point-DXH4kJNQ.js} +21 -22
  38. package/dist/{Promotion-C1pB_Mup.js → Promotion-Cn-wAx6m.js} +131 -137
  39. package/dist/{Queue-DkmBLRMM.js → Queue-CEEUE-UT.js} +45 -45
  40. package/dist/{Record-B5onEmZr.js → Record-BFIjLKJD.js} +9 -9
  41. package/dist/{Review-fkpAgnWl.js → Review-BMRfKri0.js} +2 -2
  42. package/dist/ReviewFacebookCallback-CPYIC3RS.js +238 -0
  43. package/dist/{ReviewGoogleCallback-Cj9zmCme.js → ReviewGoogleCallback-Cflqv5Z5.js} +5 -5
  44. package/dist/{Reward-BNt4rJXG.js → Reward-C-qGtzpu.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJbD7izQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-kxJ5i8xe.js} +13 -13
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BlRmshrE.js +1884 -0
  47. package/dist/{Segment-9weq5m6d.js → Segment-Bx1pfw4Q.js} +306 -303
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-j_DlD4Uz.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-vuH9xdOi.js} +14 -14
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bq1XKmWl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CZHpyimI.js} +4 -4
  50. package/dist/Setting-CEcpuE_O.js +578 -0
  51. package/dist/{SettingAdvertisements-BdXfSnNM.js → SettingAdvertisements-CZlIQ5m_.js} +12 -12
  52. package/dist/Settings-CPLibjQy.js +179 -0
  53. package/dist/{Store-D3cAsGJ6.js → Store-BhZulzuc.js} +28 -28
  54. package/dist/{StoreRewards-C2y1M4Ps.js → StoreRewards-CvYgJVFU.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dqj5zIgi.js +1297 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang--Ii9ejFG.js +142 -0
  57. package/dist/{Tier-Dci8VbpH.js → Tier-BPPSaEe0.js} +687 -2575
  58. package/dist/{Title-D4BpqJPQ.js → Title-CccRUVZV.js} +94 -95
  59. package/dist/{Transaction-1biUZvIt.js → Transaction-ULzAt-u7.js} +2 -2
  60. package/dist/Upselling-D2tSUTkE.js +200 -0
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D7W1cxlp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CoqrSuWu.js} +26 -26
  62. package/dist/{Voucher-DSygKr_u.js → Voucher-Cz7IMRNl.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-JL1V_LbU.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BaxHZN76.js} +12 -12
  64. package/dist/{WhatsappAccount-CZ-js350.js → WhatsappAccount-BsxVHiZZ.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DBiqtHgs.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DJnkGMF1.js} +1 -1
  66. package/dist/{WhatsappBot-Bygdlech.js → WhatsappBot-sd6erVZk.js} +6 -6
  67. package/dist/{WhatsappBotLogs-BFLRYeQf.js → WhatsappBotLogs-DNbGWyOY.js} +6 -6
  68. package/dist/{WhatsappBotSettings-COZEGQxT.js → WhatsappBotSettings-DXa_e7-a.js} +4 -4
  69. package/dist/{WhatsappLayout-DEzbS1SP.js → WhatsappLayout-DvBPIB5f.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DUX8zJnw.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CRDouGvj.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BJFYIRZl.js → ZodTextField.vue_vue_type_script_setup_true_lang-B6BvSACt.js} +2 -2
  72. package/dist/{app-gGao9t7Z.js → app-4x06ItoL.js} +15017 -14861
  73. package/dist/app.js +3 -4
  74. package/dist/{base.export-cVWgL6vy.js → base.export-DS0xThWi.js} +2 -2
  75. package/dist/{business-DbDh-BxN.js → business-D0I7G-5H.js} +1 -1
  76. package/dist/{campaign-B9tq1vZv.js → campaign-BuJCjEH-.js} +94 -121
  77. package/dist/{campaign-D8jV7hA8.js → campaign-CC9U7rkr.js} +28 -34
  78. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  79. package/dist/campaign.fn-CLUOgMgc.js +776 -0
  80. package/dist/{collection.fn-DBfMa_P2.js → collection.fn-CUifllLR.js} +2 -2
  81. package/dist/{currency-SZSbDgAr.js → currency-BPhBDOpt.js} +1 -1
  82. package/dist/{effect-CVTuOMbk.js → effect-DKHOR-B3.js} +1 -1
  83. package/dist/{email-addresses-DpVS_e0D.js → email-addresses-B-VEReRV.js} +25 -25
  84. package/dist/{feature-flag-orm4I4-0.js → feature-flag-Cjl6gaO5.js} +185 -171
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-Ct1_-IEp.js → helper-CBLh1PWR.js} +1 -1
  87. package/dist/{index-Clg5CVmr.js → index-BBsqcXfJ.js} +1 -1
  88. package/dist/{index-NN_GXe7Q.js → index-B_iKSOXp.js} +1 -1
  89. package/dist/{index-BeGbQvrb.js → index-BwgjSrwa.js} +2 -2
  90. package/dist/{index-DW5cDL7l.js → index-BzKKNuLc.js} +2 -2
  91. package/dist/{index-Bz2GhZNd.js → index-C1QA2M4I.js} +10 -10
  92. package/dist/{index-uIOAK7Yt.js → index-CGcWs8B5.js} +462 -533
  93. package/dist/{index-CrluLS6Q.js → index-CWJi_hw-.js} +2 -2
  94. package/dist/{index-BUDFQtMG.js → index-D3B392A3.js} +3 -3
  95. package/dist/{index-CONIxgEK.js → index-DL_UYO4J.js} +234 -380
  96. package/dist/{index-B6hbCvzb.js → index-DenQ8DV4.js} +1 -1
  97. package/dist/{index-BOoNJIJh.js → index-Djf4TpYV.js} +23 -23
  98. package/dist/{index-DBpHsVZR.js → index-EpqQFMu2.js} +2614 -2699
  99. package/dist/{index-MlhU8ucu.js → index-Ob5I-Sex.js} +1 -1
  100. package/dist/{index-BXXLVdgj.js → index-RMsQnHez.js} +1 -1
  101. package/dist/{index-COAgKj0v.js → index-ZTC5k9Jb.js} +6 -19
  102. package/dist/{index-B2GJ653R.js → index-bc7bIIVP.js} +197 -197
  103. package/dist/{index-DFePTLAw.js → index-kClA31M9.js} +10 -10
  104. package/dist/{index-vfdh50L9.js → index-nnmfOPuw.js} +4 -4
  105. package/dist/{index-DCuUA8EI.js → index-umYXnOWc.js} +251 -608
  106. package/dist/{index-DwofBI5n.js → index-vqUiCeKb.js} +1 -1
  107. package/dist/{index.esm2017-ZSQn8C-d.js → index.esm2017-DMKkHR06.js} +111 -111
  108. package/dist/{loading-B-xDCOdo.js → loading-Cb4RgEo7.js} +1 -1
  109. package/dist/{lodash-DFW9UbwC.js → lodash-CMazTe9d.js} +1 -1
  110. package/dist/{member-import-J0fm9uzH.js → member-import-Df1y7FvX.js} +1 -1
  111. package/dist/{membership-B8KWhxBD.js → membership-yvDb2HS8.js} +2 -2
  112. package/dist/{money-CSIA5h2F.js → money-rs9shyUy.js} +1 -1
  113. package/dist/{number-mHKvdu_x.js → number-Ecq6MjRx.js} +1 -1
  114. package/dist/objectid-BVri-Vim.js +145 -0
  115. package/dist/{onboarding-CbvpduVK.js → onboarding-DugmLfNG.js} +36 -36
  116. package/dist/{onboardingSetup-pQHr4ATi.js → onboardingSetup-DMzNxJC4.js} +2 -2
  117. package/dist/{plugins-D_LhWxFb.js → plugins-CvhBJQEK.js} +3 -3
  118. package/dist/{reward-CFEIG_Fc.js → reward-BGUOUKZn.js} +1 -1
  119. package/dist/{rule-Dqxm0TiU.js → rule-C87YbT3F.js} +492 -572
  120. package/dist/rule-builder-lzMi7irV.js +102 -0
  121. package/dist/style.css +1 -1
  122. package/dist/template-BfFSbH04.js +275 -0
  123. package/dist/{timezone-CijbubTV.js → timezone-uP_heouv.js} +1 -1
  124. package/dist/{transaction.fn-Bg5w0js6.js → transaction.fn-CiGhIgzP.js} +2 -2
  125. package/dist/{trigger-Z2ynsa7k.js → trigger-dOOSh-Yp.js} +9 -9
  126. package/dist/{useMarketingMaterialActions-Dgm-u9Nu.js → useMarketingMaterialActions-BRenBblP.js} +4 -4
  127. package/dist/{usePagination-Dlw4BUF1.js → usePagination-DNOc8GFS.js} +1 -1
  128. package/dist/{user-BRNDlg4h.js → user-DTAGYy-F.js} +1 -1
  129. package/dist/vue-i18n-D8wuxuA4.js +2365 -0
  130. package/dist/{xlsx-CnlrcvXS.js → xlsx-BU0bDwTF.js} +1 -1
  131. package/dist/{zod-DPWT8J03.js → zod-mPFqdty8.js} +1 -1
  132. package/package.json +3 -7
  133. package/dist/AuditLogs-C4DQ624f.js +0 -2016
  134. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CXNf6M-7.js +0 -4439
  135. package/dist/Grab-CNXLDEKx.js +0 -301
  136. package/dist/ReviewFacebookCallback-CLeQP52t.js +0 -225
  137. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-ie0okvmi.js +0 -1923
  138. package/dist/Setting-DadiBCUq.js +0 -574
  139. package/dist/Settings-SF-Ai88W.js +0 -286
  140. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DX8nrBZd.js +0 -1319
  141. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CjBucvpJ.js +0 -7007
  142. package/dist/Upselling-BTqqiZlc.js +0 -1032
  143. package/dist/campaign.fn-DiQIanat.js +0 -776
  144. package/dist/duplicateCampaign-3K1VYqMD.js +0 -51
  145. package/dist/google-BQK68wbe.js +0 -5
  146. package/dist/objectid-BVNgDFLu.js +0 -145
  147. package/dist/template-BKPcMDwU.js +0 -227
  148. package/dist/vue-i18n-h2H0nxj-.js +0 -2365
@@ -1,14 +1,14 @@
1
1
  var de = Object.defineProperty;
2
- var ve = (m, u, d) => u in m ? de(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
3
- var st = (m, u, d) => ve(m, typeof u != "symbol" ? u + "" : u, d);
4
- import { ref as ht, readonly as Rt } from "vue";
5
- import { c as lt } from "./app-gGao9t7Z.js";
6
- import { useCoreStore as ae } from "@feedmepos/mf-common";
2
+ var ve = (g, u, d) => u in g ? de(g, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[u] = d;
3
+ var lt = (g, u, d) => ve(g, typeof u != "symbol" ? u + "" : u, d);
4
+ import { ref as ht, readonly as Ut } from "vue";
5
+ import { c as ut } from "./app-4x06ItoL.js";
6
+ import { useCoreStore as Dt } from "@feedmepos/mf-common";
7
7
  var Kt = { exports: {} };
8
- (function(m, u) {
8
+ (function(g, u) {
9
9
  (function(d, v) {
10
10
  v(u);
11
- })(lt, function(d) {
11
+ })(ut, function(d) {
12
12
  var v = { getItemSync: function(a) {
13
13
  try {
14
14
  return localStorage.getItem(a) || null;
@@ -41,24 +41,24 @@ var Kt = { exports: {} };
41
41
  };
42
42
  function T(a, e, t, i) {
43
43
  return new (t || (t = Promise))(function(n, r) {
44
- function o(f) {
44
+ function o(p) {
45
45
  try {
46
- h(i.next(f));
46
+ h(i.next(p));
47
47
  } catch (l) {
48
48
  r(l);
49
49
  }
50
50
  }
51
- function c(f) {
51
+ function c(p) {
52
52
  try {
53
- h(i.throw(f));
53
+ h(i.throw(p));
54
54
  } catch (l) {
55
55
  r(l);
56
56
  }
57
57
  }
58
- function h(f) {
58
+ function h(p) {
59
59
  var l;
60
- f.done ? n(f.value) : (l = f.value, l instanceof t ? l : new t(function(p) {
61
- p(l);
60
+ p.done ? n(p.value) : (l = p.value, l instanceof t ? l : new t(function(y) {
61
+ y(l);
62
62
  })).then(o, c);
63
63
  }
64
64
  h((i = i.apply(a, [])).next());
@@ -73,7 +73,7 @@ var Kt = { exports: {} };
73
73
  return this;
74
74
  }), r;
75
75
  function c(h) {
76
- return function(f) {
76
+ return function(p) {
77
77
  return function(l) {
78
78
  if (t) throw new TypeError("Generator is already executing.");
79
79
  for (; o; ) try {
@@ -112,14 +112,14 @@ var Kt = { exports: {} };
112
112
  continue;
113
113
  }
114
114
  l = e.call(a, o);
115
- } catch (p) {
116
- l = [6, p], i = 0;
115
+ } catch (y) {
116
+ l = [6, y], i = 0;
117
117
  } finally {
118
118
  t = n = 0;
119
119
  }
120
120
  if (5 & l[0]) throw l[1];
121
121
  return { value: l[0] ? l[1] : void 0, done: !0 };
122
- }([h, f]);
122
+ }([h, p]);
123
123
  };
124
124
  }
125
125
  }
@@ -127,7 +127,7 @@ var Kt = { exports: {} };
127
127
  for (var i, n = 0, r = e.length; n < r; n++) !i && n in e || (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
128
128
  return a.concat(i || Array.prototype.slice.call(e));
129
129
  }
130
- var it = function a(e, t) {
130
+ var at = function a(e, t) {
131
131
  if (e === t) return !0;
132
132
  if (e && t && typeof e == "object" && typeof t == "object") {
133
133
  if (e.constructor !== t.constructor) return !1;
@@ -153,13 +153,13 @@ var Kt = { exports: {} };
153
153
  function _(a, e) {
154
154
  var t = Object.keys(e || {}).filter(function(i) {
155
155
  var n = a == null ? void 0 : a[i], r = e == null ? void 0 : e[i];
156
- return !it(n, r);
156
+ return !at(n, r);
157
157
  });
158
158
  return Object.keys(a || {}).filter(function(i) {
159
159
  Object.keys(e || {}).includes(i) || t.push(i);
160
160
  }), Object.keys(t).length ? t : null;
161
161
  }
162
- var g, C;
162
+ var f, C;
163
163
  function b(a, e, t) {
164
164
  var i = "shortString", n = !0;
165
165
  typeof t == "number" && (i = "javaDouble", n = !1), a[i] = a[i] || {}, a[i][e] = n ? t + "" : t;
@@ -167,69 +167,69 @@ var Kt = { exports: {} };
167
167
  function G(a) {
168
168
  return !!a && typeof a == "object" && a.value !== void 0;
169
169
  }
170
- function at(a) {
170
+ function rt(a) {
171
171
  return Object.fromEntries(Object.entries(a).map(function(e) {
172
172
  var t = e[0], i = e[1];
173
173
  return [t, G(i) ? i : { value: i }];
174
174
  }));
175
175
  }
176
176
  function dt(a) {
177
- return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: at(a.identity.traits || {}) }) : void 0 });
177
+ return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: rt(a.identity.traits || {}) }) : void 0 });
178
178
  }
179
179
  (function(a) {
180
180
  a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
181
- })(g || (g = {}));
182
- var vt, w = null, se = "FLAGSMITH_EVENT", rt = se, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Bt = "flagsmith_trait_", le = function() {
181
+ })(f || (f = {}));
182
+ var vt, w = null, se = "FLAGSMITH_EVENT", ot = se, Bt = "https://edge.api.flagsmith.com/api/v1/", Ht = "flagsmith_value_", Vt = "flagsmith_enabled_", zt = "flagsmith_trait_", le = function() {
183
183
  function a(e) {
184
184
  var t = this;
185
185
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
186
186
  var i = t, n = i.api, r = i.evaluationContext;
187
187
  t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(s(s({}, t.loadingState), { isFetching: !0 }));
188
188
  var o = "".concat(t.getContext().identity), c = function(h) {
189
- var f, l, p, F;
189
+ var p, l, y, F;
190
190
  if (h && o === "".concat(t.getContext().identity)) {
191
- var P = h.flags, O = h.traits, j = h.identifier;
191
+ var R = h.flags, O = h.traits, j = h.identifier;
192
192
  t.isLoading = !1;
193
193
  var I = {}, A = {};
194
- O = O || [], (P = P || []).forEach(function(y) {
195
- I[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
196
- }), O.forEach(function(y) {
197
- A[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
194
+ O = O || [], (R = R || []).forEach(function(m) {
195
+ I[m.feature.name.toLowerCase().replace(/ /g, "_")] = { id: m.feature.id, enabled: m.enabled, value: m.feature_state_value };
196
+ }), O.forEach(function(m) {
197
+ A[m.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: m.transient, value: m.trait_value };
198
198
  }), t.oldFlags = s({}, t.flags);
199
- var k = _(t.oldFlags, I), Q = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, A);
200
- if ((j || Object.keys(A).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: A }), j && (t.evaluationContext.identity.identifier = j)), t.flags = I, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Q }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
199
+ var k = _(t.oldFlags, I), Q = _((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.traits, A);
200
+ if ((j || Object.keys(A).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: A }), j && (t.evaluationContext.identity.identifier = j)), t.flags = I, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Q }, t._loadedState(null, f.SERVER)), t.datadogRum) try {
201
201
  if (t.datadogRum.trackTraits) {
202
202
  var W = {};
203
- Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
204
- W[Bt + y] = t.getTrait(y);
203
+ Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(m) {
204
+ W[zt + m] = t.getTrait(m);
205
205
  });
206
- var $ = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.identifier) }), W);
206
+ var $ = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((y = t.evaluationContext.identity) === null || y === void 0 ? void 0 : y.identifier) }), W);
207
207
  t.log("Setting Datadog user", $), t.datadogRum.client.setUser($);
208
208
  }
209
- } catch (y) {
210
- console.error(y);
209
+ } catch (m) {
210
+ console.error(m);
211
211
  }
212
212
  if (t.dtrum) try {
213
213
  var E = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
214
- Object.keys(t.flags).map(function(y) {
215
- b(E, Gt + y, t.getValue(y, { skipAnalytics: !0 })), b(E, Jt + y, t.hasFeature(y, { skipAnalytics: !0 }));
216
- }), Object.keys(((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.traits) || {}).map(function(y) {
217
- b(E, Bt + y, t.getTrait(y));
214
+ Object.keys(t.flags).map(function(m) {
215
+ b(E, Ht + m, t.getValue(m, { skipAnalytics: !0 })), b(E, Vt + m, t.hasFeature(m, { skipAnalytics: !0 }));
216
+ }), Object.keys(((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.traits) || {}).map(function(m) {
217
+ b(E, zt + m, t.getTrait(m));
218
218
  }), t.log("Sending javaLongOrObject traits to dynatrace", E.javaLongOrObject), t.log("Sending date traits to dynatrace", E.date), t.log("Sending shortString traits to dynatrace", E.shortString), t.log("Sending javaDouble to dynatrace", E.javaDouble), t.dtrum.sendSessionProperties(E.javaLongOrObject, E.date, E.shortString, E.javaDouble);
219
- } catch (y) {
220
- console.error(y);
219
+ } catch (m) {
220
+ console.error(m);
221
221
  }
222
222
  }
223
223
  };
224
224
  return r.identity ? Promise.all([r.identity.traits && Object.keys(r.identity.traits).length || !r.identity.identifier ? t.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: r.identity.identifier, transient: r.identity.transient, traits: Object.entries(r.identity.traits).map(function(h) {
225
- var f = h[0], l = h[1];
226
- return { trait_key: f, trait_value: l == null ? void 0 : l.value, transient: l == null ? void 0 : l.transient };
225
+ var p = h[0], l = h[1];
226
+ return { trait_key: p, trait_value: l == null ? void 0 : l.value, transient: l == null ? void 0 : l.transient };
227
227
  }).filter(function(h) {
228
228
  return h.trait_value !== void 0 || (t.log("Warning - attempted to set an undefined trait value for key", h.trait_key), !1);
229
229
  }) })) : t.getJSON(n + "identities/?identifier=" + encodeURIComponent(r.identity.identifier) + (r.identity.transient ? "&transient=true" : ""))]).then(function(h) {
230
230
  return t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: {} }), c(h == null ? void 0 : h[0]);
231
231
  }).catch(function(h) {
232
- var f = h.message, l = new Error(f);
232
+ var p = h.message, l = new Error(p);
233
233
  return Promise.reject(l);
234
234
  }) : t.getJSON(n + "flags/").then(function(h) {
235
235
  return c({ flags: h, traits: void 0 });
@@ -244,7 +244,7 @@ var Kt = { exports: {} };
244
244
  }).catch(function(n) {
245
245
  t.log("Exception fetching evaluationEvent", n);
246
246
  }) : void 0;
247
- }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: g.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(i, n, r) {
247
+ }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: f.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(i, n, r) {
248
248
  var o = t.flags && t.flags[i.toLowerCase().replace(/ /g, "_")], c = null;
249
249
  if (o && (c = o.value), n != null && n.skipAnalytics || r || t.evaluateFlag(i, "VALUE"), c === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
250
250
  if (n != null && n.json) try {
@@ -271,7 +271,7 @@ var Kt = { exports: {} };
271
271
  return t.setContext(s(s({}, t.getContext()), i));
272
272
  }, this.setTrait = function(i, n) {
273
273
  var r;
274
- if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), at(Object.fromEntries([[i, n]]))) }) }));
274
+ if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), rt(Object.fromEntries([[i, n]]))) }) }));
275
275
  }, this.setTraits = function(i) {
276
276
  var n;
277
277
  if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (n = t.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(i).map(function(r) {
@@ -288,13 +288,13 @@ var Kt = { exports: {} };
288
288
  }, this.getJSON = function(i, n, r) {
289
289
  var o, c = t;
290
290
  c.evaluationContext;
291
- var h = c.headers, f = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
292
- t.evaluationContext.environment && (f.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (f.headers["Content-Type"] = "application/json; charset=utf-8"), h && Object.assign(f.headers, h), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
291
+ var h = c.headers, p = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
292
+ t.evaluationContext.environment && (p.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (p.headers["Content-Type"] = "application/json; charset=utf-8"), h && Object.assign(p.headers, h), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
293
293
  var l = "".concat((o = t.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
294
- return C(i, f).then(function(p) {
295
- var F, P, O = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
294
+ return C(i, p).then(function(y) {
295
+ var F, R, O = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
296
296
  if (l === O) {
297
- var j = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
297
+ var j = (R = y.headers) === null || R === void 0 ? void 0 : R.get("x-flagsmith-document-updated-at");
298
298
  if (j) try {
299
299
  var I = parseFloat(j);
300
300
  if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
@@ -302,19 +302,19 @@ var Kt = { exports: {} };
302
302
  } catch (A) {
303
303
  t.log(A, "Failed to parse x-flagsmith-document-updated-at", j);
304
304
  }
305
- return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(A) {
305
+ return t.log("Fetch response: " + y.status + " " + (n || "GET") + 0 + i), y.text().then(function(A) {
306
306
  var k = A;
307
307
  try {
308
308
  k = JSON.parse(A);
309
309
  } catch {
310
310
  }
311
- return !k && p.status && (k = "API Response: ".concat(p.status)), p.status && p.status >= 200 && p.status < 300 ? k : Promise.reject(new Error(k));
311
+ return !k && y.status && (k = "API Response: ".concat(y.status)), y.status && y.status >= 200 && y.status < 300 ? k : Promise.reject(new Error(k));
312
312
  });
313
313
  }
314
314
  t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(O));
315
315
  });
316
316
  }, this.evaluateFlag = function(i, n) {
317
- if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(Gt + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Jt + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
317
+ if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(Ht + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Vt + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
318
318
  if (!t.evaluationEvent || !t.evaluationContext.environment) return;
319
319
  t.evaluationEvent[t.evaluationContext.environment.apiKey] || (t.evaluationEvent[t.evaluationContext.environment.apiKey] = {}), t.evaluationEvent[t.evaluationContext.environment.apiKey][i] === void 0 && (t.evaluationEvent[t.evaluationContext.environment.apiKey][i] = 0), t.evaluationEvent[t.evaluationContext.environment.apiKey][i] += 1;
320
320
  }
@@ -322,72 +322,72 @@ var Kt = { exports: {} };
322
322
  }, this._onChange = function(i, n, r) {
323
323
  var o, c;
324
324
  t.setLoadingState(r), (o = t.onChange) === null || o === void 0 || o.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
325
- }, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : lt === null || lt === void 0 ? void 0 : lt.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (vt = e.eventSource), e.AsyncStorage && (w = e.AsyncStorage);
325
+ }, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : ut === null || ut === void 0 ? void 0 : ut.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (vt = e.eventSource), e.AsyncStorage && (w = e.AsyncStorage);
326
326
  }
327
327
  return a.prototype.init = function(e) {
328
328
  var t, i, n;
329
329
  return T(this, void 0, void 0, function() {
330
- var r, o, c, h, f, l, p, F, P, O, j, I, A, k, Q, W, $, E, y, ft, tt, Xt, q, pt, Zt, Yt, yt, Qt, mt, et, X, Wt, x = this;
330
+ var r, o, c, h, p, l, y, F, R, O, j, I, A, k, Q, W, $, E, m, ft, tt, Qt, X, pt, Wt, te, yt, ee, mt, et, q, ne, x = this;
331
331
  return z(this, function(N) {
332
332
  switch (N.label) {
333
333
  case 0:
334
334
  r = dt(e.evaluationContext || this.evaluationContext), N.label = 1;
335
335
  case 1:
336
- if (N.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ? Dt : c, f = e.headers, l = e.onChange, p = e.cacheFlags, F = e.datadogRum, P = e.onError, O = e.defaultFlags, j = e.fetch, I = e.preventFetch, A = e.enableLogs, k = e.enableDynatrace, Q = e.enableAnalytics, W = e.realtime, $ = e.eventSourceUrl, E = $ === void 0 ? "https://realtime.flagsmith.com/" : $, y = e.AsyncStorage, ft = e.identity, tt = e.traits, Xt = e.state, q = e.cacheOptions, pt = e.angularHttpClient, Zt = e._trigger, Yt = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
336
+ if (N.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ? Bt : c, p = e.headers, l = e.onChange, y = e.cacheFlags, F = e.datadogRum, R = e.onError, O = e.defaultFlags, j = e.fetch, I = e.preventFetch, A = e.enableLogs, k = e.enableDynatrace, Q = e.enableAnalytics, W = e.realtime, $ = e.eventSourceUrl, E = $ === void 0 ? "https://realtime.flagsmith.com/" : $, m = e.AsyncStorage, ft = e.identity, tt = e.traits, Qt = e.state, X = e.cacheOptions, pt = e.angularHttpClient, Wt = e._trigger, te = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
337
337
  if (r.identity = ft || tt ? { identifier: ft, traits: tt ? Object.fromEntries(Object.entries(tt).map(function(L) {
338
338
  return [L[0], { value: L[1] }];
339
- })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, yt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Yt || this._triggerLoadingState, this.onError = function(L) {
340
- x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })), P == null || P(L);
341
- }, this.enableLogs = A || !1, this.cacheOptions = q ? { skipAPI: !!q.skipAPI, ttl: q.ttl || 0, storageKey: q.storageKey, loadStale: !!q.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), j && (C = j), this.enableAnalytics = Q || !1, this.flags = Object.assign({}, O) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = w !== void 0 && !!p, rt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (w = y), W && typeof window < "u" && this.setupRealtime(E, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(Xt), this.log("Initialising with properties", e, this), k && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), pt && (C = /* @__PURE__ */ function(L) {
342
- return function(U, R) {
343
- var B = R.headers, S = R.method, Z = R.body;
344
- return new Promise(function(H) {
339
+ })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = p, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, yt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Wt || this._trigger, this._triggerLoadingState = te || this._triggerLoadingState, this.onError = function(L) {
340
+ x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })), R == null || R(L);
341
+ }, this.enableLogs = A || !1, this.cacheOptions = X ? { skipAPI: !!X.skipAPI, ttl: X.ttl || 0, storageKey: X.storageKey, loadStale: !!X.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), j && (C = j), this.enableAnalytics = Q || !1, this.flags = Object.assign({}, O) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = w !== void 0 && !!y, ot = "FLAGSMITH_EVENT_" + r.environment.apiKey, m && (w = m), W && typeof window < "u" && this.setupRealtime(E, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: f.DEFAULT_FLAGS })), this.setState(Qt), this.log("Initialising with properties", e, this), k && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), pt && (C = /* @__PURE__ */ function(L) {
342
+ return function(P, U) {
343
+ var H = U.headers, S = U.method, Y = U.body;
344
+ return new Promise(function(M) {
345
345
  switch (S) {
346
346
  case "GET":
347
- return L.get(U, { headers: B }).subscribe(function(J) {
348
- H({ ok: !0, text: function() {
347
+ return L.get(P, { headers: H }).subscribe(function(J) {
348
+ M({ ok: !0, text: function() {
349
349
  return Promise.resolve(J);
350
350
  } });
351
351
  });
352
352
  case "POST":
353
353
  case "PUT":
354
- return L.post(U, Z, { headers: B }).subscribe(function(J) {
355
- H({ ok: !0, text: function() {
354
+ return L.post(P, Y, { headers: H }).subscribe(function(J) {
355
+ M({ ok: !0, text: function() {
356
356
  return Promise.resolve(J);
357
357
  } });
358
358
  });
359
359
  }
360
360
  });
361
361
  };
362
- }(pt)), w && this.canUseStorage && w.getItem(rt).then(function(L) {
362
+ }(pt)), w && this.canUseStorage && w.getItem(ot).then(function(L) {
363
363
  try {
364
364
  x.evaluationEvent = JSON.parse(L) || {};
365
365
  } catch {
366
366
  x.evaluationEvent = {};
367
367
  }
368
368
  x.analyticsInterval = setInterval(x.analyticsFlags, x.ticks);
369
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(rt, function(L, U) {
370
- if (U && x.evaluationContext.environment) {
371
- var R = JSON.parse(U);
372
- if (R[x.evaluationContext.environment.apiKey]) {
373
- var B = x.getState();
374
- x.log("Retrieved events from cache", U), x.setState(s(s({}, B), { evaluationEvent: R[x.evaluationContext.environment.apiKey] }));
369
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(ot, function(L, P) {
370
+ if (P && x.evaluationContext.environment) {
371
+ var U = JSON.parse(P);
372
+ if (U[x.evaluationContext.environment.apiKey]) {
373
+ var H = x.getState();
374
+ x.log("Retrieved events from cache", P), x.setState(s(s({}, H), { evaluationEvent: U[x.evaluationContext.environment.apiKey] }));
375
375
  }
376
376
  }
377
- })), !p) return [3, 9];
377
+ })), !y) return [3, 9];
378
378
  if (!w || !this.canUseStorage) return [3, 8];
379
- Qt = function(L, U) {
379
+ ee = function(L, P) {
380
380
  return T(x, void 0, void 0, function() {
381
- var R, B, S, Z, H, J, St, te, Ct, bt, _t, Ft, Et, xt, wt, Ot, It, At, Lt, jt, Nt, Tt, Pt, kt, ee = this;
381
+ var U, H, S, Y, M, J, St, ie, Ct, bt, _t, Ft, Et, xt, wt, Ot, It, At, Lt, jt, Nt, Tt, Rt, kt, ae = this;
382
382
  return z(this, function(V) {
383
383
  switch (V.label) {
384
384
  case 0:
385
- if (!U) return [3, 7];
386
- R = null, B = null, V.label = 1;
385
+ if (!P) return [3, 7];
386
+ U = null, H = null, V.label = 1;
387
387
  case 1:
388
- return V.trys.push([1, 5, , 6]), S = JSON.parse(U), Z = !1, H = !1, S && S.api === this.api && ((bt = (Ct = S.evaluationContext) === null || Ct === void 0 ? void 0 : Ct.environment) === null || bt === void 0 ? void 0 : bt.apiKey) === ((_t = this.evaluationContext.environment) === null || _t === void 0 ? void 0 : _t.apiKey) && (J = !0, this.evaluationContext.identity && ((Et = (Ft = S.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((wt = (xt = S.evaluationContext) === null || xt === void 0 ? void 0 : xt.identity) === null || wt === void 0 ? void 0 : wt.identifier) + " to " + this.evaluationContext.identity.identifier), J = !1), this.cacheOptions.ttl && (!S.ts || (/* @__PURE__ */ new Date()).valueOf() - S.ts > this.cacheOptions.ttl) && (S.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), J = !1) : S.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), H = !0, J = !0)), J && (Z = !0, B = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (At = (It = S.evaluationContext) === null || It === void 0 ? void 0 : It.identity) === null || At === void 0 ? void 0 : At.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: dt(s(s({}, S.evaluationContext), { identity: !((Lt = S.evaluationContext) === null || Lt === void 0) && Lt.identity ? s(s({}, (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: s(s({}, ((Tt = (Nt = S.evaluationContext) === null || Nt === void 0 ? void 0 : Nt.identity) === null || Tt === void 0 ? void 0 : Tt.traits) || {}), tt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), Z ? (St = !I && (!this.cacheOptions.skipAPI || H), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: B }, this._loadedState(null, g.CACHE, St)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Z && !H && this.log("Skipping API, using cache"), St && this.getFlags().catch(function(he) {
389
- var Ut;
390
- (Ut = ee.onError) === null || Ut === void 0 || Ut.call(ee, he);
388
+ return V.trys.push([1, 5, , 6]), S = JSON.parse(P), Y = !1, M = !1, S && S.api === this.api && ((bt = (Ct = S.evaluationContext) === null || Ct === void 0 ? void 0 : Ct.environment) === null || bt === void 0 ? void 0 : bt.apiKey) === ((_t = this.evaluationContext.environment) === null || _t === void 0 ? void 0 : _t.apiKey) && (J = !0, this.evaluationContext.identity && ((Et = (Ft = S.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((wt = (xt = S.evaluationContext) === null || xt === void 0 ? void 0 : xt.identity) === null || wt === void 0 ? void 0 : wt.identifier) + " to " + this.evaluationContext.identity.identifier), J = !1), this.cacheOptions.ttl && (!S.ts || (/* @__PURE__ */ new Date()).valueOf() - S.ts > this.cacheOptions.ttl) && (S.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), J = !1) : S.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), M = !0, J = !0)), J && (Y = !0, H = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (At = (It = S.evaluationContext) === null || It === void 0 ? void 0 : It.identity) === null || At === void 0 ? void 0 : At.traits), U = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: dt(s(s({}, S.evaluationContext), { identity: !((Lt = S.evaluationContext) === null || Lt === void 0) && Lt.identity ? s(s({}, (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: s(s({}, ((Tt = (Nt = S.evaluationContext) === null || Nt === void 0 ? void 0 : Nt.identity) === null || Tt === void 0 ? void 0 : Tt.traits) || {}), tt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), Y ? (St = !I && (!this.cacheOptions.skipAPI || M), this._onChange(null, { isFromServer: !1, flagsChanged: U, traitsChanged: H }, this._loadedState(null, f.CACHE, St)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Y && !M && this.log("Skipping API, using cache"), St && this.getFlags().catch(function(he) {
389
+ var Pt;
390
+ (Pt = ae.onError) === null || Pt === void 0 || Pt.call(ae, he);
391
391
  }), [3, 4]) : [3, 2];
392
392
  case 2:
393
393
  return I ? [3, 4] : [4, this.getFlags()];
@@ -396,7 +396,7 @@ var Kt = { exports: {} };
396
396
  case 4:
397
397
  return [3, 6];
398
398
  case 5:
399
- return te = V.sent(), this.log("Exception fetching cached logs", te), [3, 6];
399
+ return ie = V.sent(), this.log("Exception fetching cached logs", ie), [3, 6];
400
400
  case 6:
401
401
  return [3, 10];
402
402
  case 7:
@@ -404,10 +404,10 @@ var Kt = { exports: {} };
404
404
  case 8:
405
405
  return V.sent(), [3, 10];
406
406
  case 9:
407
- if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Pt = this.evaluationContext.identity) === null || Pt === void 0 ? void 0 : Pt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
407
+ if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Rt = this.evaluationContext.identity) === null || Rt === void 0 ? void 0 : Rt.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
408
408
  else {
409
409
  if (!this.flags) throw new Error(yt);
410
- this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
410
+ this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
411
411
  }
412
412
  V.label = 10;
413
413
  case 10:
@@ -423,7 +423,7 @@ var Kt = { exports: {} };
423
423
  case 4:
424
424
  mt = N.sent(), N.label = 5;
425
425
  case 5:
426
- return [4, Qt(null, mt)];
426
+ return [4, ee(null, mt)];
427
427
  case 6:
428
428
  case 7:
429
429
  return N.sent(), [3, 8];
@@ -434,13 +434,13 @@ var Kt = { exports: {} };
434
434
  case 10:
435
435
  return N.sent(), [3, 12];
436
436
  case 11:
437
- if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, O), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
438
- else if (this.flags && (et = null, Object.keys(this.flags).length === 0 && (et = yt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(et, g.DEFAULT_FLAGS)), et)) throw new Error(et);
437
+ if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, O), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
438
+ else if (this.flags && (et = null, Object.keys(this.flags).length === 0 && (et = yt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(et, f.DEFAULT_FLAGS)), et)) throw new Error(et);
439
439
  N.label = 12;
440
440
  case 12:
441
441
  return [3, 14];
442
442
  case 13:
443
- throw X = N.sent(), this.log("Error during initialisation ", X), Wt = X instanceof Error ? X : new Error("".concat(X)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), X;
443
+ throw q = N.sent(), this.log("Error during initialisation ", q), ne = q instanceof Error ? q : new Error("".concat(q)), (n = this.onError) === null || n === void 0 || n.call(this, ne), q;
444
444
  case 14:
445
445
  return [2];
446
446
  }
@@ -456,7 +456,7 @@ var Kt = { exports: {} };
456
456
  }, a.prototype.getState = function() {
457
457
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
458
458
  }, a.prototype.setState = function(e) {
459
- e && (this.initialised = !0, this.api = e.api || this.api || Dt, this.flags = e.flags || this.flags, this.evaluationContext = e.evaluationContext || this.evaluationContext, this.evaluationEvent = e.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
459
+ e && (this.initialised = !0, this.api = e.api || this.api || Bt, this.flags = e.flags || this.flags, this.evaluationContext = e.evaluationContext || this.evaluationContext, this.evaluationEvent = e.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
460
460
  }, a.prototype.logout = function() {
461
461
  return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
462
462
  }, a.prototype.startListening = function(e) {
@@ -477,13 +477,13 @@ var Kt = { exports: {} };
477
477
  }, a.prototype.updateEventStorage = function() {
478
478
  if (this.enableAnalytics) {
479
479
  var e = JSON.stringify(this.getState().evaluationEvent);
480
- w.setItem(rt, e).catch(function(t) {
480
+ w.setItem(ot, e).catch(function(t) {
481
481
  return console.error("Flagsmith: Error setting item in async storage", t);
482
482
  });
483
483
  }
484
484
  }, a.prototype.setLoadingState = function(e) {
485
485
  var t;
486
- it(e, this.loadingState) || (this.loadingState = s({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
486
+ at(e, this.loadingState) || (this.loadingState = s({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
487
487
  }, a.prototype.setupRealtime = function(e, t) {
488
488
  var i = this, n = e + "sse/environments/" + t + "/stream";
489
489
  vt ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new vt(n), this.eventSource.addEventListener("environment_updated", function(r) {
@@ -497,30 +497,30 @@ var Kt = { exports: {} };
497
497
  })) : this.log("Error, EventSource is undefined");
498
498
  }, a;
499
499
  }();
500
- function Vt(a) {
500
+ function Mt(a) {
501
501
  var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
502
502
  return new le({ fetch: e, AsyncStorage: t, eventSource: i });
503
503
  }
504
- var ot, ue = (ot = function(a, e) {
505
- return ot = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
504
+ var st, ue = (st = function(a, e) {
505
+ return st = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
506
506
  t.__proto__ = i;
507
507
  } || function(t, i) {
508
508
  for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
509
- }, ot(a, e);
509
+ }, st(a, e);
510
510
  }, function(a, e) {
511
511
  if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
512
512
  function t() {
513
513
  this.constructor = a;
514
514
  }
515
- ot(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
516
- }), zt = function(a) {
515
+ st(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
516
+ }), $t = function(a) {
517
517
  var e = typeof Symbol == "function" && Symbol.iterator, t = e && a[e], i = 0;
518
518
  if (t) return t.call(a);
519
519
  if (a && typeof a.length == "number") return { next: function() {
520
520
  return a && i >= a.length && (a = void 0), { value: a && a[i++], done: !a };
521
521
  } };
522
522
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
523
- }, Ht = function(a, e) {
523
+ }, Xt = function(a, e) {
524
524
  var t = typeof Symbol == "function" && a[Symbol.iterator];
525
525
  if (!t) return a;
526
526
  var i, n, r = t.call(a), o = [];
@@ -545,7 +545,7 @@ var Kt = { exports: {} };
545
545
  Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
546
546
  }
547
547
  return ue(e, a), e;
548
- }(Error), Mt = function() {
548
+ }(Error), qt = function() {
549
549
  function a(e, t) {
550
550
  var i = this;
551
551
  if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = t != null ? Object.assign({}, t) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = e.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new ce();
@@ -565,7 +565,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
565
565
  i.onmessage(h);
566
566
  };
567
567
  try {
568
- for (var r = zt(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
568
+ for (var r = $t(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
569
569
  var c = o.value;
570
570
  this._eventSource.addEventListener(c, this._onevent_wrapped);
571
571
  }
@@ -594,7 +594,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
594
594
  e && e.lastEventId && (this._lastEventId = e.lastEventId);
595
595
  var n = this._listeners[e.type];
596
596
  if (n != null) try {
597
- for (var r = zt(gt([], Ht(n), !1)), o = r.next(); !o.done; o = r.next())
597
+ for (var r = $t(gt([], Xt(n), !1)), o = r.next(); !o.done; o = r.next())
598
598
  o.value.call(this, e);
599
599
  } catch (c) {
600
600
  t = { error: c };
@@ -614,7 +614,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
614
614
  }, a.prototype.addEventListener = function(e, t, i) {
615
615
  this._listeners[e] == null && (this._listeners[e] = [], this._eventSource != null && this._eventSource.addEventListener(e, this._onevent_wrapped));
616
616
  var n = this._listeners[e];
617
- n.includes(t) || (this._listeners[e] = gt(gt([], Ht(n), !1), [t], !1));
617
+ n.includes(t) || (this._listeners[e] = gt(gt([], Xt(n), !1), [t], !1));
618
618
  }, a.prototype.removeEventListener = function(e, t, i) {
619
619
  var n = this._listeners[e];
620
620
  this._listeners[e] = n.filter(function(r) {
@@ -623,7 +623,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
623
623
  }, a;
624
624
  }();
625
625
  globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
626
- var $t = function(a, e) {
626
+ var Yt = function(a, e) {
627
627
  return e = e || {}, new Promise(function(t, i) {
628
628
  var n = new XMLHttpRequest(), r = [], o = [], c = {}, h = function() {
629
629
  return { ok: (n.status / 100 | 0) == 2, statusText: n.statusText, status: n.status, url: n.responseURL, text: function() {
@@ -642,17 +642,17 @@ Consider loading an EventSource polyfill and making it available globally as Eve
642
642
  return l.toLowerCase() in c;
643
643
  } } };
644
644
  };
645
- for (var f in n.open(e.method || "get", a, !0), n.onload = function() {
646
- n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, p, F) {
647
- r.push(p = p.toLowerCase()), o.push([p, F]), c[p] = c[p] ? c[p] + "," + F : F;
645
+ for (var p in n.open(e.method || "get", a, !0), n.onload = function() {
646
+ n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(l, y, F) {
647
+ r.push(y = y.toLowerCase()), o.push([y, F]), c[y] = c[y] ? c[y] + "," + F : F;
648
648
  }), t(h());
649
- }, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(f, e.headers[f]);
649
+ }, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(p, e.headers[p]);
650
650
  n.send(e.body || null);
651
651
  });
652
- }, qt = Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
653
- typeof window < "u" && (window.flagsmith = qt), d.createFlagsmithInstance = function() {
654
- return Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
655
- }, d.default = qt, Object.defineProperty(d, "__esModule", { value: !0 });
652
+ }, Zt = Mt({ AsyncStorage: v, fetch: Yt, eventSource: qt });
653
+ typeof window < "u" && (window.flagsmith = Zt), d.createFlagsmithInstance = function() {
654
+ return Mt({ AsyncStorage: v, fetch: Yt, eventSource: qt });
655
+ }, d.default = Zt, Object.defineProperty(d, "__esModule", { value: !0 });
656
656
  });
657
657
  })(Kt, Kt.exports);
658
658
  var ge = Kt.exports, fe = {
@@ -661,10 +661,10 @@ var ge = Kt.exports, fe = {
661
661
  FETCH_FAILED: "Failed to fetch Flagsmith configuration",
662
662
  NO_USER_CONTEXT: "User context not set. Call setUser() first.",
663
663
  ALREADY_INITIALIZED: "FeatureFlag is already initialized."
664
- }, ne = "business", K, pe = (K = class {
664
+ }, re = "business", K, pe = (K = class {
665
665
  constructor() {
666
- st(this, "flagsmithClient", null);
667
- st(this, "userContext", null);
666
+ lt(this, "flagsmithClient", null);
667
+ lt(this, "userContext", null);
668
668
  }
669
669
  static getInstance() {
670
670
  return K.instance || (K.instance = new K()), K.instance;
@@ -763,122 +763,136 @@ var ge = Kt.exports, fe = {
763
763
  reset() {
764
764
  this.flagsmithClient = null, this.userContext = null;
765
765
  }
766
- }, st(K, "instance"), K), ye = pe.getInstance(), nt = ht(!1), ut = ht([]), Y = ht(null);
767
- function me(m = ye) {
768
- const u = () => nt.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (g, C = []) => {
766
+ }, lt(K, "instance"), K), ye = pe.getInstance(), nt = ht(!1), ct = ht([]), Z = ht(null);
767
+ function me(g = ye) {
768
+ const u = () => nt.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (f, C = []) => {
769
769
  if (nt.value) {
770
770
  console.warn("FeatureFlag is already initialized.");
771
771
  return;
772
772
  }
773
773
  try {
774
- await m.init(g, C), ut.value = await m.getFlags(), nt.value = !0, Y.value = null;
774
+ await g.init(f, C), ct.value = await g.getFlags(), nt.value = !0, Z.value = null;
775
775
  } catch (b) {
776
- console.error("Failed to initialize feature flags:", b), Y.value = b;
776
+ console.error("Failed to initialize feature flags:", b), Z.value = b;
777
777
  }
778
- }, v = async (g) => {
778
+ }, v = async (f) => {
779
779
  if (u())
780
780
  try {
781
- await m.setUser(g), ut.value = await m.getFlags(), Y.value = null;
781
+ await g.setUser(f), ct.value = await g.getFlags(), Z.value = null;
782
782
  } catch (C) {
783
- console.error("Failed to set user:", C), Y.value = C;
783
+ console.error("Failed to set user:", C), Z.value = C;
784
784
  }
785
- }, s = async (g) => v(`${ne}-${g}`), T = (g, C, b = null) => {
785
+ }, s = async (f) => v(`${re}-${f}`), T = (f, C, b = null) => {
786
786
  if (!u()) return b;
787
787
  try {
788
- return m.getFlagValue(g, C) ?? b;
788
+ return g.getFlagValue(f, C) ?? b;
789
789
  } catch (G) {
790
- return console.error(`Error getting flag value for ${g}:`, G), b;
790
+ return console.error(`Error getting flag value for ${f}:`, G), b;
791
791
  }
792
- }, z = (g, C) => {
792
+ }, z = (f, C) => {
793
793
  if (!u()) return C ?? null;
794
794
  try {
795
- return m.getFlag(g) ?? C ?? null;
795
+ return g.getFlag(f) ?? C ?? null;
796
796
  } catch (b) {
797
- return console.error(`Error getting flag for ${g}:`, b), C ?? null;
797
+ return console.error(`Error getting flag for ${f}:`, b), C ?? null;
798
798
  }
799
- }, D = async (g, C, b = null, G) => {
799
+ }, D = async (f, C, b = null, G) => {
800
800
  if (!u()) return b;
801
801
  try {
802
- return await m.getUserFlagValue(g, C, b, G);
803
- } catch (at) {
804
- return console.error(`Error getting user flag value for ${C}:`, at), b;
802
+ return await g.getUserFlagValue(f, C, b, G);
803
+ } catch (rt) {
804
+ return console.error(`Error getting user flag value for ${C}:`, rt), b;
805
805
  }
806
- }, it = async (g, C, b = null, G) => D(`${ne}-${g}`, C, b, G), _ = () => {
806
+ }, at = async (f, C, b = null, G) => D(`${re}-${f}`, C, b, G), _ = () => {
807
807
  try {
808
- m.reset();
809
- } catch (g) {
810
- console.error("Error resetting feature flags:", g);
808
+ g.reset();
809
+ } catch (f) {
810
+ console.error("Error resetting feature flags:", f);
811
811
  } finally {
812
- ut.value = [], nt.value = !1, Y.value = null;
812
+ ct.value = [], nt.value = !1, Z.value = null;
813
813
  }
814
814
  };
815
815
  return {
816
- flags: Rt(ut),
817
- isInitialized: Rt(nt),
818
- error: Rt(Y),
816
+ flags: Ut(ct),
817
+ isInitialized: Ut(nt),
818
+ error: Ut(Z),
819
819
  init: d,
820
820
  setUser: v,
821
821
  setBusiness: s,
822
822
  getFlagValue: T,
823
823
  getFlag: z,
824
824
  getUserFlagValue: D,
825
- getBusinessFlagValue: it,
825
+ getBusinessFlagValue: at,
826
826
  reset: _
827
827
  };
828
828
  }
829
829
  var Se = () => me();
830
- function re(m, u) {
831
- if (!(m != null && m.enabled)) return !1;
832
- const d = (m.value ?? "").split(",").map((v) => v.trim().toUpperCase()).filter(Boolean);
830
+ function Gt(g, u) {
831
+ if (!(g != null && g.enabled)) return !1;
832
+ const d = (g.value ?? "").split(",").map((v) => v.trim().toUpperCase()).filter(Boolean);
833
833
  return !d.length || d.includes("*") ? !0 : !!u && d.includes(u.toUpperCase());
834
834
  }
835
- var Ce = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", featureFlagApiKey: "MaGoXrEWuEJNpWgKTqseee" };
836
- const ct = {
835
+ var Ce = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476", featureFlagApiKey: "6GhcttsJ9Rj9cTevcdrpin" };
836
+ const it = {
837
837
  broadcastAppInbox: "connect_broadcast_app_inbox_countries",
838
838
  broadcastPush: "connect_broadcast_push_countries",
839
839
  broadcastWhatsapp: "connect_broadcast_whatsapp_countries",
840
- whatsappBot: "connect_whatsapp_bot"
840
+ whatsappBot: "connect_whatsapp_bot",
841
+ autoRevertReward: "connect_auto_revert_reward_countries"
841
842
  }, be = {
842
- APP_INBOX: ct.broadcastAppInbox,
843
- PUSH: ct.broadcastPush,
844
- WHATSAPP: ct.broadcastWhatsapp
843
+ APP_INBOX: it.broadcastAppInbox,
844
+ PUSH: it.broadcastPush,
845
+ WHATSAPP: it.broadcastWhatsapp
845
846
  }, {
846
847
  init: _e,
847
848
  isInitialized: Fe,
848
849
  setBusiness: Ee,
849
- flags: oe,
850
- error: ie
851
- } = Se(), M = ht("loading");
852
- async function Ae(m) {
853
- M.value = "loading";
850
+ flags: Jt,
851
+ error: oe
852
+ } = Se(), B = ht("loading");
853
+ async function Ae(g) {
854
+ B.value = "loading";
854
855
  try {
855
- if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(m), ie.value) throw ie.value;
856
- M.value = "ready";
856
+ if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(g), oe.value) throw oe.value;
857
+ B.value = "ready";
857
858
  } catch (u) {
858
- M.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
859
+ B.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
859
860
  }
860
861
  }
861
862
  function Le() {
862
- const m = ae();
863
+ const g = Dt();
863
864
  return () => {
864
- if (M.value === "loading") return "loading";
865
- if (M.value === "error") return "off";
866
- const u = oe.value.find((d) => d.feature.name === ct.whatsappBot);
867
- return re(u, m.currentCountry.value) ? "on" : "off";
865
+ if (B.value === "loading") return "loading";
866
+ if (B.value === "error") return "off";
867
+ const u = Jt.value.find((d) => d.feature.name === it.whatsappBot);
868
+ return Gt(u, g.currentCountry.value) ? "on" : "off";
868
869
  };
869
870
  }
870
871
  function je() {
871
- const m = ae();
872
+ const g = Dt();
872
873
  return (u) => {
873
874
  const d = be[u];
874
- return d ? M.value === "loading" ? "loading" : M.value === "error" ? "off" : re(
875
- oe.value.find((v) => v.feature.name === d),
876
- m.currentCountry.value
875
+ return d ? B.value === "loading" ? "loading" : B.value === "error" ? "off" : Gt(
876
+ Jt.value.find((v) => v.feature.name === d),
877
+ g.currentCountry.value
877
878
  ) ? "on" : "off" : "on";
878
879
  };
879
880
  }
881
+ function Ne() {
882
+ const g = Dt();
883
+ return () => {
884
+ if (B.value === "loading") return "loading";
885
+ if (B.value === "error" || !g.currentCountry.value)
886
+ return "off";
887
+ const u = Jt.value.find(
888
+ (d) => d.feature.name === it.autoRevertReward
889
+ );
890
+ return typeof (u == null ? void 0 : u.value) == "string" && u.value.split(",").some((d) => d.trim()) && Gt(u, g.currentCountry.value) ? "on" : "off";
891
+ };
892
+ }
880
893
  export {
881
894
  je as a,
895
+ Ne as b,
882
896
  Ae as l,
883
897
  Le as u
884
898
  };