@feedmepos/mf-connect 0.1.116-dev → 0.1.117-dev

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 (134) hide show
  1. package/README.md +42 -44
  2. package/dist/{App-DWDgsBqW.js → App-BpcsgH7K.js} +380 -397
  3. package/dist/{AuditLogs-BqEtvKFs.js → AuditLogs-BNnUiVnD.js} +12 -12
  4. package/dist/{Bin-Cz6fmewG.js → Bin-Cm0wjQeR.js} +8 -8
  5. package/dist/{Broadcast-CQ0pfKpx.js → Broadcast-BoJaHqnO.js} +12 -12
  6. package/dist/{CampaignAnalytic-CiRCB3kh.js → CampaignAnalytic-Eg4xZW0B.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bp7UeQWJ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js} +8 -8
  8. package/dist/{Card-Kw2PFL2m.js → Card-BfkMcFaG.js} +22 -22
  9. package/dist/{Collections-D8Vx_EEH.js → Collections-RXmxQbII.js} +8 -8
  10. package/dist/{Credit-B1jsQ5zg.js → Credit-CsRPM1jv.js} +12 -12
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B6Fpf8zy.js → DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js} +1 -1
  12. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW1RntIP.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js} +35 -35
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Cdpr9Ku4.js → EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js} +6 -6
  14. package/dist/{Experience-B0JIA3sL.js → Experience-BC8Pj-v9.js} +13 -13
  15. package/dist/{FileSaver.min-M-9kTN8q.js → FileSaver.min-DzmoQFA0.js} +1 -1
  16. package/dist/{Game-CNJyqnK3.js → Game-DJXNHFBs.js} +13 -13
  17. package/dist/{GiftCardSetup-DSQIC7fD.js → GiftCardSetup-_0n8lU-t.js} +10 -10
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ABiLOF1j.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js} +7 -7
  19. package/dist/{Goals-DBPzGIRK.js → Goals-DSZwKpds.js} +4 -4
  20. package/dist/{Grab-CGWinKBS.js → Grab-DDc7e-AC.js} +9 -9
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B2edB52s.js → ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js} +1 -1
  22. package/dist/{Index-CiWyZXnK.js → Index-Cbi0bquE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DnP03_b7.js → LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DM17LaNE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js} +1 -1
  25. package/dist/{LoyaltyDashboard-C4ZlK9Hv.js → LoyaltyDashboard-fK90c27A.js} +15 -15
  26. package/dist/{MainLayout-D22Q2_jN.js → MainLayout-Bf-l9yL4.js} +1 -1
  27. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CJncINki.js → MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js} +3 -3
  28. package/dist/{Marketing-CmVnvEN6.js → Marketing-B7cZGsO-.js} +4 -4
  29. package/dist/{MarketingMaterialEdit-CQ55zG-W.js → MarketingMaterialEdit-5IcV2ct6.js} +6 -6
  30. package/dist/{Member-B-l5P9jk.js → Member-BGTrRVdq.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C_ZjHH4I.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js} +23 -23
  32. package/dist/{MemberImportHistory-BJcu-ahG.js → MemberImportHistory--FxkTJmu.js} +7 -7
  33. package/dist/{MemberList-DVsWNWIc.js → MemberList-EjY5dgwt.js} +14 -14
  34. package/dist/{MemberTransactions-C2VPySEO.js → MemberTransactions-Oia7LIFK.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BXqrn9tg.js → MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js} +10 -10
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BouFp66T.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js} +1 -1
  37. package/dist/{Mission-DWO-IF0f.js → Mission-BFHYb4aT.js} +14 -14
  38. package/dist/{Overview-DPcWm2S0.js → Overview-BVNyQxFL.js} +20 -20
  39. package/dist/{Overview-Dbp4Sv-H.js → Overview-d5U37aot.js} +4 -4
  40. package/dist/{Point-PnWrzVOY.js → Point-CXkqH02Z.js} +14 -14
  41. package/dist/{Promotion-Bwpi60dN.js → Promotion-DdxNvlOO.js} +14 -14
  42. package/dist/{Queue-BvEcKyVJ.js → Queue-C96oNKyP.js} +12 -12
  43. package/dist/{Record-DzNvU2fM.js → Record-Bj2e2Y4i.js} +9 -9
  44. package/dist/{Review-HDYwnMd6.js → Review-CJK5S1oI.js} +2 -2
  45. package/dist/{ReviewFacebookCallback-rAlgcTQ_.js → ReviewFacebookCallback-ChG7TRy5.js} +5 -5
  46. package/dist/{ReviewGoogleCallback-6V9JNKsl.js → ReviewGoogleCallback-Dmk4VyGA.js} +5 -5
  47. package/dist/{Reward-DI6IyG-d.js → Reward-Dh2YI0Xb.js} +16 -16
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DFAIPMe7.js → RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js} +13 -13
  49. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CDoba0oG.js → RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js} +14 -14
  50. package/dist/{Segment-DrV6pQyx.js → Segment-FYvtCkqH.js} +25 -25
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CXHt_ZeT.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js} +14 -14
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-XRXkLy6j.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js} +4 -4
  53. package/dist/{Setting-aLQCUCP9.js → Setting-CUAWjCqa.js} +14 -14
  54. package/dist/{SettingAdvertisements-BtqKt4Ca.js → SettingAdvertisements-COIQwUD6.js} +12 -12
  55. package/dist/{Settings-BkYtKb4l.js → Settings-D2gFPvmW.js} +5 -5
  56. package/dist/{Store-HZs9GG03.js → Store-BAXwiyvx.js} +26 -26
  57. package/dist/{StoreRewards-BSTXL4FR.js → StoreRewards-2mUavtUg.js} +15 -15
  58. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D9nykzc3.js → StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js} +24 -24
  59. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DBnHk6jn.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js} +2 -2
  60. package/dist/{Tier-Ka0rbjC_.js → Tier-BmAOzRHL.js} +26 -26
  61. package/dist/{Title-7jvrf34J.js → Title-DMxiUg30.js} +22 -22
  62. package/dist/{Transaction-D-M3udf5.js → Transaction-CF6hXEpN.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CrlpuElX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js} +6 -6
  64. package/dist/{Voucher-BZCLPyDk.js → Voucher-DrtITxq-.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C_MOMFkX.js → VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js} +12 -12
  66. package/dist/{WhatsappAccount-BG0dIroG.js → WhatsappAccount-Bb0Y7ikk.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Co05OXon.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js} +1 -1
  68. package/dist/{WhatsappBot-O5h5UKXz.js → WhatsappBot-DNvvaPey.js} +6 -6
  69. package/dist/{WhatsappBotLogs-BOPTuu6o.js → WhatsappBotLogs-C8M-1pvv.js} +6 -6
  70. package/dist/{WhatsappBotSettings-BSiIvpGO.js → WhatsappBotSettings-D6egqUyU.js} +4 -4
  71. package/dist/WhatsappLayout-DeQTPuF6.js +21 -0
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DJdi7dV6.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Do4GTTKx.js → ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js} +2 -2
  74. package/dist/{app-CEe3kSZM.js → app-BjdLqYQq.js} +69 -69
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-BjSdr85q.js → base.export-B68z5BF6.js} +2 -2
  77. package/dist/{business-CJjiItSo.js → business-D9fgkHxb.js} +1 -1
  78. package/dist/{campaign-D4MWLs1D.js → campaign-Dw_ujovr.js} +8 -8
  79. package/dist/{campaign-DEXq52fE.js → campaign-eMaPX8r6.js} +2 -2
  80. package/dist/{campaign.fn-DiadKjES.js → campaign.fn-DFjGNvmN.js} +20 -20
  81. package/dist/{collection.fn-CfqIdnSS.js → collection.fn-CCOWtB-c.js} +2 -2
  82. package/dist/{currency-CPB6E_s-.js → currency-CTLKReFC.js} +1 -1
  83. package/dist/{duplicateCampaign-BzWvsZwc.js → duplicateCampaign-BcpBfUGL.js} +2 -2
  84. package/dist/{effect-DFodA5mh.js → effect-CTI1ZH57.js} +1 -1
  85. package/dist/{email-addresses-C0CwgNs_.js → email-addresses-B74e3bnB.js} +2 -2
  86. package/dist/{feature-flag-Bap2oi_S.js → feature-flag-DVdEaChJ.js} +156 -140
  87. package/dist/{helper-DKKsSb2o.js → helper-as9K-piK.js} +1 -1
  88. package/dist/{index-CJGb1iJi.js → index-3LjKJhQa.js} +1 -1
  89. package/dist/{index-DDmpyI6z.js → index-8mBfDn3M.js} +7 -7
  90. package/dist/{index-CFZMwKR6.js → index-B0h0iYWP.js} +2 -2
  91. package/dist/{index-BS6725ZB.js → index-BEKMTiFb.js} +3 -3
  92. package/dist/{index-CXqPYmyv.js → index-BW7FoVEA.js} +1 -1
  93. package/dist/{index-BWsGYTzB.js → index-B_wRpO02.js} +2 -2
  94. package/dist/{index-CEFEuMOF.js → index-Ba719MYq.js} +1 -1
  95. package/dist/{index-DxmlvoHV.js → index-BbVbqe4Y.js} +2 -2
  96. package/dist/{index-C_4eW8Sr.js → index-BhTrG89b.js} +4 -4
  97. package/dist/{index-D5veZ8LP.js → index-C5V6u2Qd.js} +2 -2
  98. package/dist/{index-DRnUcSVN.js → index-CHU3UePP.js} +1 -1
  99. package/dist/{index-CfqmNZUH.js → index-CQxkDpX0.js} +4 -4
  100. package/dist/{index-RUdMURTx.js → index-CWLOcQ6j.js} +8 -8
  101. package/dist/{index-CtwPthW5.js → index-Ckz6u3ac.js} +2 -2
  102. package/dist/{index-BJCirs9i.js → index-Czg-2Ni0.js} +3 -3
  103. package/dist/{index-qAQiQd-s.js → index-DKI8401o.js} +2 -2
  104. package/dist/{index-4LQanFJi.js → index-DcZiikOH.js} +2 -2
  105. package/dist/{index-BdGo-qgB.js → index-QHqcSN2q.js} +1 -1
  106. package/dist/{index-DFV2ydYE.js → index-TAoQpeLQ.js} +1 -1
  107. package/dist/{index-C1C21iKU.js → index-wsCCqwdr.js} +1 -1
  108. package/dist/{index.esm2017-i1myv90H.js → index.esm2017-DL6rTGDW.js} +1 -1
  109. package/dist/{loading-BAFiJnEb.js → loading-x6IScY4K.js} +1 -1
  110. package/dist/{lodash-De2KDgqX.js → lodash-nwnDizYo.js} +1 -1
  111. package/dist/{member-import-BP4RZGbA.js → member-import-C-b01Tyd.js} +1 -1
  112. package/dist/{membership-CQWw-rTa.js → membership-DfarOMtO.js} +2 -2
  113. package/dist/{money-rwjWYzdi.js → money-CFn-jR4W.js} +1 -1
  114. package/dist/{number-DwSvkBpS.js → number-CSlyDL2x.js} +1 -1
  115. package/dist/objectid-zcT6ESET.js +145 -0
  116. package/dist/{onboarding-u7cpl6k3.js → onboarding-DyaFaaF2.js} +3 -3
  117. package/dist/{onboardingSetup-DoxDlcVN.js → onboardingSetup-DQt91O9f.js} +2 -2
  118. package/dist/{plugins-CKaeoHSK.js → plugins-DEHr0UOe.js} +3 -3
  119. package/dist/{reward-BasbGRWt.js → reward-Du_Pv-4p.js} +1 -1
  120. package/dist/{rule-IN41b-qE.js → rule-DfqmQTVK.js} +9 -9
  121. package/dist/{template-3Nu_MAMG.js → template-CcbNF4PF.js} +6 -6
  122. package/dist/{timezone-C68y8HiI.js → timezone-_4tabIaK.js} +1 -1
  123. package/dist/{transaction.fn-Ckxm2gof.js → transaction.fn-C46PHwCV.js} +2 -2
  124. package/dist/{trigger-xA8j3s9B.js → trigger-Dipr6btC.js} +5 -5
  125. package/dist/{useMarketingMaterialActions-ClYoBaFw.js → useMarketingMaterialActions-BAw2ZjeF.js} +4 -4
  126. package/dist/{usePagination-CIRxyVr8.js → usePagination-D6RZ18zS.js} +1 -1
  127. package/dist/{user-PTTQTMyQ.js → user-BCexQj3Q.js} +1 -1
  128. package/dist/{vue-i18n-DYnrLWFT.js → vue-i18n-DXvyTCZf.js} +109 -109
  129. package/dist/{xlsx-l0AsOrP1.js → xlsx-BTxt_Jg6.js} +166 -166
  130. package/dist/{zod-Bm1pKYLC.js → zod-T4wMYjWT.js} +1 -1
  131. package/package.json +1 -1
  132. package/dist/WhatsappLayout-DLVIfkzJ.js +0 -21
  133. package/dist/feature-flag--GbS6Qn_.js +0 -50
  134. package/dist/objectid-DtEPzPd_.js +0 -145
@@ -1,14 +1,14 @@
1
- var le = Object.defineProperty;
2
- var ue = (m, u, d) => u in m ? le(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
3
- var ot = (m, u, d) => ue(m, typeof u != "symbol" ? u + "" : u, d);
4
- import { ref as ut, readonly as kt } from "vue";
5
- import { c as st } from "./app-CEe3kSZM.js";
6
- import { useCoreStore as ce } from "@feedmepos/mf-common";
7
- var Rt = { exports: {} };
1
+ var ce = Object.defineProperty;
2
+ var he = (m, u, d) => u in m ? ce(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
3
+ var st = (m, u, d) => he(m, typeof u != "symbol" ? u + "" : u, d);
4
+ import { ref as ct, readonly as Ut } from "vue";
5
+ import { c as lt } from "./app-BjdLqYQq.js";
6
+ import { useCoreStore as de } from "@feedmepos/mf-common";
7
+ var Kt = { exports: {} };
8
8
  (function(m, u) {
9
9
  (function(d, v) {
10
10
  v(u);
11
- })(st, function(d) {
11
+ })(lt, function(d) {
12
12
  var v = { getItemSync: function(a) {
13
13
  try {
14
14
  return localStorage.getItem(a) || null;
@@ -39,7 +39,7 @@ var Rt = { exports: {} };
39
39
  return a;
40
40
  }, s.apply(this, arguments);
41
41
  };
42
- function T(a, e, t, i) {
42
+ function w(a, e, t, i) {
43
43
  return new (t || (t = Promise))(function(n, r) {
44
44
  function o(f) {
45
45
  try {
@@ -127,7 +127,7 @@ var Rt = { 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 nt = function a(e, t) {
130
+ var it = 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,7 +153,7 @@ var Rt = { 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 !nt(n, r);
156
+ return !it(n, r);
157
157
  });
158
158
  return Object.keys(a || {}).filter(function(i) {
159
159
  Object.keys(e || {}).includes(i) || t.push(i);
@@ -167,19 +167,19 @@ var Rt = { exports: {} };
167
167
  function G(a) {
168
168
  return !!a && typeof a == "object" && a.value !== void 0;
169
169
  }
170
- function it(a) {
170
+ function at(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
- function ct(a) {
177
- return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: it(a.identity.traits || {}) }) : void 0 });
176
+ function ht(a) {
177
+ return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: at(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
181
  })(g || (g = {}));
182
- var ht, O = null, ie = "FLAGSMITH_EVENT", at = ie, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Vt = "flagsmith_trait_", ae = function() {
182
+ var dt, O = null, re = "FLAGSMITH_EVENT", rt = re, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Vt = "flagsmith_trait_", oe = 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() {
@@ -188,16 +188,16 @@ var Rt = { exports: {} };
188
188
  var o = "".concat(t.getContext().identity), c = function(h) {
189
189
  var f, l, p, F;
190
190
  if (h && o === "".concat(t.getContext().identity)) {
191
- var P = h.flags, w = h.traits, j = h.identifier;
191
+ var P = h.flags, I = h.traits, N = h.identifier;
192
192
  t.isLoading = !1;
193
- var I = {}, A = {};
194
- w = w || [], (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
- }), w.forEach(function(y) {
197
- A[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
193
+ var A = {}, L = {};
194
+ I = I || [], (P = P || []).forEach(function(y) {
195
+ A[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
196
+ }), I.forEach(function(y) {
197
+ L[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
198
198
  }), t.oldFlags = s({}, t.flags);
199
- var k = _(t.oldFlags, I), Y = _((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: Y }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
199
+ var k = _(t.oldFlags, A), Y = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, L);
200
+ if ((N || Object.keys(L).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: L }), N && (t.evaluationContext.identity.identifier = N)), t.flags = A, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Y }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
201
201
  if (t.datadogRum.trackTraits) {
202
202
  var Q = {};
203
203
  Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
@@ -263,7 +263,7 @@ var Rt = { exports: {} };
263
263
  return [r, o == null ? void 0 : o.value];
264
264
  }));
265
265
  }, this.setContext = function(i) {
266
- var n = ct(i);
266
+ var n = ht(i);
267
267
  return t.evaluationContext = s(s({}, n), { environment: n.environment || t.evaluationContext.environment }), t.initialised ? t.getFlags() : Promise.resolve();
268
268
  }, this.getContext = function() {
269
269
  return t.evaluationContext;
@@ -271,7 +271,7 @@ var Rt = { 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), it(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), at(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) {
@@ -292,26 +292,26 @@ var Rt = { exports: {} };
292
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.");
293
293
  var l = "".concat((o = t.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
294
294
  return C(i, f).then(function(p) {
295
- var F, P, w = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
296
- if (l === w) {
297
- var j = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
298
- if (j) try {
299
- var I = parseFloat(j);
300
- if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
- t.timestamp = I;
302
- } catch (A) {
303
- t.log(A, "Failed to parse x-flagsmith-document-updated-at", j);
295
+ var F, P, I = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
296
+ if (l === I) {
297
+ var N = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
298
+ if (N) try {
299
+ var A = parseFloat(N);
300
+ if (isNaN(A)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
+ t.timestamp = A;
302
+ } catch (L) {
303
+ t.log(L, "Failed to parse x-flagsmith-document-updated-at", N);
304
304
  }
305
- return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(A) {
306
- var k = A;
305
+ return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(L) {
306
+ var k = L;
307
307
  try {
308
- k = JSON.parse(A);
308
+ k = JSON.parse(L);
309
309
  } catch {
310
310
  }
311
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));
312
312
  });
313
313
  }
314
- t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(w));
314
+ t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(I));
315
315
  });
316
316
  }, this.evaluateFlag = function(i, n) {
317
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) {
@@ -322,36 +322,36 @@ var Rt = { 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 : st === null || st === void 0 ? void 0 : st.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (ht = e.eventSource), e.AsyncStorage && (O = e.AsyncStorage);
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 && (dt = e.eventSource), e.AsyncStorage && (O = e.AsyncStorage);
326
326
  }
327
327
  return a.prototype.init = function(e) {
328
328
  var t, i, n;
329
- return T(this, void 0, void 0, function() {
330
- var r, o, c, h, f, l, p, F, P, w, j, I, A, k, Y, Q, M, E, y, vt, W, Xt, $, gt, Zt, Yt, ft, Qt, pt, tt, q, Wt, x = this;
331
- return H(this, function(N) {
332
- switch (N.label) {
329
+ return w(this, void 0, void 0, function() {
330
+ var r, o, c, h, f, l, p, F, P, I, N, A, L, k, Y, Q, M, E, y, gt, W, Xt, $, ft, Zt, Yt, pt, Qt, yt, tt, q, Wt, x = this;
331
+ return H(this, function(T) {
332
+ switch (T.label) {
333
333
  case 0:
334
- r = ct(e.evaluationContext || this.evaluationContext), N.label = 1;
334
+ r = ht(e.evaluationContext || this.evaluationContext), T.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, w = e.defaultFlags, j = e.fetch, I = e.preventFetch, A = e.enableLogs, k = e.enableDynatrace, Y = e.enableAnalytics, Q = e.realtime, M = e.eventSourceUrl, E = M === void 0 ? "https://realtime.flagsmith.com/" : M, y = e.AsyncStorage, vt = e.identity, W = e.traits, Xt = e.state, $ = e.cacheOptions, gt = 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`");
337
- if (r.identity = vt || W ? { identifier: vt, traits: W ? Object.fromEntries(Object.entries(W).map(function(L) {
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, ft = "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 = $ ? { skipAPI: !!$.skipAPI, ttl: $.ttl || 0, storageKey: $.storageKey, loadStale: !!$.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 = Y || !1, this.flags = Object.assign({}, w) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = O !== void 0 && !!p, at = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (O = y), Q && 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), gt && (C = /* @__PURE__ */ function(L) {
336
+ if (T.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, I = e.defaultFlags, N = e.fetch, A = e.preventFetch, L = e.enableLogs, k = e.enableDynatrace, Y = e.enableAnalytics, Q = e.realtime, M = e.eventSourceUrl, E = M === void 0 ? "https://realtime.flagsmith.com/" : M, y = e.AsyncStorage, gt = e.identity, W = e.traits, Xt = e.state, $ = e.cacheOptions, ft = 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`");
337
+ if (r.identity = gt || W ? { identifier: gt, traits: W ? Object.fromEntries(Object.entries(W).map(function(j) {
338
+ return [j[0], { value: j[1] }];
339
+ })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, pt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Yt || this._triggerLoadingState, this.onError = function(j) {
340
+ x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: j })), P == null || P(j);
341
+ }, this.enableLogs = L || !1, this.cacheOptions = $ ? { skipAPI: !!$.skipAPI, ttl: $.ttl || 0, storageKey: $.storageKey, loadStale: !!$.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."), N && (C = N), this.enableAnalytics = Y || !1, this.flags = Object.assign({}, I) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = O !== void 0 && !!p, rt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (O = y), Q && 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), ft && (C = /* @__PURE__ */ function(j) {
342
342
  return function(U, R) {
343
343
  var V = R.headers, S = R.method, X = R.body;
344
344
  return new Promise(function(B) {
345
345
  switch (S) {
346
346
  case "GET":
347
- return L.get(U, { headers: V }).subscribe(function(J) {
347
+ return j.get(U, { headers: V }).subscribe(function(J) {
348
348
  B({ 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, X, { headers: V }).subscribe(function(J) {
354
+ return j.post(U, X, { headers: V }).subscribe(function(J) {
355
355
  B({ ok: !0, text: function() {
356
356
  return Promise.resolve(J);
357
357
  } });
@@ -359,14 +359,14 @@ var Rt = { exports: {} };
359
359
  }
360
360
  });
361
361
  };
362
- }(gt)), O && this.canUseStorage && O.getItem(at).then(function(L) {
362
+ }(ft)), O && this.canUseStorage && O.getItem(rt).then(function(j) {
363
363
  try {
364
- x.evaluationEvent = JSON.parse(L) || {};
364
+ x.evaluationEvent = JSON.parse(j) || {};
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), O && this.canUseStorage && O.getItem(at, function(L, U) {
369
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), O && this.canUseStorage && O.getItem(rt, function(j, U) {
370
370
  if (U && x.evaluationContext.environment) {
371
371
  var R = JSON.parse(U);
372
372
  if (R[x.evaluationContext.environment.apiKey]) {
@@ -376,21 +376,21 @@ var Rt = { exports: {} };
376
376
  }
377
377
  })), !p) return [3, 9];
378
378
  if (!O || !this.canUseStorage) return [3, 8];
379
- Qt = function(L, U) {
380
- return T(x, void 0, void 0, function() {
381
- var R, V, S, X, B, J, yt, te, mt, St, Ct, bt, _t, Ft, Et, xt, Ot, wt, It, At, Lt, jt, Nt, Tt, ee = this;
379
+ Qt = function(j, U) {
380
+ return w(x, void 0, void 0, function() {
381
+ var R, V, S, X, B, J, mt, te, St, Ct, bt, _t, Ft, Et, xt, Ot, wt, It, At, Lt, jt, Nt, Tt, Pt, ee = this;
382
382
  return H(this, function(z) {
383
383
  switch (z.label) {
384
384
  case 0:
385
385
  if (!U) return [3, 7];
386
386
  R = null, V = null, z.label = 1;
387
387
  case 1:
388
- return z.trys.push([1, 5, , 6]), S = JSON.parse(U), X = !1, B = !1, S && S.api === this.api && ((St = (mt = S.evaluationContext) === null || mt === void 0 ? void 0 : mt.environment) === null || St === void 0 ? void 0 : St.apiKey) === ((Ct = this.evaluationContext.environment) === null || Ct === void 0 ? void 0 : Ct.apiKey) && (J = !0, this.evaluationContext.identity && ((_t = (bt = S.evaluationContext) === null || bt === void 0 ? void 0 : bt.identity) === null || _t === void 0 ? void 0 : _t.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Et = (Ft = S.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.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"), B = !0, J = !0)), J && (X = !0, V = _((xt = this.evaluationContext.identity) === null || xt === void 0 ? void 0 : xt.traits, (wt = (Ot = S.evaluationContext) === null || Ot === void 0 ? void 0 : Ot.identity) === null || wt === void 0 ? void 0 : wt.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: ct(s(s({}, S.evaluationContext), { identity: !((It = S.evaluationContext) === null || It === void 0) && It.identity ? s(s({}, (At = S.evaluationContext) === null || At === void 0 ? void 0 : At.identity), { traits: s(s({}, ((jt = (Lt = S.evaluationContext) === null || Lt === void 0 ? void 0 : Lt.identity) === null || jt === void 0 ? void 0 : jt.traits) || {}), W || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), X ? (yt = !I && (!this.cacheOptions.skipAPI || B), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: V }, this._loadedState(null, g.CACHE, yt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && X && !B && this.log("Skipping API, using cache"), yt && this.getFlags().catch(function(se) {
389
- var Pt;
390
- (Pt = ee.onError) === null || Pt === void 0 || Pt.call(ee, se);
388
+ return z.trys.push([1, 5, , 6]), S = JSON.parse(U), X = !1, B = !1, S && S.api === this.api && ((Ct = (St = S.evaluationContext) === null || St === void 0 ? void 0 : St.environment) === null || Ct === void 0 ? void 0 : Ct.apiKey) === ((bt = this.evaluationContext.environment) === null || bt === void 0 ? void 0 : bt.apiKey) && (J = !0, this.evaluationContext.identity && ((Ft = (_t = S.evaluationContext) === null || _t === void 0 ? void 0 : _t.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((xt = (Et = S.evaluationContext) === null || Et === void 0 ? void 0 : Et.identity) === null || xt === void 0 ? void 0 : xt.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"), B = !0, J = !0)), J && (X = !0, V = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (It = (wt = S.evaluationContext) === null || wt === void 0 ? void 0 : wt.identity) === null || It === void 0 ? void 0 : It.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: ht(s(s({}, S.evaluationContext), { identity: !((At = S.evaluationContext) === null || At === void 0) && At.identity ? s(s({}, (Lt = S.evaluationContext) === null || Lt === void 0 ? void 0 : Lt.identity), { traits: s(s({}, ((Nt = (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity) === null || Nt === void 0 ? void 0 : Nt.traits) || {}), W || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), X ? (mt = !A && (!this.cacheOptions.skipAPI || B), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: V }, this._loadedState(null, g.CACHE, mt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && X && !B && this.log("Skipping API, using cache"), mt && this.getFlags().catch(function(ue) {
389
+ var kt;
390
+ (kt = ee.onError) === null || kt === void 0 || kt.call(ee, ue);
391
391
  }), [3, 4]) : [3, 2];
392
392
  case 2:
393
- return I ? [3, 4] : [4, this.getFlags()];
393
+ return A ? [3, 4] : [4, this.getFlags()];
394
394
  case 3:
395
395
  z.sent(), z.label = 4;
396
396
  case 4:
@@ -400,14 +400,14 @@ var Rt = { exports: {} };
400
400
  case 6:
401
401
  return [3, 10];
402
402
  case 7:
403
- return I ? [3, 9] : [4, this.getFlags()];
403
+ return A ? [3, 9] : [4, this.getFlags()];
404
404
  case 8:
405
405
  return z.sent(), [3, 10];
406
406
  case 9:
407
- if (w) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Nt = this.evaluationContext.identity) === null || Nt === void 0 ? void 0 : Nt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
407
+ if (I) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Tt = this.evaluationContext.identity) === null || Tt === void 0 ? void 0 : Tt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
408
408
  else {
409
- if (!this.flags) throw new Error(ft);
410
- this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Tt = this.evaluationContext.identity) === null || Tt === void 0 ? void 0 : Tt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
409
+ if (!this.flags) throw new Error(pt);
410
+ 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));
411
411
  }
412
412
  z.label = 10;
413
413
  case 10:
@@ -415,32 +415,32 @@ var Rt = { exports: {} };
415
415
  }
416
416
  });
417
417
  });
418
- }, N.label = 2;
418
+ }, T.label = 2;
419
419
  case 2:
420
- return N.trys.push([2, 7, , 8]), O.getItemSync ? (pt = O.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
420
+ return T.trys.push([2, 7, , 8]), O.getItemSync ? (yt = O.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
421
421
  case 3:
422
422
  return [4, O.getItem(this.getStorageKey())];
423
423
  case 4:
424
- pt = N.sent(), N.label = 5;
424
+ yt = T.sent(), T.label = 5;
425
425
  case 5:
426
- return [4, Qt(null, pt)];
426
+ return [4, Qt(null, yt)];
427
427
  case 6:
428
428
  case 7:
429
- return N.sent(), [3, 8];
429
+ return T.sent(), [3, 8];
430
430
  case 8:
431
431
  return [3, 12];
432
432
  case 9:
433
- return I ? [3, 11] : [4, this.getFlags()];
433
+ return A ? [3, 11] : [4, this.getFlags()];
434
434
  case 10:
435
- return N.sent(), [3, 12];
435
+ return T.sent(), [3, 12];
436
436
  case 11:
437
- if (w) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, w), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
438
- else if (this.flags && (tt = null, Object.keys(this.flags).length === 0 && (tt = ft), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(tt, g.DEFAULT_FLAGS)), tt)) throw new Error(tt);
439
- N.label = 12;
437
+ if (I) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, I), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
438
+ else if (this.flags && (tt = null, Object.keys(this.flags).length === 0 && (tt = pt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(tt, g.DEFAULT_FLAGS)), tt)) throw new Error(tt);
439
+ T.label = 12;
440
440
  case 12:
441
441
  return [3, 14];
442
442
  case 13:
443
- throw q = N.sent(), this.log("Error during initialisation ", q), Wt = q instanceof Error ? q : new Error("".concat(q)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), q;
443
+ throw q = T.sent(), this.log("Error during initialisation ", q), Wt = q instanceof Error ? q : new Error("".concat(q)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), q;
444
444
  case 14:
445
445
  return [2];
446
446
  }
@@ -477,16 +477,16 @@ var Rt = { exports: {} };
477
477
  }, a.prototype.updateEventStorage = function() {
478
478
  if (this.enableAnalytics) {
479
479
  var e = JSON.stringify(this.getState().evaluationEvent);
480
- O.setItem(at, e).catch(function(t) {
480
+ O.setItem(rt, 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
- nt(e, this.loadingState) || (this.loadingState = s({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
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));
487
487
  }, a.prototype.setupRealtime = function(e, t) {
488
488
  var i = this, n = e + "sse/environments/" + t + "/stream";
489
- ht ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new ht(n), this.eventSource.addEventListener("environment_updated", function(r) {
489
+ dt ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new dt(n), this.eventSource.addEventListener("environment_updated", function(r) {
490
490
  var o;
491
491
  try {
492
492
  o = JSON.parse(r.data).updated_at;
@@ -499,20 +499,20 @@ var Rt = { exports: {} };
499
499
  }();
500
500
  function zt(a) {
501
501
  var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
502
- return new ae({ fetch: e, AsyncStorage: t, eventSource: i });
502
+ return new oe({ fetch: e, AsyncStorage: t, eventSource: i });
503
503
  }
504
- var rt, re = (rt = function(a, e) {
505
- return rt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
504
+ var ot, se = (ot = function(a, e) {
505
+ return ot = 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
- }, rt(a, e);
509
+ }, ot(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
- rt(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
515
+ ot(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
516
516
  }), Ht = 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);
@@ -536,19 +536,19 @@ var Rt = { exports: {} };
536
536
  }
537
537
  }
538
538
  return o;
539
- }, dt = function(a, e, t) {
539
+ }, vt = function(a, e, t) {
540
540
  if (arguments.length === 2) 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]);
541
541
  return a.concat(i || Array.prototype.slice.call(e));
542
- }, oe = function(a) {
542
+ }, le = function(a) {
543
543
  function e() {
544
544
  return a.call(this, `EventSource not available.
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
- return re(e, a), e;
547
+ return se(e, a), e;
548
548
  }(Error), Mt = function() {
549
549
  function a(e, t) {
550
550
  var i = this;
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 oe();
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 le();
552
552
  this._onevent_wrapped = function(n) {
553
553
  i._onevent(n);
554
554
  }, this._start();
@@ -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 = Ht(dt([], Bt(n), !1)), o = r.next(); !o.done; o = r.next())
597
+ for (var r = Ht(vt([], Bt(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] = dt(dt([], Bt(n), !1), [t], !1));
617
+ n.includes(t) || (this._listeners[e] = vt(vt([], Bt(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) {
@@ -654,30 +654,30 @@ Consider loading an EventSource polyfill and making it available globally as Eve
654
654
  return zt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
655
655
  }, d.default = qt, Object.defineProperty(d, "__esModule", { value: !0 });
656
656
  });
657
- })(Rt, Rt.exports);
658
- var he = Rt.exports, de = {
657
+ })(Kt, Kt.exports);
658
+ var ve = Kt.exports, ge = {
659
659
  NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first.",
660
660
  INVALID_CONFIG: "Invalid Flagsmith configuration",
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, ve = (K = class {
664
+ }, ne = "business", K, fe = (K = class {
665
665
  constructor() {
666
- ot(this, "flagsmithClient", null);
667
- ot(this, "userContext", null);
666
+ st(this, "flagsmithClient", null);
667
+ st(this, "userContext", null);
668
668
  }
669
669
  static getInstance() {
670
670
  return K.instance || (K.instance = new K()), K.instance;
671
671
  }
672
672
  ensureInitialized() {
673
673
  if (!this.flagsmithClient)
674
- throw new Error(de.NOT_INITIALIZED);
674
+ throw new Error(ge.NOT_INITIALIZED);
675
675
  }
676
676
  async init(u, d = []) {
677
677
  if (!this.flagsmithClient)
678
678
  try {
679
- this.flagsmithClient = he.createFlagsmithInstance();
680
- const v = d.reduce((s, T) => (s[T.feature.name] = T, s), {});
679
+ this.flagsmithClient = ve.createFlagsmithInstance();
680
+ const v = d.reduce((s, w) => (s[w.feature.name] = w, s), {});
681
681
  await this.flagsmithClient.init({
682
682
  environmentID: u.apiKey,
683
683
  api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
@@ -747,14 +747,14 @@ var he = Rt.exports, de = {
747
747
  }
748
748
  async getUserFlagValue(u, d, v = null, s) {
749
749
  var H;
750
- const T = this.userContext;
750
+ const w = this.userContext;
751
751
  try {
752
752
  return await this.setUser(u), this.getFlagValue(d, s) ?? v;
753
753
  } catch (D) {
754
754
  return console.error(`Error getting user flag value for ${d}:`, D), v;
755
755
  } finally {
756
756
  try {
757
- await ((H = this.flagsmithClient) == null ? void 0 : H.logout()), this.userContext = null, T && await this.setUser(T.identifier);
757
+ await ((H = this.flagsmithClient) == null ? void 0 : H.logout()), this.userContext = null, w && await this.setUser(w.identifier);
758
758
  } catch (D) {
759
759
  console.error("Error during cleanup:", D);
760
760
  }
@@ -763,26 +763,26 @@ var he = Rt.exports, de = {
763
763
  reset() {
764
764
  this.flagsmithClient = null, this.userContext = null;
765
765
  }
766
- }, ot(K, "instance"), K), ge = ve.getInstance(), et = ut(!1), lt = ut([]), Z = ut(null);
767
- function fe(m = ge) {
766
+ }, st(K, "instance"), K), pe = fe.getInstance(), et = ct(!1), ut = ct([]), Z = ct(null);
767
+ function ye(m = pe) {
768
768
  const u = () => et.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (g, C = []) => {
769
769
  if (et.value) {
770
770
  console.warn("FeatureFlag is already initialized.");
771
771
  return;
772
772
  }
773
773
  try {
774
- await m.init(g, C), lt.value = await m.getFlags(), et.value = !0, Z.value = null;
774
+ await m.init(g, C), ut.value = await m.getFlags(), et.value = !0, Z.value = null;
775
775
  } catch (b) {
776
776
  console.error("Failed to initialize feature flags:", b), Z.value = b;
777
777
  }
778
778
  }, v = async (g) => {
779
779
  if (u())
780
780
  try {
781
- await m.setUser(g), lt.value = await m.getFlags(), Z.value = null;
781
+ await m.setUser(g), ut.value = await m.getFlags(), Z.value = null;
782
782
  } catch (C) {
783
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 (g) => v(`${ne}-${g}`), w = (g, C, b = null) => {
786
786
  if (!u()) return b;
787
787
  try {
788
788
  return m.getFlagValue(g, C) ?? b;
@@ -800,69 +800,85 @@ function fe(m = ge) {
800
800
  if (!u()) return b;
801
801
  try {
802
802
  return await m.getUserFlagValue(g, C, b, G);
803
- } catch (it) {
804
- return console.error(`Error getting user flag value for ${C}:`, it), b;
803
+ } catch (at) {
804
+ return console.error(`Error getting user flag value for ${C}:`, at), b;
805
805
  }
806
- }, nt = async (g, C, b = null, G) => D(`${ne}-${g}`, C, b, G), _ = () => {
806
+ }, it = async (g, C, b = null, G) => D(`${ne}-${g}`, C, b, G), _ = () => {
807
807
  try {
808
808
  m.reset();
809
809
  } catch (g) {
810
810
  console.error("Error resetting feature flags:", g);
811
811
  } finally {
812
- lt.value = [], et.value = !1, Z.value = null;
812
+ ut.value = [], et.value = !1, Z.value = null;
813
813
  }
814
814
  };
815
815
  return {
816
- flags: kt(lt),
817
- isInitialized: kt(et),
818
- error: kt(Z),
816
+ flags: Ut(ut),
817
+ isInitialized: Ut(et),
818
+ error: Ut(Z),
819
819
  init: d,
820
820
  setUser: v,
821
821
  setBusiness: s,
822
- getFlagValue: T,
822
+ getFlagValue: w,
823
823
  getFlag: H,
824
824
  getUserFlagValue: D,
825
- getBusinessFlagValue: nt,
825
+ getBusinessFlagValue: it,
826
826
  reset: _
827
827
  };
828
828
  }
829
- var pe = () => fe();
830
- function ye(m, u) {
829
+ var me = () => ye();
830
+ function Se(m, u) {
831
831
  if (!(m != null && m.enabled)) return !1;
832
832
  const d = (m.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 me = { 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 Ut = {
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 Rt = {
837
837
  broadcastAppInbox: "connect_broadcast_app_inbox_countries",
838
838
  broadcastPush: "connect_broadcast_push_countries",
839
- broadcastWhatsapp: "connect_broadcast_whatsapp_countries"
840
- }, Se = {
841
- APP_INBOX: Ut.broadcastAppInbox,
842
- PUSH: Ut.broadcastPush,
843
- WHATSAPP: Ut.broadcastWhatsapp
844
- }, { init: Ce, isInitialized: be, setBusiness: _e, flags: Fe } = pe(), Kt = ut(!1);
845
- async function Ie(m) {
846
- Kt.value = !1;
839
+ broadcastWhatsapp: "connect_broadcast_whatsapp_countries",
840
+ whatsappBot: "connect_whatsapp_bot"
841
+ }, be = {
842
+ APP_INBOX: Rt.broadcastAppInbox,
843
+ PUSH: Rt.broadcastPush,
844
+ WHATSAPP: Rt.broadcastWhatsapp
845
+ }, {
846
+ init: _e,
847
+ isInitialized: Fe,
848
+ setBusiness: Ee,
849
+ flags: ae,
850
+ error: ie
851
+ } = me(), nt = ct("loading");
852
+ async function Le(m) {
853
+ nt.value = "loading";
847
854
  try {
848
- be.value || await Ce({ apiKey: me.featureFlagApiKey }), await _e(m);
855
+ if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(m), ie.value) throw ie.value;
856
+ nt.value = "ready";
849
857
  } catch (u) {
850
- console.warn("CONNECT: loadBusinessFlags failed", u);
851
- } finally {
852
- Kt.value = !0;
858
+ nt.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
853
859
  }
854
860
  }
855
- function Ae() {
856
- const m = ce();
857
- return (u) => {
858
- const d = Se[u];
859
- return d ? Kt.value ? ye(
860
- Fe.value.find((v) => v.feature.name === d),
861
+ function xe() {
862
+ return (m) => {
863
+ var u;
864
+ return nt.value === "loading" ? "loading" : nt.value === "error" ? "off" : (u = ae.value.find((d) => d.feature.name === m)) != null && u.enabled ? "on" : "off";
865
+ };
866
+ }
867
+ function je() {
868
+ const m = de(), u = xe();
869
+ return (d) => {
870
+ const v = be[d];
871
+ if (!v) return "on";
872
+ const s = u(v);
873
+ return s !== "on" ? s : Se(
874
+ ae.value.find((w) => w.feature.name === v),
861
875
  m.currentCountry.value
862
- ) ? "on" : "off" : "loading" : "on";
876
+ ) ? "on" : "off";
863
877
  };
864
878
  }
865
879
  export {
866
- Ie as l,
867
- Ae as u
880
+ Rt as F,
881
+ je as a,
882
+ Le as l,
883
+ xe as u
868
884
  };