@feedmepos/mf-inventory-portal 1.7.0-dev.0 → 1.7.0-dev.2

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 (111) hide show
  1. package/dist/{App-DaAOxELy.js → App-BJilVJ6h.js} +6 -6
  2. package/dist/{ApprovalView-CxJ79rW7.js → ApprovalView-BFIyc3SS.js} +15 -15
  3. package/dist/{BindingsDialog-CZhCQoLO.js → BindingsDialog-C1HM5tIJ.js} +3 -3
  4. package/dist/{BindingsPicker-BWRMxgYR.js → BindingsPicker-2mJvKG0k.js} +6 -6
  5. package/dist/{BindingsTable-fvBa1dHb.js → BindingsTable-D3au8Csm.js} +5 -5
  6. package/dist/{BulkReceiveRequestView-Bq7_r-qY.js → BulkReceiveRequestView-DGCRmzzH.js} +36 -36
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CKM48Ktp.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D937HMIP.js} +9 -9
  8. package/dist/{ClosingDraftView-DdMr571D.js → ClosingDraftView-ex1eBo9N.js} +31 -31
  9. package/dist/{ClosingHistoryView-BIpPvvzQ.js → ClosingHistoryView-v2bOWHYJ.js} +8 -8
  10. package/dist/{ClosingTemplateView-IlV4hRZ7.js → ClosingTemplateView-CHLcLd_s.js} +18 -18
  11. package/dist/{DefaultView-TKUUG9_5.js → DefaultView-DlF-ZqYm.js} +4 -4
  12. package/dist/{DeliveryOrderPrintPreview-DTjC7-Op.js → DeliveryOrderPrintPreview-DsEYc7I7.js} +19 -19
  13. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DeFiuGtR.js → EmailDialog.vue_vue_type_script_setup_true_lang-3yiwiUFW.js} +9313 -9301
  14. package/dist/{FmAdminBadge-DjnBAgyv.js → FmAdminBadge-DlplQOHb.js} +6 -6
  15. package/dist/{FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js → FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js} +5 -5
  16. package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js} +6 -6
  17. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-D6KJIhNi.js} +3 -3
  18. package/dist/{FmDroppableField-J0xUsOTV.js → FmDroppableField-J0tG_U3w.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CzHFzHXg.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DVPdMDAf.js} +3 -3
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiMEAtPb.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DmcdM6Fz.js} +6 -6
  21. package/dist/{FmMultiselectDialog-D_4f9sXH.js → FmMultiselectDialog-BdWXuvmR.js} +1 -1
  22. package/dist/{FmMultiselectDialog-BdXOoS6z.js → FmMultiselectDialog-igkyqMtb.js} +4 -4
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BKZHxVbh.js} +9 -9
  24. package/dist/{ImportView-BnL6y68X.js → ImportView-BuWkEOOe.js} +11 -11
  25. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-g-g6qaNU.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVRoTZJg.js} +5 -5
  26. package/dist/{IngredientGroupView-Du0iICme.js → IngredientGroupView-Cuy1-Poq.js} +9 -9
  27. package/dist/{IngredientsView-m2Rtn_F_.js → IngredientsView-Brp6bESK.js} +26 -26
  28. package/dist/{IntegrationExplorerView-J5BtpWN_.js → IntegrationExplorerView-_hzmZJ8r.js} +3897 -3898
  29. package/dist/{IntegrationView-BMQj8wg-.js → IntegrationView-CNg9vmQy.js} +18 -18
  30. package/dist/{InventoryBindingForm-D_KFXokV.js → InventoryBindingForm-C0idDplf.js} +1 -1
  31. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7GjOoZh.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Duka71_1.js} +6 -6
  32. package/dist/{InventoryBindingSummary-9TWMG5bm.js → InventoryBindingSummary-UeTZqaed.js} +3 -3
  33. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYXtIoll.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CuPeixvo.js} +3 -3
  34. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CGJ_uWzF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B2p6aGk3.js} +3 -3
  35. package/dist/{PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js → PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js} +2 -2
  36. package/dist/{ProductionView-CI07S6oW.js → ProductionView-DUBl0109.js} +9 -9
  37. package/dist/{PublishView-CWMdUnaY.js → PublishView-DCMY9XyK.js} +7 -7
  38. package/dist/{PurchaseOrderPrintPreview-B5XJcf8G.js → PurchaseOrderPrintPreview-CXGmmtS1.js} +17 -17
  39. package/dist/{ReceiveRequestView-st3jdG9W.js → ReceiveRequestView-iHlIjUjd.js} +19 -19
  40. package/dist/{RecipeView-D9ZVbmtm.js → RecipeView-fjgD8jQU.js} +23 -23
  41. package/dist/{SettingsView-CUS0aMbf.js → SettingsView-CL4-N_xx.js} +9 -9
  42. package/dist/{SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js → SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js} +2 -2
  43. package/dist/{StockView-Co4DOixF.js → StockView-gIhHMfMp.js} +27 -27
  44. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt6XECIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-1ZKwSPHJ.js} +8 -8
  45. package/dist/{SupplierView-DXw6V-uS.js → SupplierView-KxEVuBPZ.js} +201 -205
  46. package/dist/{SurchargeView-C-Bg7UsR.js → SurchargeView-Cd7pbFt9.js} +11 -11
  47. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-B-OuEWRl.js} +4 -4
  48. package/dist/{TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js → TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js} +7 -7
  49. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D7NrX7HR.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-B4-8JOtV.js} +4 -4
  50. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang--gKHVU0B.js +4607 -0
  51. package/dist/{TransferTemplateView-CP7ia82t.js → TransferTemplateView-DfJ4A3hN.js} +24 -24
  52. package/dist/{UnitCostHistoryView-xe5q6105.js → UnitCostHistoryView-43d2wfCn.js} +8 -8
  53. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-_Eax2wkO.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Du7-c6nt.js} +9 -9
  54. package/dist/{UnitView-1e6MQ-Vu.js → UnitView-BF33MXY_.js} +11 -11
  55. package/dist/{WarehouseView-DXB6Ygwb.js → WarehouseView-CDwyNo0S.js} +9 -9
  56. package/dist/{WastageTemplateView-CWGNtaZJ.js → WastageTemplateView-CMNT3MWM.js} +18 -18
  57. package/dist/{app-DXqwG4b3.js → app-BB7awVIO.js} +6920 -6786
  58. package/dist/{app-DiX-EfV6.js → app-C39bYJmq.js} +283 -283
  59. package/dist/app.js +1 -1
  60. package/dist/{closing-template-CCY6fg4v.js → closing-template-BjZWpNvD.js} +1 -1
  61. package/dist/{date2-BWfUJajP.js → date2-CEoGS9UZ.js} +1 -1
  62. package/dist/{dayjs.min-BqAOh_2L.js → dayjs.min-BVhDPC6x.js} +3 -3
  63. package/dist/{decimal-DmkQg2_J.js → decimal-DfbkUdYf.js} +2 -2
  64. package/dist/{defineDeepModel-D9smHIGg.js → defineDeepModel-DUgtruT9.js} +1 -1
  65. package/dist/{duplicate-template-Ebdaehmw.js → duplicate-template-CZJdIDFH.js} +1 -1
  66. package/dist/{feature-CD2ndvWN.js → feature-DBMkQQTb.js} +209 -206
  67. package/dist/{format-time-from-id-BtUh8UMO.js → format-time-from-id-DkU2ePWj.js} +1 -1
  68. package/dist/{format-unit-display-DLoTr1Hz.js → format-unit-display-BgQ-6M12.js} +24 -25
  69. package/dist/{import-export.helper-DYgr7Lvo.js → import-export.helper-BtWxCT6b.js} +6 -6
  70. package/dist/{index-CnuWmvgF.js → index-BAxOInk9.js} +1 -1
  71. package/dist/{index-z_cku6cd.js → index-BWQ8NB8N.js} +11 -15
  72. package/dist/{index-DmdqVO9N.js → index-Cloa6kzu.js} +3 -3
  73. package/dist/{inventory-core-dart.default-CEnDozvp.js → inventory-core-dart.default-DaFglZqk.js} +4049 -1741
  74. package/dist/{jszip.min-DKMvkIMM.js → jszip.min-Z2D3xvD5.js} +6 -6
  75. package/dist/{lz-string-BH6J5xxX.js → lz-string-DnBkKC8g.js} +33 -34
  76. package/dist/{menu-usage-module-D7cxkbEk.js → menu-usage-module-BdjYEk3s.js} +5 -5
  77. package/dist/{netsuite-kR1AFzO9.js → netsuite-D36Elkhq.js} +145 -145
  78. package/dist/{number-CRrcUtSg.js → number-BSIHQzsE.js} +3 -3
  79. package/dist/{predefined-templates-DbAHazbJ.js → predefined-templates-C-kyAGru.js} +4 -13
  80. package/dist/{purchase-order-template-DoEJEwqG.js → purchase-order-template-RYyeW23k.js} +1 -1
  81. package/dist/{recalculationUtils-hk2PE0q1.js → recalculationUtils-BjZoDT6Q.js} +1 -1
  82. package/dist/{rules-BPXgi6ZE.js → rules-DOAV9M_O.js} +2 -2
  83. package/dist/{stock-qAhTEKrH.js → stock-Benafybl.js} +1 -1
  84. package/dist/{stock-CJAv4fTu.js → stock-D0y6PGGf.js} +6 -6
  85. package/dist/stores/feature.d.ts +2 -0
  86. package/dist/{supplier-BvzIGpwW.js → supplier-DwlZEe13.js} +2 -2
  87. package/dist/{surcharge-BhLHJ3gK.js → surcharge-BtxMy1qW.js} +1 -1
  88. package/dist/tsconfig.app.tsbuildinfo +1 -1
  89. package/dist/{uom-rules-B1s74P9M.js → uom-rules-B_xfjjcG.js} +1 -1
  90. package/dist/{use-ingredient-select-dialog-aAPbd5cS.js → use-ingredient-select-dialog-DyHBqVJY.js} +2 -2
  91. package/dist/{use-inventory-binding-dialog-CTjQzuV7.js → use-inventory-binding-dialog-B5yt-QSn.js} +2 -2
  92. package/dist/{use-template-enabled-locations-Brw80-tj.js → use-template-enabled-locations-iUZkCklL.js} +2 -2
  93. package/dist/{use-transfer-locations-BF7CKYpr.js → use-transfer-locations-ysstFC-U.js} +2 -2
  94. package/dist/{useHrmPermission-Csjov-cy.js → useHrmPermission-DGarJPGU.js} +1 -1
  95. package/dist/{useNavigationMenu-D8BERWXB.js → useNavigationMenu-59ksBzue.js} +4 -4
  96. package/dist/{useSseClient-Cen-cw5C.js → useSseClient-CfHMj54d.js} +1 -1
  97. package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditForm.vue.d.ts +19 -0
  98. package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditor.vue.d.ts +18 -0
  99. package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentList.vue.d.ts +33 -0
  100. package/dist/views/receive-request/components/price-adjustment/use-price-adjustment-form-controller.d.ts +9 -0
  101. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +10 -0
  102. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +20 -0
  103. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +120 -0
  104. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +140 -0
  105. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +100 -0
  106. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +20 -0
  107. package/dist/vue-i18n-1OYA26Pg.js +2351 -0
  108. package/dist/{xlsx.util-DxgWqaTd.js → xlsx.util-J9LqmOSi.js} +3712 -3722
  109. package/package.json +2 -2
  110. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-D9Fl_xAx.js +0 -4360
  111. package/dist/vue-i18n-lC_mdXT4.js +0 -2365
@@ -1,16 +1,16 @@
1
1
  var ht = Object.defineProperty;
2
- var ft = (l, u, _) => u in l ? ht(l, u, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : l[u] = _;
3
- var ce = (l, u, _) => ft(l, typeof u != "symbol" ? u + "" : u, _);
2
+ var pt = (l, u, _) => u in l ? ht(l, u, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : l[u] = _;
3
+ var ce = (l, u, _) => pt(l, typeof u != "symbol" ? u + "" : u, _);
4
4
  import { useCoreStore as Ke } from "@feedmepos/mf-common";
5
- import { Y as ve, u as Ve, j as ot, a as pt } from "./app-DXqwG4b3.js";
6
- import { ref as de, readonly as Ge } from "vue";
7
- import "./inventory-core-dart.default-CEnDozvp.js";
5
+ import { Y as ve, a as ft, u as Ve, j as ot } from "./app-BB7awVIO.js";
6
+ import { readonly as Ge, ref as de } from "vue";
7
+ import "./inventory-core-dart.default-DaFglZqk.js";
8
8
  var qe = { exports: {} };
9
9
  (function(l, u) {
10
- (function(_, f) {
11
- f(u);
10
+ (function(_, p) {
11
+ p(u);
12
12
  })(ve, function(_) {
13
- var f = { getItemSync: function(i) {
13
+ var p = { getItemSync: function(i) {
14
14
  try {
15
15
  return localStorage.getItem(i) || null;
16
16
  } catch {
@@ -42,24 +42,24 @@ var qe = { exports: {} };
42
42
  };
43
43
  function O(i, t, e, r) {
44
44
  return new (e || (e = Promise))(function(n, a) {
45
- function o(g) {
45
+ function o(y) {
46
46
  try {
47
- d(r.next(g));
47
+ d(r.next(y));
48
48
  } catch (c) {
49
49
  a(c);
50
50
  }
51
51
  }
52
- function v(g) {
52
+ function v(y) {
53
53
  try {
54
- d(r.throw(g));
54
+ d(r.throw(y));
55
55
  } catch (c) {
56
56
  a(c);
57
57
  }
58
58
  }
59
- function d(g) {
59
+ function d(y) {
60
60
  var c;
61
- g.done ? n(g.value) : (c = g.value, c instanceof e ? c : new e(function(m) {
62
- m(c);
61
+ y.done ? n(y.value) : (c = y.value, c instanceof e ? c : new e(function(b) {
62
+ b(c);
63
63
  })).then(o, v);
64
64
  }
65
65
  d((r = r.apply(i, [])).next());
@@ -74,7 +74,7 @@ var qe = { exports: {} };
74
74
  return this;
75
75
  }), a;
76
76
  function v(d) {
77
- return function(g) {
77
+ return function(y) {
78
78
  return function(c) {
79
79
  if (e) throw new TypeError("Generator is already executing.");
80
80
  for (; o; ) try {
@@ -113,18 +113,18 @@ var qe = { exports: {} };
113
113
  continue;
114
114
  }
115
115
  c = t.call(i, o);
116
- } catch (m) {
117
- c = [6, m], r = 0;
116
+ } catch (b) {
117
+ c = [6, b], r = 0;
118
118
  } finally {
119
119
  e = n = 0;
120
120
  }
121
121
  if (5 & c[0]) throw c[1];
122
122
  return { value: c[0] ? c[1] : void 0, done: !0 };
123
- }([d, g]);
123
+ }([d, y]);
124
124
  };
125
125
  }
126
126
  }
127
- function F(i, t, e) {
127
+ function P(i, t, e) {
128
128
  for (var r, n = 0, a = t.length; n < a; n++) !r && n in t || (r || (r = Array.prototype.slice.call(t, 0, n)), r[n] = t[n]);
129
129
  return i.concat(r || Array.prototype.slice.call(t));
130
130
  }
@@ -151,7 +151,7 @@ var qe = { exports: {} };
151
151
  }
152
152
  return t != t && e != e;
153
153
  };
154
- function w(i, t) {
154
+ function E(i, t) {
155
155
  var e = Object.keys(t || {}).filter(function(r) {
156
156
  var n = i == null ? void 0 : i[r], a = t == null ? void 0 : t[r];
157
157
  return !W(n, a);
@@ -160,18 +160,18 @@ var qe = { exports: {} };
160
160
  Object.keys(t || {}).includes(r) || e.push(r);
161
161
  }), Object.keys(e).length ? e : null;
162
162
  }
163
- var p, C;
164
- function E(i, t, e) {
163
+ var f, C;
164
+ function w(i, t, e) {
165
165
  var r = "shortString", n = !0;
166
166
  typeof e == "number" && (r = "javaDouble", n = !1), i[r] = i[r] || {}, i[r][t] = n ? e + "" : e;
167
167
  }
168
- function I(i) {
168
+ function A(i) {
169
169
  return !!i && typeof i == "object" && i.value !== void 0;
170
170
  }
171
171
  function $(i) {
172
172
  return Object.fromEntries(Object.entries(i).map(function(t) {
173
173
  var e = t[0], r = t[1];
174
- return [e, I(r) ? r : { value: r }];
174
+ return [e, A(r) ? r : { value: r }];
175
175
  }));
176
176
  }
177
177
  function Y(i) {
@@ -179,58 +179,58 @@ var qe = { exports: {} };
179
179
  }
180
180
  (function(i) {
181
181
  i.NONE = "NONE", i.DEFAULT_FLAGS = "DEFAULT_FLAGS", i.CACHE = "CACHE", i.SERVER = "SERVER";
182
- })(p || (p = {}));
183
- var fe, A = null, ut = "FLAGSMITH_EVENT", le = ut, Be = "https://edge.api.flagsmith.com/api/v1/", Je = "flagsmith_value_", Me = "flagsmith_enabled_", ze = "flagsmith_trait_", ct = function() {
182
+ })(f || (f = {}));
183
+ var pe, j = null, ut = "FLAGSMITH_EVENT", le = ut, Be = "https://edge.api.flagsmith.com/api/v1/", Je = "flagsmith_value_", Me = "flagsmith_enabled_", ze = "flagsmith_trait_", ct = function() {
184
184
  function i(t) {
185
185
  var e = this;
186
186
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
187
187
  var r = e, n = r.api, a = r.evaluationContext;
188
188
  e.log("Get Flags"), e.isLoading = !0, e.loadingState.isFetching || e.setLoadingState(s(s({}, e.loadingState), { isFetching: !0 }));
189
189
  var o = "".concat(e.getContext().identity), v = function(d) {
190
- var g, c, m, k;
190
+ var y, c, b, k;
191
191
  if (d && o === "".concat(e.getContext().identity)) {
192
- var V = d.flags, j = d.traits, U = d.identifier;
192
+ var V = d.flags, F = d.traits, U = d.identifier;
193
193
  e.isLoading = !1;
194
- var P = {}, N = {};
195
- j = j || [], (V = V || []).forEach(function(b) {
196
- P[b.feature.name.toLowerCase().replace(/ /g, "_")] = { id: b.feature.id, enabled: b.enabled, value: b.feature_state_value };
197
- }), j.forEach(function(b) {
198
- N[b.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: b.transient, value: b.trait_value };
194
+ var I = {}, N = {};
195
+ F = F || [], (V = V || []).forEach(function(S) {
196
+ I[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
197
+ }), F.forEach(function(S) {
198
+ N[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
199
199
  }), e.oldFlags = s({}, e.flags);
200
- var G = w(e.oldFlags, P), re = w((g = e.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits, N);
201
- if ((U || Object.keys(N).length) && (e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: N }), U && (e.evaluationContext.identity.identifier = U)), e.flags = P, e.updateStorage(), e._onChange(e.oldFlags, { isFromServer: !0, flagsChanged: G, traitsChanged: re }, e._loadedState(null, p.SERVER)), e.datadogRum) try {
200
+ var G = E(e.oldFlags, I), re = E((y = e.evaluationContext.identity) === null || y === void 0 ? void 0 : y.traits, N);
201
+ if ((U || Object.keys(N).length) && (e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: N }), U && (e.evaluationContext.identity.identifier = U)), e.flags = I, e.updateStorage(), e._onChange(e.oldFlags, { isFromServer: !0, flagsChanged: G, traitsChanged: re }, e._loadedState(null, f.SERVER)), e.datadogRum) try {
202
202
  if (e.datadogRum.trackTraits) {
203
203
  var ie = {};
204
- Object.keys(((c = e.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(b) {
205
- ie[ze + b] = e.getTrait(b);
204
+ Object.keys(((c = e.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(S) {
205
+ ie[ze + S] = e.getTrait(S);
206
206
  });
207
- var Z = s(s(s({}, e.datadogRum.client.getUser()), { id: e.datadogRum.client.getUser().id || ((m = e.evaluationContext.identity) === null || m === void 0 ? void 0 : m.identifier) }), ie);
207
+ var Z = s(s(s({}, e.datadogRum.client.getUser()), { id: e.datadogRum.client.getUser().id || ((b = e.evaluationContext.identity) === null || b === void 0 ? void 0 : b.identifier) }), ie);
208
208
  e.log("Setting Datadog user", Z), e.datadogRum.client.setUser(Z);
209
209
  }
210
- } catch (b) {
211
- console.error(b);
210
+ } catch (S) {
211
+ console.error(S);
212
212
  }
213
213
  if (e.dtrum) try {
214
214
  var T = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
215
- Object.keys(e.flags).map(function(b) {
216
- E(T, Je + b, e.getValue(b, { skipAnalytics: !0 })), E(T, Me + b, e.hasFeature(b, { skipAnalytics: !0 }));
217
- }), Object.keys(((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(b) {
218
- E(T, ze + b, e.getTrait(b));
215
+ Object.keys(e.flags).map(function(S) {
216
+ w(T, Je + S, e.getValue(S, { skipAnalytics: !0 })), w(T, Me + S, e.hasFeature(S, { skipAnalytics: !0 }));
217
+ }), Object.keys(((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(S) {
218
+ w(T, ze + S, e.getTrait(S));
219
219
  }), e.log("Sending javaLongOrObject traits to dynatrace", T.javaLongOrObject), e.log("Sending date traits to dynatrace", T.date), e.log("Sending shortString traits to dynatrace", T.shortString), e.log("Sending javaDouble to dynatrace", T.javaDouble), e.dtrum.sendSessionProperties(T.javaLongOrObject, T.date, T.shortString, T.javaDouble);
220
- } catch (b) {
221
- console.error(b);
220
+ } catch (S) {
221
+ console.error(S);
222
222
  }
223
223
  }
224
224
  };
225
225
  return a.identity ? Promise.all([a.identity.traits && Object.keys(a.identity.traits).length || !a.identity.identifier ? e.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: a.identity.identifier, transient: a.identity.transient, traits: Object.entries(a.identity.traits).map(function(d) {
226
- var g = d[0], c = d[1];
227
- return { trait_key: g, trait_value: c == null ? void 0 : c.value, transient: c == null ? void 0 : c.transient };
226
+ var y = d[0], c = d[1];
227
+ return { trait_key: y, trait_value: c == null ? void 0 : c.value, transient: c == null ? void 0 : c.transient };
228
228
  }).filter(function(d) {
229
229
  return d.trait_value !== void 0 || (e.log("Warning - attempted to set an undefined trait value for key", d.trait_key), !1);
230
230
  }) })) : e.getJSON(n + "identities/?identifier=" + encodeURIComponent(a.identity.identifier) + (a.identity.transient ? "&transient=true" : ""))]).then(function(d) {
231
231
  return e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: {} }), v(d == null ? void 0 : d[0]);
232
232
  }).catch(function(d) {
233
- var g = d.message, c = new Error(g);
233
+ var y = d.message, c = new Error(y);
234
234
  return Promise.reject(c);
235
235
  }) : e.getJSON(n + "flags/").then(function(d) {
236
236
  return v({ flags: d, traits: void 0 });
@@ -245,7 +245,7 @@ var qe = { exports: {} };
245
245
  }).catch(function(n) {
246
246
  e.log("Exception fetching evaluationEvent", n);
247
247
  }) : void 0;
248
- }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: p.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(r, n, a) {
248
+ }, 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(r, n, a) {
249
249
  var o = e.flags && e.flags[r.toLowerCase().replace(/ /g, "_")], v = null;
250
250
  if (o && (v = o.value), n != null && n.skipAnalytics || a || e.evaluateFlag(r, "VALUE"), v === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
251
251
  if (n != null && n.json) try {
@@ -277,7 +277,7 @@ var qe = { exports: {} };
277
277
  var n;
278
278
  if (e.api) return e.setContext(s(s({}, e.evaluationContext), { identity: s(s({}, e.evaluationContext.identity), { traits: s(s({}, (n = e.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(r).map(function(a) {
279
279
  var o = a[0], v = a[1];
280
- return [o, I(v) ? v : { value: v }];
280
+ return [o, A(v) ? v : { value: v }];
281
281
  }))) }) }));
282
282
  console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
283
283
  }, this.hasFeature = function(r, n) {
@@ -289,30 +289,30 @@ var qe = { exports: {} };
289
289
  }, this.getJSON = function(r, n, a) {
290
290
  var o, v = e;
291
291
  v.evaluationContext;
292
- var d = v.headers, g = { method: n || "GET", body: a, cache: "no-cache", headers: {} };
293
- e.evaluationContext.environment && (g.headers["X-Environment-Key"] = e.evaluationContext.environment.apiKey), n && n !== "GET" && (g.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(g.headers, d), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
292
+ var d = v.headers, y = { method: n || "GET", body: a, cache: "no-cache", headers: {} };
293
+ e.evaluationContext.environment && (y.headers["X-Environment-Key"] = e.evaluationContext.environment.apiKey), n && n !== "GET" && (y.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(y.headers, d), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
294
294
  var c = "".concat((o = e.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
295
- return C(r, g).then(function(m) {
296
- var k, V, j = "".concat((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
297
- if (c === j) {
298
- var U = (V = m.headers) === null || V === void 0 ? void 0 : V.get("x-flagsmith-document-updated-at");
295
+ return C(r, y).then(function(b) {
296
+ var k, V, F = "".concat((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
297
+ if (c === F) {
298
+ var U = (V = b.headers) === null || V === void 0 ? void 0 : V.get("x-flagsmith-document-updated-at");
299
299
  if (U) try {
300
- var P = parseFloat(U);
301
- if (isNaN(P)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
302
- e.timestamp = P;
300
+ var I = parseFloat(U);
301
+ if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
302
+ e.timestamp = I;
303
303
  } catch (N) {
304
304
  e.log(N, "Failed to parse x-flagsmith-document-updated-at", U);
305
305
  }
306
- return e.log("Fetch response: " + m.status + " " + (n || "GET") + 0 + r), m.text().then(function(N) {
306
+ return e.log("Fetch response: " + b.status + " " + (n || "GET") + 0 + r), b.text().then(function(N) {
307
307
  var G = N;
308
308
  try {
309
309
  G = JSON.parse(N);
310
310
  } catch {
311
311
  }
312
- return !G && m.status && (G = "API Response: ".concat(m.status)), m.status && m.status >= 200 && m.status < 300 ? G : Promise.reject(new Error(G));
312
+ return !G && b.status && (G = "API Response: ".concat(b.status)), b.status && b.status >= 200 && b.status < 300 ? G : Promise.reject(new Error(G));
313
313
  });
314
314
  }
315
- e.log("Received response with identity mismatch, ignoring response. Requested: ".concat(c, ", Current: ").concat(j));
315
+ e.log("Received response with identity mismatch, ignoring response. Requested: ".concat(c, ", Current: ").concat(F));
316
316
  });
317
317
  }, this.evaluateFlag = function(r, n) {
318
318
  if (e.datadogRum && (e.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? e.datadogRum.client.addFeatureFlagEvaluation(Je + r, e.getValue(r, {}, !0)) : e.datadogRum.client.addFeatureFlagEvaluation(Me + r, e.hasFeature(r, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), e.enableAnalytics) {
@@ -323,23 +323,23 @@ var qe = { exports: {} };
323
323
  }, this._onChange = function(r, n, a) {
324
324
  var o, v;
325
325
  e.setLoadingState(a), (o = e.onChange) === null || o === void 0 || o.call(e, r, n, e.loadingState), (v = e._trigger) === null || v === void 0 || v.call(e);
326
- }, C = t.fetch ? t.fetch : typeof fetch < "u" ? fetch : ve === null || ve === void 0 ? void 0 : ve.fetch, this.canUseStorage = typeof window < "u" || !!t.browserlessStorage, this.log("Constructing flagsmith instance " + t), t.eventSource && (fe = t.eventSource), t.AsyncStorage && (A = t.AsyncStorage);
326
+ }, C = t.fetch ? t.fetch : typeof fetch < "u" ? fetch : ve === null || ve === void 0 ? void 0 : ve.fetch, this.canUseStorage = typeof window < "u" || !!t.browserlessStorage, this.log("Constructing flagsmith instance " + t), t.eventSource && (pe = t.eventSource), t.AsyncStorage && (j = t.AsyncStorage);
327
327
  }
328
328
  return i.prototype.init = function(t) {
329
329
  var e, r, n;
330
330
  return O(this, void 0, void 0, function() {
331
- var a, o, v, d, g, c, m, k, V, j, U, P, N, G, re, ie, Z, T, b, ge, ae, Qe, Q, ye, et, tt, me, nt, be, oe, ee, rt, L = this;
331
+ var a, o, v, d, y, c, b, k, V, F, U, I, N, G, re, ie, Z, T, S, ge, ae, Qe, Q, ye, et, tt, me, nt, be, oe, ee, rt, L = this;
332
332
  return K(this, function(D) {
333
333
  switch (D.label) {
334
334
  case 0:
335
335
  a = Y(t.evaluationContext || this.evaluationContext), D.label = 1;
336
336
  case 1:
337
- if (D.trys.push([1, 13, , 14]), o = t.environmentID, v = t.api, d = v === void 0 ? Be : v, g = t.headers, c = t.onChange, m = t.cacheFlags, k = t.datadogRum, V = t.onError, j = t.defaultFlags, U = t.fetch, P = t.preventFetch, N = t.enableLogs, G = t.enableDynatrace, re = t.enableAnalytics, ie = t.realtime, Z = t.eventSourceUrl, T = Z === void 0 ? "https://realtime.flagsmith.com/" : Z, b = t.AsyncStorage, ge = t.identity, ae = t.traits, Qe = t.state, Q = t.cacheOptions, ye = t.angularHttpClient, et = t._trigger, tt = t._triggerLoadingState, a.environment = o ? { apiKey: o } : a.environment, !a.environment || !a.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
337
+ if (D.trys.push([1, 13, , 14]), o = t.environmentID, v = t.api, d = v === void 0 ? Be : v, y = t.headers, c = t.onChange, b = t.cacheFlags, k = t.datadogRum, V = t.onError, F = t.defaultFlags, U = t.fetch, I = t.preventFetch, N = t.enableLogs, G = t.enableDynatrace, re = t.enableAnalytics, ie = t.realtime, Z = t.eventSourceUrl, T = Z === void 0 ? "https://realtime.flagsmith.com/" : Z, S = t.AsyncStorage, ge = t.identity, ae = t.traits, Qe = t.state, Q = t.cacheOptions, ye = t.angularHttpClient, et = t._trigger, tt = t._triggerLoadingState, a.environment = o ? { apiKey: o } : a.environment, !a.environment || !a.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
338
338
  if (a.identity = ge || ae ? { identifier: ge, traits: ae ? Object.fromEntries(Object.entries(ae).map(function(R) {
339
339
  return [R[0], { value: R[1] }];
340
- })) : {} } : a.identity, this.evaluationContext = a, this.api = d, this.headers = g, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = c, me = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = et || this._trigger, this._triggerLoadingState = tt || this._triggerLoadingState, this.onError = function(R) {
340
+ })) : {} } : a.identity, this.evaluationContext = a, this.api = d, this.headers = y, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = c, me = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = et || this._trigger, this._triggerLoadingState = tt || this._triggerLoadingState, this.onError = function(R) {
341
341
  L.setLoadingState(s(s({}, L.loadingState), { isFetching: !1, isLoading: !1, error: R })), V == null || V(R);
342
- }, this.enableLogs = N || !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."), U && (C = U), this.enableAnalytics = re || !1, this.flags = Object.assign({}, j) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!m, le = "FLAGSMITH_EVENT_" + a.environment.apiKey, b && (A = b), ie && typeof window < "u" && this.setupRealtime(T, a.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: p.DEFAULT_FLAGS })), this.setState(Qe), this.log("Initialising with properties", t, this), G && (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), ye && (C = /* @__PURE__ */ function(R) {
342
+ }, this.enableLogs = N || !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."), U && (C = U), this.enableAnalytics = re || !1, this.flags = Object.assign({}, F) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = j !== void 0 && !!b, le = "FLAGSMITH_EVENT_" + a.environment.apiKey, S && (j = S), ie && typeof window < "u" && this.setupRealtime(T, a.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: f.DEFAULT_FLAGS })), this.setState(Qe), this.log("Initialising with properties", t, this), G && (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), ye && (C = /* @__PURE__ */ function(R) {
343
343
  return function(q, B) {
344
344
  var z = B.headers, x = B.method, te = B.body;
345
345
  return new Promise(function(X) {
@@ -360,14 +360,14 @@ var qe = { exports: {} };
360
360
  }
361
361
  });
362
362
  };
363
- }(ye)), A && this.canUseStorage && A.getItem(le).then(function(R) {
363
+ }(ye)), j && this.canUseStorage && j.getItem(le).then(function(R) {
364
364
  try {
365
365
  L.evaluationEvent = JSON.parse(R) || {};
366
366
  } catch {
367
367
  L.evaluationEvent = {};
368
368
  }
369
369
  L.analyticsInterval = setInterval(L.analyticsFlags, L.ticks);
370
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), A && this.canUseStorage && A.getItem(le, function(R, q) {
370
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), j && this.canUseStorage && j.getItem(le, function(R, q) {
371
371
  if (q && L.evaluationContext.environment) {
372
372
  var B = JSON.parse(q);
373
373
  if (B[L.evaluationContext.environment.apiKey]) {
@@ -375,23 +375,23 @@ var qe = { exports: {} };
375
375
  L.log("Retrieved events from cache", q), L.setState(s(s({}, z), { evaluationEvent: B[L.evaluationContext.environment.apiKey] }));
376
376
  }
377
377
  }
378
- })), !m) return [3, 9];
379
- if (!A || !this.canUseStorage) return [3, 8];
378
+ })), !b) return [3, 9];
379
+ if (!j || !this.canUseStorage) return [3, 8];
380
380
  nt = function(R, q) {
381
381
  return O(L, void 0, void 0, function() {
382
- var B, z, x, te, X, M, Se, it, Ce, xe, Ee, we, Oe, ke, Te, Le, Ae, Fe, Ie, je, Pe, Ne, Re, Ue, at = this;
382
+ var B, z, x, te, X, M, Se, it, Ce, xe, we, Ee, Oe, ke, Te, Le, je, Pe, Ae, Fe, Ie, Ne, Re, Ue, at = this;
383
383
  return K(this, function(H) {
384
384
  switch (H.label) {
385
385
  case 0:
386
386
  if (!q) return [3, 7];
387
387
  B = null, z = null, H.label = 1;
388
388
  case 1:
389
- return H.trys.push([1, 5, , 6]), x = JSON.parse(q), te = !1, X = !1, x && x.api === this.api && ((xe = (Ce = x.evaluationContext) === null || Ce === void 0 ? void 0 : Ce.environment) === null || xe === void 0 ? void 0 : xe.apiKey) === ((Ee = this.evaluationContext.environment) === null || Ee === void 0 ? void 0 : Ee.apiKey) && (M = !0, this.evaluationContext.identity && ((Oe = (we = x.evaluationContext) === null || we === void 0 ? void 0 : we.identity) === null || Oe === void 0 ? void 0 : Oe.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Te = (ke = x.evaluationContext) === null || ke === void 0 ? void 0 : ke.identity) === null || Te === void 0 ? void 0 : Te.identifier) + " to " + this.evaluationContext.identity.identifier), M = !1), this.cacheOptions.ttl && (!x.ts || (/* @__PURE__ */ new Date()).valueOf() - x.ts > this.cacheOptions.ttl) && (x.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), M = !1) : x.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), X = !0, M = !0)), M && (te = !0, z = w((Le = this.evaluationContext.identity) === null || Le === void 0 ? void 0 : Le.traits, (Fe = (Ae = x.evaluationContext) === null || Ae === void 0 ? void 0 : Ae.identity) === null || Fe === void 0 ? void 0 : Fe.traits), B = w(this.flags, x.flags), this.setState(s(s({}, x), { evaluationContext: Y(s(s({}, x.evaluationContext), { identity: !((Ie = x.evaluationContext) === null || Ie === void 0) && Ie.identity ? s(s({}, (je = x.evaluationContext) === null || je === void 0 ? void 0 : je.identity), { traits: s(s({}, ((Ne = (Pe = x.evaluationContext) === null || Pe === void 0 ? void 0 : Pe.identity) === null || Ne === void 0 ? void 0 : Ne.traits) || {}), ae || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", x))), te ? (Se = !P && (!this.cacheOptions.skipAPI || X), this._onChange(null, { isFromServer: !1, flagsChanged: B, traitsChanged: z }, this._loadedState(null, p.CACHE, Se)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && te && !X && this.log("Skipping API, using cache"), Se && this.getFlags().catch(function(dt) {
389
+ return H.trys.push([1, 5, , 6]), x = JSON.parse(q), te = !1, X = !1, x && x.api === this.api && ((xe = (Ce = x.evaluationContext) === null || Ce === void 0 ? void 0 : Ce.environment) === null || xe === void 0 ? void 0 : xe.apiKey) === ((we = this.evaluationContext.environment) === null || we === void 0 ? void 0 : we.apiKey) && (M = !0, this.evaluationContext.identity && ((Oe = (Ee = x.evaluationContext) === null || Ee === void 0 ? void 0 : Ee.identity) === null || Oe === void 0 ? void 0 : Oe.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Te = (ke = x.evaluationContext) === null || ke === void 0 ? void 0 : ke.identity) === null || Te === void 0 ? void 0 : Te.identifier) + " to " + this.evaluationContext.identity.identifier), M = !1), this.cacheOptions.ttl && (!x.ts || (/* @__PURE__ */ new Date()).valueOf() - x.ts > this.cacheOptions.ttl) && (x.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), M = !1) : x.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), X = !0, M = !0)), M && (te = !0, z = E((Le = this.evaluationContext.identity) === null || Le === void 0 ? void 0 : Le.traits, (Pe = (je = x.evaluationContext) === null || je === void 0 ? void 0 : je.identity) === null || Pe === void 0 ? void 0 : Pe.traits), B = E(this.flags, x.flags), this.setState(s(s({}, x), { evaluationContext: Y(s(s({}, x.evaluationContext), { identity: !((Ae = x.evaluationContext) === null || Ae === void 0) && Ae.identity ? s(s({}, (Fe = x.evaluationContext) === null || Fe === void 0 ? void 0 : Fe.identity), { traits: s(s({}, ((Ne = (Ie = x.evaluationContext) === null || Ie === void 0 ? void 0 : Ie.identity) === null || Ne === void 0 ? void 0 : Ne.traits) || {}), ae || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", x))), te ? (Se = !I && (!this.cacheOptions.skipAPI || X), this._onChange(null, { isFromServer: !1, flagsChanged: B, traitsChanged: z }, this._loadedState(null, f.CACHE, Se)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && te && !X && this.log("Skipping API, using cache"), Se && this.getFlags().catch(function(dt) {
390
390
  var De;
391
391
  (De = at.onError) === null || De === void 0 || De.call(at, dt);
392
392
  }), [3, 4]) : [3, 2];
393
393
  case 2:
394
- return P ? [3, 4] : [4, this.getFlags()];
394
+ return I ? [3, 4] : [4, this.getFlags()];
395
395
  case 3:
396
396
  H.sent(), H.label = 4;
397
397
  case 4:
@@ -401,14 +401,14 @@ var qe = { exports: {} };
401
401
  case 6:
402
402
  return [3, 10];
403
403
  case 7:
404
- return P ? [3, 9] : [4, this.getFlags()];
404
+ return I ? [3, 9] : [4, this.getFlags()];
405
405
  case 8:
406
406
  return H.sent(), [3, 10];
407
407
  case 9:
408
- if (j) this._onChange(null, { isFromServer: !1, flagsChanged: w({}, this.flags), traitsChanged: w({}, (Re = this.evaluationContext.identity) === null || Re === void 0 ? void 0 : Re.traits) }, this._loadedState(null, p.DEFAULT_FLAGS));
408
+ if (F) this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (Re = this.evaluationContext.identity) === null || Re === void 0 ? void 0 : Re.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
409
409
  else {
410
410
  if (!this.flags) throw new Error(me);
411
- this._onChange(null, { isFromServer: !1, flagsChanged: w({}, this.flags), traitsChanged: w({}, (Ue = this.evaluationContext.identity) === null || Ue === void 0 ? void 0 : Ue.traits) }, this._loadedState(null, p.DEFAULT_FLAGS));
411
+ this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (Ue = this.evaluationContext.identity) === null || Ue === void 0 ? void 0 : Ue.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
412
412
  }
413
413
  H.label = 10;
414
414
  case 10:
@@ -418,9 +418,9 @@ var qe = { exports: {} };
418
418
  });
419
419
  }, D.label = 2;
420
420
  case 2:
421
- return D.trys.push([2, 7, , 8]), A.getItemSync ? (be = A.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
421
+ return D.trys.push([2, 7, , 8]), j.getItemSync ? (be = j.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
422
422
  case 3:
423
- return [4, A.getItem(this.getStorageKey())];
423
+ return [4, j.getItem(this.getStorageKey())];
424
424
  case 4:
425
425
  be = D.sent(), D.label = 5;
426
426
  case 5:
@@ -431,12 +431,12 @@ var qe = { exports: {} };
431
431
  case 8:
432
432
  return [3, 12];
433
433
  case 9:
434
- return P ? [3, 11] : [4, this.getFlags()];
434
+ return I ? [3, 11] : [4, this.getFlags()];
435
435
  case 10:
436
436
  return D.sent(), [3, 12];
437
437
  case 11:
438
- if (j) this._onChange(null, { isFromServer: !1, flagsChanged: w({}, j), traitsChanged: w({}, (e = a.identity) === null || e === void 0 ? void 0 : e.traits) }, this._loadedState(null, p.DEFAULT_FLAGS));
439
- else if (this.flags && (oe = null, Object.keys(this.flags).length === 0 && (oe = me), this._onChange(null, { isFromServer: !1, flagsChanged: w({}, this.flags), traitsChanged: w({}, (r = a.identity) === null || r === void 0 ? void 0 : r.traits) }, this._loadedState(oe, p.DEFAULT_FLAGS)), oe)) throw new Error(oe);
438
+ if (F) this._onChange(null, { isFromServer: !1, flagsChanged: E({}, F), traitsChanged: E({}, (e = a.identity) === null || e === void 0 ? void 0 : e.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
439
+ else if (this.flags && (oe = null, Object.keys(this.flags).length === 0 && (oe = me), this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (r = a.identity) === null || r === void 0 ? void 0 : r.traits) }, this._loadedState(oe, f.DEFAULT_FLAGS)), oe)) throw new Error(oe);
440
440
  D.label = 12;
441
441
  case 12:
442
442
  return [3, 14];
@@ -452,7 +452,7 @@ var qe = { exports: {} };
452
452
  }, i.prototype.identify = function(t, e, r) {
453
453
  return this.evaluationContext.identity = { identifier: t, transient: r, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == t ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = t, this.log("Identify: " + this.evaluationContext.identity.identifier), e && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(e).map(function(n) {
454
454
  var a = n[0], o = n[1];
455
- return [a, I(o) ? o : { value: o }];
455
+ return [a, A(o) ? o : { value: o }];
456
456
  }))), this.initialised ? this.getFlags() : Promise.resolve();
457
457
  }, i.prototype.getState = function() {
458
458
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
@@ -468,17 +468,17 @@ var qe = { exports: {} };
468
468
  return t === void 0 && (t = null), r === void 0 && (r = !1), { error: t, isFetching: r, isLoading: !1, source: e };
469
469
  }, i.prototype.log = function() {
470
470
  for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
471
- this.enableLogs && console.log.apply(this, F(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], t));
471
+ this.enableLogs && console.log.apply(this, P(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], t));
472
472
  }, i.prototype.updateStorage = function() {
473
473
  if (this.cacheFlags) {
474
474
  this.ts = (/* @__PURE__ */ new Date()).valueOf();
475
475
  var t = JSON.stringify(this.getState());
476
- this.log("Setting storage", t), A.setItem(this.getStorageKey(), t);
476
+ this.log("Setting storage", t), j.setItem(this.getStorageKey(), t);
477
477
  }
478
478
  }, i.prototype.updateEventStorage = function() {
479
479
  if (this.enableAnalytics) {
480
480
  var t = JSON.stringify(this.getState().evaluationEvent);
481
- A.setItem(le, t).catch(function(e) {
481
+ j.setItem(le, t).catch(function(e) {
482
482
  return console.error("Flagsmith: Error setting item in async storage", e);
483
483
  });
484
484
  }
@@ -487,7 +487,7 @@ var qe = { exports: {} };
487
487
  W(t, this.loadingState) || (this.loadingState = s({}, t), this.log("Loading state changed", t), (e = this._triggerLoadingState) === null || e === void 0 || e.call(this));
488
488
  }, i.prototype.setupRealtime = function(t, e) {
489
489
  var r = this, n = t + "sse/environments/" + e + "/stream";
490
- fe ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new fe(n), this.eventSource.addEventListener("environment_updated", function(a) {
490
+ pe ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new pe(n), this.eventSource.addEventListener("environment_updated", function(a) {
491
491
  var o;
492
492
  try {
493
493
  o = JSON.parse(a.data).updated_at;
@@ -537,7 +537,7 @@ var qe = { exports: {} };
537
537
  }
538
538
  }
539
539
  return o;
540
- }, pe = function(i, t, e) {
540
+ }, fe = function(i, t, e) {
541
541
  if (arguments.length === 2) for (var r, n = 0, a = t.length; n < a; n++) !r && n in t || (r || (r = Array.prototype.slice.call(t, 0, n)), r[n] = t[n]);
542
542
  return i.concat(r || Array.prototype.slice.call(t));
543
543
  }, _t = function(i) {
@@ -595,7 +595,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
595
595
  t && t.lastEventId && (this._lastEventId = t.lastEventId);
596
596
  var n = this._listeners[t.type];
597
597
  if (n != null) try {
598
- for (var a = $e(pe([], Xe(n), !1)), o = a.next(); !o.done; o = a.next())
598
+ for (var a = $e(fe([], Xe(n), !1)), o = a.next(); !o.done; o = a.next())
599
599
  o.value.call(this, t);
600
600
  } catch (v) {
601
601
  e = { error: v };
@@ -615,7 +615,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
615
615
  }, i.prototype.addEventListener = function(t, e, r) {
616
616
  this._listeners[t] == null && (this._listeners[t] = [], this._eventSource != null && this._eventSource.addEventListener(t, this._onevent_wrapped));
617
617
  var n = this._listeners[t];
618
- n.includes(e) || (this._listeners[t] = pe(pe([], Xe(n), !1), [e], !1));
618
+ n.includes(e) || (this._listeners[t] = fe(fe([], Xe(n), !1), [e], !1));
619
619
  }, i.prototype.removeEventListener = function(t, e, r) {
620
620
  var n = this._listeners[t];
621
621
  this._listeners[t] = n.filter(function(a) {
@@ -643,25 +643,21 @@ Consider loading an EventSource polyfill and making it available globally as Eve
643
643
  return c.toLowerCase() in v;
644
644
  } } };
645
645
  };
646
- for (var g in n.open(t.method || "get", i, !0), n.onload = function() {
647
- n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(c, m, k) {
648
- a.push(m = m.toLowerCase()), o.push([m, k]), v[m] = v[m] ? v[m] + "," + k : k;
646
+ for (var y in n.open(t.method || "get", i, !0), n.onload = function() {
647
+ n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(c, b, k) {
648
+ a.push(b = b.toLowerCase()), o.push([b, k]), v[b] = v[b] ? v[b] + "," + k : k;
649
649
  }), e(d());
650
- }, n.onerror = r, n.withCredentials = t.credentials == "include", t.headers) n.setRequestHeader(g, t.headers[g]);
650
+ }, n.onerror = r, n.withCredentials = t.credentials == "include", t.headers) n.setRequestHeader(y, t.headers[y]);
651
651
  n.send(t.body || null);
652
652
  });
653
- }, Ze = He({ AsyncStorage: f, fetch: Ye, eventSource: We });
653
+ }, Ze = He({ AsyncStorage: p, fetch: Ye, eventSource: We });
654
654
  typeof window < "u" && (window.flagsmith = Ze), _.createFlagsmithInstance = function() {
655
- return He({ AsyncStorage: f, fetch: Ye, eventSource: We });
655
+ return He({ AsyncStorage: p, fetch: Ye, eventSource: We });
656
656
  }, _.default = Ze, Object.defineProperty(_, "__esModule", { value: !0 });
657
657
  });
658
658
  })(qe, qe.exports);
659
659
  var gt = qe.exports, yt = {
660
- NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first.",
661
- INVALID_CONFIG: "Invalid Flagsmith configuration",
662
- FETCH_FAILED: "Failed to fetch Flagsmith configuration",
663
- NO_USER_CONTEXT: "User context not set. Call setUser() first.",
664
- ALREADY_INITIALIZED: "FeatureFlag is already initialized."
660
+ NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first."
665
661
  }, st = "business", J, mt = (J = class {
666
662
  constructor() {
667
663
  ce(this, "flagsmithClient", null);
@@ -678,16 +674,16 @@ var gt = qe.exports, yt = {
678
674
  if (!this.flagsmithClient)
679
675
  try {
680
676
  this.flagsmithClient = gt.createFlagsmithInstance();
681
- const f = _.reduce((s, O) => (s[O.feature.name] = O, s), {});
677
+ const p = _.reduce((s, O) => (s[O.feature.name] = O, s), {});
682
678
  await this.flagsmithClient.init({
683
679
  environmentID: u.apiKey,
684
680
  api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
685
681
  enableAnalytics: (u == null ? void 0 : u.enableAnalytics) ?? !0,
686
- defaultFlags: f,
682
+ defaultFlags: p,
687
683
  cacheFlags: (u == null ? void 0 : u.cacheFlags) ?? !0
688
684
  });
689
- } catch (f) {
690
- throw console.error("Failed to initialize FeatureFlag:", f), f;
685
+ } catch (p) {
686
+ throw console.error("Failed to initialize FeatureFlag:", p), p;
691
687
  }
692
688
  }
693
689
  async setUser(u) {
@@ -708,25 +704,25 @@ var gt = qe.exports, yt = {
708
704
  async getFlags() {
709
705
  this.ensureInitialized();
710
706
  const u = this.flagsmithClient.getAllFlags();
711
- return Object.entries(u).map(([_, f]) => {
707
+ return Object.entries(u).map(([_, p]) => {
712
708
  var s;
713
709
  return {
714
710
  feature: {
715
711
  name: _,
716
- id: (f == null ? void 0 : f.id) ?? 0
712
+ id: (p == null ? void 0 : p.id) ?? 0
717
713
  },
718
- enabled: f.enabled,
719
- value: ((s = f.value) == null ? void 0 : s.toString()) ?? null
714
+ enabled: p.enabled,
715
+ value: ((s = p.value) == null ? void 0 : s.toString()) ?? null
720
716
  };
721
717
  });
722
718
  }
723
719
  getFlagValue(u, _) {
724
720
  this.ensureInitialized();
725
- const f = this.flagsmithClient.getValue(u);
726
- if (f == null)
721
+ const p = this.flagsmithClient.getValue(u);
722
+ if (p == null)
727
723
  return null;
728
724
  try {
729
- const s = f.toString();
725
+ const s = p.toString();
730
726
  return _ ? _(s) : typeof {} == "number" ? isNaN(Number(s)) ? null : Number(s) : typeof {} == "boolean" ? s.toLowerCase() === "true" : s;
731
727
  } catch (s) {
732
728
  return console.error("Error transforming flag value:", s), null;
@@ -736,28 +732,28 @@ var gt = qe.exports, yt = {
736
732
  this.ensureInitialized();
737
733
  const _ = this.flagsmithClient.getValue(u);
738
734
  if (_ == null) return null;
739
- const f = this.flagsmithClient.hasFeature(u);
735
+ const p = this.flagsmithClient.hasFeature(u);
740
736
  return {
741
737
  feature: {
742
738
  name: u,
743
739
  id: 0
744
740
  },
745
- enabled: f,
741
+ enabled: p,
746
742
  value: _.toString()
747
743
  };
748
744
  }
749
- async getUserFlagValue(u, _, f = null, s) {
745
+ async getUserFlagValue(u, _, p = null, s) {
750
746
  var K;
751
747
  const O = this.userContext;
752
748
  try {
753
- return await this.setUser(u), this.getFlagValue(_, s) ?? f;
754
- } catch (F) {
755
- return console.error(`Error getting user flag value for ${_}:`, F), f;
749
+ return await this.setUser(u), this.getFlagValue(_, s) ?? p;
750
+ } catch (P) {
751
+ return console.error(`Error getting user flag value for ${_}:`, P), p;
756
752
  } finally {
757
753
  try {
758
754
  await ((K = this.flagsmithClient) == null ? void 0 : K.logout()), this.userContext = null, O && await this.setUser(O.identifier);
759
- } catch (F) {
760
- console.error("Error during cleanup:", F);
755
+ } catch (P) {
756
+ console.error("Error during cleanup:", P);
761
757
  }
762
758
  }
763
759
  }
@@ -766,49 +762,49 @@ var gt = qe.exports, yt = {
766
762
  }
767
763
  }, ce(J, "instance"), J), bt = mt.getInstance(), se = de(!1), _e = de([]), ne = de(null);
768
764
  function St(l = bt) {
769
- const u = () => se.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), _ = async (p, C = []) => {
765
+ const u = () => se.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), _ = async (f, C = []) => {
770
766
  if (se.value) {
771
767
  console.warn("FeatureFlag is already initialized.");
772
768
  return;
773
769
  }
774
770
  try {
775
- await l.init(p, C), _e.value = await l.getFlags(), se.value = !0, ne.value = null;
776
- } catch (E) {
777
- console.error("Failed to initialize feature flags:", E), ne.value = E;
771
+ await l.init(f, C), _e.value = await l.getFlags(), se.value = !0, ne.value = null;
772
+ } catch (w) {
773
+ console.error("Failed to initialize feature flags:", w), ne.value = w;
778
774
  }
779
- }, f = async (p) => {
775
+ }, p = async (f) => {
780
776
  if (u())
781
777
  try {
782
- await l.setUser(p), _e.value = await l.getFlags(), ne.value = null;
778
+ await l.setUser(f), _e.value = await l.getFlags(), ne.value = null;
783
779
  } catch (C) {
784
780
  console.error("Failed to set user:", C), ne.value = C;
785
781
  }
786
- }, s = async (p) => f(`${st}-${p}`), O = (p, C, E = null) => {
787
- if (!u()) return E;
782
+ }, s = async (f) => p(`${st}-${f}`), O = (f, C, w = null) => {
783
+ if (!u()) return w;
788
784
  try {
789
- return l.getFlagValue(p, C) ?? E;
790
- } catch (I) {
791
- return console.error(`Error getting flag value for ${p}:`, I), E;
785
+ return l.getFlagValue(f, C) ?? w;
786
+ } catch (A) {
787
+ return console.error(`Error getting flag value for ${f}:`, A), w;
792
788
  }
793
- }, K = (p, C) => {
789
+ }, K = (f, C) => {
794
790
  if (!u()) return C ?? null;
795
791
  try {
796
- return l.getFlag(p) ?? C ?? null;
797
- } catch (E) {
798
- return console.error(`Error getting flag for ${p}:`, E), C ?? null;
792
+ return l.getFlag(f) ?? C ?? null;
793
+ } catch (w) {
794
+ return console.error(`Error getting flag for ${f}:`, w), C ?? null;
799
795
  }
800
- }, F = async (p, C, E = null, I) => {
801
- if (!u()) return E;
796
+ }, P = async (f, C, w = null, A) => {
797
+ if (!u()) return w;
802
798
  try {
803
- return await l.getUserFlagValue(p, C, E, I);
799
+ return await l.getUserFlagValue(f, C, w, A);
804
800
  } catch ($) {
805
- return console.error(`Error getting user flag value for ${C}:`, $), E;
801
+ return console.error(`Error getting user flag value for ${C}:`, $), w;
806
802
  }
807
- }, W = async (p, C, E = null, I) => F(`${st}-${p}`, C, E, I), w = () => {
803
+ }, W = async (f, C, w = null, A) => P(`${st}-${f}`, C, w, A), E = () => {
808
804
  try {
809
805
  l.reset();
810
- } catch (p) {
811
- console.error("Error resetting feature flags:", p);
806
+ } catch (f) {
807
+ console.error("Error resetting feature flags:", f);
812
808
  } finally {
813
809
  _e.value = [], se.value = !1, ne.value = null;
814
810
  }
@@ -818,16 +814,16 @@ function St(l = bt) {
818
814
  isInitialized: Ge(se),
819
815
  error: Ge(ne),
820
816
  init: _,
821
- setUser: f,
817
+ setUser: p,
822
818
  setBusiness: s,
823
819
  getFlagValue: O,
824
820
  getFlag: K,
825
- getUserFlagValue: F,
821
+ getUserFlagValue: P,
826
822
  getBusinessFlagValue: W,
827
- reset: w
823
+ reset: E
828
824
  };
829
825
  }
830
- var he = () => St(), y = /* @__PURE__ */ ((l) => (l.inventory_portal_must_use_transfer_template = "inventory_portal_must_use_transfer_template", l.inventory_portal_use_iframe = "inventory_portal_use_iframe", l.inventory_pos_adjust_v1 = "inventory_pos_adjust_v1", l.inventory_pos_adjust_v2_wastage = "inventory_pos_adjust_v2_wastage", l.inventory_pos_closing_recalculation = "inventory_pos_closing_recalculation", l.inventory_pos_closing_v1 = "inventory_pos_closing_v1", l.inventory_pos_closing_v2 = "inventory_pos_closing_v2", l.inventory_pos_convert_v1 = "inventory_pos_convert_v1", l.inventory_pos_costing = "inventory_pos_costing", l.inventory_pos_stock_return = "inventory_pos_stock_return", l.inventory_pos_transfer_require_fulfillment = "inventory_pos_transfer_require_fulfillment", l.inventory_purchase_order_approval = "inventory_purchase_order_approval", l.inventory_portal_xilnex_transfer_note = "inventory_portal_xilnex_transfer_note", l.inventory_portal_custom_attribute = "inventory_portal_custom_attribute", l.inventory_portal_purchase_order_v2 = "inventory_portal_purchase_order_v2", l.inventory_portal_accept_require_fulfillment = "inventory_portal_accept_require_fulfillment", l.inventory_portal_po_operate_v2 = "inventory_portal_po_operate_v2", l.inventory_pos_allow_receive_order = "inventory_pos_allow_receive_order", l.inventory_xilnex_opening_migration = "inventory_xilnex_opening_migration", l.inventory_ingredient_group = "inventory_ingredient_group", l.inventory_purchase_order_backdate = "inventory_purchase_order_backdate", l.inventory_synergy_opening_migration = "inventory_synergy_opening_migration", l.inventory_netsuite_inventory_transfer_out = "inventory_netsuite_inventory_transfer_out", l.inventory_portal_supplier_preparation_time = "inventory_portal_supplier_preparation_time", l.inventory_backdate_receive = "inventory_backdate_receive", l.inventory_portal_delivery_order_write = "inventory_portal_delivery_order_write", l.inventory_purchase_order_custom_cost = "inventory_purchase_order_custom_cost", l.inventory_bulk_import = "inventory_bulk_import", l.inventory_portal_surcharge = "inventory_portal_surcharge", l.inventory_purchase_order_cost_edit = "inventory_purchase_order_cost_edit", l.inventory_purchase_order_workflow_allow_to_mark_completed = "inventory_purchase_order_workflow_allow_to_mark_completed", l.inventory_recipe_v2 = "inventory_recipe_v2", l.inventory_print_template = "inventory_print_template", l.inventory_purchase_order_email = "inventory_purchase_order_email", l.inventory_bulk_edit_recipes = "inventory_bulk_edit_recipes", l.inventory_stocksnapshot_cron_beta = "inventory_stocksnapshot_cron_beta", l.inventory_scheduler_daily_stock_snapshot = "inventory_scheduler_daily_stock_snapshot", l.inventory_scheduler_hourly_recalculation = "inventory_scheduler_hourly_recalculation", l))(y || {});
826
+ var he = () => St(), g = /* @__PURE__ */ ((l) => (l.inventory_portal_must_use_transfer_template = "inventory_portal_must_use_transfer_template", l.inventory_portal_use_iframe = "inventory_portal_use_iframe", l.inventory_pos_adjust_v1 = "inventory_pos_adjust_v1", l.inventory_pos_adjust_v2_wastage = "inventory_pos_adjust_v2_wastage", l.inventory_pos_closing_recalculation = "inventory_pos_closing_recalculation", l.inventory_pos_closing_v1 = "inventory_pos_closing_v1", l.inventory_pos_closing_v2 = "inventory_pos_closing_v2", l.inventory_pos_convert_v1 = "inventory_pos_convert_v1", l.inventory_pos_costing = "inventory_pos_costing", l.inventory_pos_stock_return = "inventory_pos_stock_return", l.inventory_pos_transfer_require_fulfillment = "inventory_pos_transfer_require_fulfillment", l.inventory_purchase_order_approval = "inventory_purchase_order_approval", l.inventory_portal_xilnex_transfer_note = "inventory_portal_xilnex_transfer_note", l.inventory_portal_custom_attribute = "inventory_portal_custom_attribute", l.inventory_portal_purchase_order_v2 = "inventory_portal_purchase_order_v2", l.inventory_portal_accept_require_fulfillment = "inventory_portal_accept_require_fulfillment", l.inventory_portal_po_operate_v2 = "inventory_portal_po_operate_v2", l.inventory_pos_allow_receive_order = "inventory_pos_allow_receive_order", l.inventory_xilnex_opening_migration = "inventory_xilnex_opening_migration", l.inventory_ingredient_group = "inventory_ingredient_group", l.inventory_purchase_order_backdate = "inventory_purchase_order_backdate", l.inventory_synergy_opening_migration = "inventory_synergy_opening_migration", l.inventory_netsuite_inventory_transfer_out = "inventory_netsuite_inventory_transfer_out", l.inventory_portal_supplier_preparation_time = "inventory_portal_supplier_preparation_time", l.inventory_backdate_receive = "inventory_backdate_receive", l.inventory_portal_delivery_order_write = "inventory_portal_delivery_order_write", l.inventory_purchase_order_custom_cost = "inventory_purchase_order_custom_cost", l.inventory_bulk_import = "inventory_bulk_import", l.inventory_portal_surcharge = "inventory_portal_surcharge", l.inventory_purchase_order_cost_edit = "inventory_purchase_order_cost_edit", l.inventory_purchase_order_price_adjustment = "inventory_purchase_order_price_adjustment", l.inventory_purchase_order_workflow_allow_to_mark_completed = "inventory_purchase_order_workflow_allow_to_mark_completed", l.inventory_recipe_v2 = "inventory_recipe_v2", l.inventory_print_template = "inventory_print_template", l.inventory_purchase_order_email = "inventory_purchase_order_email", l.inventory_bulk_edit_recipes = "inventory_bulk_edit_recipes", l.inventory_stocksnapshot_cron_beta = "inventory_stocksnapshot_cron_beta", l.inventory_scheduler_daily_stock_snapshot = "inventory_scheduler_daily_stock_snapshot", l.inventory_scheduler_hourly_recalculation = "inventory_scheduler_hourly_recalculation", l))(g || {});
831
827
  const Ct = /* @__PURE__ */ new Set([
832
828
  // vivo pizza prod
833
829
  "business_6687e91fa7240b001ba3f4c2",
@@ -869,6 +865,7 @@ function lt() {
869
865
  inventory_bulk_import: !1,
870
866
  inventory_portal_surcharge: !1,
871
867
  inventory_purchase_order_cost_edit: !1,
868
+ inventory_purchase_order_price_adjustment: !1,
872
869
  inventory_purchase_order_workflow_allow_to_mark_completed: !1,
873
870
  inventory_recipe_v2: !1,
874
871
  inventory_print_template: !1,
@@ -879,7 +876,7 @@ function lt() {
879
876
  report_portal_po_forecast_days_default: 7
880
877
  };
881
878
  }
882
- const h = de(lt()), Et = () => ({
879
+ const h = de(lt()), wt = () => ({
883
880
  get businessDbName() {
884
881
  var _;
885
882
  return `business_${((_ = Ke().currentBusiness.value) == null ? void 0 : _._id) ?? ""}`;
@@ -892,9 +889,9 @@ const h = de(lt()), Et = () => ({
892
889
  var _;
893
890
  const l = Ve();
894
891
  return (_ = Ke().restaurants.value.find(
895
- (f) => {
892
+ (p) => {
896
893
  var s;
897
- return f._id === ((s = l._currentLocation) == null ? void 0 : s.doc._id);
894
+ return p._id === ((s = l._currentLocation) == null ? void 0 : s.doc._id);
898
895
  }
899
896
  )) == null ? void 0 : _.posVersion;
900
897
  },
@@ -981,6 +978,9 @@ const h = de(lt()), Et = () => ({
981
978
  get enablePurchaseOrderCostEdit() {
982
979
  return h.value.inventory_purchase_order_cost_edit;
983
980
  },
981
+ get enablePurchaseOrderPriceAdjustment() {
982
+ return h.value.inventory_purchase_order_price_adjustment;
983
+ },
984
984
  get poWorkflowAllowToMarkCompleted() {
985
985
  return h.value.inventory_purchase_order_workflow_allow_to_mark_completed;
986
986
  },
@@ -1006,81 +1006,84 @@ const h = de(lt()), Et = () => ({
1006
1006
  return h.value.report_portal_po_forecast_days_default;
1007
1007
  },
1008
1008
  async init() {
1009
- const l = Ke(), { init: u, setBusiness: _ } = he(), f = pt(), s = l.namespace.value === "prod";
1009
+ const l = Ke(), { init: u, setBusiness: _ } = he(), p = ft(), s = l.namespace.value === "prod";
1010
1010
  await u({
1011
1011
  apiKey: s ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
1012
1012
  // url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
1013
1013
  // enableAnalytics: true, // optional, defaults to true
1014
1014
  // cacheFlags: true // optional, defaults to true
1015
1015
  }), Ve().watchLocation(async (K) => {
1016
- var I, $, Y;
1016
+ var A, $, Y;
1017
1017
  if (!K) {
1018
1018
  h.value = lt();
1019
1019
  return;
1020
1020
  }
1021
- const F = ((I = l.currentBusiness.value) == null ? void 0 : I._id) ?? "";
1022
- await _(F);
1023
- const W = `business_${F}`, w = K.type === ot.enum.warehouse, p = (
1021
+ const P = ((A = l.currentBusiness.value) == null ? void 0 : A._id) ?? "";
1022
+ await _(P);
1023
+ const W = `business_${P}`, E = K.type === ot.enum.warehouse, f = (
1024
1024
  // if menu v4, must manual receive && must use outlet app
1025
1025
  (($ = l.currentBusiness.value) == null ? void 0 : $.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
1026
1026
  // TODO: may be removed to use menu version only
1027
1027
  Ct.has(this.businessDbName)
1028
- ), C = xt.has(W) || S(y.inventory_portal_must_use_transfer_template), E = S(y.inventory_purchase_order_backdate) && (this.isWarehouse || f.state.closing !== null);
1028
+ ), C = xt.has(W) || m(g.inventory_portal_must_use_transfer_template), w = m(g.inventory_purchase_order_backdate) && (this.isWarehouse || p.state.closing !== null);
1029
1029
  h.value = {
1030
1030
  isLoaded: !0,
1031
1031
  enableTotalCost: ((Y = l.currentBusiness.value) == null ? void 0 : Y.menuVersion) === "v4",
1032
- enableBackdatePo: E,
1033
- autoReceiveWarehouse: w && !p,
1034
- manualReceive: p,
1032
+ enableBackdatePo: w,
1033
+ autoReceiveWarehouse: E && !f,
1034
+ manualReceive: f,
1035
1035
  enablePoTemplate: C,
1036
- enableClosingTemplate: S(y.inventory_pos_closing_v2),
1037
- enableWastageTemplate: S(y.inventory_pos_adjust_v2_wastage),
1038
- enableIngredientGroup: S(y.inventory_ingredient_group),
1036
+ enableClosingTemplate: m(g.inventory_pos_closing_v2),
1037
+ enableWastageTemplate: m(g.inventory_pos_adjust_v2_wastage),
1038
+ enableIngredientGroup: m(g.inventory_ingredient_group),
1039
1039
  mustUsePoTemplate: C,
1040
1040
  businessSupplierOnly: C,
1041
- enableXilnexTransferNote: S(y.inventory_portal_xilnex_transfer_note),
1042
- enableCustomAttribute: S(y.inventory_portal_custom_attribute),
1043
- usePurchaseOrderV2: S(y.inventory_portal_purchase_order_v2),
1044
- acceptRequireFulfillment: S(
1045
- y.inventory_portal_accept_require_fulfillment
1041
+ enableXilnexTransferNote: m(g.inventory_portal_xilnex_transfer_note),
1042
+ enableCustomAttribute: m(g.inventory_portal_custom_attribute),
1043
+ usePurchaseOrderV2: m(g.inventory_portal_purchase_order_v2),
1044
+ acceptRequireFulfillment: m(
1045
+ g.inventory_portal_accept_require_fulfillment
1046
+ ),
1047
+ useOperatePurchaseOrderV2: m(g.inventory_portal_po_operate_v2),
1048
+ inventory_xilnex_opening_migration: m(
1049
+ g.inventory_xilnex_opening_migration
1046
1050
  ),
1047
- useOperatePurchaseOrderV2: S(y.inventory_portal_po_operate_v2),
1048
- inventory_xilnex_opening_migration: S(
1049
- y.inventory_xilnex_opening_migration
1051
+ inventory_synergy_opening_migration: m(
1052
+ g.inventory_synergy_opening_migration
1050
1053
  ),
1051
- inventory_synergy_opening_migration: S(
1052
- y.inventory_synergy_opening_migration
1054
+ inventory_netsuite_inventory_transfer_out: m(
1055
+ g.inventory_netsuite_inventory_transfer_out
1053
1056
  ),
1054
- inventory_netsuite_inventory_transfer_out: S(
1055
- y.inventory_netsuite_inventory_transfer_out
1057
+ inventory_portal_supplier_preparation_time: m(
1058
+ g.inventory_portal_supplier_preparation_time
1056
1059
  ),
1057
- inventory_portal_supplier_preparation_time: S(
1058
- y.inventory_portal_supplier_preparation_time
1060
+ inventory_portal_delivery_order_write: m(
1061
+ g.inventory_portal_delivery_order_write
1059
1062
  ),
1060
- inventory_portal_delivery_order_write: S(
1061
- y.inventory_portal_delivery_order_write
1063
+ inventory_pos_transfer_require_fulfillment: m(
1064
+ g.inventory_pos_transfer_require_fulfillment
1062
1065
  ),
1063
- inventory_pos_transfer_require_fulfillment: S(
1064
- y.inventory_pos_transfer_require_fulfillment
1066
+ inventory_backdate_receive: m(g.inventory_backdate_receive),
1067
+ inventory_purchase_order_custom_cost: m(
1068
+ g.inventory_purchase_order_custom_cost
1065
1069
  ),
1066
- inventory_backdate_receive: S(y.inventory_backdate_receive),
1067
- inventory_purchase_order_custom_cost: S(
1068
- y.inventory_purchase_order_custom_cost
1070
+ inventory_bulk_import: m(g.inventory_bulk_import),
1071
+ inventory_portal_surcharge: m(g.inventory_portal_surcharge),
1072
+ inventory_purchase_order_cost_edit: m(
1073
+ g.inventory_purchase_order_cost_edit
1069
1074
  ),
1070
- inventory_bulk_import: S(y.inventory_bulk_import),
1071
- inventory_portal_surcharge: S(y.inventory_portal_surcharge),
1072
- inventory_purchase_order_cost_edit: S(
1073
- y.inventory_purchase_order_cost_edit
1075
+ inventory_purchase_order_price_adjustment: m(
1076
+ g.inventory_purchase_order_price_adjustment
1074
1077
  ),
1075
- inventory_purchase_order_workflow_allow_to_mark_completed: S(
1076
- y.inventory_purchase_order_workflow_allow_to_mark_completed
1078
+ inventory_purchase_order_workflow_allow_to_mark_completed: m(
1079
+ g.inventory_purchase_order_workflow_allow_to_mark_completed
1077
1080
  ),
1078
- inventory_recipe_v2: S(y.inventory_recipe_v2),
1079
- inventory_print_template: S(y.inventory_print_template),
1080
- inventory_purchase_order_email: S(y.inventory_purchase_order_email),
1081
- inventory_bulk_edit_recipes: S(y.inventory_bulk_edit_recipes),
1082
- inventory_receive_request_beta: S("inventory_receive_request_beta"),
1083
- report_portal_po_forecast_days_constraint: wt(
1081
+ inventory_recipe_v2: m(g.inventory_recipe_v2),
1082
+ inventory_print_template: m(g.inventory_print_template),
1083
+ inventory_purchase_order_email: m(g.inventory_purchase_order_email),
1084
+ inventory_bulk_edit_recipes: m(g.inventory_bulk_edit_recipes),
1085
+ inventory_receive_request_beta: m("inventory_receive_request_beta"),
1086
+ report_portal_po_forecast_days_constraint: Et(
1084
1087
  "report_portal_po_forecast_days_constraint"
1085
1088
  ),
1086
1089
  report_portal_po_forecast_days_default: Ot(
@@ -1099,14 +1102,14 @@ const h = de(lt()), Et = () => ({
1099
1102
  });
1100
1103
  }
1101
1104
  });
1102
- function S(l, u) {
1105
+ function m(l, u) {
1103
1106
  u = u === void 0 ? null : u;
1104
1107
  const { getFlagValue: _ } = he();
1105
- return _(l, (f) => f === "true") ?? u;
1108
+ return _(l, (p) => p === "true") ?? u;
1106
1109
  }
1107
- function wt(l) {
1110
+ function Et(l) {
1108
1111
  const { getFlagValue: u } = he();
1109
- return u(l, (f) => f.trim() ? f.trim() : null) ?? null;
1112
+ return u(l, (p) => p.trim() ? p.trim() : null) ?? null;
1110
1113
  }
1111
1114
  function Ot(l, u) {
1112
1115
  const { getFlagValue: _ } = he();
@@ -1115,14 +1118,14 @@ function Ot(l, u) {
1115
1118
  return isNaN(O) ? null : O;
1116
1119
  }) ?? u;
1117
1120
  }
1118
- const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1121
+ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1119
1122
  __proto__: null,
1120
- InventoryFeatureFlags: y,
1121
- useFeatureStore: Et
1123
+ InventoryFeatureFlags: g,
1124
+ useFeatureStore: wt
1122
1125
  }, Symbol.toStringTag, { value: "Module" }));
1123
1126
  export {
1124
- y as I,
1127
+ g as I,
1125
1128
  he as a,
1126
- It as f,
1127
- Et as u
1129
+ At as f,
1130
+ wt as u
1128
1131
  };