@feedmepos/mf-inventory-portal 1.5.10 → 1.5.11-dev.1

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 (92) hide show
  1. package/dist/{App-erqZSd0c.js → App-D4rysNfh.js} +4 -4
  2. package/dist/{ApprovalView-C2CGthqi.js → ApprovalView-DpYJmgiG.js} +7 -7
  3. package/dist/{BindingsDialog-Cw6MdCbI.js → BindingsDialog-C7z0HH48.js} +2 -2
  4. package/dist/{BindingsPicker-CcSrxhUo.js → BindingsPicker-C5IKp9CT.js} +2 -2
  5. package/dist/{BindingsTable-C5nMju9L.js → BindingsTable-BRDooCs4.js} +3 -3
  6. package/dist/{ClosingDraftView-C_Loim5S.js → ClosingDraftView-CSCbfIFE.js} +15 -15
  7. package/dist/ClosingHistoryView-DCIJ5ONT.js +1114 -0
  8. package/dist/{ClosingTemplateView-PQdTcIFY.js → ClosingTemplateView-D1n9_dFc.js} +14 -14
  9. package/dist/{DefaultView-BIlFmXaB.js → DefaultView-Llrh9ufI.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-BhT1YxRZ.js → DeliveryOrderPrintPreview-DSkU-sqv.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DO7xvy5V.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DL6AKT9H.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-JHabBWJb.js} +2 -2
  13. package/dist/{FmMultiselectDialog-cXV6Jo4B.js → FmMultiselectDialog-BWujDEnX.js} +2 -2
  14. package/dist/{FmMultiselectDialog-B-X6WQXu.js → FmMultiselectDialog-C0lCYHla.js} +1 -1
  15. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CjCNHugK.js +388 -0
  16. package/dist/{ImportView-B3jO8aU8.js → ImportView-C6q4gB3S.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-GPVWrmed.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Df7B8ZEG.js} +1 -1
  18. package/dist/{IngredientGroupView-BuUoHLDb.js → IngredientGroupView-DO8OKEVU.js} +5 -5
  19. package/dist/{IngredientsView-Dq_YrtQ5.js → IngredientsView-CD2YtXPJ.js} +15 -15
  20. package/dist/{IntegrationExplorerView-Dh5ZPJK-.js → IntegrationExplorerView-CZCMnwZG.js} +352 -352
  21. package/dist/{IntegrationView-DWbHZdc4.js → IntegrationView--3nVS_X6.js} +13 -13
  22. package/dist/{InventoryBindingForm-D-EN8Tpz.js → InventoryBindingForm-FjFTiN7R.js} +1 -1
  23. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CcF5cko8.js +441 -0
  24. package/dist/{InventoryBindingSummary-BTagfxn1.js → InventoryBindingSummary-D90hAi96.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BUBHDMNn.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1iDUXU2T.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D2B20Qv0.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DTYnX8kn.js} +1 -1
  27. package/dist/{PublishView-CpiWv2n6.js → PublishView-BtcGl7zM.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-Czi5Aip0.js → PurchaseOrderPrintPreview-DvkMQv1w.js} +2 -2
  29. package/dist/{ReceiveRequestView-BVEU4j9p.js → ReceiveRequestView-DSfj36r3.js} +9631 -9552
  30. package/dist/{RecipeView-OVmWTAt-.js → RecipeView-DkDSr3LN.js} +1304 -1267
  31. package/dist/{SettingsView-CMQLojRr.js → SettingsView-iRqUoEPg.js} +4 -4
  32. package/dist/{StockView-DZeeZlJq.js → StockView-DxUXHYD_.js} +19 -19
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bf1b1rJK.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-WJ0Fz21v.js} +1 -1
  34. package/dist/{SupplierView-BcmkfFvI.js → SupplierView-BYQjWeU7.js} +12 -12
  35. package/dist/{SurchargeView-DhcatJUO.js → SurchargeView-CyhTe1B8.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6bwhx8Z.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CBM8jJqP.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-4Ti9w_wf.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DM9Cg0uk.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Dw1TIZVj.js → TransferDetails.vue_vue_type_script_setup_true_lang-D2MztVse.js} +20 -20
  39. package/dist/{TransferTemplateView-CRPvLRHd.js → TransferTemplateView-FNI6jVh0.js} +18 -18
  40. package/dist/{UnitCostHistoryView-B4pAplGT.js → UnitCostHistoryView-sGxNtk0Y.js} +4 -4
  41. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-Cn6q11Ts.js +160 -0
  42. package/dist/{UnitView-95-cARn9.js → UnitView-P8jU14k8.js} +7 -7
  43. package/dist/{WarehouseView-o1FxslRs.js → WarehouseView-NILk42Zj.js} +5 -5
  44. package/dist/{WastageTemplateView-D3hu-bq0.js → WastageTemplateView-DNrKoK3S.js} +14 -14
  45. package/dist/{app-BEJm79K1.js → app-DIOXPCfI.js} +23 -11
  46. package/dist/app.d.ts +12 -0
  47. package/dist/app.js +1 -1
  48. package/dist/{closing-template-BotB3jos.js → closing-template-DAlwSsqC.js} +1 -1
  49. package/dist/{date2-CnEklTL8.js → date2-DBIy5hnh.js} +1 -1
  50. package/dist/{dayjs.min-CUR65wqq.js → dayjs.min-B2EqUP7W.js} +1 -1
  51. package/dist/{decimal-CV_OL7iL.js → decimal-e6enR5yT.js} +2 -2
  52. package/dist/{defineDeepModel-D7NJvnaz.js → defineDeepModel-CwqnmttS.js} +1 -1
  53. package/dist/{duplicate-template-DCaAVNSG.js → duplicate-template-DRtq-b-P.js} +1 -1
  54. package/dist/{feature-BpZTiO4W.js → feature-BCSp38rL.js} +2 -2
  55. package/dist/{format-time-from-id-Awu23hHz.js → format-time-from-id-CTWNRFSC.js} +1 -1
  56. package/dist/{format-unit-display-B2_RGXzk.js → format-unit-display-BFP12VU7.js} +11 -11
  57. package/dist/{import-export.helper-BuNDvFsc.js → import-export.helper-Dr7R0Zql.js} +6 -6
  58. package/dist/{index-BBqEhoS9.js → index-BhS1AhF-.js} +1 -1
  59. package/dist/{index-BK75WSFH.js → index-C2MhE26a.js} +3 -3
  60. package/dist/{index-D_u-AkFp.js → index-Df-NlbKu.js} +1 -1
  61. package/dist/{inventory-core-dart.default-D_hfcDPc.js → inventory-core-dart.default-CW9d8gJh.js} +1 -1
  62. package/dist/{lz-string-K7l_8Og1.js → lz-string-BHfmMoLE.js} +1 -1
  63. package/dist/{netsuite-CPUKn7UQ.js → netsuite-BSEnJOMn.js} +2 -2
  64. package/dist/{number-DoYjk_zN.js → number-B1buZ_S4.js} +3 -3
  65. package/dist/{predefined-templates-CEDkdeWc.js → predefined-templates-BIFClpKf.js} +1 -1
  66. package/dist/{purchase-order-template-ChZyiCwx.js → purchase-order-template-BCt-pDW-.js} +1 -1
  67. package/dist/{recalculationUtils-CEkm9-mp.js → recalculationUtils-CASVCqt7.js} +1 -1
  68. package/dist/{rules-DDjcQi_O.js → rules-C60UHyIn.js} +2 -2
  69. package/dist/{stock-Voq2gMuS.js → stock-CkWMLoi7.js} +1 -1
  70. package/dist/{supplier-DFopX4OU.js → supplier-CiW6zfX_.js} +2 -2
  71. package/dist/{surcharge-CjwbPJQi.js → surcharge-B9FUKx0L.js} +1 -1
  72. package/dist/tsconfig.app.tsbuildinfo +1 -1
  73. package/dist/{uom-rules-CHnn3ILl.js → uom-rules-DXiQ0ZIA.js} +1 -1
  74. package/dist/{use-ingredient-select-dialog-DS6__LXy.js → use-ingredient-select-dialog-Bn8C8IG1.js} +2 -2
  75. package/dist/{use-inventory-binding-dialog-DcJJo3Lr.js → use-inventory-binding-dialog-DZQ1WG1S.js} +2 -2
  76. package/dist/{use-template-enabled-locations-BVs_0JOA.js → use-template-enabled-locations-B9YKq5YY.js} +2 -2
  77. package/dist/{use-transfer-locations-Dzp5fj3Z.js → use-transfer-locations-D0mDjUMQ.js} +2 -2
  78. package/dist/{useHrmPermission-DQQ5MYsL.js → useHrmPermission-BTkOHa4h.js} +1 -1
  79. package/dist/{useNavigationMenu-msCIV-Ux.js → useNavigationMenu-CSfM_5Wy.js} +2 -2
  80. package/dist/{useSseClient-cer6d2VA.js → useSseClient-DwJXBOEF.js} +3 -3
  81. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -0
  82. package/dist/views/receive-request/components/transfer-form/composables/use-stock-balance-toggle.d.ts +3 -0
  83. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +4 -0
  84. package/dist/{vue-i18n-BiedKAFs.js → vue-i18n-BWe-vqm2.js} +556 -556
  85. package/dist/{xlsx-DGn-BAF9.js → xlsx-BT7Z_gt_.js} +1 -1
  86. package/dist/{xlsx.util-DXnaPoeW.js → xlsx.util-Bm6lJRyh.js} +3 -3
  87. package/package.json +4 -4
  88. package/dist/ClosingHistoryView-7TcMNjKb.js +0 -1108
  89. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-BHazP1jS.js +0 -362
  90. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CI4hutH2.js +0 -404
  91. package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-D3OGljNP.js +0 -137
  92. package/dist/export-HmzdllkU.js +0 -26
@@ -1,36 +1,36 @@
1
- import { defineComponent as ie, ref as K, onMounted as pt, resolveComponent as G, openBlock as b, createElementBlock as B, Fragment as X, createElementVNode as y, toDisplayString as D, createVNode as k, createCommentVNode as U, computed as R, watch as ue, unref as n, normalizeClass as Be, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
- import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-BEJm79K1.js";
1
+ import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as y, createElementBlock as E, Fragment as X, createElementVNode as v, toDisplayString as U, createVNode as h, createCommentVNode as T, computed as A, watch as ue, unref as n, normalizeClass as Ce, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
2
+ import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-DIOXPCfI.js";
3
3
  import { useDialog as Le, useSnackbar as je, components as _e, useProxiedModel as Ge, useBreakpoints as xt } from "@feedmepos/ui-library";
4
4
  import { i as $t, _ as It, m as wt } from "./menu-usage-module-D7cxkbEk.js";
5
5
  import { F as se } from "./form-mode.enum-BKiNVH6A.js";
6
- import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-GPVWrmed.js";
6
+ import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-Df7B8ZEG.js";
7
7
  import { defineStore as ot, storeToRefs as Et } from "pinia";
8
8
  import { D as He, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
9
9
  import { c as Vt } from "./component-kqxARxvM.js";
10
- import { a as Q, c as Ke } from "./number-DoYjk_zN.js";
11
- import { useI18n as oe, useCoreStore as St } from "@feedmepos/mf-common";
12
- import { u as Bt, _ as Ct } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
13
- import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-DDjcQi_O.js";
14
- import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CI4hutH2.js";
15
- import { a as Pe } from "./FmMultiselectDialog-cXV6Jo4B.js";
16
- import { d as at } from "./defineDeepModel-D7NJvnaz.js";
10
+ import { a as Q, c as Ke } from "./number-B1buZ_S4.js";
11
+ import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
12
+ import { u as Ct, _ as Bt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
13
+ import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-C60UHyIn.js";
14
+ import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CcF5cko8.js";
15
+ import { a as Pe } from "./FmMultiselectDialog-BWujDEnX.js";
16
+ import { d as rt } from "./defineDeepModel-CwqnmttS.js";
17
17
  import { L as Tt, P as Ut, D as Pt } from "./app-DiX-EfV6.js";
18
- import { _ as Ce, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BHazP1jS.js";
19
- import { u as Gt } from "./FmMultiselectDialog-B-X6WQXu.js";
20
- import { u as Nt } from "./vue-i18n-BiedKAFs.js";
21
- import { F as zt } from "./inventory-core-dart.default-D_hfcDPc.js";
18
+ import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CjCNHugK.js";
19
+ import { u as Gt } from "./FmMultiselectDialog-C0lCYHla.js";
20
+ import { u as Nt } from "./vue-i18n-BWe-vqm2.js";
21
+ import { F as zt } from "./inventory-core-dart.default-CW9d8gJh.js";
22
22
  import { _ as Ot } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
23
- import { u as We } from "./feature-BpZTiO4W.js";
24
- import { F as he } from "./decimal-CV_OL7iL.js";
25
- import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DO7xvy5V.js";
26
- import { b as rt, d as st } from "./xlsx.util-DXnaPoeW.js";
27
- import { f as dt } from "./date2-CnEklTL8.js";
23
+ import { u as We } from "./feature-BCSp38rL.js";
24
+ import { F as he } from "./decimal-e6enR5yT.js";
25
+ import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DL6AKT9H.js";
26
+ import { b as at, d as st } from "./xlsx.util-Bm6lJRyh.js";
27
+ import { f as dt } from "./date2-DBIy5hnh.js";
28
28
  import { _ as Lt, F as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
29
- import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bf6RHJdQ.js";
29
+ import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-JHabBWJb.js";
30
30
  const Kt = {
31
31
  key: 0,
32
32
  class: "flex flex-col items-center w-full h-full gap-24"
33
- }, qt = { key: 1 }, Wt = { key: 0 }, Yt = /* @__PURE__ */ ie({
33
+ }, qt = { key: 1 }, Wt = { key: 0 }, Yt = /* @__PURE__ */ le({
34
34
  __name: "DeleteDialog",
35
35
  props: {
36
36
  type: {},
@@ -39,68 +39,68 @@ const Kt = {
39
39
  bindedItems: {}
40
40
  },
41
41
  setup(m) {
42
- const d = m, l = K(d.bindedItems || []), t = K(!1);
42
+ const d = m, l = W(d.bindedItems || []), t = W(!1);
43
43
  pt(() => {
44
44
  i();
45
45
  });
46
46
  async function i() {
47
- var a, h;
48
- !t.value && ((a = d.data) != null && a._id) && (t.value = !0, l.value = await ne().getAffectedMenu((h = d.data) == null ? void 0 : h._id), t.value = !1);
47
+ var r, x;
48
+ !t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu((x = d.data) == null ? void 0 : x._id), t.value = !1);
49
49
  }
50
- return (a, h) => {
50
+ return (r, x) => {
51
51
  const u = G("FmSpacer"), o = G("FmCircularProgress");
52
- return b(), B(X, null, [
53
- y("p", null, D(a.message), 1),
54
- t.value ? (b(), B("div", Kt, [
55
- k(u),
56
- y("div", null, [
57
- k(o, { size: "xl" })
52
+ return y(), E(X, null, [
53
+ v("p", null, U(r.message), 1),
54
+ t.value ? (y(), E("div", Kt, [
55
+ h(u),
56
+ v("div", null, [
57
+ h(o, { size: "xl" })
58
58
  ]),
59
- h[0] || (h[0] = y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
- k(u)
61
- ])) : (b(), B("div", qt, [
62
- h[2] || (h[2] = y("br", null, null, -1)),
63
- l.value.length > 0 ? (b(), B("div", Wt, [
64
- h[1] || (h[1] = y("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
- k(nt, {
59
+ x[0] || (x[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
60
+ h(u)
61
+ ])) : (y(), E("div", qt, [
62
+ x[2] || (x[2] = v("br", null, null, -1)),
63
+ l.value.length > 0 ? (y(), E("div", Wt, [
64
+ x[1] || (x[1] = v("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
65
+ h(nt, {
66
66
  name: "Menu",
67
67
  bindings: l.value
68
68
  }, null, 8, ["bindings"])
69
- ])) : U("", !0)
69
+ ])) : T("", !0)
70
70
  ]))
71
71
  ], 64);
72
72
  };
73
73
  }
74
74
  }), ze = ot("recipeForm", function() {
75
- const d = Le(), l = je(), t = ne(), i = K(!1), a = K();
76
- function h() {
77
- const r = {
75
+ const d = Le(), l = je(), t = ne(), i = W(!1), r = W();
76
+ function x() {
77
+ const a = {
78
78
  recipe: {},
79
79
  mode: se.CREATE,
80
80
  show: !0,
81
81
  "onUpdate:show"(p) {
82
- a.value.show = p;
82
+ r.value.show = p;
83
83
  }
84
84
  };
85
- a.value = r;
85
+ r.value = a;
86
86
  }
87
- async function u(r) {
87
+ async function u(a) {
88
88
  const p = {
89
- recipe: Oe(r),
89
+ recipe: Oe(a),
90
90
  mode: se.UPDATE,
91
91
  show: !0,
92
92
  "onUpdate:show"($) {
93
- a.value.show = $;
93
+ r.value.show = $;
94
94
  }
95
95
  };
96
- a.value = p;
96
+ r.value = p;
97
97
  }
98
- async function o(r) {
98
+ async function o(a) {
99
99
  i.value = !0;
100
100
  try {
101
- await t.deleteRecipe(r), l.open({
101
+ await t.deleteRecipe(a), l.open({
102
102
  title: "Success",
103
- message: `Deleted ${r.name}`,
103
+ message: `Deleted ${a.name}`,
104
104
  type: "success"
105
105
  });
106
106
  } catch (p) {
@@ -109,7 +109,7 @@ const Kt = {
109
109
  title: "Cannot delete recipe",
110
110
  contentComponent: It,
111
111
  contentComponentProps: {
112
- subject: (r == null ? void 0 : r.name) ?? "",
112
+ subject: (a == null ? void 0 : a.name) ?? "",
113
113
  items: p.errorResponse.errors.map(($) => {
114
114
  var C;
115
115
  return {
@@ -130,7 +130,7 @@ const Kt = {
130
130
  return;
131
131
  }
132
132
  l.open({
133
- title: `Cannot delete ${r == null ? void 0 : r.name}`,
133
+ title: `Cannot delete ${a == null ? void 0 : a.name}`,
134
134
  message: "Please try again.",
135
135
  type: "error"
136
136
  }), console.error("failed to delete recipe", p);
@@ -138,9 +138,9 @@ const Kt = {
138
138
  i.value = !1;
139
139
  }
140
140
  }
141
- function s(r) {
141
+ function s(a) {
142
142
  d.open({
143
- title: `Delete ${(r == null ? void 0 : r.name) ?? "recipe"}?`,
143
+ title: `Delete ${(a == null ? void 0 : a.name) ?? "recipe"}?`,
144
144
  closeButton: !1,
145
145
  primaryActions: {
146
146
  text: "Delete",
@@ -154,45 +154,45 @@ const Kt = {
154
154
  contentComponent: Yt,
155
155
  contentComponentProps: {
156
156
  type: "menu",
157
- data: r,
157
+ data: a,
158
158
  message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
159
159
  }
160
- }).onPrimary(() => o(r));
160
+ }).onPrimary(() => o(a));
161
161
  }
162
162
  return {
163
- createRecipe: h,
163
+ createRecipe: x,
164
164
  updateRecipe: u,
165
165
  deleteRecipe: s,
166
- recipeDialogProps: a,
166
+ recipeDialogProps: r,
167
167
  recipeViewLoading: i
168
168
  };
169
169
  });
170
170
  function Jt() {
171
- const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = oe();
171
+ const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = ie();
172
172
  async function i(o, s) {
173
- const r = Oe(s);
173
+ const a = Oe(s);
174
174
  if (o === Ve.Edit) {
175
- await m(r);
175
+ await m(a);
176
176
  return;
177
177
  }
178
178
  if (o === Ve.Delete) {
179
- await d(r);
179
+ await d(a);
180
180
  return;
181
181
  }
182
182
  }
183
- function a(o, s) {
184
- const r = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
183
+ function r(o, s) {
184
+ const a = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
185
185
  (C) => C.type === be.enum.SKU_GROUP
186
186
  ), $ = o.filter((C) => C.type === be.enum.RECIPE);
187
187
  return [
188
- ...r.map((C) => ({ ...C, recipeIds: [...s] })),
188
+ ...a.map((C) => ({ ...C, recipeIds: [...s] })),
189
189
  ...p.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
190
190
  ...$.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
191
- (C) => a(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
191
+ (C) => r(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
192
192
  )
193
193
  ];
194
194
  }
195
- const h = [
195
+ const x = [
196
196
  {
197
197
  accessorKey: "recipe",
198
198
  header: () => t("inventory.recipe.name"),
@@ -224,38 +224,38 @@ function Jt() {
224
224
  ];
225
225
  function u(o) {
226
226
  const s = ne();
227
- return o.map((r) => ({
228
- recipe: r.name,
229
- ingredients: a(r.contains, /* @__PURE__ */ new Set([r._id])).map((p) => {
230
- var C, I, f, _, S, v;
227
+ return o.map((a) => ({
228
+ recipe: a.name,
229
+ ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((p) => {
230
+ var C, I, f, k, S, b;
231
231
  if (p.isGroup) {
232
232
  const e = s.skuGroupById[p.id];
233
233
  return p.recipeIds.slice(1).length ? `(${(C = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
234
234
  }
235
235
  const $ = s.skuById[p.id];
236
- return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((_ = $ == null ? void 0 : $.unit) == null ? void 0 : _.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((v = $ == null ? void 0 : $.unit) == null ? void 0 : v.abbrev)})` : null;
236
+ return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((k = $ == null ? void 0 : $.unit) == null ? void 0 : k.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((b = $ == null ? void 0 : $.unit) == null ? void 0 : b.abbrev)})` : null;
237
237
  }).filter((p) => p).join(", "),
238
- original: r
238
+ original: a
239
239
  }));
240
240
  }
241
- return { columnDefs: h, formatRowData: u };
241
+ return { columnDefs: x, formatRowData: u };
242
242
  }
243
243
  function Ht() {
244
244
  const m = ne(), d = Le();
245
- async function l(a, h, u, o = []) {
245
+ async function l(r, x, u, o = []) {
246
246
  var I, f;
247
- const s = a.filter((_) => _.type === "SKU"), r = a.filter((_) => _.type !== "SKU"), p = /* @__PURE__ */ new Set();
247
+ const s = r.filter((k) => k.type === "SKU"), a = r.filter((k) => k.type !== "SKU"), p = /* @__PURE__ */ new Set();
248
248
  if (u)
249
- for (const _ of m.skus)
250
- !o.some((v) => v === _._id) && _._id !== u && !((f = (I = _.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((v) => v.id === u)) || p.add(_._id);
251
- const $ = m.skus.map((_) => ({
252
- label: _.name,
253
- sublabel: `${_.code}${p.has(_._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
- value: _,
255
- disabled: p.has(_._id)
249
+ for (const k of m.skus)
250
+ !o.some((b) => b === k._id) && k._id !== u && !((f = (I = k.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((b) => b.id === u)) || p.add(k._id);
251
+ const $ = m.skus.map((k) => ({
252
+ label: k.name,
253
+ sublabel: `${k.code}${p.has(k._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
254
+ value: k,
255
+ disabled: p.has(k._id)
256
256
  })), C = $.filter(
257
- (_) => s.find((S) => S.id === _.value._id) && !p.has(_.value._id)
258
- ).map((_) => _.value);
257
+ (k) => s.find((S) => S.id === k.value._id) && !p.has(k.value._id)
258
+ ).map((k) => k.value);
259
259
  d.open({
260
260
  title: "Select ingredients",
261
261
  contentComponent: Pe,
@@ -273,41 +273,41 @@ function Ht() {
273
273
  close: !0,
274
274
  variant: "tertiary"
275
275
  }
276
- }).onPrimary((_) => {
276
+ }).onPrimary((k) => {
277
277
  const S = [
278
- ...r,
279
- ...a.filter((v) => _.find((e) => e._id === v.id)),
280
- ..._.filter((v) => !a.find((e) => e.id === v._id)).map((v) => ({
278
+ ...a,
279
+ ...r.filter((b) => k.find((e) => e._id === b.id)),
280
+ ...k.filter((b) => !r.find((e) => e.id === b._id)).map((b) => ({
281
281
  type: "SKU",
282
- id: v._id,
282
+ id: b._id,
283
283
  amount: {
284
284
  amount: 1,
285
285
  precision: 0
286
286
  }
287
287
  }))
288
288
  ];
289
- h(S);
289
+ x(S);
290
290
  });
291
291
  }
292
- async function t(a, h, u = []) {
292
+ async function t(r, x, u = []) {
293
293
  var C;
294
- const o = a.filter((I) => I.type === "RECIPE"), s = a.filter((I) => I.type !== "RECIPE"), r = /* @__PURE__ */ new Set();
294
+ const o = r.filter((I) => I.type === "RECIPE"), s = r.filter((I) => I.type !== "RECIPE"), a = /* @__PURE__ */ new Set();
295
295
  if (u.length)
296
296
  for (const I of m.recipes) {
297
- const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], _ = f.some(
297
+ const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], k = f.some(
298
298
  (e) => e.bindingPaths.some((V) => u.some((c) => c === V.id))
299
299
  ), S = f.some(
300
300
  (e) => "success" in e && u.includes(e.ingredient._id)
301
301
  );
302
- (u.some((e) => e === I._id) || _ || S) && r.add(I._id);
302
+ (u.some((e) => e === I._id) || k || S) && a.add(I._id);
303
303
  }
304
304
  const p = m.recipes.filter((I) => !u.includes(I._id)).map((I) => ({
305
305
  label: I.name,
306
- sublabel: r.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
306
+ sublabel: a.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
307
307
  value: I,
308
- disabled: r.has(I._id)
308
+ disabled: a.has(I._id)
309
309
  })), $ = p.filter(
310
- (I) => o.find((f) => f.id === I.value._id) && !r.has(I.value._id)
310
+ (I) => o.find((f) => f.id === I.value._id) && !a.has(I.value._id)
311
311
  ).map((I) => I.value);
312
312
  d.open({
313
313
  title: "Select recipes",
@@ -328,10 +328,10 @@ function Ht() {
328
328
  }
329
329
  }).onPrimary((I) => {
330
330
  const f = [
331
- ...a.filter((_) => I.find((S) => S._id === _.id)),
332
- ...I.filter((_) => !a.find((S) => S.id === _._id)).map((_) => ({
331
+ ...r.filter((k) => I.find((S) => S._id === k.id)),
332
+ ...I.filter((k) => !r.find((S) => S.id === k._id)).map((k) => ({
333
333
  type: "RECIPE",
334
- id: _._id,
334
+ id: k._id,
335
335
  amount: {
336
336
  amount: 1,
337
337
  precision: 0
@@ -339,19 +339,19 @@ function Ht() {
339
339
  })),
340
340
  ...s
341
341
  ];
342
- h(f);
342
+ x(f);
343
343
  });
344
344
  }
345
- async function i(a, h, u = []) {
346
- const o = a.filter(($) => $.type === "SKU_GROUP"), s = a.filter(($) => $.type !== "SKU_GROUP"), r = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
345
+ async function i(r, x, u = []) {
346
+ const o = r.filter(($) => $.type === "SKU_GROUP"), s = r.filter(($) => $.type !== "SKU_GROUP"), a = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
347
347
  label: $.name,
348
348
  value: $
349
- })), p = r.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
349
+ })), p = a.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
350
350
  d.open({
351
351
  title: "Select ingredient group",
352
352
  contentComponent: Pe,
353
353
  contentComponentProps: {
354
- items: r,
354
+ items: a,
355
355
  modelValue: p,
356
356
  virtualScroll: !0
357
357
  },
@@ -366,8 +366,8 @@ function Ht() {
366
366
  }
367
367
  }).onPrimary(($) => {
368
368
  const C = [
369
- ...a.filter((I) => $.find((f) => f._id === I.id)),
370
- ...$.filter((I) => !a.find((f) => f.id === I._id)).map((I) => ({
369
+ ...r.filter((I) => $.find((f) => f._id === I.id)),
370
+ ...$.filter((I) => !r.find((f) => f.id === I._id)).map((I) => ({
371
371
  type: "SKU_GROUP",
372
372
  id: I._id,
373
373
  amount: {
@@ -377,7 +377,7 @@ function Ht() {
377
377
  })),
378
378
  ...s
379
379
  ];
380
- h(C);
380
+ x(C);
381
381
  });
382
382
  }
383
383
  return {
@@ -386,7 +386,7 @@ function Ht() {
386
386
  promptIngredientGroupsBinding: i
387
387
  };
388
388
  }
389
- const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re = /* @__PURE__ */ ie({
389
+ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re = /* @__PURE__ */ le({
390
390
  __name: "InventoryBindingRule",
391
391
  props: {
392
392
  disabled: { type: Boolean },
@@ -396,14 +396,14 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
396
396
  },
397
397
  emits: ["update:modelValue"],
398
398
  setup(m, { emit: d }) {
399
- const l = m, t = d, { t: i } = oe(), a = St(), h = tt(), u = R(() => {
399
+ const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u = A(() => {
400
400
  var C;
401
- const p = /* @__PURE__ */ new Map(), $ = a.restaurants.value.map((I) => I.customAttributes ?? {});
401
+ const p = /* @__PURE__ */ new Map(), $ = r.restaurants.value.map((I) => I.customAttributes ?? {});
402
402
  for (const I of $)
403
- for (const [f, _] of Object.entries(I))
404
- p.has(f) || p.set(f, /* @__PURE__ */ new Set()), _ && ((C = p.get(f)) == null || C.add(_));
403
+ for (const [f, k] of Object.entries(I))
404
+ p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((C = p.get(f)) == null || C.add(k));
405
405
  return p;
406
- }), o = R(() => [
406
+ }), o = A(() => [
407
407
  ...[...u.value.entries()].map(([$, C]) => ({
408
408
  type: "string",
409
409
  key: $,
@@ -415,45 +415,45 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
415
415
  key: "state",
416
416
  entity: "restaurant",
417
417
  values: [...new Set(
418
- h.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
418
+ x.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
419
419
  )]
420
420
  }
421
- ]), s = K(null);
422
- let r = null;
421
+ ]), s = W(null);
422
+ let a = null;
423
423
  return ue(
424
424
  () => l.modelValue,
425
425
  (p) => {
426
- JSON.stringify(p) !== JSON.stringify(r) && (s.value = p ? Tt.build(p) : null);
426
+ JSON.stringify(p) !== JSON.stringify(a) && (s.value = p ? Tt.build(p) : null);
427
427
  },
428
428
  { immediate: !0 }
429
429
  ), ue(
430
430
  s,
431
431
  (p) => {
432
- r = p ? Ut.build(p) : null, t("update:modelValue", r);
432
+ a = p ? Ut.build(p) : null, t("update:modelValue", a);
433
433
  },
434
434
  { deep: !0 }
435
435
  ), (p, $) => {
436
436
  const C = G("FmLabel"), I = G("FmFormGroup");
437
- return b(), B("div", Qt, [
438
- y("div", Xt, [
439
- k(C, {
437
+ return y(), E("div", Qt, [
438
+ v("div", Xt, [
439
+ h(C, {
440
440
  label: n(i)("inventory.ingredientGroup.form.rules.title"),
441
441
  required: p.minCount != null && p.minCount > 0
442
442
  }, null, 8, ["label", "required"]),
443
- k(n(Pt), {
443
+ h(n(Pt), {
444
444
  modelValue: s.value,
445
445
  "onUpdate:modelValue": $[0] || ($[0] = (f) => s.value = f),
446
446
  attributes: o.value
447
447
  }, null, 8, ["modelValue", "attributes"])
448
448
  ]),
449
- k(I, {
449
+ h(I, {
450
450
  "model-value": s.value,
451
451
  rules: [
452
452
  (f) => {
453
- const _ = f ? 1 : 0;
454
- return l.minCount !== void 0 && _ < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
453
+ const k = f ? 1 : 0;
454
+ return l.minCount !== void 0 && k < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
455
455
  count: l.minCount
456
- }) : l.maxCount !== void 0 && _ > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
456
+ }) : l.maxCount !== void 0 && k > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
457
457
  count: l.maxCount
458
458
  }) : !0;
459
459
  }
@@ -465,13 +465,13 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
465
465
  }), Zt = { class: "border-1 mx-3 my-1 rounded-md" }, en = { class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100" }, tn = {
466
466
  class: "flex items-center",
467
467
  style: { "min-height": "48px" }
468
- }, nn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, on = { class: "flex flex-col" }, ln = { class: "line-clamp-1" }, an = { class: "w-[200px]" }, rn = {
468
+ }, nn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, on = { class: "flex flex-col" }, ln = { class: "line-clamp-1" }, rn = { class: "w-[200px]" }, an = {
469
469
  key: 0,
470
470
  class: "w-[52px]"
471
471
  }, sn = {
472
472
  key: 0,
473
473
  class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-8"
474
- }, dn = { class: "px-12 pb-4" }, un = /* @__PURE__ */ ie({
474
+ }, dn = { class: "px-12 pb-4" }, un = /* @__PURE__ */ le({
475
475
  __name: "InventoryRecipeBindingV2Field",
476
476
  props: {
477
477
  disabled: { type: Boolean },
@@ -482,85 +482,85 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
482
482
  },
483
483
  emits: ["update:modelValue", "delete", "settings"],
484
484
  setup(m, { emit: d }) {
485
- const l = d, { t } = oe(), i = at("modelValue"), a = K(""), h = R(() => +Q(i.amount));
485
+ const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x = A(() => +Q(i.amount));
486
486
  ue(
487
487
  () => i.amount,
488
488
  (s) => {
489
- const r = Q(s);
490
- a.value !== r && (a.value = r);
489
+ const a = Q(s);
490
+ r.value !== a && (r.value = a);
491
491
  },
492
492
  { immediate: !0 }
493
493
  );
494
494
  let u = null;
495
495
  function o(s) {
496
- a.value = s, u && clearTimeout(u), u = setTimeout(() => {
497
- const r = +s;
498
- s.length > 0 && isFinite(r) ? i.amount = Ke(r) : i.amount = { amount: 0, precision: 0 };
496
+ r.value = s, u && clearTimeout(u), u = setTimeout(() => {
497
+ const a = +s;
498
+ s.length > 0 && isFinite(a) ? i.amount = Ke(a) : i.amount = { amount: 0, precision: 0 };
499
499
  }, 300);
500
500
  }
501
- return (s, r) => {
501
+ return (s, a) => {
502
502
  const p = G("FmTooltip"), $ = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
503
- return b(), B("div", Zt, [
504
- k(f, {
505
- class: Be(["mb-2"]),
503
+ return y(), E("div", Zt, [
504
+ h(f, {
505
+ class: Ce(["mb-2"]),
506
506
  disabled: s.disabled,
507
- modelValue: h.value,
507
+ modelValue: x.value,
508
508
  rules: [n(it)(0), n(qe)(-1)]
509
509
  }, {
510
- default: J(({ invalid: _ }) => [
511
- y("div", en, [
512
- y("div", tn, [
513
- y("div", nn, [
514
- y("div", on, [
515
- k(p, {
510
+ default: J(({ invalid: k }) => [
511
+ v("div", en, [
512
+ v("div", tn, [
513
+ v("div", nn, [
514
+ v("div", on, [
515
+ h(p, {
516
516
  zIndex: 51,
517
517
  variant: "plain",
518
518
  placement: "top",
519
519
  content: s.displayName
520
520
  }, {
521
521
  default: J(() => [
522
- y("span", ln, D(s.displayName), 1)
522
+ v("span", ln, U(s.displayName), 1)
523
523
  ]),
524
524
  _: 1
525
525
  }, 8, ["content"])
526
526
  ])
527
527
  ]),
528
- y("div", an, [
529
- k($, {
528
+ v("div", rn, [
529
+ h($, {
530
530
  class: "w-full",
531
531
  disabled: s.disabled,
532
- modelValue: a.value,
533
- "onUpdate:modelValue": r[0] || (r[0] = (S) => o(S)),
534
- invalid: _
532
+ modelValue: r.value,
533
+ "onUpdate:modelValue": a[0] || (a[0] = (S) => o(S)),
534
+ invalid: k
535
535
  }, null, 8, ["disabled", "modelValue", "invalid"])
536
536
  ]),
537
- s.readonly ? U("", !0) : (b(), B("div", rn, [
538
- k(C, {
537
+ s.readonly ? T("", !0) : (y(), E("div", an, [
538
+ h(C, {
539
539
  disabled: s.disabled,
540
540
  type: "button",
541
541
  variant: "plain",
542
542
  icon: "delete",
543
543
  "icon-color": "#000000",
544
- onClick: r[1] || (r[1] = () => l("delete", n(i).id))
544
+ onClick: a[1] || (a[1] = () => l("delete", n(i).id))
545
545
  }, null, 8, ["disabled"])
546
546
  ]))
547
547
  ]),
548
- s.showError ? (b(), B("div", sn, [
549
- k(I, {
548
+ s.showError ? (y(), E("div", sn, [
549
+ h(I, {
550
550
  name: "error",
551
551
  color: "system-error-300",
552
552
  size: "sm"
553
553
  }),
554
- y("div", null, D(n(t)("inventory.inventoryBindings.circularError")), 1)
555
- ])) : U("", !0)
554
+ v("div", null, U(n(t)("inventory.inventoryBindings.circularError")), 1)
555
+ ])) : T("", !0)
556
556
  ])
557
557
  ]),
558
558
  _: 1
559
559
  }, 8, ["disabled", "modelValue", "rules"]),
560
- y("div", dn, [
561
- k(Re, {
560
+ v("div", dn, [
561
+ h(Re, {
562
562
  modelValue: n(i).rules,
563
- "onUpdate:modelValue": r[2] || (r[2] = (_) => n(i).rules = _),
563
+ "onUpdate:modelValue": a[2] || (a[2] = (k) => n(i).rules = k),
564
564
  disabled: s.disabled
565
565
  }, null, 8, ["modelValue", "disabled"])
566
566
  ])
@@ -569,7 +569,7 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
569
569
  }
570
570
  });
571
571
  function cn(m) {
572
- const d = Gt(), { t: l } = Nt(), t = ne(), i = R(() => [
572
+ const d = Gt(), { t: l } = Nt(), t = ne(), i = A(() => [
573
573
  {
574
574
  id: "delete",
575
575
  header: "",
@@ -652,18 +652,18 @@ function cn(m) {
652
652
  sublabel: o.unit.abbrev,
653
653
  value: null
654
654
  },
655
- ...o.unit.measurements.map((r) => ({
656
- label: `${r.name} (${r.abbrev})`,
655
+ ...o.unit.measurements.map((a) => ({
656
+ label: `${a.name} (${a.abbrev})`,
657
657
  sublabel: l("inventory.inventoryBindings.alternativeTable.measurementOption"),
658
- value: r.id
658
+ value: a.id
659
659
  }))
660
- ].filter((r) => !r.label.toLowerCase().includes("inactive"));
660
+ ].filter((a) => !a.label.toLowerCase().includes("inactive"));
661
661
  return de(_e.FmSelect, {
662
662
  modelValue: u.row.original.trackingMeasurement ?? null,
663
663
  items: s,
664
664
  disabled: m.disabled ?? !1,
665
- "onUpdate:modelValue": (r) => {
666
- m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: r } : p);
665
+ "onUpdate:modelValue": (a) => {
666
+ m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: a } : p);
667
667
  }
668
668
  });
669
669
  },
@@ -683,17 +683,17 @@ function cn(m) {
683
683
  Ne(1),
684
684
  lt(
685
685
  m.bindingAlternatives.filter((s) => s._id !== o._id).map((s) => {
686
- const r = t.skuById[s._id];
686
+ const a = t.skuById[s._id];
687
687
  return {
688
- label: r == null ? void 0 : r.name,
688
+ label: a == null ? void 0 : a.name,
689
689
  value: s.priority
690
690
  };
691
691
  })
692
692
  )
693
693
  ],
694
694
  "onUpdate:modelValue": (s) => {
695
- const r = Number(s);
696
- isNaN(r) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: r } : p));
695
+ const a = Number(s);
696
+ isNaN(a) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: a } : p));
697
697
  }
698
698
  });
699
699
  }
@@ -734,10 +734,10 @@ function cn(m) {
734
734
  size: "md",
735
735
  disabled: m.disabled ?? !1,
736
736
  onClick: () => {
737
- const s = [...m.bindingAlternatives], r = s.findIndex((p) => p._id === o._id);
738
- if (r > 0) {
739
- const p = s[r - 1];
740
- s[r - 1] = o, s[r] = p;
737
+ const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
738
+ if (a > 0) {
739
+ const p = s[a - 1];
740
+ s[a - 1] = o, s[a] = p;
741
741
  }
742
742
  m.bindingAlternatives = [...s];
743
743
  }
@@ -750,10 +750,10 @@ function cn(m) {
750
750
  size: "md",
751
751
  disabled: m.disabled ?? !1,
752
752
  onClick: () => {
753
- const s = [...m.bindingAlternatives], r = s.findIndex((p) => p._id === o._id);
754
- if (r < s.length - 1) {
755
- const p = s[r + 1];
756
- s[r + 1] = o, s[r] = p;
753
+ const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
754
+ if (a < s.length - 1) {
755
+ const p = s[a + 1];
756
+ s[a + 1] = o, s[a] = p;
757
757
  }
758
758
  m.bindingAlternatives = [...s];
759
759
  }
@@ -772,22 +772,22 @@ function cn(m) {
772
772
  get columnDefs() {
773
773
  return i.value;
774
774
  },
775
- promptAddIngredient: async (h) => {
775
+ promptAddIngredient: async (x) => {
776
776
  const u = [];
777
- for (const r of t.skus)
778
- h.includes(r._id) || u.push({
779
- label: r.name,
780
- sublabel: r.code,
781
- value: r._id,
782
- disabled: h.includes(r._id)
777
+ for (const a of t.skus)
778
+ x.includes(a._id) || u.push({
779
+ label: a.name,
780
+ sublabel: a.code,
781
+ value: a._id,
782
+ disabled: x.includes(a._id)
783
783
  });
784
- const o = (m.bindingAlternatives ?? []).map((r) => r._id), s = await d.multiSelect(u, o, (r) => {
785
- var $, C, I, f, _, S;
786
- const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((v) => v._id === r);
784
+ const o = (m.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
785
+ var $, C, I, f, k, S;
786
+ const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((b) => b._id === a);
787
787
  return {
788
- _id: r,
789
- trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[r]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
790
- priority: ((S = (_ = m.bindingAlternatives) == null ? void 0 : _[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
788
+ _id: a,
789
+ trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[a]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
790
+ priority: ((S = (k = m.bindingAlternatives) == null ? void 0 : k[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
791
791
  default: !1
792
792
  };
793
793
  });
@@ -805,7 +805,7 @@ function cn(m) {
805
805
  }
806
806
  };
807
807
  }
808
- const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, fn = { class: "flex justify-between items-center px-2" }, Se = /* @__PURE__ */ ie({
808
+ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, fn = { class: "flex justify-between items-center px-2" }, Se = /* @__PURE__ */ le({
809
809
  __name: "InventoryBindingAlternative",
810
810
  props: {
811
811
  disabled: { type: Boolean },
@@ -814,7 +814,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
814
814
  },
815
815
  emits: ["update:modelValue"],
816
816
  setup(m, { emit: d }) {
817
- const l = m, t = d, { t: i } = oe(), a = cn({
817
+ const l = m, t = d, { t: i } = ie(), r = cn({
818
818
  get disabled() {
819
819
  return l.disabled ?? !1;
820
820
  },
@@ -824,36 +824,36 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
824
824
  set bindingAlternatives(o) {
825
825
  t("update:modelValue", o);
826
826
  }
827
- }), h = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
827
+ }), x = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
828
828
  return (o, s) => {
829
829
  var I;
830
- const r = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
831
- return b(), B("div", pn, [
832
- y("div", mn, [
833
- y("div", fn, [
834
- k(r, {
830
+ const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
831
+ return y(), E("div", pn, [
832
+ v("div", mn, [
833
+ v("div", fn, [
834
+ h(a, {
835
835
  label: n(i)("inventory.alternatives")
836
836
  }, null, 8, ["label"]),
837
- k(p, {
837
+ h(p, {
838
838
  disabled: o.disabled,
839
839
  "prepend-icon": "link",
840
840
  variant: "primary",
841
841
  class: "border-1 rounded-lg border-fm-color-primary",
842
- onClick: s[0] || (s[0] = (f) => n(a).promptAddIngredient(o.filterIngredientIds)),
842
+ onClick: s[0] || (s[0] = (f) => n(r).promptAddIngredient(o.filterIngredientIds)),
843
843
  size: "md"
844
844
  }, null, 8, ["disabled"])
845
845
  ]),
846
- k($, {
846
+ h($, {
847
847
  "model-value": o.modelValue,
848
- rules: [h, u]
848
+ rules: [x, u]
849
849
  }, null, 8, ["model-value", "rules"])
850
850
  ]),
851
- k(C, {
851
+ h(C, {
852
852
  "row-data": o.modelValue ?? [],
853
- "column-defs": n(a).columnDefs,
853
+ "column-defs": n(r).columnDefs,
854
854
  "page-size": ((I = o.modelValue) == null ? void 0 : I.length) || 0,
855
855
  "shrink-at": 9999,
856
- "column-visibility": n(a).columnVisibility,
856
+ "column-visibility": n(r).columnVisibility,
857
857
  "hide-footer": ""
858
858
  }, null, 8, ["row-data", "column-defs", "page-size", "column-visibility"])
859
859
  ]);
@@ -865,7 +865,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
865
865
  }, gn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, _n = { class: "line-clamp-1 w-full" }, kn = { class: "w-[150px]" }, hn = {
866
866
  key: 0,
867
867
  class: "w-[52px]"
868
- }, xn = { class: "flex flex-col px-12 pb-4" }, $n = /* @__PURE__ */ ie({
868
+ }, xn = { class: "flex flex-col px-12 pb-4" }, $n = /* @__PURE__ */ le({
869
869
  __name: "InventorySkuBindingV2Field",
870
870
  props: {
871
871
  disabled: { type: Boolean },
@@ -879,11 +879,11 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
879
879
  },
880
880
  emits: ["update:modelValue", "delete", "settings"],
881
881
  setup(m, { emit: d }) {
882
- const l = d, { t } = oe(), i = at("modelValue");
883
- function a(u) {
882
+ const l = d, { t } = ie(), i = rt("modelValue");
883
+ function r(u) {
884
884
  u && (i.amount = u.amount, i.measurement = u.measurement);
885
885
  }
886
- function h() {
886
+ function x() {
887
887
  return {
888
888
  modelValue: {
889
889
  amount: i.amount,
@@ -895,35 +895,35 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
895
895
  };
896
896
  }
897
897
  return (u, o) => {
898
- const s = G("FmTooltip"), r = G("FmButton"), p = G("FmFormGroup");
899
- return b(), B("div", vn, [
900
- y("div", yn, [
901
- y("div", bn, [
902
- y("div", gn, [
903
- k(s, {
898
+ const s = G("FmTooltip"), a = G("FmButton"), p = G("FmFormGroup");
899
+ return y(), E("div", vn, [
900
+ v("div", yn, [
901
+ v("div", bn, [
902
+ v("div", gn, [
903
+ h(s, {
904
904
  zIndex: 51,
905
905
  variant: "plain",
906
906
  placement: "top",
907
907
  content: u.displayName
908
908
  }, {
909
909
  default: J(() => [
910
- y("span", _n, D(u.displayName), 1)
910
+ v("span", _n, U(u.displayName), 1)
911
911
  ]),
912
912
  _: 1
913
913
  }, 8, ["content"])
914
914
  ]),
915
- y("div", kn, [
916
- k(Ce, {
915
+ v("div", kn, [
916
+ h(Be, {
917
917
  "model-value": { amount: n(i).amount, measurement: n(i).measurement },
918
- "onUpdate:modelValue": a,
918
+ "onUpdate:modelValue": r,
919
919
  unit: u.unit,
920
920
  placement: "bottom",
921
921
  "convert-amount-on-change-unit": "",
922
922
  disabled: u.readonly
923
923
  }, null, 8, ["model-value", "unit", "disabled"])
924
924
  ]),
925
- u.readonly ? U("", !0) : (b(), B("div", hn, [
926
- k(r, {
925
+ u.readonly ? T("", !0) : (y(), E("div", hn, [
926
+ h(a, {
927
927
  disabled: u.disabled,
928
928
  type: "button",
929
929
  variant: "tertiary",
@@ -932,13 +932,13 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
932
932
  }, null, 8, ["disabled"])
933
933
  ]))
934
934
  ]),
935
- y("div", xn, [
936
- k(p, {
935
+ v("div", xn, [
936
+ h(p, {
937
937
  modelValue: n(i).amount,
938
938
  rules: [n(qe)(0)]
939
939
  }, null, 8, ["modelValue", "rules"]),
940
- k(p, {
941
- modelValue: h(),
940
+ h(p, {
941
+ modelValue: x(),
942
942
  rules: [
943
943
  n(Mt)(),
944
944
  n(Dt)(u.unit),
@@ -946,19 +946,19 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
946
946
  ]
947
947
  }, null, 8, ["modelValue", "rules"])
948
948
  ]),
949
- u.ableToApplyRules ? (b(), Y(Re, {
949
+ u.ableToApplyRules ? (y(), Y(Re, {
950
950
  key: 0,
951
951
  modelValue: n(i).rules,
952
952
  "onUpdate:modelValue": o[1] || (o[1] = ($) => n(i).rules = $),
953
953
  disabled: u.disabled
954
- }, null, 8, ["modelValue", "disabled"])) : U("", !0),
955
- u.ableToConfigureAlternative ? (b(), Y(Se, {
954
+ }, null, 8, ["modelValue", "disabled"])) : T("", !0),
955
+ u.ableToConfigureAlternative ? (y(), Y(Se, {
956
956
  key: 1,
957
957
  modelValue: n(i).alternatives,
958
958
  "onUpdate:modelValue": o[2] || (o[2] = ($) => n(i).alternatives = $),
959
959
  disabled: u.disabled,
960
960
  filterIngredientIds: [n(i).id]
961
- }, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : U("", !0)
961
+ }, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : T("", !0)
962
962
  ])
963
963
  ]);
964
964
  };
@@ -968,7 +968,7 @@ exports.FfCalculator;
968
968
  const In = { class: "flex flex-col gap-24" }, wn = {
969
969
  key: 0,
970
970
  class: "flex flex-col gap-16"
971
- }, En = { class: "flex items-center" }, Vn = { class: "flex-1 fm-typo-en-title-sm-600" }, Sn = { class: "flex flex-col" }, Bn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Cn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Fn = {
971
+ }, En = { class: "flex items-center" }, Vn = { class: "flex-1 fm-typo-en-title-sm-600" }, Sn = { class: "flex flex-col" }, Cn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Fn = {
972
972
  key: 0,
973
973
  class: "w-[52px]"
974
974
  }, Rn = {
@@ -989,7 +989,16 @@ const In = { class: "flex flex-col gap-24" }, wn = {
989
989
  }, qn = { class: "flex flex-col gap-16" }, Wn = { class: "flex items-center" }, Yn = { class: "flex-1 fm-typo-en-title-sm-600" }, Jn = { class: "flex flex-col" }, Hn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Qn = { class: "flex-1 fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Xn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary w-[150px] px-16" }, Zn = {
990
990
  key: 0,
991
991
  class: "w-[52px]"
992
- }, eo = /* @__PURE__ */ ie({
992
+ }, eo = {
993
+ key: 0,
994
+ class: "flex flex-col border-b border-fm-color-neutral-gray-100"
995
+ }, to = {
996
+ class: "flex items-center w-full",
997
+ style: { "min-height": "48px" }
998
+ }, no = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12 text-fm-color-typo-secondary line-clamp-1" }, oo = {
999
+ key: 0,
1000
+ class: "w-[52px]"
1001
+ }, io = { class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-12 pb-4" }, lo = /* @__PURE__ */ le({
993
1002
  __name: "InventoryBindingFormV2",
994
1003
  props: {
995
1004
  id: {},
@@ -1009,7 +1018,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1009
1018
  },
1010
1019
  emits: ["update:modelValue", "click:pick-inventory-bindings"],
1011
1020
  setup(m, { emit: d }) {
1012
- const { t: l } = oe(), t = ne(), i = R(() => t.recipeById), a = R(() => t.skuById), h = R(() => t.skuGroupById), u = m, o = d, s = R(() => kt({
1021
+ const { t: l } = ie(), t = ne(), i = A(() => t.recipeById), r = A(() => t.skuById), x = A(() => t.skuGroupById), u = m, o = d, s = A(() => kt({
1013
1022
  parentId: u.id,
1014
1023
  bindings: u.modelValue,
1015
1024
  recipes: t.recipes.map((F) => F._id === u.id ? {
@@ -1023,12 +1032,12 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1023
1032
  }
1024
1033
  } : F),
1025
1034
  skuGroups: t.skuGroups
1026
- }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), r = R(
1027
- () => new Set(s.value.map((x) => {
1028
- var w;
1029
- return (w = x.bindingPaths[0]) == null ? void 0 : w.id;
1035
+ }).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = A(
1036
+ () => new Set(s.value.map((g) => {
1037
+ var B;
1038
+ return (B = g.bindingPaths[0]) == null ? void 0 : B.id;
1030
1039
  }))
1031
- ), p = R(() => u.modelValue.filter((x) => x.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
1040
+ ), p = A(() => u.modelValue.filter((g) => g.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
1032
1041
  async function f() {
1033
1042
  if (u.iframeMode) {
1034
1043
  o("click:pick-inventory-bindings", "RECIPE");
@@ -1036,24 +1045,24 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1036
1045
  }
1037
1046
  C(
1038
1047
  u.modelValue,
1039
- (x) => o("update:modelValue", x),
1048
+ (g) => o("update:modelValue", g),
1040
1049
  u.id ? [u.id] : []
1041
1050
  );
1042
1051
  }
1043
- const _ = R(() => u.modelValue.filter((x) => x.type === "SKU_GROUP"));
1052
+ const k = A(() => u.modelValue.filter((g) => g.type === "SKU_GROUP"));
1044
1053
  async function S() {
1045
1054
  I(
1046
1055
  u.modelValue,
1047
- (x) => o("update:modelValue", x),
1056
+ (g) => o("update:modelValue", g),
1048
1057
  u.id ? [u.id] : []
1049
1058
  );
1050
1059
  }
1051
- function v(x, w, F) {
1052
- const N = +w;
1053
- let T = F;
1054
- w.length > 0 && isFinite(N) ? T = F.map((P) => (P.id !== x || (P.amount = Ke(N)), P)) : T = F.map((P) => (P.id !== x || (P.amount = { amount: 0, precision: 0 }), P)), o("update:modelValue", T);
1060
+ function b(g, B, F) {
1061
+ const R = +B;
1062
+ let P = F;
1063
+ B.length > 0 && isFinite(R) ? P = F.map((K) => (K.id !== g || (K.amount = Ke(R)), K)) : P = F.map((K) => (K.id !== g || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
1055
1064
  }
1056
- const e = R(() => u.modelValue.filter((x) => x.type === "SKU") ?? []);
1065
+ const e = A(() => u.modelValue.filter((g) => g.type === "SKU") ?? []);
1057
1066
  async function V() {
1058
1067
  if (u.iframeMode) {
1059
1068
  o("click:pick-inventory-bindings", "SKU");
@@ -1061,48 +1070,51 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1061
1070
  }
1062
1071
  $(
1063
1072
  u.modelValue,
1064
- (x) => o("update:modelValue", x),
1073
+ (g) => o("update:modelValue", g),
1065
1074
  u.excludeBindingId,
1066
1075
  u.id ? [u.id] : []
1067
1076
  );
1068
1077
  }
1069
- function c(x) {
1070
- const w = u.modelValue.map((F) => F.id === x.id ? x : F);
1071
- o("update:modelValue", w);
1078
+ function c(g) {
1079
+ const B = u.modelValue.map((F) => F.id === g.id ? g : F);
1080
+ o("update:modelValue", B);
1072
1081
  }
1073
- function g(x) {
1074
- const w = u.modelValue.filter((F) => F.id !== x);
1075
- o("update:modelValue", w);
1082
+ function _(g) {
1083
+ const B = u.modelValue.filter((F) => F.id !== g);
1084
+ o("update:modelValue", B);
1076
1085
  }
1077
- function z(x) {
1078
- var F, N;
1079
- if (x.type !== be.enum.SKU)
1086
+ function N(g) {
1087
+ var F, R;
1088
+ if (g.type !== be.enum.SKU)
1080
1089
  throw new Error("Non-SKU binding does not have unit");
1081
- if (!((F = a.value[x.id]) == null ? void 0 : F.unit))
1082
- throw new Error(`Cannot find ingredient: ${x.id}`);
1083
- return (N = a.value[x.id]) == null ? void 0 : N.unit;
1084
- }
1085
- return (x, w) => {
1086
- var W, H, Z;
1087
- const F = G("FmFormGroup"), N = G("FmButton"), T = G("FmIcon"), P = G("FmTextField");
1088
- return b(), B("div", In, [
1089
- k(F, {
1090
- disabled: x.disabled,
1091
- "model-value": x.modelValue,
1090
+ if (!((F = r.value[g.id]) == null ? void 0 : F.unit))
1091
+ throw new Error(`Cannot find ingredient: ${g.id}`);
1092
+ return (R = r.value[g.id]) == null ? void 0 : R.unit;
1093
+ }
1094
+ function z(g) {
1095
+ return !r.value[g.id];
1096
+ }
1097
+ return (g, B) => {
1098
+ var H, ee, O;
1099
+ const F = G("FmFormGroup"), R = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
1100
+ return y(), E("div", In, [
1101
+ h(F, {
1102
+ disabled: g.disabled,
1103
+ "model-value": g.modelValue,
1092
1104
  rules: [
1093
- ...x.rules,
1105
+ ...g.rules,
1094
1106
  () => s.value.length ? "There is a binding error in your configuration" : !0
1095
1107
  ]
1096
1108
  }, {
1097
- label: J(() => w[4] || (w[4] = [
1098
- y("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1109
+ label: J(() => B[4] || (B[4] = [
1110
+ v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
1099
1111
  ])),
1100
1112
  _: 1
1101
1113
  }, 8, ["disabled", "model-value", "rules"]),
1102
- ((W = x.recipeBindingConfig) == null ? void 0 : W.enabled) !== !1 ? (b(), B("div", wn, [
1103
- y("div", En, [
1104
- y("div", Vn, D(n(l)("inventory.inventoryBindings.recipe")), 1),
1105
- x.readonly ? U("", !0) : (b(), Y(N, {
1114
+ ((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (y(), E("div", wn, [
1115
+ v("div", En, [
1116
+ v("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1117
+ g.readonly ? T("", !0) : (y(), Y(R, {
1106
1118
  key: 0,
1107
1119
  variant: "secondary",
1108
1120
  "text-color": "primary",
@@ -1112,32 +1124,32 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1112
1124
  onClick: f
1113
1125
  }, null, 8, ["label"]))
1114
1126
  ]),
1115
- y("div", Sn, [
1116
- y("div", Bn, [
1117
- y("div", Cn, D(n(l)("inventory.inventoryBindings.recipe")), 1),
1118
- w[5] || (w[5] = y("div", { class: "w-[200px]" }, null, -1)),
1119
- x.recipeBindingConfig.ableToApplyRules ? (b(), B("div", Fn)) : U("", !0),
1120
- x.readonly ? U("", !0) : (b(), B("div", Rn))
1127
+ v("div", Sn, [
1128
+ v("div", Cn, [
1129
+ v("div", Bn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
1130
+ B[5] || (B[5] = v("div", { class: "w-[200px]" }, null, -1)),
1131
+ g.recipeBindingConfig.ableToApplyRules ? (y(), E("div", Fn)) : T("", !0),
1132
+ g.readonly ? T("", !0) : (y(), E("div", Rn))
1121
1133
  ]),
1122
- (b(!0), B(X, null, me(p.value, (A) => {
1134
+ (y(!0), E(X, null, me(p.value, (M) => {
1123
1135
  var L;
1124
- return b(), Y(un, {
1125
- key: A.id,
1126
- "model-value": A,
1127
- "display-name": (L = i.value[A.id]) == null ? void 0 : L.name,
1128
- "show-error": r.value.has(A.id),
1129
- readonly: x.readonly,
1130
- disabled: x.disabled,
1131
- "onUpdate:modelValue": w[0] || (w[0] = (O) => c(O)),
1132
- onDelete: w[1] || (w[1] = (O) => g(O))
1136
+ return y(), Y(un, {
1137
+ key: M.id,
1138
+ "model-value": M,
1139
+ "display-name": (L = i.value[M.id]) == null ? void 0 : L.name,
1140
+ "show-error": a.value.has(M.id),
1141
+ readonly: g.readonly,
1142
+ disabled: g.disabled,
1143
+ "onUpdate:modelValue": B[0] || (B[0] = (q) => c(q)),
1144
+ onDelete: B[1] || (B[1] = (q) => _(q))
1133
1145
  }, null, 8, ["model-value", "display-name", "show-error", "readonly", "disabled"]);
1134
1146
  }), 128))
1135
1147
  ])
1136
- ])) : U("", !0),
1137
- x.enableIngredientGroup ? (b(), B("div", An, [
1138
- y("div", Tn, [
1139
- y("div", Un, D(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1140
- x.readonly ? U("", !0) : (b(), Y(N, {
1148
+ ])) : T("", !0),
1149
+ g.enableIngredientGroup ? (y(), E("div", An, [
1150
+ v("div", Tn, [
1151
+ v("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1152
+ g.readonly ? T("", !0) : (y(), Y(R, {
1141
1153
  key: 0,
1142
1154
  variant: "secondary",
1143
1155
  "text-color": "primary",
@@ -1147,51 +1159,51 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1147
1159
  onClick: S
1148
1160
  }, null, 8, ["label"]))
1149
1161
  ]),
1150
- y("div", Pn, [
1151
- y("div", Mn, [
1152
- y("div", Dn, D(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1153
- w[6] || (w[6] = y("div", { class: "w-[200px]" }, null, -1)),
1154
- w[7] || (w[7] = y("div", { class: "w-[52px]" }, null, -1))
1162
+ v("div", Pn, [
1163
+ v("div", Mn, [
1164
+ v("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
1165
+ B[6] || (B[6] = v("div", { class: "w-[200px]" }, null, -1)),
1166
+ B[7] || (B[7] = v("div", { class: "w-[52px]" }, null, -1))
1155
1167
  ]),
1156
- (b(!0), B(X, null, me(_.value, (A) => (b(), Y(F, {
1157
- key: A.id,
1158
- disabled: x.disabled,
1159
- modelValue: +n(Q)(A.amount ?? { amount: 1, precision: 0 }),
1168
+ (y(!0), E(X, null, me(k.value, (M) => (y(), Y(F, {
1169
+ key: M.id,
1170
+ disabled: g.disabled,
1171
+ modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
1160
1172
  rules: [n(it)(0), n(qe)(0)]
1161
1173
  }, {
1162
1174
  default: J(({ invalid: L }) => {
1163
- var O;
1175
+ var q;
1164
1176
  return [
1165
- y("div", Gn, [
1166
- r.value.has(A.id) ? (b(), B("div", Nn, [
1167
- k(T, {
1177
+ v("div", Gn, [
1178
+ a.value.has(M.id) ? (y(), E("div", Nn, [
1179
+ h(P, {
1168
1180
  name: "error",
1169
1181
  color: "system-error-300",
1170
1182
  size: "sm"
1171
1183
  }),
1172
- y("div", null, D(n(l)("inventory.inventoryBindings.circularError")), 1)
1173
- ])) : U("", !0),
1174
- y("div", zn, [
1175
- y("div", On, [
1176
- y("div", Ln, D((O = h.value[A.id]) == null ? void 0 : O.name), 1)
1184
+ v("div", null, U(n(l)("inventory.inventoryBindings.circularError")), 1)
1185
+ ])) : T("", !0),
1186
+ v("div", zn, [
1187
+ v("div", On, [
1188
+ v("div", Ln, U((q = x.value[M.id]) == null ? void 0 : q.name), 1)
1177
1189
  ]),
1178
- y("div", jn, [
1179
- k(P, {
1190
+ v("div", jn, [
1191
+ h(K, {
1180
1192
  class: "w-full",
1181
- disabled: x.disabled,
1182
- modelValue: +n(Q)(A.amount ?? { amount: 1, precision: 0 }),
1183
- "onUpdate:modelValue": (q) => v(A.id, q, x.modelValue),
1193
+ disabled: g.disabled,
1194
+ modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
1195
+ "onUpdate:modelValue": (oe) => b(M.id, oe, g.modelValue),
1184
1196
  invalid: L
1185
1197
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
1186
1198
  ]),
1187
- x.readonly ? U("", !0) : (b(), B("div", Kn, [
1188
- k(N, {
1189
- disabled: x.disabled,
1199
+ g.readonly ? T("", !0) : (y(), E("div", Kn, [
1200
+ h(R, {
1201
+ disabled: g.disabled,
1190
1202
  type: "button",
1191
1203
  variant: "plain",
1192
1204
  icon: "delete",
1193
1205
  "icon-color": "#000000",
1194
- onClick: (q) => g(A.id)
1206
+ onClick: (oe) => _(M.id)
1195
1207
  }, null, 8, ["disabled", "onClick"])
1196
1208
  ]))
1197
1209
  ])
@@ -1201,11 +1213,11 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1201
1213
  _: 2
1202
1214
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
1203
1215
  ])
1204
- ])) : U("", !0),
1205
- y("div", qn, [
1206
- y("div", Wn, [
1207
- y("div", Yn, D(n(l)("inventory.inventoryBindings.ingredient")), 1),
1208
- x.readonly ? U("", !0) : (b(), Y(N, {
1216
+ ])) : T("", !0),
1217
+ v("div", qn, [
1218
+ v("div", Wn, [
1219
+ v("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1220
+ g.readonly ? T("", !0) : (y(), Y(R, {
1209
1221
  key: 0,
1210
1222
  variant: "secondary",
1211
1223
  "text-color": "primary",
@@ -1215,44 +1227,69 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1215
1227
  onClick: V
1216
1228
  }, null, 8, ["label"]))
1217
1229
  ]),
1218
- y("div", Jn, [
1219
- y("div", Hn, [
1220
- y("div", Qn, D(n(l)("inventory.inventoryBindings.ingredient")), 1),
1221
- y("div", Xn, D(n(l)("inventory.inventoryBindings.amount")), 1),
1222
- w[8] || (w[8] = y("div", { class: "w-[52px]" }, null, -1)),
1223
- (H = x.skuBindingConfig) != null && H.ableToApplyRules || (Z = x.skuBindingConfig) != null && Z.ableToConfigureAlternative ? (b(), B("div", Zn)) : U("", !0)
1230
+ v("div", Jn, [
1231
+ v("div", Hn, [
1232
+ v("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
1233
+ v("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
1234
+ B[8] || (B[8] = v("div", { class: "w-[52px]" }, null, -1)),
1235
+ (ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (y(), E("div", Zn)) : T("", !0)
1224
1236
  ]),
1225
- (b(!0), B(X, null, me(e.value, (A) => {
1226
- var L, O, q;
1227
- return b(), Y($n, {
1228
- key: A.id,
1229
- "model-value": A,
1230
- "display-name": (L = a.value[A.id]) == null ? void 0 : L.name,
1231
- unit: z(A),
1232
- "show-error": r.value.has(A.id),
1233
- "able-to-apply-rules": ((O = x.skuBindingConfig) == null ? void 0 : O.ableToApplyRules) === !0,
1234
- "able-to-configure-alternative": ((q = x.skuBindingConfig) == null ? void 0 : q.ableToConfigureAlternative) === !0,
1235
- readonly: x.readonly,
1236
- disabled: x.disabled,
1237
- "onUpdate:modelValue": w[2] || (w[2] = (le) => c(le)),
1238
- onDelete: w[3] || (w[3] = (le) => g(le))
1239
- }, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]);
1237
+ (y(!0), E(X, null, me(e.value, (M) => {
1238
+ var L, q, oe;
1239
+ return y(), E(X, {
1240
+ key: M.id
1241
+ }, [
1242
+ z(M) ? (y(), E("div", eo, [
1243
+ v("div", to, [
1244
+ v("div", no, U(M.id), 1),
1245
+ g.readonly ? T("", !0) : (y(), E("div", oo, [
1246
+ h(R, {
1247
+ disabled: g.disabled,
1248
+ type: "button",
1249
+ variant: "tertiary",
1250
+ icon: "delete",
1251
+ onClick: () => _(M.id)
1252
+ }, null, 8, ["disabled", "onClick"])
1253
+ ]))
1254
+ ]),
1255
+ v("div", io, [
1256
+ h(P, {
1257
+ name: "error",
1258
+ color: "system-error-300",
1259
+ size: "sm"
1260
+ }),
1261
+ v("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
1262
+ ])
1263
+ ])) : (y(), Y($n, {
1264
+ key: 1,
1265
+ "model-value": M,
1266
+ "display-name": (L = r.value[M.id]) == null ? void 0 : L.name,
1267
+ unit: N(M),
1268
+ "show-error": a.value.has(M.id),
1269
+ "able-to-apply-rules": ((q = g.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
1270
+ "able-to-configure-alternative": ((oe = g.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
1271
+ readonly: g.readonly,
1272
+ disabled: g.disabled,
1273
+ "onUpdate:modelValue": B[2] || (B[2] = (Z) => c(Z)),
1274
+ onDelete: B[3] || (B[3] = (Z) => _(Z))
1275
+ }, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]))
1276
+ ], 64);
1240
1277
  }), 128))
1241
1278
  ])
1242
1279
  ])
1243
1280
  ]);
1244
1281
  };
1245
1282
  }
1246
- }), to = { class: "flex flex-col gap-40" }, no = {
1283
+ }), ro = { class: "flex flex-col gap-40" }, ao = {
1247
1284
  key: 0,
1248
1285
  class: "flex flex-col gap-16"
1249
- }, oo = {
1286
+ }, so = {
1250
1287
  key: 0,
1251
1288
  class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
1252
- }, io = {
1289
+ }, uo = {
1253
1290
  key: 0,
1254
1291
  class: "flex flex-col items-center w-full h-full gap-24"
1255
- }, lo = { key: 1 }, ao = { class: "mt-32" }, ro = /* @__PURE__ */ ie({
1292
+ }, co = { key: 1 }, po = { class: "mt-32" }, mo = /* @__PURE__ */ le({
1256
1293
  __name: "RecipeForm",
1257
1294
  props: {
1258
1295
  mode: {},
@@ -1261,175 +1298,175 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1261
1298
  },
1262
1299
  emits: ["update:modelValue", "click:submit"],
1263
1300
  setup(m, { expose: d, emit: l }) {
1264
- const t = m, i = l, a = We(), { t: h } = oe(), u = R({
1301
+ const t = m, i = l, r = We(), { t: x } = ie(), u = A({
1265
1302
  get() {
1266
1303
  var c;
1267
1304
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1268
1305
  },
1269
1306
  set(c) {
1270
- const g = t.modelValue ?? {};
1271
- g.name = c, i("update:modelValue", g);
1307
+ const _ = t.modelValue ?? {};
1308
+ _.name = c, i("update:modelValue", _);
1272
1309
  }
1273
- }), o = R({
1310
+ }), o = A({
1274
1311
  get() {
1275
1312
  var c;
1276
1313
  return ((c = t.modelValue) == null ? void 0 : c.contains) ?? [];
1277
1314
  },
1278
1315
  set(c) {
1279
- const g = t.modelValue ?? {};
1280
- g.contains = c, i("update:modelValue", g);
1316
+ const _ = t.modelValue ?? {};
1317
+ _.contains = c, i("update:modelValue", _);
1281
1318
  }
1282
- }), s = R({
1319
+ }), s = A({
1283
1320
  get() {
1284
1321
  var c;
1285
1322
  return ((c = t.modelValue) == null ? void 0 : c.customAttributes) ?? {};
1286
1323
  },
1287
1324
  set(c) {
1288
- const g = t.modelValue ? {
1325
+ const _ = t.modelValue ? {
1289
1326
  ...t.modelValue
1290
1327
  } : {};
1291
- g.customAttributes = c, i("update:modelValue", g);
1328
+ _.customAttributes = c, i("update:modelValue", _);
1292
1329
  }
1293
- }), r = R({
1330
+ }), a = A({
1294
1331
  get() {
1295
1332
  var c;
1296
1333
  return ((c = t.modelValue) == null ? void 0 : c.version) ?? null;
1297
1334
  },
1298
1335
  set(c) {
1299
- const g = t.modelValue ? { ...t.modelValue } : {};
1300
- g.version = c, i("update:modelValue", g);
1336
+ const _ = t.modelValue ? { ...t.modelValue } : {};
1337
+ _.version = c, i("update:modelValue", _);
1301
1338
  }
1302
- }), p = R({
1339
+ }), p = A({
1303
1340
  get() {
1304
- return r.value === "v2";
1341
+ return a.value === "v2";
1305
1342
  },
1306
1343
  set(c) {
1307
- r.value = c ? "v2" : null;
1344
+ a.value = c ? "v2" : null;
1308
1345
  }
1309
1346
  });
1310
1347
  function $() {
1311
1348
  i("click:submit");
1312
1349
  }
1313
- const C = K();
1350
+ const C = W();
1314
1351
  d({
1315
1352
  validateInputs: () => {
1316
- var c, g;
1317
- (g = (c = C.value) == null ? void 0 : c.validateInputs) == null || g.call(c);
1353
+ var c, _;
1354
+ (_ = (c = C.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
1318
1355
  },
1319
1356
  resetInputsValidation: () => {
1320
- var c, g;
1321
- (g = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || g.call(c);
1357
+ var c, _;
1358
+ (_ = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
1322
1359
  },
1323
1360
  resetInputs: () => {
1324
- var c, g;
1325
- (g = (c = C.value) == null ? void 0 : c.resetInputs) == null || g.call(c);
1361
+ var c, _;
1362
+ (_ = (c = C.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
1326
1363
  }
1327
1364
  });
1328
- const I = ne(), f = K([]), _ = K(!1), S = K(!1);
1329
- ue(_, async (c) => {
1330
- v(c);
1365
+ const I = ne(), f = W([]), k = W(!1), S = W(!1);
1366
+ ue(k, async (c) => {
1367
+ b(c);
1331
1368
  });
1332
- async function v(c) {
1333
- var g, z;
1334
- c && !S.value && ((g = t.modelValue) != null && g._id) && (S.value = !0, f.value = await I.getAffectedMenu((z = t.modelValue) == null ? void 0 : z._id).delayed(500), S.value = !1);
1369
+ async function b(c) {
1370
+ var _, N;
1371
+ c && !S.value && ((_ = t.modelValue) != null && _._id) && (S.value = !0, f.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), S.value = !1);
1335
1372
  }
1336
- const e = R(
1373
+ const e = A(
1337
1374
  () => I.recipes.map((c) => ({ label: c.name, value: c.name }))
1338
- ), V = R(() => {
1375
+ ), V = A(() => {
1339
1376
  var c;
1340
1377
  return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
1341
1378
  });
1342
- return (c, g) => {
1343
- const z = G("FmTextField"), x = G("FmSwitch"), w = G("FmCard"), F = G("FmSpacer"), N = G("FmCircularProgress"), T = G("FmForm");
1344
- return b(), Y(T, {
1379
+ return (c, _) => {
1380
+ const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"), B = G("FmSpacer"), F = G("FmCircularProgress"), R = G("FmForm");
1381
+ return y(), Y(R, {
1345
1382
  ref_key: "formRef",
1346
1383
  ref: C,
1347
1384
  onValidationSuccess: $
1348
1385
  }, {
1349
1386
  default: J(() => [
1350
- y("div", to, [
1351
- k(z, {
1387
+ v("div", ro, [
1388
+ h(N, {
1352
1389
  disabled: c.disabled,
1353
- label: n(h)("inventory.recipe.name"),
1390
+ label: n(x)("inventory.recipe.name"),
1354
1391
  "model-value": u.value,
1355
- "onUpdate:modelValue": g[0] || (g[0] = (P) => u.value = P),
1392
+ "onUpdate:modelValue": _[0] || (_[0] = (P) => u.value = P),
1356
1393
  rules: [
1357
1394
  n(Rt)(),
1358
1395
  n(lt)(e.value, V.value, (P) => `[${P.value}] already exists`)
1359
1396
  ],
1360
1397
  "label-mark": "required"
1361
1398
  }, null, 8, ["disabled", "label", "model-value", "rules"]),
1362
- n(a).enableRecipeV2 ? (b(), B("div", no, [
1363
- k(x, {
1399
+ n(r).enableRecipeV2 ? (y(), E("div", ao, [
1400
+ h(z, {
1364
1401
  modelValue: p.value,
1365
- "onUpdate:modelValue": g[1] || (g[1] = (P) => p.value = P),
1402
+ "onUpdate:modelValue": _[1] || (_[1] = (P) => p.value = P),
1366
1403
  value: !0,
1367
- label: n(h)("inventory.recipe.enableRecipeV2"),
1404
+ label: n(x)("inventory.recipe.enableRecipeV2"),
1368
1405
  "label-placement": "right",
1369
1406
  disabled: c.disabled,
1370
- sublabel: n(h)("inventory.recipe.recipeV2Warning")
1407
+ sublabel: n(x)("inventory.recipe.recipeV2Warning")
1371
1408
  }, null, 8, ["modelValue", "label", "disabled", "sublabel"])
1372
- ])) : U("", !0),
1373
- k(w, {
1409
+ ])) : T("", !0),
1410
+ h(g, {
1374
1411
  variant: "outlined",
1375
1412
  class: "p-16"
1376
1413
  }, {
1377
1414
  default: J(() => {
1378
- var P, W;
1415
+ var P, K;
1379
1416
  return [
1380
- n(a).enableRecipeV2 ? (b(), Y(eo, {
1417
+ n(r).enableRecipeV2 ? (y(), Y(lo, {
1381
1418
  key: 0,
1382
1419
  id: (P = c.modelValue) == null ? void 0 : P._id,
1383
1420
  disabled: c.disabled,
1384
1421
  "model-value": o.value,
1385
- "onUpdate:modelValue": g[2] || (g[2] = (H) => o.value = H),
1422
+ "onUpdate:modelValue": _[2] || (_[2] = (H) => o.value = H),
1386
1423
  rules: [n(Ne)(1)],
1387
- "enable-ingredient-group": n(a).enableIngredientGroup,
1424
+ "enable-ingredient-group": n(r).enableIngredientGroup,
1388
1425
  "recipe-binding-config": { enabled: !p.value, ableToApplyRules: p.value },
1389
1426
  "sku-binding-config": {
1390
1427
  ableToConfigureAlternative: p.value
1391
1428
  }
1392
- }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (b(), Y(At, {
1429
+ }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (y(), Y(At, {
1393
1430
  key: 1,
1394
- id: (W = c.modelValue) == null ? void 0 : W._id,
1431
+ id: (K = c.modelValue) == null ? void 0 : K._id,
1395
1432
  disabled: c.disabled,
1396
1433
  "model-value": o.value,
1397
- "onUpdate:modelValue": g[3] || (g[3] = (H) => o.value = H),
1434
+ "onUpdate:modelValue": _[3] || (_[3] = (H) => o.value = H),
1398
1435
  rules: [n(Ne)(1)],
1399
- "enable-ingredient-group": n(a).enableIngredientGroup
1436
+ "enable-ingredient-group": n(r).enableIngredientGroup
1400
1437
  }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group"]))
1401
1438
  ];
1402
1439
  }),
1403
1440
  _: 1
1404
1441
  })
1405
1442
  ]),
1406
- c.mode !== n(se).CREATE ? (b(), B("div", oo, [
1407
- k(x, {
1443
+ c.mode !== n(se).CREATE ? (y(), E("div", so, [
1444
+ h(z, {
1408
1445
  label: "Show binded items",
1409
- modelValue: _.value,
1410
- "onUpdate:modelValue": g[4] || (g[4] = (P) => _.value = P),
1446
+ modelValue: k.value,
1447
+ "onUpdate:modelValue": _[4] || (_[4] = (P) => k.value = P),
1411
1448
  "label-placement": "right",
1412
1449
  disabled: S.value
1413
1450
  }, null, 8, ["modelValue", "disabled"]),
1414
- S.value ? (b(), B("div", io, [
1415
- k(F),
1416
- y("div", null, [
1417
- k(N, { size: "xl" })
1451
+ S.value ? (y(), E("div", uo, [
1452
+ h(B),
1453
+ v("div", null, [
1454
+ h(F, { size: "xl" })
1418
1455
  ]),
1419
- g[6] || (g[6] = y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1420
- k(F)
1421
- ])) : _.value && f.value.length ? (b(), B("div", lo, [
1422
- k(nt, {
1456
+ _[6] || (_[6] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
1457
+ h(B)
1458
+ ])) : k.value && f.value.length ? (y(), E("div", co, [
1459
+ h(nt, {
1423
1460
  name: "Menu",
1424
1461
  bindings: f.value
1425
1462
  }, null, 8, ["bindings"])
1426
- ])) : U("", !0)
1427
- ])) : U("", !0),
1428
- y("div", ao, [
1429
- k(Ot, {
1463
+ ])) : T("", !0)
1464
+ ])) : T("", !0),
1465
+ v("div", po, [
1466
+ h(Ot, {
1430
1467
  entity: "inventoryRecipe",
1431
1468
  modelValue: s.value,
1432
- "onUpdate:modelValue": g[5] || (g[5] = (P) => s.value = P)
1469
+ "onUpdate:modelValue": _[5] || (_[5] = (P) => s.value = P)
1433
1470
  }, null, 8, ["modelValue"])
1434
1471
  ])
1435
1472
  ]),
@@ -1437,7 +1474,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1437
1474
  }, 512);
1438
1475
  };
1439
1476
  }
1440
- }), so = { class: "flex gap-4" }, uo = /* @__PURE__ */ ie({
1477
+ }), fo = { class: "flex gap-4" }, vo = /* @__PURE__ */ le({
1441
1478
  __name: "RecipeDialog",
1442
1479
  props: {
1443
1480
  show: { type: Boolean },
@@ -1446,7 +1483,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1446
1483
  },
1447
1484
  emits: ["update:show"],
1448
1485
  setup(m) {
1449
- const d = m, l = ne(), t = je(), { t: i } = oe(), a = Ge(d, "show"), h = Ge(d, "recipe"), u = R(() => {
1486
+ const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u = A(() => {
1450
1487
  switch (d.mode) {
1451
1488
  case se.READ:
1452
1489
  return "";
@@ -1456,7 +1493,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1456
1493
  return i("inventory.recipe.create.title");
1457
1494
  }
1458
1495
  return "";
1459
- }), o = R(() => {
1496
+ }), o = A(() => {
1460
1497
  switch (d.mode) {
1461
1498
  case se.READ:
1462
1499
  return "";
@@ -1466,14 +1503,14 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1466
1503
  return i("common.add");
1467
1504
  }
1468
1505
  return "";
1469
- }), s = K(), r = K(!1);
1506
+ }), s = W(), a = W(!1);
1470
1507
  async function p() {
1471
- r.value = !0;
1508
+ a.value = !0;
1472
1509
  try {
1473
- const f = Oe(h.value);
1474
- f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), a.value = !1, t.open({
1510
+ const f = Oe(x.value);
1511
+ f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), r.value = !1, t.open({
1475
1512
  title: i("inventory.common.success"),
1476
- message: i("inventory.recipe.create.success", { name: h.value.name }),
1513
+ message: i("inventory.recipe.create.success", { name: x.value.name }),
1477
1514
  type: "success"
1478
1515
  });
1479
1516
  } catch (f) {
@@ -1483,15 +1520,15 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1483
1520
  type: "error"
1484
1521
  });
1485
1522
  } finally {
1486
- r.value = !1;
1523
+ a.value = !1;
1487
1524
  }
1488
1525
  }
1489
1526
  async function $() {
1490
- r.value = !0;
1527
+ a.value = !0;
1491
1528
  try {
1492
- await l.updateRecipe(h.value), a.value = !1, t.open({
1529
+ await l.updateRecipe(x.value), r.value = !1, t.open({
1493
1530
  title: i("inventory.common.success"),
1494
- message: i("inventory.recipe.update.success", { name: h.value.name }),
1531
+ message: i("inventory.recipe.update.success", { name: x.value.name }),
1495
1532
  type: "success"
1496
1533
  });
1497
1534
  } catch (f) {
@@ -1501,12 +1538,12 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1501
1538
  type: "error"
1502
1539
  });
1503
1540
  } finally {
1504
- r.value = !1;
1541
+ a.value = !1;
1505
1542
  }
1506
1543
  }
1507
1544
  function C() {
1508
- var f, _;
1509
- (_ = (f = s.value) == null ? void 0 : f.validateInputs) == null || _.call(f);
1545
+ var f, k;
1546
+ (k = (f = s.value) == null ? void 0 : f.validateInputs) == null || k.call(f);
1510
1547
  }
1511
1548
  function I() {
1512
1549
  switch (d.mode) {
@@ -1518,41 +1555,41 @@ const In = { class: "flex flex-col gap-24" }, wn = {
1518
1555
  return p();
1519
1556
  }
1520
1557
  }
1521
- return (f, _) => {
1522
- const S = G("FmButton"), v = G("FmSideSheet");
1523
- return b(), Y(v, {
1524
- "model-value": n(a),
1525
- "onUpdate:modelValue": _[3] || (_[3] = (e) => De(a) ? a.value = e : null),
1558
+ return (f, k) => {
1559
+ const S = G("FmButton"), b = G("FmSideSheet");
1560
+ return y(), Y(b, {
1561
+ "model-value": n(r),
1562
+ "onUpdate:modelValue": k[3] || (k[3] = (e) => De(r) ? r.value = e : null),
1526
1563
  header: u.value,
1527
1564
  "close-button": "",
1528
1565
  "dismiss-away": "",
1529
1566
  "max-width": 800
1530
1567
  }, {
1531
1568
  "side-sheet-footer": J(() => [
1532
- y("div", so, [
1533
- k(S, {
1534
- loading: r.value,
1569
+ v("div", fo, [
1570
+ h(S, {
1571
+ loading: a.value,
1535
1572
  label: o.value,
1536
1573
  onClick: C
1537
1574
  }, null, 8, ["loading", "label"]),
1538
- k(S, {
1539
- disabled: r.value,
1575
+ h(S, {
1576
+ disabled: a.value,
1540
1577
  label: n(i)("common.close"),
1541
1578
  variant: "tertiary",
1542
- onClick: _[2] || (_[2] = (e) => a.value = !1)
1579
+ onClick: k[2] || (k[2] = (e) => r.value = !1)
1543
1580
  }, null, 8, ["disabled", "label"])
1544
1581
  ])
1545
1582
  ]),
1546
1583
  default: J(() => [
1547
- k(ro, {
1584
+ h(mo, {
1548
1585
  class: "w-full",
1549
1586
  ref_key: "hasValidationExpose",
1550
1587
  ref: s,
1551
- modelValue: n(h),
1552
- "onUpdate:modelValue": _[0] || (_[0] = (e) => De(h) ? h.value = e : null),
1588
+ modelValue: n(x),
1589
+ "onUpdate:modelValue": k[0] || (k[0] = (e) => De(x) ? x.value = e : null),
1553
1590
  mode: f.mode,
1554
- disabled: r.value,
1555
- "onClick:submit": _[1] || (_[1] = (e) => I())
1591
+ disabled: a.value,
1592
+ "onClick:submit": k[1] || (k[1] = (e) => I())
1556
1593
  }, null, 8, ["modelValue", "mode", "disabled"])
1557
1594
  ]),
1558
1595
  _: 1
@@ -1568,14 +1605,14 @@ function ke(m, d, l) {
1568
1605
  else if (i.type === be.enum.SKU_GROUP)
1569
1606
  t.push({ ...i, isGroup: !0, recipeIds: [...d] });
1570
1607
  else if (i.type === be.enum.RECIPE) {
1571
- const a = l[i.id];
1572
- a && !d.has(i.id) && t.push(
1573
- ...ke(a.contains, /* @__PURE__ */ new Set([...d, i.id]), l)
1608
+ const r = l[i.id];
1609
+ r && !d.has(i.id) && t.push(
1610
+ ...ke(r.contains, /* @__PURE__ */ new Set([...d, i.id]), l)
1574
1611
  );
1575
1612
  }
1576
1613
  return t;
1577
1614
  }
1578
- function co(m, d) {
1615
+ function yo(m, d) {
1579
1616
  return he.equal(m, d);
1580
1617
  }
1581
1618
  function Ae(m) {
@@ -1596,115 +1633,115 @@ function Xe(m) {
1596
1633
  return m.measurement ? he.multiplyDecimal(m.amount, m.measurement.conversion) : m.amount;
1597
1634
  }
1598
1635
  function Me(m, d) {
1599
- var i, a;
1600
- if (m.type !== d.type || m.id !== d.id || !co(Xe(m), Xe(d))) return !1;
1601
- const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((a = d.measurement) == null ? void 0 : a.id) ?? null;
1636
+ var i, r;
1637
+ if (m.type !== d.type || m.id !== d.id || !yo(Xe(m), Xe(d))) return !1;
1638
+ const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
1602
1639
  return !(l !== t || Ae(m.rules) !== Ae(d.rules) || Te(m.alternatives) !== Te(d.alternatives));
1603
1640
  }
1604
1641
  function Ze(m, d) {
1605
1642
  return m.type === d.type && m.id === d.id;
1606
1643
  }
1607
- function po(m, d) {
1644
+ function bo(m, d) {
1608
1645
  const l = [];
1609
1646
  let t = [...m.contains];
1610
- for (const a of d)
1611
- switch (a.type) {
1647
+ for (const r of d)
1648
+ switch (r.type) {
1612
1649
  case "remove-binding": {
1613
- const h = t.findIndex(
1614
- (u) => u.type === a.target.type && u.id === a.target.id
1650
+ const x = t.findIndex(
1651
+ (u) => u.type === r.target.type && u.id === r.target.id
1615
1652
  );
1616
- h === -1 ? l.push({ change: a, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, h), ...t.slice(h + 1)], l.push({ change: a, outcome: "applied" }));
1653
+ x === -1 ? l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied" }));
1617
1654
  break;
1618
1655
  }
1619
1656
  case "add-binding": {
1620
- if (t.find((o) => Me(o, a.binding))) {
1621
- l.push({ change: a, outcome: "already-satisfied", reason: "Exact binding already present" });
1657
+ if (t.find((o) => Me(o, r.binding))) {
1658
+ l.push({ change: r, outcome: "already-satisfied", reason: "Exact binding already present" });
1622
1659
  break;
1623
1660
  }
1624
- if (t.find((o) => Ze(o, a.binding))) {
1625
- l.push({ change: a, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
1661
+ if (t.find((o) => Ze(o, r.binding))) {
1662
+ l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
1626
1663
  break;
1627
1664
  }
1628
- if (m.version === "v2" && a.binding.type === "RECIPE") {
1629
- l.push({ change: a, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1665
+ if (m.version === "v2" && r.binding.type === "RECIPE") {
1666
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1630
1667
  break;
1631
1668
  }
1632
- if (m.version !== "v2" && (a.binding.alternatives ?? []).length > 0) {
1633
- l.push({ change: a, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
1669
+ if (m.version !== "v2" && (r.binding.alternatives ?? []).length > 0) {
1670
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
1634
1671
  break;
1635
1672
  }
1636
- t = [...t, a.binding], l.push({ change: a, outcome: "applied" });
1673
+ t = [...t, r.binding], l.push({ change: r, outcome: "applied" });
1637
1674
  break;
1638
1675
  }
1639
1676
  case "replace-binding": {
1640
- const h = t.findIndex(
1641
- (s) => s.type === a.from.type && s.id === a.from.id
1642
- ), u = t.find((s) => Me(s, a.to)), o = t.find((s, r) => r !== h && Ze(s, a.to) && !Me(s, a.to));
1643
- if (h === -1) {
1644
- u ? l.push({ change: a, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: a, outcome: "ignored", reason: "Source binding not found in target" });
1677
+ const x = t.findIndex(
1678
+ (s) => s.type === r.from.type && s.id === r.from.id
1679
+ ), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !== x && Ze(s, r.to) && !Me(s, r.to));
1680
+ if (x === -1) {
1681
+ u ? l.push({ change: r, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" });
1645
1682
  break;
1646
1683
  }
1647
- if (m.version === "v2" && a.to.type === "RECIPE") {
1648
- l.push({ change: a, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1684
+ if (m.version === "v2" && r.to.type === "RECIPE") {
1685
+ l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
1649
1686
  break;
1650
1687
  }
1651
- if (m.version !== "v2" && (a.to.alternatives ?? []).length > 0) {
1652
- l.push({ change: a, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
1688
+ if (m.version !== "v2" && (r.to.alternatives ?? []).length > 0) {
1689
+ l.push({ change: r, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
1653
1690
  break;
1654
1691
  }
1655
1692
  if (o) {
1656
- l.push({ change: a, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
1693
+ l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
1657
1694
  break;
1658
1695
  }
1659
- u ? (t = [...t.slice(0, h), ...t.slice(h + 1)], l.push({ change: a, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1660
- ...t.slice(0, h),
1661
- a.to,
1662
- ...t.slice(h + 1)
1663
- ], l.push({ change: a, outcome: "applied" }));
1696
+ u ? (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
1697
+ ...t.slice(0, x),
1698
+ r.to,
1699
+ ...t.slice(x + 1)
1700
+ ], l.push({ change: r, outcome: "applied" }));
1664
1701
  break;
1665
1702
  }
1666
1703
  case "update-binding-rule": {
1667
- const h = t.findIndex(
1668
- (r) => r.type === a.target.type && r.id === a.target.id
1704
+ const x = t.findIndex(
1705
+ (a) => a.type === r.target.type && a.id === r.target.id
1669
1706
  );
1670
- if (h === -1) {
1671
- l.push({ change: a, outcome: "ignored", reason: "Binding not found in target" });
1707
+ if (x === -1) {
1708
+ l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1672
1709
  break;
1673
1710
  }
1674
- const u = t[h], o = u.rules ?? null, s = a.rule ?? null;
1711
+ const u = t[x], o = u.rules ?? null, s = r.rule ?? null;
1675
1712
  if (Ae(o) === Ae(s)) {
1676
- l.push({ change: a, outcome: "already-satisfied", reason: "Rule already matches" });
1713
+ l.push({ change: r, outcome: "already-satisfied", reason: "Rule already matches" });
1677
1714
  break;
1678
1715
  }
1679
1716
  t = [
1680
- ...t.slice(0, h),
1717
+ ...t.slice(0, x),
1681
1718
  { ...u, rules: s },
1682
- ...t.slice(h + 1)
1683
- ], l.push({ change: a, outcome: "applied" });
1719
+ ...t.slice(x + 1)
1720
+ ], l.push({ change: r, outcome: "applied" });
1684
1721
  break;
1685
1722
  }
1686
1723
  case "update-alternatives": {
1687
1724
  if (m.version !== "v2") {
1688
- l.push({ change: a, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
1725
+ l.push({ change: r, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
1689
1726
  break;
1690
1727
  }
1691
- const h = t.findIndex(
1692
- (r) => r.type === a.target.type && r.id === a.target.id
1728
+ const x = t.findIndex(
1729
+ (a) => a.type === r.target.type && a.id === r.target.id
1693
1730
  );
1694
- if (h === -1) {
1695
- l.push({ change: a, outcome: "ignored", reason: "Binding not found in target" });
1731
+ if (x === -1) {
1732
+ l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
1696
1733
  break;
1697
1734
  }
1698
- const u = t[h], o = Te(u.alternatives), s = Te(a.alternatives);
1735
+ const u = t[x], o = Te(u.alternatives), s = Te(r.alternatives);
1699
1736
  if (o === s) {
1700
- l.push({ change: a, outcome: "already-satisfied", reason: "Alternatives already match" });
1737
+ l.push({ change: r, outcome: "already-satisfied", reason: "Alternatives already match" });
1701
1738
  break;
1702
1739
  }
1703
1740
  t = [
1704
- ...t.slice(0, h),
1705
- { ...u, alternatives: a.alternatives },
1706
- ...t.slice(h + 1)
1707
- ], l.push({ change: a, outcome: "applied" });
1741
+ ...t.slice(0, x),
1742
+ { ...u, alternatives: r.alternatives },
1743
+ ...t.slice(x + 1)
1744
+ ], l.push({ change: r, outcome: "applied" });
1708
1745
  break;
1709
1746
  }
1710
1747
  }
@@ -1724,17 +1761,17 @@ function et(m) {
1724
1761
  return m.target.id !== "";
1725
1762
  }
1726
1763
  }
1727
- function mo(m) {
1764
+ function go(m) {
1728
1765
  if (m.length === 0) return "no-applicable-changes";
1729
1766
  let d = 0, l = 0, t = 0, i = 0;
1730
- for (const a of m)
1731
- a.outcome === "applied" ? d++ : a.outcome === "blocked" ? l++ : a.outcome === "ignored" ? t++ : a.outcome === "already-satisfied" && i++;
1767
+ for (const r of m)
1768
+ r.outcome === "applied" ? d++ : r.outcome === "blocked" ? l++ : r.outcome === "ignored" ? t++ : r.outcome === "already-satisfied" && i++;
1732
1769
  return l > 0 && d === 0 ? "blocked" : i === m.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
1733
1770
  }
1734
- let fo = 0;
1735
- function vo(m = null) {
1771
+ let _o = 0;
1772
+ function ko(m = null) {
1736
1773
  return {
1737
- id: String(++fo),
1774
+ id: String(++_o),
1738
1775
  type: m,
1739
1776
  itemId: null,
1740
1777
  amountModel: ye()
@@ -1745,60 +1782,60 @@ function ut(m, d, l, t) {
1745
1782
  if (i.type === "RECIPE") {
1746
1783
  if (i.id === d) return !0;
1747
1784
  if (!l.has(i.id)) {
1748
- const a = t[i.id];
1749
- if (a && ut(a.contains, d, /* @__PURE__ */ new Set([...l, i.id]), t))
1785
+ const r = t[i.id];
1786
+ if (r && ut(r.contains, d, /* @__PURE__ */ new Set([...l, i.id]), t))
1750
1787
  return !0;
1751
1788
  }
1752
1789
  }
1753
1790
  return !1;
1754
1791
  }
1755
1792
  const ge = ot("recipeBulkEditor", function() {
1756
- const d = ne(), l = je(), { t } = oe(), i = K(!1), a = K(1), h = K(null), u = K(/* @__PURE__ */ new Set()), o = K([]), s = K({}), r = K(!1), p = K(/* @__PURE__ */ new Map()), $ = K(""), C = K([]), I = R(() => {
1757
- let A = d.recipes;
1758
- const L = h.value;
1759
- if (L != null && L.nameSearch) {
1760
- const O = L.nameSearch.trim().toLowerCase();
1761
- O && (A = A.filter((q) => q.name.toLowerCase().includes(O)));
1762
- }
1763
- if (L != null && L.filters && L.filters.length > 0) {
1764
- const O = /* @__PURE__ */ new Map();
1765
- for (const q of A)
1766
- O.set(
1793
+ const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""), C = W([]), I = A(() => {
1794
+ let O = d.recipes;
1795
+ const M = x.value;
1796
+ if (M != null && M.nameSearch) {
1797
+ const L = M.nameSearch.trim().toLowerCase();
1798
+ L && (O = O.filter((q) => q.name.toLowerCase().includes(L)));
1799
+ }
1800
+ if (M != null && M.filters && M.filters.length > 0) {
1801
+ const L = /* @__PURE__ */ new Map();
1802
+ for (const q of O)
1803
+ L.set(
1767
1804
  q._id,
1768
1805
  ke(q.contains, /* @__PURE__ */ new Set([q._id]), d.recipeById)
1769
1806
  );
1770
- for (const q of L.filters)
1807
+ for (const q of M.filters)
1771
1808
  if (q.type === "ingredient") {
1772
- const { itemId: le, amount: ee, measurementId: re } = q;
1773
- A = A.filter((fe) => (O.get(fe._id) ?? []).some((ae) => {
1809
+ const { itemId: oe, amount: Z, measurementId: ae } = q;
1810
+ O = O.filter((fe) => (L.get(fe._id) ?? []).some((re) => {
1774
1811
  var ce;
1775
- if (ae.type !== "SKU" || ae.id !== le) return !1;
1776
- if (ae.recipeIds.length === 1) {
1777
- if (ee != null) {
1778
- const Ue = ae.measurement ? he.multiplyDecimal(ae.amount, ae.measurement.conversion) : ae.amount;
1779
- if (!he.equal(Ue, ee)) return !1;
1812
+ if (re.type !== "SKU" || re.id !== oe) return !1;
1813
+ if (re.recipeIds.length === 1) {
1814
+ if (Z != null) {
1815
+ const Ue = re.measurement ? he.multiplyDecimal(re.amount, re.measurement.conversion) : re.amount;
1816
+ if (!he.equal(Ue, Z)) return !1;
1780
1817
  }
1781
- if (re != null && (((ce = ae.measurement) == null ? void 0 : ce.id) ?? null) !== re)
1818
+ if (ae != null && (((ce = re.measurement) == null ? void 0 : ce.id) ?? null) !== ae)
1782
1819
  return !1;
1783
1820
  }
1784
1821
  return !0;
1785
1822
  }));
1786
1823
  } else if (q.type === "recipe") {
1787
- const le = q.itemId;
1788
- A = A.filter(
1789
- (ee) => ut(ee.contains, le, /* @__PURE__ */ new Set([ee._id]), d.recipeById)
1824
+ const oe = q.itemId;
1825
+ O = O.filter(
1826
+ (Z) => ut(Z.contains, oe, /* @__PURE__ */ new Set([Z._id]), d.recipeById)
1790
1827
  );
1791
1828
  }
1792
1829
  }
1793
- return A;
1794
- }), f = R(
1795
- () => I.value.filter((A) => !u.value.has(A._id))
1796
- ), _ = R(() => f.value.length > 0), S = R(() => {
1797
- const A = o.value.filter(et);
1798
- if (A.length === 0) {
1799
- const O = {};
1830
+ return O;
1831
+ }), f = A(
1832
+ () => I.value.filter((O) => !u.value.has(O._id))
1833
+ ), k = A(() => f.value.length > 0), S = A(() => {
1834
+ const O = o.value.filter(et);
1835
+ if (O.length === 0) {
1836
+ const L = {};
1800
1837
  for (const q of f.value)
1801
- O[q._id] = {
1838
+ L[q._id] = {
1802
1839
  recipeId: q._id,
1803
1840
  recipeName: q.name,
1804
1841
  original: q,
@@ -1807,27 +1844,27 @@ const ge = ot("recipeBulkEditor", function() {
1807
1844
  changes: [],
1808
1845
  counts: { applied: 0, ignored: 0, blocked: 0, satisfied: 0 }
1809
1846
  };
1810
- return O;
1811
- }
1812
- const L = {};
1813
- for (const O of f.value) {
1814
- const q = JSON.parse(JSON.stringify(O)), { projected: le, results: ee } = po(q, A), re = mo(ee);
1815
- let fe = 0, xe = 0, ae = 0, ve = 0;
1816
- for (const ce of ee)
1817
- ce.outcome === "applied" ? fe++ : ce.outcome === "ignored" ? xe++ : ce.outcome === "blocked" ? ae++ : ce.outcome === "already-satisfied" && ve++;
1818
- L[O._id] = {
1819
- recipeId: O._id,
1820
- recipeName: O.name,
1847
+ return L;
1848
+ }
1849
+ const M = {};
1850
+ for (const L of f.value) {
1851
+ const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } = bo(q, O), ae = go(Z);
1852
+ let fe = 0, xe = 0, re = 0, ve = 0;
1853
+ for (const ce of Z)
1854
+ ce.outcome === "applied" ? fe++ : ce.outcome === "ignored" ? xe++ : ce.outcome === "blocked" ? re++ : ce.outcome === "already-satisfied" && ve++;
1855
+ M[L._id] = {
1856
+ recipeId: L._id,
1857
+ recipeName: L.name,
1821
1858
  original: q,
1822
- projected: re === "will-update" || re === "partially-ignored" ? le : null,
1823
- status: re,
1824
- changes: ee,
1825
- counts: { applied: fe, ignored: xe, blocked: ae, satisfied: ve }
1859
+ projected: ae === "will-update" || ae === "partially-ignored" ? oe : null,
1860
+ status: ae,
1861
+ changes: Z,
1862
+ counts: { applied: fe, ignored: xe, blocked: re, satisfied: ve }
1826
1863
  };
1827
1864
  }
1828
- return L;
1829
- }), v = R(() => o.value.some(et) ? Object.values(S.value).some(
1830
- (A) => A.status === "will-update" || A.status === "partially-ignored"
1865
+ return M;
1866
+ }), b = A(() => o.value.some(et) ? Object.values(S.value).some(
1867
+ (O) => O.status === "will-update" || O.status === "partially-ignored"
1831
1868
  ) : !1);
1832
1869
  function e() {
1833
1870
  c(), i.value = !0;
@@ -1836,61 +1873,61 @@ const ge = ot("recipeBulkEditor", function() {
1836
1873
  i.value = !1;
1837
1874
  }
1838
1875
  function c() {
1839
- a.value = 1, h.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, r.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
1876
+ r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
1840
1877
  }
1841
- function g(A) {
1842
- h.value = A;
1878
+ function _(O) {
1879
+ x.value = O;
1843
1880
  }
1844
- function z(A) {
1845
- const L = new Set(u.value);
1846
- L.add(A), u.value = L;
1881
+ function N(O) {
1882
+ const M = new Set(u.value);
1883
+ M.add(O), u.value = M;
1847
1884
  }
1848
- function x() {
1885
+ function z() {
1849
1886
  u.value = /* @__PURE__ */ new Set();
1850
1887
  }
1851
- function w(A) {
1852
- o.value = [...o.value, A];
1888
+ function g(O) {
1889
+ o.value = [...o.value, O];
1853
1890
  }
1854
- function F(A, L) {
1855
- const O = [...o.value];
1856
- O[A] = L, o.value = O;
1891
+ function B(O, M) {
1892
+ const L = [...o.value];
1893
+ L[O] = M, o.value = L;
1857
1894
  }
1858
- function N(A) {
1859
- o.value = o.value.filter((L, O) => O !== A);
1895
+ function F(O) {
1896
+ o.value = o.value.filter((M, L) => L !== O);
1860
1897
  }
1861
- function T(A, L) {
1862
- const O = [...o.value], [q] = O.splice(A, 1);
1863
- O.splice(L, 0, q), o.value = O;
1898
+ function R(O, M) {
1899
+ const L = [...o.value], [q] = L.splice(O, 1);
1900
+ L.splice(M, 0, q), o.value = L;
1864
1901
  }
1865
1902
  function P() {
1866
- s.value = { ...S.value }, a.value = 3;
1903
+ s.value = { ...S.value }, r.value = 3;
1867
1904
  }
1868
- function W() {
1869
- s.value = {}, a.value = 2;
1905
+ function K() {
1906
+ s.value = {}, r.value = 2;
1870
1907
  }
1871
1908
  function H() {
1872
1909
  return Object.values(s.value).filter(
1873
- (A) => (A.status === "will-update" || A.status === "partially-ignored") && A.projected != null
1874
- ).map((A) => A.projected);
1910
+ (O) => (O.status === "will-update" || O.status === "partially-ignored") && O.projected != null
1911
+ ).map((O) => O.projected);
1875
1912
  }
1876
- async function Z() {
1877
- if (!r.value) {
1878
- r.value = !0, p.value = /* @__PURE__ */ new Map();
1913
+ async function ee() {
1914
+ if (!a.value) {
1915
+ a.value = !0, p.value = /* @__PURE__ */ new Map();
1879
1916
  try {
1880
- const A = H(), L = await d.importRecipes({
1917
+ const O = H(), M = await d.importRecipes({
1881
1918
  create: [],
1882
- update: A
1883
- }), O = (L == null ? void 0 : L.errors) ?? [];
1884
- if (O.length > 0) {
1919
+ update: O
1920
+ }), L = (M == null ? void 0 : M.errors) ?? [];
1921
+ if (L.length > 0) {
1885
1922
  const q = /* @__PURE__ */ new Map();
1886
- for (const { data: le, error: ee } of O) {
1887
- const re = typeof ee == "string" ? ee : (ee == null ? void 0 : ee.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
1888
- q.set(le._id, re);
1923
+ for (const { data: oe, error: Z } of L) {
1924
+ const ae = typeof Z == "string" ? Z : (Z == null ? void 0 : Z.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
1925
+ q.set(oe._id, ae);
1889
1926
  }
1890
1927
  p.value = q, l.open({
1891
1928
  title: t("inventory.recipe.bulkEditor.step3.partialErrorTitle"),
1892
1929
  message: t("inventory.recipe.bulkEditor.step3.partialErrorMessage", {
1893
- count: O.length
1930
+ count: L.length
1894
1931
  }),
1895
1932
  type: "warning"
1896
1933
  });
@@ -1898,30 +1935,30 @@ const ge = ot("recipeBulkEditor", function() {
1898
1935
  l.open({
1899
1936
  title: t("inventory.recipe.bulkEditor.step3.successTitle"),
1900
1937
  message: t("inventory.recipe.bulkEditor.step3.successMessage", {
1901
- count: A.length
1938
+ count: O.length
1902
1939
  }),
1903
1940
  type: "success"
1904
1941
  }), i.value = !1, c();
1905
- } catch (A) {
1942
+ } catch (O) {
1906
1943
  l.open({
1907
1944
  title: t("inventory.recipe.bulkEditor.step3.errorTitle"),
1908
1945
  message: t("inventory.recipe.bulkEditor.step3.errorMessage"),
1909
1946
  type: "error"
1910
- }), console.error("confirmAndApply failed", A);
1947
+ }), console.error("confirmAndApply failed", O);
1911
1948
  } finally {
1912
- r.value = !1;
1949
+ a.value = !1;
1913
1950
  }
1914
1951
  }
1915
1952
  }
1916
1953
  return {
1917
1954
  // state
1918
1955
  show: i,
1919
- currentStep: a,
1920
- query: h,
1956
+ currentStep: r,
1957
+ query: x,
1921
1958
  excludedRecipeIds: u,
1922
1959
  modifications: o,
1923
1960
  entries: s,
1924
- isSaving: r,
1961
+ isSaving: a,
1925
1962
  applyErrors: p,
1926
1963
  nameSearch: $,
1927
1964
  filterRows: C,
@@ -1929,257 +1966,257 @@ const ge = ot("recipeBulkEditor", function() {
1929
1966
  matchedRecipes: I,
1930
1967
  selectedRecipes: f,
1931
1968
  livePreviewEntries: S,
1932
- canGoToStep2: _,
1933
- canGoToStep3: v,
1969
+ canGoToStep2: k,
1970
+ canGoToStep3: b,
1934
1971
  // actions
1935
1972
  openDialog: e,
1936
1973
  closeDialog: V,
1937
1974
  reset: c,
1938
- updateQuery: g,
1939
- removeRecipe: z,
1940
- restoreAllRecipes: x,
1941
- addModification: w,
1942
- updateModification: F,
1943
- removeModification: N,
1944
- reorderModification: T,
1975
+ updateQuery: _,
1976
+ removeRecipe: N,
1977
+ restoreAllRecipes: z,
1978
+ addModification: g,
1979
+ updateModification: B,
1980
+ removeModification: F,
1981
+ reorderModification: R,
1945
1982
  goToStep3: P,
1946
- backToStep2: W,
1983
+ backToStep2: K,
1947
1984
  buildPayload: H,
1948
- confirmAndApply: Z
1985
+ confirmAndApply: ee
1949
1986
  };
1950
- }), yo = { class: "flex flex-col h-full" }, bo = { class: "px-16 pt-16 pb-8 shrink-0 flex items-center justify-between" }, go = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, _o = { class: "px-16 pt-12 pb-16 border-b border-fm-color-border-default bg-fm-color-surface-default flex flex-col gap-12 shrink-0" }, ko = {
1987
+ }), ho = { class: "flex flex-col h-full" }, xo = { class: "px-16 pt-16 pb-8 shrink-0 flex items-center justify-between" }, $o = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, Io = { class: "px-16 pt-12 pb-16 border-b border-fm-color-border-default bg-fm-color-surface-default flex flex-col gap-12 shrink-0" }, wo = {
1951
1988
  key: 0,
1952
1989
  class: "flex flex-wrap items-center gap-8"
1953
- }, ho = {
1990
+ }, Eo = {
1954
1991
  type: "button",
1955
1992
  class: "inline-flex items-center gap-4 h-[30px] pl-8 pr-6 rounded-l-md border border-r-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover cursor-pointer select-none transition-colors"
1956
- }, xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-primary" }, $o = { class: "flex flex-col gap-8 p-12 min-w-[260px]" }, Io = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, wo = {
1993
+ }, Vo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-primary" }, So = { class: "flex flex-col gap-8 p-12 min-w-[260px]" }, Co = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, Bo = {
1957
1994
  key: 0,
1958
1995
  class: "flex flex-col gap-4"
1959
- }, Eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vo = { class: "text-fm-color-typo-placeholder ml-4" }, So = ["title", "onClick"], Bo = { class: "flex-1 overflow-y-auto" }, Co = {
1996
+ }, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = { class: "text-fm-color-typo-placeholder ml-4" }, Ao = ["title", "onClick"], To = { class: "flex-1 overflow-y-auto" }, Uo = {
1960
1997
  key: 0,
1961
1998
  class: "flex flex-col items-center justify-center h-full gap-8 px-24 text-center"
1962
- }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = {
1999
+ }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = {
1963
2000
  key: 1,
1964
2001
  class: "divide-y divide-fm-color-border-default"
1965
- }, Ao = { class: "flex-1 min-w-0" }, To = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, Uo = {
2002
+ }, Do = { class: "flex-1 min-w-0" }, Go = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, No = {
1966
2003
  key: 0,
1967
2004
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-1 whitespace-normal break-words"
1968
- }, Po = { class: "flex items-center gap-4 mt-2" }, Mo = /* @__PURE__ */ ie({
2005
+ }, zo = { class: "flex items-center gap-4 mt-2" }, Oo = /* @__PURE__ */ le({
1969
2006
  __name: "RecipeBulkEditorStep1",
1970
2007
  setup(m) {
1971
- const { t: d } = oe(), l = ne(), t = ge(), i = R({
2008
+ const { t: d } = ie(), l = ne(), t = ge(), i = A({
1972
2009
  get: () => t.nameSearch,
1973
- set: (v) => {
1974
- t.nameSearch = v;
2010
+ set: (b) => {
2011
+ t.nameSearch = b;
1975
2012
  }
1976
- }), a = R(() => t.filterRows), h = K({});
1977
- function u(v) {
1978
- return h.value[v] ?? !1;
1979
- }
1980
- function o(v, e) {
1981
- h.value = { ...h.value, [v]: e };
1982
- }
1983
- const s = R(
1984
- () => l.skus.map((v) => ({
1985
- label: v.name,
1986
- sublabel: v.code,
1987
- value: v._id
2013
+ }), r = A(() => t.filterRows), x = W({});
2014
+ function u(b) {
2015
+ return x.value[b] ?? !1;
2016
+ }
2017
+ function o(b, e) {
2018
+ x.value = { ...x.value, [b]: e };
2019
+ }
2020
+ const s = A(
2021
+ () => l.skus.map((b) => ({
2022
+ label: b.name,
2023
+ sublabel: b.code,
2024
+ value: b._id
1988
2025
  }))
1989
- ), r = R(
1990
- () => l.recipes.map((v) => ({
1991
- label: v.name,
1992
- value: v._id
2026
+ ), a = A(
2027
+ () => l.recipes.map((b) => ({
2028
+ label: b.name,
2029
+ value: b._id
1993
2030
  }))
1994
2031
  );
1995
- function p(v) {
1996
- return v.type !== "ingredient" || !v.itemId ? null : l.skuById[v.itemId] ?? null;
2032
+ function p(b) {
2033
+ return b.type !== "ingredient" || !b.itemId ? null : l.skuById[b.itemId] ?? null;
1997
2034
  }
1998
- function $(v) {
2035
+ function $(b) {
1999
2036
  var e;
2000
- if (!v.type) return d("inventory.recipe.bulkEditor.step1.filter");
2001
- if (v.type === "ingredient") {
2002
- if (!v.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2003
- const V = l.skuById[v.itemId];
2037
+ if (!b.type) return d("inventory.recipe.bulkEditor.step1.filter");
2038
+ if (b.type === "ingredient") {
2039
+ if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2040
+ const V = l.skuById[b.itemId];
2004
2041
  if (!V) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
2005
- const { amount: c, measurement: g } = v.amountModel;
2042
+ const { amount: c, measurement: _ } = b.amountModel;
2006
2043
  if (!(c != null && c.amount > 0)) return V.name;
2007
- const x = (g == null ? void 0 : g.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", w = Q(c);
2008
- return `${V.name} (${w}${x})`;
2044
+ const z = (_ == null ? void 0 : _.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", g = Q(c);
2045
+ return `${V.name} (${g}${z})`;
2009
2046
  }
2010
- if (v.type === "recipe") {
2011
- if (!v.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2012
- const V = l.recipeById[v.itemId];
2047
+ if (b.type === "recipe") {
2048
+ if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2049
+ const V = l.recipeById[b.itemId];
2013
2050
  return V ? V.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
2014
2051
  }
2015
2052
  return "";
2016
2053
  }
2017
- function C(v) {
2018
- const e = vo(v);
2054
+ function C(b) {
2055
+ const e = ko(b);
2019
2056
  t.filterRows.push(e), o(e.id, !0);
2020
2057
  }
2021
- function I(v) {
2022
- t.filterRows = t.filterRows.filter((V) => V.id !== v);
2023
- const e = { ...h.value };
2024
- delete e[v], h.value = e;
2058
+ function I(b) {
2059
+ t.filterRows = t.filterRows.filter((V) => V.id !== b);
2060
+ const e = { ...x.value };
2061
+ delete e[b], x.value = e;
2025
2062
  }
2026
- function f(v) {
2027
- v.amountModel = ye(), o(v.id, !0);
2063
+ function f(b) {
2064
+ b.amountModel = ye(), o(b.id, !0);
2028
2065
  }
2029
2066
  ue(
2030
- [i, a],
2067
+ [i, r],
2031
2068
  () => {
2032
- const v = [];
2033
- for (const c of a.value)
2069
+ const b = [];
2070
+ for (const c of r.value)
2034
2071
  if (!(!c.type || !c.itemId))
2035
2072
  if (c.type === "ingredient") {
2036
- const g = p(c), { amount: z, measurement: x } = c.amountModel, w = z != null && z.amount > 0;
2037
- let F, N;
2038
- g && w && (F = x ? he.multiplyDecimal(z, x.conversion) : z, N = (x == null ? void 0 : x.id) ?? null), v.push({
2073
+ const _ = p(c), { amount: N, measurement: z } = c.amountModel, g = N != null && N.amount > 0;
2074
+ let B, F;
2075
+ _ && g && (B = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), b.push({
2039
2076
  id: c.id,
2040
2077
  type: "ingredient",
2041
2078
  itemId: c.itemId,
2042
- amount: F ?? null,
2043
- measurementId: N
2079
+ amount: B ?? null,
2080
+ measurementId: F
2044
2081
  });
2045
- } else c.type === "recipe" && v.push({
2082
+ } else c.type === "recipe" && b.push({
2046
2083
  id: c.id,
2047
2084
  type: "recipe",
2048
2085
  itemId: c.itemId
2049
2086
  });
2050
2087
  t.updateQuery({
2051
2088
  nameSearch: i.value,
2052
- filters: v
2089
+ filters: b
2053
2090
  });
2054
- const e = i.value.trim().length > 0, V = v.length > 0;
2091
+ const e = i.value.trim().length > 0, V = b.length > 0;
2055
2092
  !e && !V && t.restoreAllRecipes();
2056
2093
  },
2057
2094
  { deep: !0, immediate: !0 }
2058
2095
  );
2059
- function _(v) {
2060
- var g, z, x, w;
2061
- if (v.isGroup) {
2062
- const F = l.skuGroupById[v.id];
2063
- if (!F) return null;
2064
- const N = `x${Q(v.amount)}`;
2065
- return v.recipeIds.slice(1).length ? `(${((g = l.recipeById[v.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${F.name} (${N})` : `${F.name} (${N})`;
2096
+ function k(b) {
2097
+ var _, N, z, g;
2098
+ if (b.isGroup) {
2099
+ const B = l.skuGroupById[b.id];
2100
+ if (!B) return null;
2101
+ const F = `x${Q(b.amount)}`;
2102
+ return b.recipeIds.slice(1).length ? `(${((_ = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? ""}) ${B.name} (${F})` : `${B.name} (${F})`;
2066
2103
  }
2067
- const e = l.skuById[v.id];
2104
+ const e = l.skuById[b.id];
2068
2105
  if (!e) return null;
2069
- const V = ((z = v.measurement) == null ? void 0 : z.abbrev) ?? ((x = e.unit) == null ? void 0 : x.abbrev) ?? "", c = `${Q(v.amount)}${V}`;
2070
- return v.recipeIds.slice(1).length ? `(${((w = l.recipeById[v.recipeIds.at(-1) ?? ""]) == null ? void 0 : w.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2106
+ const V = ((N = b.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(b.amount)}${V}`;
2107
+ return b.recipeIds.slice(1).length ? `(${((g = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
2071
2108
  }
2072
- function S(v) {
2073
- return ke(v.contains, /* @__PURE__ */ new Set([v._id]), l.recipeById).map(_).filter((e) => e !== null).join(", ");
2109
+ function S(b) {
2110
+ return ke(b.contains, /* @__PURE__ */ new Set([b._id]), l.recipeById).map(k).filter((e) => e !== null).join(", ");
2074
2111
  }
2075
- return (v, e) => {
2076
- const V = G("FmButton"), c = G("FmSearch"), g = G("FmSelect"), z = G("FmPopover"), x = G("FmIcon"), w = G("FmMenuItem"), F = G("FmMenu"), N = G("FmChip");
2077
- return b(), B("div", yo, [
2078
- y("div", bo, [
2079
- y("span", go, D(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2112
+ return (b, e) => {
2113
+ const V = G("FmButton"), c = G("FmSearch"), _ = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), g = G("FmMenuItem"), B = G("FmMenu"), F = G("FmChip");
2114
+ return y(), E("div", ho, [
2115
+ v("div", xo, [
2116
+ v("span", $o, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
2080
2117
  count: n(t).selectedRecipes.length
2081
2118
  })), 1),
2082
- n(t).excludedRecipeIds.size > 0 ? (b(), Y(V, {
2119
+ n(t).excludedRecipeIds.size > 0 ? (y(), Y(V, {
2083
2120
  key: 0,
2084
2121
  label: n(d)("inventory.recipe.bulkEditor.step1.restoreAll"),
2085
2122
  variant: "tertiary",
2086
2123
  size: "md",
2087
- onClick: e[0] || (e[0] = (T) => n(t).restoreAllRecipes())
2088
- }, null, 8, ["label"])) : U("", !0)
2124
+ onClick: e[0] || (e[0] = (R) => n(t).restoreAllRecipes())
2125
+ }, null, 8, ["label"])) : T("", !0)
2089
2126
  ]),
2090
- y("div", _o, [
2091
- k(c, {
2127
+ v("div", Io, [
2128
+ h(c, {
2092
2129
  modelValue: i.value,
2093
- "onUpdate:modelValue": e[1] || (e[1] = (T) => i.value = T),
2130
+ "onUpdate:modelValue": e[1] || (e[1] = (R) => i.value = R),
2094
2131
  placeholder: n(d)("inventory.recipe.bulkEditor.query.nameSearchPlaceholder")
2095
2132
  }, null, 8, ["modelValue", "placeholder"]),
2096
- a.value.length > 0 ? (b(), B("div", ko, [
2097
- (b(!0), B(X, null, me(a.value, (T) => (b(), B("div", {
2098
- key: T.id,
2133
+ r.value.length > 0 ? (y(), E("div", wo, [
2134
+ (y(!0), E(X, null, me(r.value, (R) => (y(), E("div", {
2135
+ key: R.id,
2099
2136
  class: "flex items-center"
2100
2137
  }, [
2101
- k(z, {
2102
- "show-popover": u(T.id),
2138
+ h(N, {
2139
+ "show-popover": u(R.id),
2103
2140
  "exclude-el-from-click-outside": ["fm-menu"],
2104
2141
  placement: "bottom-start",
2105
- onPopoverChanged: (P) => o(T.id, P)
2142
+ onPopoverChanged: (P) => o(R.id, P)
2106
2143
  }, {
2107
2144
  "popover-button": J(() => [
2108
- y("button", ho, [
2109
- y("span", xo, D($(T)), 1)
2145
+ v("button", Eo, [
2146
+ v("span", Vo, U($(R)), 1)
2110
2147
  ])
2111
2148
  ]),
2112
2149
  default: J(() => [
2113
- y("div", $o, [
2114
- y("p", Io, D(T.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2115
- T.type === "ingredient" ? (b(), B(X, { key: 0 }, [
2116
- k(g, {
2117
- modelValue: T.itemId,
2118
- "onUpdate:modelValue": [(P) => T.itemId = P, (P) => f(T)],
2150
+ v("div", So, [
2151
+ v("p", Co, U(R.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
2152
+ R.type === "ingredient" ? (y(), E(X, { key: 0 }, [
2153
+ h(_, {
2154
+ modelValue: R.itemId,
2155
+ "onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
2119
2156
  items: s.value,
2120
2157
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectIngredient"),
2121
2158
  clearable: ""
2122
2159
  }, {
2123
2160
  "menu-wrapper": J((P) => [
2124
- k(Fe, we({ ref_for: !0 }, P, {
2161
+ h(Fe, we({ ref_for: !0 }, P, {
2125
2162
  items: s.value,
2126
- "model-value": T.itemId
2163
+ "model-value": R.itemId
2127
2164
  }), null, 16, ["items", "model-value"])
2128
2165
  ]),
2129
2166
  _: 2
2130
2167
  }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"]),
2131
- p(T) ? (b(), B("div", wo, [
2132
- y("span", Eo, [
2133
- mt(D(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
2134
- y("span", Vo, D(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2168
+ p(R) ? (y(), E("div", Bo, [
2169
+ v("span", Fo, [
2170
+ mt(U(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
2171
+ v("span", Ro, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
2135
2172
  ]),
2136
- k(Ce, {
2137
- modelValue: T.amountModel,
2138
- "onUpdate:modelValue": (P) => T.amountModel = P,
2139
- unit: p(T).unit,
2173
+ h(Be, {
2174
+ modelValue: R.amountModel,
2175
+ "onUpdate:modelValue": (P) => R.amountModel = P,
2176
+ unit: p(R).unit,
2140
2177
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.amountPlaceholder"),
2141
2178
  "convert-amount-on-change-unit": ""
2142
2179
  }, null, 8, ["modelValue", "onUpdate:modelValue", "unit", "placeholder"])
2143
- ])) : U("", !0)
2144
- ], 64)) : T.type === "recipe" ? (b(), Y(g, {
2180
+ ])) : T("", !0)
2181
+ ], 64)) : R.type === "recipe" ? (y(), Y(_, {
2145
2182
  key: 1,
2146
- modelValue: T.itemId,
2147
- "onUpdate:modelValue": [(P) => T.itemId = P, (P) => f(T)],
2148
- items: r.value,
2183
+ modelValue: R.itemId,
2184
+ "onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
2185
+ items: a.value,
2149
2186
  placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectRecipe"),
2150
2187
  clearable: ""
2151
2188
  }, {
2152
2189
  "menu-wrapper": J((P) => [
2153
- k(Fe, we({ ref_for: !0 }, P, {
2154
- items: r.value,
2155
- "model-value": T.itemId
2190
+ h(Fe, we({ ref_for: !0 }, P, {
2191
+ items: a.value,
2192
+ "model-value": R.itemId
2156
2193
  }), null, 16, ["items", "model-value"])
2157
2194
  ]),
2158
2195
  _: 2
2159
- }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"])) : U("", !0)
2196
+ }, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"])) : T("", !0)
2160
2197
  ])
2161
2198
  ]),
2162
2199
  _: 2
2163
2200
  }, 1032, ["show-popover", "onPopoverChanged"]),
2164
- y("button", {
2201
+ v("button", {
2165
2202
  type: "button",
2166
2203
  class: "inline-flex items-center justify-center h-[30px] w-[26px] rounded-r-md border border-l-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover text-fm-color-typo-secondary hover:text-fm-color-typo-primary cursor-pointer transition-colors",
2167
2204
  title: n(d)("inventory.recipe.bulkEditor.step1.removeFilter"),
2168
- onClick: (P) => I(T.id)
2205
+ onClick: (P) => I(R.id)
2169
2206
  }, [
2170
- k(x, {
2207
+ h(z, {
2171
2208
  name: "close",
2172
2209
  size: "sm"
2173
2210
  })
2174
- ], 8, So)
2211
+ ], 8, Ao)
2175
2212
  ]))), 128))
2176
- ])) : U("", !0),
2177
- k(F, {
2213
+ ])) : T("", !0),
2214
+ h(B, {
2178
2215
  "close-on-click": !0,
2179
2216
  placement: "bottom-start"
2180
2217
  }, {
2181
2218
  "menu-button": J(() => [
2182
- k(V, {
2219
+ h(V, {
2183
2220
  label: n(d)("inventory.recipe.bulkEditor.step1.filter"),
2184
2221
  variant: "secondary",
2185
2222
  size: "md",
@@ -2188,50 +2225,50 @@ const ge = ot("recipeBulkEditor", function() {
2188
2225
  }, null, 8, ["label"])
2189
2226
  ]),
2190
2227
  default: J(() => [
2191
- k(w, {
2228
+ h(g, {
2192
2229
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient"),
2193
2230
  icon: "inventory_2",
2194
- onClick: e[2] || (e[2] = (T) => C("ingredient"))
2231
+ onClick: e[2] || (e[2] = (R) => C("ingredient"))
2195
2232
  }, null, 8, ["label"]),
2196
- k(w, {
2233
+ h(g, {
2197
2234
  label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe"),
2198
2235
  icon: "restaurant_menu",
2199
- onClick: e[3] || (e[3] = (T) => C("recipe"))
2236
+ onClick: e[3] || (e[3] = (R) => C("recipe"))
2200
2237
  }, null, 8, ["label"])
2201
2238
  ]),
2202
2239
  _: 1
2203
2240
  })
2204
2241
  ]),
2205
- y("div", Bo, [
2206
- n(t).selectedRecipes.length === 0 ? (b(), B("div", Co, [
2207
- k(x, {
2242
+ v("div", To, [
2243
+ n(t).selectedRecipes.length === 0 ? (y(), E("div", Uo, [
2244
+ h(z, {
2208
2245
  name: "search_off",
2209
2246
  size: "lg",
2210
2247
  class: "text-fm-color-typo-placeholder"
2211
2248
  }),
2212
- y("p", Fo, D(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2213
- ])) : (b(), B("div", Ro, [
2214
- (b(!0), B(X, null, me(n(t).selectedRecipes, (T) => (b(), B("div", {
2215
- key: T._id,
2249
+ v("p", Po, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
2250
+ ])) : (y(), E("div", Mo, [
2251
+ (y(!0), E(X, null, me(n(t).selectedRecipes, (R) => (y(), E("div", {
2252
+ key: R._id,
2216
2253
  class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors"
2217
2254
  }, [
2218
- y("div", Ao, [
2219
- y("div", To, D(T.name), 1),
2220
- T.contains.length > 0 ? (b(), B("div", Uo, D(S(T)), 1)) : U("", !0),
2221
- y("div", Po, [
2222
- T.version === "v2" ? (b(), Y(N, {
2255
+ v("div", Do, [
2256
+ v("div", Go, U(R.name), 1),
2257
+ R.contains.length > 0 ? (y(), E("div", No, U(S(R)), 1)) : T("", !0),
2258
+ v("div", zo, [
2259
+ R.version === "v2" ? (y(), Y(F, {
2223
2260
  key: 0,
2224
2261
  size: "sm",
2225
2262
  label: "V2",
2226
2263
  variant: "info"
2227
- })) : U("", !0)
2264
+ })) : T("", !0)
2228
2265
  ])
2229
2266
  ]),
2230
- k(V, {
2267
+ h(V, {
2231
2268
  variant: "tertiary",
2232
2269
  icon: "do_not_disturb_on",
2233
2270
  title: n(d)("inventory.recipe.bulkEditor.step1.removeRecipeTooltip"),
2234
- onClick: (P) => n(t).removeRecipe(T._id)
2271
+ onClick: (P) => n(t).removeRecipe(R._id)
2235
2272
  }, null, 8, ["title", "onClick"])
2236
2273
  ]))), 128))
2237
2274
  ]))
@@ -2239,16 +2276,16 @@ const ge = ot("recipeBulkEditor", function() {
2239
2276
  ]);
2240
2277
  };
2241
2278
  }
2242
- }), Do = { class: "flex flex-col gap-0 rounded-lg border border-fm-color-border-default bg-fm-color-surface-default overflow-hidden" }, Go = { class: "flex items-start gap-12 px-16 py-12" }, No = { class: "flex-1" }, zo = { class: "flex-1" }, Oo = {
2279
+ }), Lo = { class: "flex flex-col gap-0 rounded-lg border border-fm-color-border-default bg-fm-color-surface-default overflow-hidden" }, jo = { class: "flex items-start gap-12 px-16 py-12" }, Ko = { class: "flex-1" }, qo = { class: "flex-1" }, Wo = {
2243
2280
  key: 0,
2244
2281
  class: "border-t border-fm-color-border-default px-16 py-10 flex items-center gap-10"
2245
- }, Lo = {
2282
+ }, Yo = {
2246
2283
  key: 1,
2247
2284
  class: "border-t border-fm-color-border-default px-16 py-10 flex items-start gap-8 bg-fm-color-surface-warning"
2248
- }, jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ko = {
2285
+ }, Jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ho = {
2249
2286
  key: 2,
2250
2287
  class: "border-t border-fm-color-border-default px-16 py-12 flex flex-col gap-12"
2251
- }, qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Yo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ho = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary -mt-8" }, Qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ei = /* @__PURE__ */ ie({
2288
+ }, Qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ei = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, ti = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary -mt-8" }, ni = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, oi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ii = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, li = /* @__PURE__ */ le({
2252
2289
  __name: "ModificationCard",
2253
2290
  props: {
2254
2291
  modelValue: {},
@@ -2256,20 +2293,20 @@ const ge = ot("recipeBulkEditor", function() {
2256
2293
  },
2257
2294
  emits: ["update:modelValue"],
2258
2295
  setup(m, { emit: d }) {
2259
- const l = m, t = d, { t: i } = oe(), a = ne(), h = We();
2260
- function u(E) {
2261
- const M = E.type === "replace-binding" ? E.from.type : E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives" ? E.target.type : E.type === "add-binding" ? E.binding.type : null;
2262
- return M ? M === "RECIPE" ? "recipe" : "ingredient" : null;
2296
+ const l = m, t = d, { t: i } = ie(), r = ne(), x = We();
2297
+ function u(w) {
2298
+ const D = w.type === "replace-binding" ? w.from.type : w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives" ? w.target.type : w.type === "add-binding" ? w.binding.type : null;
2299
+ return D ? D === "RECIPE" ? "recipe" : "ingredient" : null;
2263
2300
  }
2264
- function o(E) {
2265
- return E.type === "update-alternatives" ? !0 : E.type === "add-binding" ? (E.binding.alternatives ?? []).length > 0 : E.type === "replace-binding" ? (E.to.alternatives ?? []).length > 0 : !1;
2301
+ function o(w) {
2302
+ return w.type === "update-alternatives" ? !0 : w.type === "add-binding" ? (w.binding.alternatives ?? []).length > 0 : w.type === "replace-binding" ? (w.to.alternatives ?? []).length > 0 : !1;
2266
2303
  }
2267
- function s(E) {
2268
- switch (E.type) {
2304
+ function s(w) {
2305
+ switch (w.type) {
2269
2306
  case "add-binding":
2270
2307
  return "link";
2271
2308
  case "replace-binding":
2272
- return E.from.id === E.to.id ? "update" : null;
2309
+ return w.from.id === w.to.id ? "update" : null;
2273
2310
  case "remove-binding":
2274
2311
  return "remove";
2275
2312
  case "update-binding-rule":
@@ -2278,358 +2315,358 @@ const ge = ot("recipeBulkEditor", function() {
2278
2315
  return "alts";
2279
2316
  }
2280
2317
  }
2281
- function r(E) {
2282
- return E.type === "replace-binding" ? E.from.id || null : (E.type === "remove-binding" || E.type === "update-binding-rule" || E.type === "update-alternatives") && E.target.id || null;
2318
+ function a(w) {
2319
+ return w.type === "replace-binding" ? w.from.id || null : (w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives") && w.target.id || null;
2283
2320
  }
2284
- function p(E) {
2285
- return E.type === "add-binding" && E.binding.id || null;
2321
+ function p(w) {
2322
+ return w.type === "add-binding" && w.binding.id || null;
2286
2323
  }
2287
- function $(E) {
2288
- const M = E.type === "replace-binding" ? E.to : E.type === "add-binding" ? E.binding : null;
2289
- return M ? { amount: M.amount, measurement: M.measurement ?? null } : ye();
2324
+ function $(w) {
2325
+ const D = w.type === "replace-binding" ? w.to : w.type === "add-binding" ? w.binding : null;
2326
+ return D ? { amount: D.amount, measurement: D.measurement ?? null } : ye();
2290
2327
  }
2291
- function C(E) {
2292
- return E.type === "replace-binding" ? E.to.rules ?? null : E.type === "add-binding" ? E.binding.rules ?? null : null;
2328
+ function C(w) {
2329
+ return w.type === "replace-binding" ? w.to.rules ?? null : w.type === "add-binding" ? w.binding.rules ?? null : null;
2293
2330
  }
2294
- function I(E) {
2295
- return E.type === "update-alternatives" ? E.alternatives ?? [] : E.type === "add-binding" ? E.binding.alternatives ?? [] : [];
2331
+ function I(w) {
2332
+ return w.type === "update-alternatives" ? w.alternatives ?? [] : w.type === "add-binding" ? w.binding.alternatives ?? [] : [];
2296
2333
  }
2297
- const f = K(u(l.modelValue)), _ = K(s(l.modelValue)), S = K(o(l.modelValue)), v = K(r(l.modelValue)), e = K(p(l.modelValue)), V = K($(l.modelValue)), c = K(C(l.modelValue)), g = K(I(l.modelValue)), z = K(
2334
+ const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)), b = W(a(l.modelValue)), e = W(p(l.modelValue)), V = W($(l.modelValue)), c = W(C(l.modelValue)), _ = W(I(l.modelValue)), N = W(
2298
2335
  (() => {
2299
- const E = $(l.modelValue);
2300
- return E.amount ? Q(E.amount) : "";
2336
+ const w = $(l.modelValue);
2337
+ return w.amount ? Q(w.amount) : "";
2301
2338
  })()
2302
2339
  );
2303
- let x = null;
2304
- function w(E) {
2305
- z.value = E, x && clearTimeout(x), x = setTimeout(() => {
2306
- const M = +E;
2340
+ let z = null;
2341
+ function g(w) {
2342
+ N.value = w, z && clearTimeout(z), z = setTimeout(() => {
2343
+ const D = +w;
2307
2344
  V.value = {
2308
- amount: E.length > 0 && isFinite(M) ? Ke(M) : { amount: 0, precision: 0 },
2345
+ amount: w.length > 0 && isFinite(D) ? Ke(D) : { amount: 0, precision: 0 },
2309
2346
  measurement: null
2310
2347
  };
2311
2348
  }, 300);
2312
2349
  }
2313
2350
  ue(f, () => {
2314
- _.value = null, S.value = !1, v.value = null, e.value = null, V.value = ye(), c.value = null, g.value = [], z.value = "";
2315
- }), ue(_, () => {
2316
- v.value = null, e.value = null, V.value = ye(), c.value = null, g.value = [], z.value = "";
2317
- }), ue(S, (E) => {
2318
- E || (g.value = [], _.value === "alts" && (_.value = null));
2351
+ k.value = null, S.value = !1, b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
2352
+ }), ue(k, () => {
2353
+ b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
2354
+ }), ue(S, (w) => {
2355
+ w || (_.value = [], k.value === "alts" && (k.value = null));
2319
2356
  });
2320
- const F = R(() => [
2357
+ const B = A(() => [
2321
2358
  { label: i("inventory.recipe.bulkEditor.step2.fieldIngredient"), value: "ingredient" },
2322
2359
  { label: i("inventory.recipe.bulkEditor.step2.fieldRecipe"), value: "recipe" }
2323
- ]), N = R(() => {
2324
- const E = [
2360
+ ]), F = A(() => {
2361
+ const w = [
2325
2362
  { label: i("inventory.recipe.bulkEditor.step2.actionLink"), value: "link" },
2326
2363
  { label: i("inventory.recipe.bulkEditor.step2.actionUpdate"), value: "update" },
2327
2364
  { label: i("inventory.recipe.bulkEditor.step2.actionRemove"), value: "remove" }
2328
2365
  ];
2329
- return f.value === "ingredient" && S.value && h.enableRecipeV2 && E.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), E;
2330
- }), T = R(() => f.value !== null && _.value !== null), P = R(
2331
- () => _.value === "update" || _.value === "remove" || _.value === "alts"
2332
- ), W = R(
2333
- () => _.value === "link"
2334
- ), H = R(
2335
- () => _.value === "update" && v.value !== null
2336
- ), Z = R(
2337
- () => f.value === "ingredient" && S.value && h.enableRecipeV2
2338
- ), A = R(
2339
- () => a.skus.map((E) => ({ label: E.name, sublabel: E.code, value: E._id }))
2340
- ), L = R(
2341
- () => a.recipes.map((E) => ({ label: E.name, value: E._id }))
2342
- ), O = R(() => f.value === "recipe" ? L.value : A.value), q = R(() => f.value === "recipe" ? L.value : A.value), le = R(() => f.value !== "ingredient" || !e.value ? null : a.skuById[e.value] ?? null), ee = R(() => f.value !== "ingredient" || !v.value ? null : a.skuById[v.value] ?? null), re = R(() => {
2343
- const E = v.value ?? e.value;
2344
- return E ? [E] : [];
2345
- }), fe = R(() => Z.value ? Object.values(l.livePreviewEntries).filter(
2346
- (E) => E.original.version !== "v2"
2347
- ).length : 0), xe = R(() => Object.values(l.livePreviewEntries).length);
2366
+ return f.value === "ingredient" && S.value && x.enableRecipeV2 && w.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), w;
2367
+ }), R = A(() => f.value !== null && k.value !== null), P = A(
2368
+ () => k.value === "update" || k.value === "remove" || k.value === "alts"
2369
+ ), K = A(
2370
+ () => k.value === "link"
2371
+ ), H = A(
2372
+ () => k.value === "update" && b.value !== null
2373
+ ), ee = A(
2374
+ () => f.value === "ingredient" && S.value && x.enableRecipeV2
2375
+ ), O = A(
2376
+ () => r.skus.map((w) => ({ label: w.name, sublabel: w.code, value: w._id }))
2377
+ ), M = A(
2378
+ () => r.recipes.map((w) => ({ label: w.name, value: w._id }))
2379
+ ), L = A(() => f.value === "recipe" ? M.value : O.value), q = A(() => f.value === "recipe" ? M.value : O.value), oe = A(() => f.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = A(() => f.value !== "ingredient" || !b.value ? null : r.skuById[b.value] ?? null), ae = A(() => {
2380
+ const w = b.value ?? e.value;
2381
+ return w ? [w] : [];
2382
+ }), fe = A(() => ee.value ? Object.values(l.livePreviewEntries).filter(
2383
+ (w) => w.original.version !== "v2"
2384
+ ).length : 0), xe = A(() => Object.values(l.livePreviewEntries).length);
2348
2385
  ue(
2349
- () => [_.value, v.value],
2350
- ([E, M], [te, pe]) => {
2351
- if (E !== "alts" || M === pe) return;
2352
- if (!M) {
2353
- g.value = [];
2386
+ () => [k.value, b.value],
2387
+ ([w, D], [te, pe]) => {
2388
+ if (w !== "alts" || D === pe) return;
2389
+ if (!D) {
2390
+ _.value = [];
2354
2391
  return;
2355
2392
  }
2356
2393
  const $e = Object.values(l.livePreviewEntries).find(
2357
- (j) => j.original.version === "v2" && j.original.contains.some((Ie) => Ie.type === "SKU" && Ie.id === M)
2394
+ (j) => j.original.version === "v2" && j.original.contains.some((Ie) => Ie.type === "SKU" && Ie.id === D)
2358
2395
  );
2359
2396
  if ($e) {
2360
- const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === M);
2361
- g.value = j != null && j.alternatives ? [...j.alternatives] : [];
2397
+ const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === D);
2398
+ _.value = j != null && j.alternatives ? [...j.alternatives] : [];
2362
2399
  } else
2363
- g.value = [];
2400
+ _.value = [];
2364
2401
  }
2365
2402
  );
2366
- const ae = R(() => _.value !== "alts" || !v.value ? 0 : Object.values(l.livePreviewEntries).filter(
2367
- (E) => E.original.version === "v2" && E.original.contains.some((M) => M.type === "SKU" && M.id === v.value)
2403
+ const re = A(() => k.value !== "alts" || !b.value ? 0 : Object.values(l.livePreviewEntries).filter(
2404
+ (w) => w.original.version === "v2" && w.original.contains.some((D) => D.type === "SKU" && D.id === b.value)
2368
2405
  ).length);
2369
2406
  function ve() {
2370
2407
  return f.value === "recipe" ? "RECIPE" : "SKU";
2371
2408
  }
2372
2409
  function ce() {
2373
- const E = ve(), M = ye().amount, te = {
2374
- type: E,
2410
+ const w = ve(), D = ye().amount, te = {
2411
+ type: w,
2375
2412
  id: "",
2376
- amount: M,
2413
+ amount: D,
2377
2414
  measurement: null,
2378
2415
  rules: null,
2379
2416
  alternatives: []
2380
2417
  };
2381
- switch (_.value) {
2418
+ switch (k.value) {
2382
2419
  case "update":
2383
- return { type: "replace-binding", from: { type: E, id: "" }, to: te };
2420
+ return { type: "replace-binding", from: { type: w, id: "" }, to: te };
2384
2421
  case "remove":
2385
- return { type: "remove-binding", target: { type: E, id: "" } };
2422
+ return { type: "remove-binding", target: { type: w, id: "" } };
2386
2423
  case "alts":
2387
- return { type: "update-alternatives", target: { type: E, id: "" }, alternatives: [] };
2424
+ return { type: "update-alternatives", target: { type: w, id: "" }, alternatives: [] };
2388
2425
  case "link":
2389
2426
  default:
2390
2427
  return { type: "add-binding", binding: te };
2391
2428
  }
2392
2429
  }
2393
2430
  function Ue() {
2394
- return v.value ? { type: ve(), id: v.value } : null;
2431
+ return b.value ? { type: ve(), id: b.value } : null;
2395
2432
  }
2396
- function Ye(E = !1) {
2397
- const M = E ? v.value : e.value;
2398
- if (!M) return null;
2433
+ function Ye(w = !1) {
2434
+ const D = w ? b.value : e.value;
2435
+ if (!D) return null;
2399
2436
  const { amount: te, measurement: pe } = V.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
2400
2437
  return {
2401
2438
  type: ve(),
2402
- id: M,
2439
+ id: D,
2403
2440
  amount: Ee,
2404
2441
  measurement: pe ?? null,
2405
2442
  rules: f.value === "recipe" ? c.value ?? null : null,
2406
- alternatives: Z.value ? g.value : []
2443
+ alternatives: ee.value ? _.value : []
2407
2444
  };
2408
2445
  }
2409
2446
  function ct() {
2410
2447
  if (!f.value) return;
2411
- if (!_.value) {
2448
+ if (!k.value) {
2412
2449
  t("update:modelValue", ce());
2413
2450
  return;
2414
2451
  }
2415
- const E = Ue(), M = Ye(!1);
2452
+ const w = Ue(), D = Ye(!1);
2416
2453
  let te = null;
2417
- switch (_.value) {
2454
+ switch (k.value) {
2418
2455
  case "link":
2419
- M && (te = { type: "add-binding", binding: M });
2456
+ D && (te = { type: "add-binding", binding: D });
2420
2457
  break;
2421
2458
  case "update": {
2422
2459
  const pe = Ye(!0);
2423
- E && pe && (te = { type: "replace-binding", from: E, to: pe });
2460
+ w && pe && (te = { type: "replace-binding", from: w, to: pe });
2424
2461
  break;
2425
2462
  }
2426
2463
  case "remove":
2427
- E && (te = { type: "remove-binding", target: E });
2464
+ w && (te = { type: "remove-binding", target: w });
2428
2465
  break;
2429
2466
  case "alts":
2430
- E && (te = { type: "update-alternatives", target: E, alternatives: g.value });
2467
+ w && (te = { type: "update-alternatives", target: w, alternatives: _.value });
2431
2468
  break;
2432
2469
  }
2433
2470
  t("update:modelValue", te ?? ce());
2434
2471
  }
2435
2472
  return ue(
2436
- [f, _, S, v, e, V, c, g],
2473
+ [f, k, S, b, e, V, c, _],
2437
2474
  () => ct(),
2438
2475
  { deep: !0 }
2439
- ), (E, M) => {
2476
+ ), (w, D) => {
2440
2477
  const te = G("FmSelect"), pe = G("FmSwitch"), Ee = G("FmIcon"), $e = G("FmTextField");
2441
- return b(), B("div", Do, [
2442
- y("div", Go, [
2443
- y("div", No, [
2444
- k(te, {
2478
+ return y(), E("div", Lo, [
2479
+ v("div", jo, [
2480
+ v("div", Ko, [
2481
+ h(te, {
2445
2482
  modelValue: f.value,
2446
- "onUpdate:modelValue": M[0] || (M[0] = (j) => f.value = j),
2447
- items: F.value,
2483
+ "onUpdate:modelValue": D[0] || (D[0] = (j) => f.value = j),
2484
+ items: B.value,
2448
2485
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionField"),
2449
2486
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionField")
2450
2487
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2451
2488
  ]),
2452
- y("div", zo, [
2453
- k(te, {
2454
- modelValue: _.value,
2455
- "onUpdate:modelValue": M[1] || (M[1] = (j) => _.value = j),
2456
- items: N.value,
2489
+ v("div", qo, [
2490
+ h(te, {
2491
+ modelValue: k.value,
2492
+ "onUpdate:modelValue": D[1] || (D[1] = (j) => k.value = j),
2493
+ items: F.value,
2457
2494
  label: n(i)("inventory.recipe.bulkEditor.step2.sectionAction"),
2458
2495
  placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionAction")
2459
2496
  }, null, 8, ["modelValue", "items", "label", "placeholder"])
2460
2497
  ])
2461
2498
  ]),
2462
- f.value === "ingredient" && n(h).enableRecipeV2 ? (b(), B("div", Oo, [
2463
- k(pe, {
2499
+ f.value === "ingredient" && n(x).enableRecipeV2 ? (y(), E("div", Wo, [
2500
+ h(pe, {
2464
2501
  modelValue: S.value,
2465
- "onUpdate:modelValue": M[2] || (M[2] = (j) => S.value = j),
2502
+ "onUpdate:modelValue": D[2] || (D[2] = (j) => S.value = j),
2466
2503
  label: n(i)("inventory.recipe.bulkEditor.step2.includeAlternativesToggle")
2467
2504
  }, null, 8, ["modelValue", "label"])
2468
- ])) : U("", !0),
2469
- Z.value && fe.value > 0 ? (b(), B("div", Lo, [
2470
- k(Ee, {
2505
+ ])) : T("", !0),
2506
+ ee.value && fe.value > 0 ? (y(), E("div", Yo, [
2507
+ h(Ee, {
2471
2508
  name: "warning",
2472
2509
  size: "sm",
2473
2510
  class: "text-fm-color-typo-warning mt-1 shrink-0"
2474
2511
  }),
2475
- y("p", jo, D(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2512
+ v("p", Jo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
2476
2513
  v1Count: fe.value,
2477
2514
  total: xe.value
2478
2515
  })), 1)
2479
- ])) : U("", !0),
2480
- T.value ? (b(), B("div", Ko, [
2481
- P.value ? (b(), B(X, { key: 0 }, [
2482
- y("p", qo, D(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2483
- k(te, {
2484
- modelValue: v.value,
2485
- "onUpdate:modelValue": M[3] || (M[3] = (j) => v.value = j),
2486
- items: O.value,
2516
+ ])) : T("", !0),
2517
+ R.value ? (y(), E("div", Ho, [
2518
+ P.value ? (y(), E(X, { key: 0 }, [
2519
+ v("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
2520
+ h(te, {
2521
+ modelValue: b.value,
2522
+ "onUpdate:modelValue": D[3] || (D[3] = (j) => b.value = j),
2523
+ items: L.value,
2487
2524
  placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2488
2525
  clearable: ""
2489
2526
  }, {
2490
2527
  "menu-wrapper": J((j) => [
2491
- k(Fe, we(j, {
2492
- items: O.value,
2493
- "model-value": v.value
2528
+ h(Fe, we(j, {
2529
+ items: L.value,
2530
+ "model-value": b.value
2494
2531
  }), null, 16, ["items", "model-value"])
2495
2532
  ]),
2496
2533
  _: 1
2497
2534
  }, 8, ["modelValue", "items", "placeholder"]),
2498
- H.value ? (b(), B(X, { key: 0 }, [
2499
- f.value === "ingredient" && ee.value ? (b(), Y(Ce, {
2535
+ H.value ? (y(), E(X, { key: 0 }, [
2536
+ f.value === "ingredient" && Z.value ? (y(), Y(Be, {
2500
2537
  key: 0,
2501
2538
  modelValue: V.value,
2502
- "onUpdate:modelValue": M[4] || (M[4] = (j) => V.value = j),
2503
- unit: ee.value.unit,
2539
+ "onUpdate:modelValue": D[4] || (D[4] = (j) => V.value = j),
2540
+ unit: Z.value.unit,
2504
2541
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2505
2542
  "convert-amount-on-change-unit": ""
2506
- }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (b(), Y($e, {
2543
+ }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
2507
2544
  key: 1,
2508
- "model-value": z.value,
2545
+ "model-value": N.value,
2509
2546
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2510
2547
  type: "number",
2511
- "onUpdate:modelValue": M[5] || (M[5] = (j) => w(j))
2512
- }, null, 8, ["model-value", "label"])) : U("", !0),
2513
- f.value === "recipe" ? (b(), B(X, { key: 2 }, [
2514
- y("p", Wo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2515
- k(Re, {
2548
+ "onUpdate:modelValue": D[5] || (D[5] = (j) => g(j))
2549
+ }, null, 8, ["model-value", "label"])) : T("", !0),
2550
+ f.value === "recipe" ? (y(), E(X, { key: 2 }, [
2551
+ v("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2552
+ h(Re, {
2516
2553
  modelValue: c.value,
2517
- "onUpdate:modelValue": M[6] || (M[6] = (j) => c.value = j)
2554
+ "onUpdate:modelValue": D[6] || (D[6] = (j) => c.value = j)
2518
2555
  }, null, 8, ["modelValue"])
2519
- ], 64)) : U("", !0),
2520
- Z.value ? (b(), B(X, { key: 3 }, [
2521
- y("p", Yo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2522
- k(Se, {
2523
- modelValue: g.value,
2524
- "onUpdate:modelValue": M[7] || (M[7] = (j) => g.value = j),
2525
- "filter-ingredient-ids": re.value
2556
+ ], 64)) : T("", !0),
2557
+ ee.value ? (y(), E(X, { key: 3 }, [
2558
+ v("p", Zo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2559
+ h(Se, {
2560
+ modelValue: _.value,
2561
+ "onUpdate:modelValue": D[7] || (D[7] = (j) => _.value = j),
2562
+ "filter-ingredient-ids": ae.value
2526
2563
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2527
- ], 64)) : U("", !0)
2528
- ], 64)) : U("", !0),
2529
- _.value === "alts" && v.value ? (b(), B(X, { key: 1 }, [
2530
- y("p", Jo, D(ae.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: ae.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2531
- y("p", Ho, D(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2532
- k(Se, {
2533
- modelValue: g.value,
2534
- "onUpdate:modelValue": M[8] || (M[8] = (j) => g.value = j),
2535
- "filter-ingredient-ids": re.value
2564
+ ], 64)) : T("", !0)
2565
+ ], 64)) : T("", !0),
2566
+ k.value === "alts" && b.value ? (y(), E(X, { key: 1 }, [
2567
+ v("p", ei, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
2568
+ v("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
2569
+ h(Se, {
2570
+ modelValue: _.value,
2571
+ "onUpdate:modelValue": D[8] || (D[8] = (j) => _.value = j),
2572
+ "filter-ingredient-ids": ae.value
2536
2573
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2537
- ], 64)) : U("", !0)
2538
- ], 64)) : U("", !0),
2539
- W.value ? (b(), B(X, { key: 1 }, [
2540
- y("p", Qo, D(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2541
- k(te, {
2574
+ ], 64)) : T("", !0)
2575
+ ], 64)) : T("", !0),
2576
+ K.value ? (y(), E(X, { key: 1 }, [
2577
+ v("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
2578
+ h(te, {
2542
2579
  modelValue: e.value,
2543
- "onUpdate:modelValue": M[9] || (M[9] = (j) => e.value = j),
2580
+ "onUpdate:modelValue": D[9] || (D[9] = (j) => e.value = j),
2544
2581
  items: q.value,
2545
2582
  placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
2546
2583
  clearable: ""
2547
2584
  }, {
2548
2585
  "menu-wrapper": J((j) => [
2549
- k(Fe, we(j, {
2586
+ h(Fe, we(j, {
2550
2587
  items: q.value,
2551
2588
  "model-value": e.value
2552
2589
  }), null, 16, ["items", "model-value"])
2553
2590
  ]),
2554
2591
  _: 1
2555
2592
  }, 8, ["modelValue", "items", "placeholder"]),
2556
- e.value ? (b(), B(X, { key: 0 }, [
2557
- f.value === "ingredient" && le.value ? (b(), Y(Ce, {
2593
+ e.value ? (y(), E(X, { key: 0 }, [
2594
+ f.value === "ingredient" && oe.value ? (y(), Y(Be, {
2558
2595
  key: 0,
2559
2596
  modelValue: V.value,
2560
- "onUpdate:modelValue": M[10] || (M[10] = (j) => V.value = j),
2561
- unit: le.value.unit,
2597
+ "onUpdate:modelValue": D[10] || (D[10] = (j) => V.value = j),
2598
+ unit: oe.value.unit,
2562
2599
  placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
2563
2600
  "convert-amount-on-change-unit": ""
2564
- }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (b(), Y($e, {
2601
+ }, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
2565
2602
  key: 1,
2566
- "model-value": z.value,
2603
+ "model-value": N.value,
2567
2604
  label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
2568
2605
  type: "number",
2569
- "onUpdate:modelValue": M[11] || (M[11] = (j) => w(j))
2570
- }, null, 8, ["model-value", "label"])) : U("", !0),
2571
- f.value === "recipe" ? (b(), B(X, { key: 2 }, [
2572
- y("p", Xo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2573
- k(Re, {
2606
+ "onUpdate:modelValue": D[11] || (D[11] = (j) => g(j))
2607
+ }, null, 8, ["model-value", "label"])) : T("", !0),
2608
+ f.value === "recipe" ? (y(), E(X, { key: 2 }, [
2609
+ v("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
2610
+ h(Re, {
2574
2611
  modelValue: c.value,
2575
- "onUpdate:modelValue": M[12] || (M[12] = (j) => c.value = j)
2612
+ "onUpdate:modelValue": D[12] || (D[12] = (j) => c.value = j)
2576
2613
  }, null, 8, ["modelValue"])
2577
- ], 64)) : U("", !0),
2578
- Z.value ? (b(), B(X, { key: 3 }, [
2579
- y("p", Zo, D(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2580
- k(Se, {
2581
- modelValue: g.value,
2582
- "onUpdate:modelValue": M[13] || (M[13] = (j) => g.value = j),
2583
- "filter-ingredient-ids": re.value
2614
+ ], 64)) : T("", !0),
2615
+ ee.value ? (y(), E(X, { key: 3 }, [
2616
+ v("p", ii, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
2617
+ h(Se, {
2618
+ modelValue: _.value,
2619
+ "onUpdate:modelValue": D[13] || (D[13] = (j) => _.value = j),
2620
+ "filter-ingredient-ids": ae.value
2584
2621
  }, null, 8, ["modelValue", "filter-ingredient-ids"])
2585
- ], 64)) : U("", !0)
2586
- ], 64)) : U("", !0)
2587
- ], 64)) : U("", !0)
2588
- ])) : U("", !0)
2622
+ ], 64)) : T("", !0)
2623
+ ], 64)) : T("", !0)
2624
+ ], 64)) : T("", !0)
2625
+ ])) : T("", !0)
2589
2626
  ]);
2590
2627
  };
2591
2628
  }
2592
- }), ti = { class: "flex flex-col gap-8" }, ni = { class: "flex flex-wrap items-center gap-12 px-4" }, oi = {
2629
+ }), ri = { class: "flex flex-col gap-8" }, ai = { class: "flex flex-wrap items-center gap-12 px-4" }, si = {
2593
2630
  key: 0,
2594
2631
  class: "flex items-center gap-6"
2595
- }, ii = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, li = {
2632
+ }, di = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ui = {
2596
2633
  key: 1,
2597
2634
  class: "flex items-center gap-6"
2598
- }, ai = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ri = {
2635
+ }, ci = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, pi = {
2599
2636
  key: 2,
2600
2637
  class: "flex items-center gap-6"
2601
- }, si = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, di = { class: "rounded-lg border border-fm-color-border-default overflow-hidden" }, ui = {
2638
+ }, mi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fi = { class: "rounded-lg border border-fm-color-border-default overflow-hidden" }, vi = {
2602
2639
  key: 0,
2603
2640
  class: "px-16 py-12 text-center fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
2604
- }, ci = {
2641
+ }, yi = {
2605
2642
  key: 1,
2606
2643
  class: "divide-y divide-fm-color-border-default"
2607
- }, pi = { class: "flex items-center gap-12" }, mi = { class: "flex-1 fm-typo-en-body-sm-600 text-fm-color-typo-primary truncate" }, fi = {
2644
+ }, bi = { class: "flex items-center gap-12" }, gi = { class: "flex-1 fm-typo-en-body-sm-600 text-fm-color-typo-primary truncate" }, _i = {
2608
2645
  key: 0,
2609
2646
  class: "flex flex-col gap-4 pl-8"
2610
- }, vi = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, yi = /* @__PURE__ */ ie({
2647
+ }, ki = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, hi = /* @__PURE__ */ le({
2611
2648
  __name: "LivePreviewTable",
2612
2649
  setup(m) {
2613
- const { t: d } = oe(), l = ge(), t = ne(), i = {
2650
+ const { t: d } = ie(), l = ge(), t = ne(), i = {
2614
2651
  "will-update": 0,
2615
2652
  "partially-ignored": 1,
2616
2653
  "already-satisfied": 2,
2617
2654
  blocked: 3,
2618
2655
  "no-applicable-changes": 4
2619
- }, a = R(
2656
+ }, r = A(
2620
2657
  () => Object.values(l.livePreviewEntries).sort(
2621
2658
  (e, V) => i[e.status] - i[V.status]
2622
2659
  )
2623
- ), h = R(
2624
- () => a.value.filter((e) => e.status === "will-update").length
2625
- ), u = R(
2626
- () => a.value.filter((e) => e.status === "partially-ignored").length
2627
- ), o = R(
2628
- () => a.value.filter((e) => e.status === "already-satisfied").length
2629
- ), s = R(
2630
- () => a.value.filter((e) => e.status === "blocked").length
2660
+ ), x = A(
2661
+ () => r.value.filter((e) => e.status === "will-update").length
2662
+ ), u = A(
2663
+ () => r.value.filter((e) => e.status === "partially-ignored").length
2664
+ ), o = A(
2665
+ () => r.value.filter((e) => e.status === "already-satisfied").length
2666
+ ), s = A(
2667
+ () => r.value.filter((e) => e.status === "blocked").length
2631
2668
  );
2632
- function r(e) {
2669
+ function a(e) {
2633
2670
  switch (e) {
2634
2671
  case "will-update":
2635
2672
  return d("inventory.recipe.bulkEditor.status.willUpdate");
@@ -2662,15 +2699,15 @@ const ge = ot("recipeBulkEditor", function() {
2662
2699
  }
2663
2700
  }
2664
2701
  function $(e, V) {
2665
- var c, g, z;
2666
- return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((g = t.skuGroupById[V]) == null ? void 0 : g.name) ?? V : e === "RECIPE" ? ((z = t.recipeById[V]) == null ? void 0 : z.name) ?? V : V;
2702
+ var c, _, N;
2703
+ return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((_ = t.skuGroupById[V]) == null ? void 0 : _.name) ?? V : e === "RECIPE" ? ((N = t.recipeById[V]) == null ? void 0 : N.name) ?? V : V;
2667
2704
  }
2668
2705
  function C(e) {
2669
- var c, g;
2706
+ var c, _;
2670
2707
  const V = $(e.type, e.id);
2671
2708
  if (e.type === "SKU") {
2672
- const z = t.skuById[e.id], x = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((g = z == null ? void 0 : z.unit) == null ? void 0 : g.abbrev) ?? "";
2673
- return `${V} (${Q(e.amount)} ${x})`.trim();
2709
+ const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((_ = N == null ? void 0 : N.unit) == null ? void 0 : _.abbrev) ?? "";
2710
+ return `${V} (${Q(e.amount)} ${z})`.trim();
2674
2711
  }
2675
2712
  return e.type === "RECIPE" ? `${V} ×${Q(e.amount)}` : V;
2676
2713
  }
@@ -2678,10 +2715,10 @@ const ge = ot("recipeBulkEditor", function() {
2678
2715
  return $(e.type, e.id);
2679
2716
  }
2680
2717
  function f(e, V) {
2681
- const c = V.contains.find((g) => g.type === e.type && g.id === e.id);
2718
+ const c = V.contains.find((_) => _.type === e.type && _.id === e.id);
2682
2719
  return c ? C(c) : I(e);
2683
2720
  }
2684
- function _(e, V) {
2721
+ function k(e, V) {
2685
2722
  switch (e.type) {
2686
2723
  case "add-binding":
2687
2724
  return `+ ${C(e.binding)}`;
@@ -2709,7 +2746,7 @@ const ge = ot("recipeBulkEditor", function() {
2709
2746
  return "neutral";
2710
2747
  }
2711
2748
  }
2712
- function v(e) {
2749
+ function b(e) {
2713
2750
  switch (e) {
2714
2751
  case "applied":
2715
2752
  return d("inventory.recipe.bulkEditor.livePreview.outcomeApplied");
@@ -2725,76 +2762,76 @@ const ge = ot("recipeBulkEditor", function() {
2725
2762
  }
2726
2763
  return (e, V) => {
2727
2764
  const c = G("FmChip");
2728
- return b(), B("div", ti, [
2729
- y("div", ni, [
2730
- h.value + u.value > 0 ? (b(), B("div", oi, [
2731
- k(c, {
2765
+ return y(), E("div", ri, [
2766
+ v("div", ai, [
2767
+ x.value + u.value > 0 ? (y(), E("div", si, [
2768
+ h(c, {
2732
2769
  size: "sm",
2733
- label: String(h.value + u.value),
2770
+ label: String(x.value + u.value),
2734
2771
  variant: "success"
2735
2772
  }, null, 8, ["label"]),
2736
- y("span", ii, D(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2737
- ])) : U("", !0),
2738
- o.value > 0 ? (b(), B("div", li, [
2739
- k(c, {
2773
+ v("span", di, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
2774
+ ])) : T("", !0),
2775
+ o.value > 0 ? (y(), E("div", ui, [
2776
+ h(c, {
2740
2777
  size: "sm",
2741
2778
  label: String(o.value),
2742
2779
  variant: "info"
2743
2780
  }, null, 8, ["label"]),
2744
- y("span", ai, D(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2745
- ])) : U("", !0),
2746
- s.value > 0 ? (b(), B("div", ri, [
2747
- k(c, {
2781
+ v("span", ci, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
2782
+ ])) : T("", !0),
2783
+ s.value > 0 ? (y(), E("div", pi, [
2784
+ h(c, {
2748
2785
  size: "sm",
2749
2786
  label: String(s.value),
2750
2787
  variant: "critical"
2751
2788
  }, null, 8, ["label"]),
2752
- y("span", si, D(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2753
- ])) : U("", !0)
2789
+ v("span", mi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
2790
+ ])) : T("", !0)
2754
2791
  ]),
2755
- y("div", di, [
2756
- a.value.length === 0 ? (b(), B("div", ui, D(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (b(), B("div", ci, [
2757
- (b(!0), B(X, null, me(a.value, (g) => (b(), B("div", {
2758
- key: g.recipeId,
2792
+ v("div", fi, [
2793
+ r.value.length === 0 ? (y(), E("div", vi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (y(), E("div", yi, [
2794
+ (y(!0), E(X, null, me(r.value, (_) => (y(), E("div", {
2795
+ key: _.recipeId,
2759
2796
  class: "flex flex-col gap-6 px-16 py-10"
2760
2797
  }, [
2761
- y("div", pi, [
2762
- y("span", mi, D(g.recipeName), 1),
2763
- k(c, {
2798
+ v("div", bi, [
2799
+ v("span", gi, U(_.recipeName), 1),
2800
+ h(c, {
2764
2801
  size: "sm",
2765
- label: r(g.status),
2766
- variant: p(g.status)
2802
+ label: a(_.status),
2803
+ variant: p(_.status)
2767
2804
  }, null, 8, ["label", "variant"])
2768
2805
  ]),
2769
- g.changes.length > 0 ? (b(), B("div", fi, [
2770
- (b(!0), B(X, null, me(g.changes, (z, x) => (b(), B("div", {
2771
- key: x,
2806
+ _.changes.length > 0 ? (y(), E("div", _i, [
2807
+ (y(!0), E(X, null, me(_.changes, (N, z) => (y(), E("div", {
2808
+ key: z,
2772
2809
  class: "flex items-center gap-8"
2773
2810
  }, [
2774
- y("span", vi, D(_(z.change, g.original)), 1),
2775
- k(c, {
2811
+ v("span", ki, U(k(N.change, _.original)), 1),
2812
+ h(c, {
2776
2813
  size: "sm",
2777
- label: v(z.outcome),
2778
- variant: S(z.outcome)
2814
+ label: b(N.outcome),
2815
+ variant: S(N.outcome)
2779
2816
  }, null, 8, ["label", "variant"])
2780
2817
  ]))), 128))
2781
- ])) : U("", !0)
2818
+ ])) : T("", !0)
2782
2819
  ]))), 128))
2783
2820
  ]))
2784
2821
  ])
2785
2822
  ]);
2786
2823
  };
2787
2824
  }
2788
- }), bi = { class: "flex flex-col h-full overflow-hidden" }, gi = { class: "flex flex-col min-h-0 shrink-0" }, _i = { class: "flex items-center gap-8 px-16 pt-12 border-b border-fm-color-border-default" }, ki = { class: "flex-1 overflow-x-auto min-w-0" }, hi = {
2825
+ }), xi = { class: "flex flex-col h-full overflow-hidden" }, $i = { class: "flex flex-col min-h-0 shrink-0" }, Ii = { class: "flex items-center gap-8 px-16 pt-12 border-b border-fm-color-border-default" }, wi = { class: "flex-1 overflow-x-auto min-w-0" }, Ei = {
2789
2826
  class: "px-16 py-14 overflow-y-auto",
2790
2827
  style: { "max-height": "45vh" }
2791
- }, xi = {
2828
+ }, Vi = {
2792
2829
  key: 0,
2793
2830
  class: "flex flex-col items-center justify-center py-40 gap-8 text-center rounded-lg border border-dashed border-fm-color-border-default"
2794
- }, $i = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ii = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, wi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Ei = /* @__PURE__ */ ie({
2831
+ }, Si = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ci = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, Bi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Fi = /* @__PURE__ */ le({
2795
2832
  __name: "RecipeBulkEditorStep2",
2796
2833
  setup(m) {
2797
- const { t: d } = oe(), l = ge(), t = K(null);
2834
+ const { t: d } = ie(), l = ge(), t = W(null);
2798
2835
  ue(
2799
2836
  () => l.modifications.length,
2800
2837
  (o) => {
@@ -2803,16 +2840,16 @@ const ge = ot("recipeBulkEditor", function() {
2803
2840
  { immediate: !0 }
2804
2841
  );
2805
2842
  function i(o, s) {
2806
- const r = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
2807
- return r === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : r === "SKU" || r === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
2843
+ const a = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
2844
+ return a === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : a === "SKU" || a === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
2808
2845
  }
2809
- const a = R(
2846
+ const r = A(
2810
2847
  () => l.modifications.map((o, s) => ({
2811
2848
  label: i(o, s),
2812
2849
  value: s
2813
2850
  }))
2814
2851
  );
2815
- function h() {
2852
+ function x() {
2816
2853
  const s = {
2817
2854
  type: "add-binding",
2818
2855
  binding: {
@@ -2830,24 +2867,24 @@ const ge = ot("recipeBulkEditor", function() {
2830
2867
  l.removeModification(o);
2831
2868
  }
2832
2869
  return (o, s) => {
2833
- const r = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
2834
- return b(), B("div", bi, [
2835
- y("div", gi, [
2836
- y("div", _i, [
2837
- y("div", ki, [
2838
- a.value.length > 0 ? (b(), Y($, {
2870
+ const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
2871
+ return y(), E("div", xi, [
2872
+ v("div", $i, [
2873
+ v("div", Ii, [
2874
+ v("div", wi, [
2875
+ r.value.length > 0 ? (y(), Y($, {
2839
2876
  key: 0,
2840
2877
  "model-value": t.value,
2841
- items: a.value,
2878
+ items: r.value,
2842
2879
  "onUpdate:modelValue": s[1] || (s[1] = (I) => t.value = I)
2843
2880
  }, {
2844
2881
  default: J((I) => [
2845
- k(p, we(I, {
2882
+ h(p, we(I, {
2846
2883
  "model-value": t.value,
2847
2884
  "onUpdate:modelValue": s[0] || (s[0] = (f) => t.value = f)
2848
2885
  }), {
2849
2886
  append: J(() => [
2850
- k(r, {
2887
+ h(a, {
2851
2888
  variant: "tertiary",
2852
2889
  icon: "close",
2853
2890
  size: "md",
@@ -2858,213 +2895,213 @@ const ge = ot("recipeBulkEditor", function() {
2858
2895
  }, 1040, ["model-value"])
2859
2896
  ]),
2860
2897
  _: 1
2861
- }, 8, ["model-value", "items"])) : U("", !0)
2898
+ }, 8, ["model-value", "items"])) : T("", !0)
2862
2899
  ]),
2863
- k(r, {
2900
+ h(a, {
2864
2901
  label: n(d)("inventory.recipe.bulkEditor.step2.addModification"),
2865
2902
  variant: "secondary",
2866
2903
  size: "md",
2867
2904
  "prepend-icon": "add",
2868
2905
  class: "shrink-0",
2869
- onClick: h
2906
+ onClick: x
2870
2907
  }, null, 8, ["label"])
2871
2908
  ]),
2872
- y("div", hi, [
2873
- n(l).modifications.length === 0 ? (b(), B("div", xi, [
2874
- k(C, {
2909
+ v("div", Ei, [
2910
+ n(l).modifications.length === 0 ? (y(), E("div", Vi, [
2911
+ h(C, {
2875
2912
  name: "edit_note",
2876
2913
  size: "lg",
2877
2914
  class: "text-fm-color-typo-placeholder"
2878
2915
  }),
2879
- y("p", $i, D(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2880
- ])) : t.value !== null && n(l).modifications[t.value] ? (b(), Y(ei, {
2916
+ v("p", Si, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
2917
+ ])) : t.value !== null && n(l).modifications[t.value] ? (y(), Y(li, {
2881
2918
  key: t.value,
2882
2919
  "model-value": n(l).modifications[t.value],
2883
2920
  "live-preview-entries": n(l).livePreviewEntries,
2884
2921
  "onUpdate:modelValue": s[2] || (s[2] = (I) => n(l).updateModification(t.value, I))
2885
- }, null, 8, ["model-value", "live-preview-entries"])) : U("", !0)
2922
+ }, null, 8, ["model-value", "live-preview-entries"])) : T("", !0)
2886
2923
  ])
2887
2924
  ]),
2888
- s[3] || (s[3] = y("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2889
- y("div", Ii, [
2890
- y("span", wi, D(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2891
- k(yi)
2925
+ s[3] || (s[3] = v("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
2926
+ v("div", Ci, [
2927
+ v("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
2928
+ h(hi)
2892
2929
  ])
2893
2930
  ]);
2894
2931
  };
2895
2932
  }
2896
2933
  });
2897
- function Vi(m) {
2934
+ function Ri(m) {
2898
2935
  return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
2899
2936
  }
2900
- function Si() {
2901
- const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, h = Object.values(d.entries).filter(
2937
+ function Ai() {
2938
+ const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, x = Object.values(d.entries).filter(
2902
2939
  (s) => s.status === "will-update" || s.status === "partially-ignored"
2903
- ).flatMap((s, r) => {
2940
+ ).flatMap((s, a) => {
2904
2941
  var C;
2905
- const p = s.projected ?? s.original, $ = Vi(p.customAttributes);
2942
+ const p = s.projected ?? s.original, $ = Ri(p.customAttributes);
2906
2943
  if ((C = p.contains) != null && C.length) {
2907
- const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), _ = p.contains.filter((S) => S.type === "SKU_GROUP");
2944
+ const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), k = p.contains.filter((S) => S.type === "SKU_GROUP");
2908
2945
  return [
2909
- ...r === 0 ? [] : [["", "", "", "", "", "", ""]],
2946
+ ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2910
2947
  ...I.map(
2911
- (S, v) => {
2948
+ (S, b) => {
2912
2949
  var e;
2913
2950
  return [
2914
- v === 0 ? p.name : "",
2951
+ b === 0 ? p.name : "",
2915
2952
  "RECIPE",
2916
2953
  "",
2917
2954
  ((e = t[S.id]) == null ? void 0 : e.name) ?? S.id,
2918
2955
  Q(S.amount),
2919
2956
  "UNIT",
2920
- v === 0 ? $ : ""
2957
+ b === 0 ? $ : ""
2921
2958
  ];
2922
2959
  }
2923
2960
  ),
2924
2961
  ...f.map(
2925
- (S, v) => {
2926
- var e, V, c, g;
2962
+ (S, b) => {
2963
+ var e, V, c, _;
2927
2964
  return [
2928
- !I.length && v === 0 ? p.name : "",
2965
+ !I.length && b === 0 ? p.name : "",
2929
2966
  "INGREDIENT",
2930
2967
  ((e = l[S.id]) == null ? void 0 : e.code) ?? "",
2931
2968
  ((V = l[S.id]) == null ? void 0 : V.name) ?? S.id,
2932
2969
  Q(S.amount),
2933
- S.measurement ? S.measurement.abbrev : ((g = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : g.abbrev) ?? "",
2934
- !I.length && v === 0 ? $ : ""
2970
+ S.measurement ? S.measurement.abbrev : ((_ = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : _.abbrev) ?? "",
2971
+ !I.length && b === 0 ? $ : ""
2935
2972
  ];
2936
2973
  }
2937
2974
  ),
2938
- ..._.map(
2939
- (S, v) => {
2975
+ ...k.map(
2976
+ (S, b) => {
2940
2977
  var e, V;
2941
2978
  return [
2942
- I.length === 0 && f.length === 0 && v === 0 ? p.name : "",
2979
+ I.length === 0 && f.length === 0 && b === 0 ? p.name : "",
2943
2980
  "SKU_GROUP",
2944
2981
  ((e = i[S.id]) == null ? void 0 : e.ref) ?? "",
2945
2982
  ((V = i[S.id]) == null ? void 0 : V.name) ?? S.id,
2946
2983
  Q(S.amount),
2947
2984
  "UNIT",
2948
- I.length === 0 && f.length === 0 && v === 0 ? $ : ""
2985
+ I.length === 0 && f.length === 0 && b === 0 ? $ : ""
2949
2986
  ];
2950
2987
  }
2951
2988
  )
2952
2989
  ];
2953
2990
  }
2954
2991
  return [
2955
- ...r === 0 ? [] : [["", "", "", "", "", "", ""]],
2992
+ ...a === 0 ? [] : [["", "", "", "", "", "", ""]],
2956
2993
  [p.name, "No bindings", "", "", "", "", $]
2957
2994
  ];
2958
- }), o = rt(h, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
2995
+ }), o = at(x, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
2959
2996
  st(o, `RECIPE_BULK_EDIT_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
2960
2997
  }
2961
- const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Fi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Ri = { class: "flex flex-wrap gap-12" }, Ai = { class: "flex items-center gap-6" }, Ti = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ui = {
2998
+ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Pi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Mi = { class: "flex flex-wrap gap-12" }, Di = { class: "flex items-center gap-6" }, Gi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ni = {
2962
2999
  key: 0,
2963
3000
  class: "flex items-center gap-6"
2964
- }, Pi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mi = {
3001
+ }, zi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oi = {
2965
3002
  key: 1,
2966
3003
  class: "flex items-center gap-6"
2967
- }, Di = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gi = {
3004
+ }, Li = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ji = {
2968
3005
  key: 2,
2969
3006
  class: "flex items-center gap-6"
2970
- }, Ni = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zi = {
3007
+ }, Ki = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qi = {
2971
3008
  key: 3,
2972
3009
  class: "flex items-center gap-6"
2973
- }, Oi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Li = { class: "mt-12" }, ji = ["onClick"], Ki = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, qi = {
3010
+ }, Wi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yi = { class: "mt-12" }, Ji = ["onClick"], Hi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, Qi = {
2974
3011
  key: 0,
2975
3012
  class: "px-12 py-8 border-b border-fm-color-border-default"
2976
- }, Wi = { class: "px-12 py-10 leading-relaxed" }, Yi = {
3013
+ }, Xi = { class: "px-12 py-10 leading-relaxed" }, Zi = {
2977
3014
  key: 2,
2978
3015
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder italic"
2979
- }, Ji = { class: "flex items-center gap-12 px-12 py-8 border-t border-fm-color-border-default bg-fm-color-surface-secondary text-fm-color-typo-secondary fm-typo-en-body-xs-400" }, Hi = { key: 0 }, Qi = { key: 1 }, Xi = {
3016
+ }, el = { class: "flex items-center gap-12 px-12 py-8 border-t border-fm-color-border-default bg-fm-color-surface-secondary text-fm-color-typo-secondary fm-typo-en-body-xs-400" }, tl = { key: 0 }, nl = { key: 1 }, ol = {
2980
3017
  key: 2,
2981
3018
  class: "text-fm-color-warning"
2982
- }, Zi = {
3019
+ }, il = {
2983
3020
  key: 3,
2984
3021
  class: "text-fm-color-error"
2985
- }, el = {
3022
+ }, ll = {
2986
3023
  key: 4,
2987
3024
  class: "text-fm-color-typo-placeholder"
2988
- }, tl = /* @__PURE__ */ ie({
3025
+ }, rl = /* @__PURE__ */ le({
2989
3026
  __name: "RecipeBulkEditorSummaryStep",
2990
3027
  setup(m) {
2991
- const { t: d } = oe(), l = ne(), t = ge(), i = R(() => Object.values(t.entries)), a = R(
3028
+ const { t: d } = ie(), l = ne(), t = ge(), i = A(() => Object.values(t.entries)), r = A(
2992
3029
  () => i.value.filter((e) => e.status === "will-update").length
2993
- ), h = R(
3030
+ ), x = A(
2994
3031
  () => i.value.filter((e) => e.status === "partially-ignored").length
2995
- ), u = R(
3032
+ ), u = A(
2996
3033
  () => i.value.filter((e) => e.status === "already-satisfied").length
2997
- ), o = R(
3034
+ ), o = A(
2998
3035
  () => i.value.filter((e) => e.status === "blocked").length
2999
- ), s = R(
3036
+ ), s = A(
3000
3037
  () => i.value.filter((e) => e.status === "no-applicable-changes").length
3001
- ), r = K(/* @__PURE__ */ new Set());
3038
+ ), a = W(/* @__PURE__ */ new Set());
3002
3039
  function p(e) {
3003
- return r.value.has(e);
3040
+ return a.value.has(e);
3004
3041
  }
3005
3042
  function $(e) {
3006
- const V = new Set(r.value);
3007
- V.has(e) ? V.delete(e) : V.add(e), r.value = V;
3043
+ const V = new Set(a.value);
3044
+ V.has(e) ? V.delete(e) : V.add(e), a.value = V;
3008
3045
  }
3009
3046
  function C(e) {
3010
- var g, z, x;
3047
+ var _, N, z;
3011
3048
  const V = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
3012
- for (let w = 0; w < c.length; w++) {
3013
- const F = c[w], N = F.recipeIds.slice(1).length > 0, T = N ? ((g = l.recipeById[F.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "";
3049
+ for (let g = 0; g < c.length; g++) {
3050
+ const B = c[g], F = B.recipeIds.slice(1).length > 0, R = F ? ((_ = l.recipeById[B.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? "" : "";
3014
3051
  let P;
3015
- if (F.isGroup) {
3016
- const W = l.skuGroupById[F.id];
3017
- if (!W) continue;
3018
- const H = `x${Q(F.amount)}`;
3019
- P = N ? `(${T}) ${W.name} (${H})` : `${W.name} (${H})`;
3052
+ if (B.isGroup) {
3053
+ const K = l.skuGroupById[B.id];
3054
+ if (!K) continue;
3055
+ const H = `x${Q(B.amount)}`;
3056
+ P = F ? `(${R}) ${K.name} (${H})` : `${K.name} (${H})`;
3020
3057
  } else {
3021
- const W = l.skuById[F.id];
3022
- if (!W) continue;
3023
- const H = ((z = F.measurement) == null ? void 0 : z.abbrev) ?? ((x = W.unit) == null ? void 0 : x.abbrev) ?? "", Z = `${Q(F.amount)}${H}`;
3024
- P = N ? `(${T}) ${W.name} (${Z})` : `${W.name} (${Z})`;
3058
+ const K = l.skuById[B.id];
3059
+ if (!K) continue;
3060
+ const H = ((N = B.measurement) == null ? void 0 : N.abbrev) ?? ((z = K.unit) == null ? void 0 : z.abbrev) ?? "", ee = `${Q(B.amount)}${H}`;
3061
+ P = F ? `(${R}) ${K.name} (${ee})` : `${K.name} (${ee})`;
3025
3062
  }
3026
- w > 0 && V.push({ text: ", " }), V.push({ text: P });
3063
+ g > 0 && V.push({ text: ", " }), V.push({ text: P });
3027
3064
  }
3028
3065
  return V;
3029
3066
  }
3030
3067
  function I(e) {
3031
- var w, F, N, T;
3068
+ var g, B, F, R;
3032
3069
  if (e.isGroup) {
3033
3070
  const P = l.skuGroupById[e.id];
3034
3071
  if (!P) return "";
3035
- const W = e.recipeIds.slice(1).length > 0, H = W ? ((w = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : w.name) ?? "" : "", Z = `x${Q(e.amount)}`;
3036
- return W ? `(${H}) ${P.name} (${Z})` : `${P.name} (${Z})`;
3072
+ const K = e.recipeIds.slice(1).length > 0, H = K ? ((g = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "", ee = `x${Q(e.amount)}`;
3073
+ return K ? `(${H}) ${P.name} (${ee})` : `${P.name} (${ee})`;
3037
3074
  }
3038
3075
  const V = l.skuById[e.id];
3039
3076
  if (!V) return "";
3040
- const c = e.recipeIds.slice(1).length > 0, g = c ? ((F = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : F.name) ?? "" : "", z = ((N = e.measurement) == null ? void 0 : N.abbrev) ?? ((T = V.unit) == null ? void 0 : T.abbrev) ?? "", x = `${Q(e.amount)}${z}`;
3041
- return c ? `(${g}) ${V.name} (${x})` : `${V.name} (${x})`;
3077
+ const c = e.recipeIds.slice(1).length > 0, _ = c ? ((B = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((R = V.unit) == null ? void 0 : R.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
3078
+ return c ? `(${_}) ${V.name} (${z})` : `${V.name} (${z})`;
3042
3079
  }
3043
3080
  function f(e) {
3044
3081
  if (!e.projected) return [];
3045
- const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), g = /* @__PURE__ */ new Map();
3046
- for (const N of V) g.set(`${N.type}:${N.id}`, N);
3047
- const z = /* @__PURE__ */ new Map();
3048
- for (const N of c) z.set(`${N.type}:${N.id}`, N);
3049
- const x = [];
3050
- let w = !0;
3051
- function F(N, T) {
3052
- T && (w || x.push({ kind: "unchanged", text: ", " }), x.push({ kind: N, text: T }), w = !1);
3082
+ const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), _ = /* @__PURE__ */ new Map();
3083
+ for (const F of V) _.set(`${F.type}:${F.id}`, F);
3084
+ const N = /* @__PURE__ */ new Map();
3085
+ for (const F of c) N.set(`${F.type}:${F.id}`, F);
3086
+ const z = [];
3087
+ let g = !0;
3088
+ function B(F, R) {
3089
+ R && (g || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: R }), g = !1);
3053
3090
  }
3054
- for (const [N, T] of g) {
3055
- const P = z.get(N);
3091
+ for (const [F, R] of _) {
3092
+ const P = N.get(F);
3056
3093
  if (!P)
3057
- F("removed", I(T));
3094
+ B("removed", I(R));
3058
3095
  else {
3059
- const W = I(T), H = I(P);
3060
- W === H ? F("unchanged", W) : (F("removed", W), F("added", H));
3096
+ const K = I(R), H = I(P);
3097
+ K === H ? B("unchanged", K) : (B("removed", K), B("added", H));
3061
3098
  }
3062
3099
  }
3063
- for (const [N, T] of z)
3064
- g.has(N) || F("added", I(T));
3065
- return x;
3100
+ for (const [F, R] of N)
3101
+ _.has(F) || B("added", I(R));
3102
+ return z;
3066
3103
  }
3067
- const _ = R(() => {
3104
+ const k = A(() => {
3068
3105
  const e = /* @__PURE__ */ new Map();
3069
3106
  for (const V of i.value)
3070
3107
  e.set(V.recipeId, f(V));
@@ -3086,7 +3123,7 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3086
3123
  return "";
3087
3124
  }
3088
3125
  }
3089
- function v(e) {
3126
+ function b(e) {
3090
3127
  switch (e) {
3091
3128
  case "will-update":
3092
3129
  return "success";
@@ -3103,153 +3140,153 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3103
3140
  }
3104
3141
  }
3105
3142
  return (e, V) => {
3106
- const c = G("FmChip"), g = G("FmButton"), z = G("FmBanner"), x = G("FmIcon");
3107
- return b(), B("div", Bi, [
3108
- y("div", Ci, [
3109
- y("p", Fi, D(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3110
- y("div", Ri, [
3111
- y("div", Ai, [
3112
- k(c, {
3143
+ const c = G("FmChip"), _ = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
3144
+ return y(), E("div", Ti, [
3145
+ v("div", Ui, [
3146
+ v("p", Pi, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
3147
+ v("div", Mi, [
3148
+ v("div", Di, [
3149
+ h(c, {
3113
3150
  size: "sm",
3114
- label: String(a.value),
3151
+ label: String(r.value),
3115
3152
  variant: "success"
3116
3153
  }, null, 8, ["label"]),
3117
- y("span", Ti, D(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3154
+ v("span", Gi, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
3118
3155
  ]),
3119
- h.value > 0 ? (b(), B("div", Ui, [
3120
- k(c, {
3156
+ x.value > 0 ? (y(), E("div", Ni, [
3157
+ h(c, {
3121
3158
  size: "sm",
3122
- label: String(h.value),
3159
+ label: String(x.value),
3123
3160
  variant: "warning"
3124
3161
  }, null, 8, ["label"]),
3125
- y("span", Pi, D(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3126
- ])) : U("", !0),
3127
- u.value > 0 ? (b(), B("div", Mi, [
3128
- k(c, {
3162
+ v("span", zi, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
3163
+ ])) : T("", !0),
3164
+ u.value > 0 ? (y(), E("div", Oi, [
3165
+ h(c, {
3129
3166
  size: "sm",
3130
3167
  label: String(u.value),
3131
3168
  variant: "info"
3132
3169
  }, null, 8, ["label"]),
3133
- y("span", Di, D(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3134
- ])) : U("", !0),
3135
- o.value > 0 ? (b(), B("div", Gi, [
3136
- k(c, {
3170
+ v("span", Li, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
3171
+ ])) : T("", !0),
3172
+ o.value > 0 ? (y(), E("div", ji, [
3173
+ h(c, {
3137
3174
  size: "sm",
3138
3175
  label: String(o.value),
3139
3176
  variant: "critical"
3140
3177
  }, null, 8, ["label"]),
3141
- y("span", Ni, D(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3142
- ])) : U("", !0),
3143
- s.value > 0 ? (b(), B("div", zi, [
3144
- k(c, {
3178
+ v("span", Ki, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
3179
+ ])) : T("", !0),
3180
+ s.value > 0 ? (y(), E("div", qi, [
3181
+ h(c, {
3145
3182
  size: "sm",
3146
3183
  label: String(s.value),
3147
3184
  variant: "neutral"
3148
3185
  }, null, 8, ["label"]),
3149
- y("span", Oi, D(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3150
- ])) : U("", !0)
3186
+ v("span", Wi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
3187
+ ])) : T("", !0)
3151
3188
  ]),
3152
- y("div", Li, [
3153
- k(g, {
3189
+ v("div", Yi, [
3190
+ h(_, {
3154
3191
  label: n(d)("common.export"),
3155
3192
  variant: "secondary",
3156
3193
  size: "md",
3157
- onClick: n(Si)
3194
+ onClick: n(Ai)
3158
3195
  }, null, 8, ["label", "onClick"])
3159
3196
  ]),
3160
- a.value === 0 && h.value === 0 ? (b(), Y(z, {
3197
+ r.value === 0 && x.value === 0 ? (y(), Y(N, {
3161
3198
  key: 0,
3162
3199
  class: "mt-12",
3163
3200
  type: "warning",
3164
3201
  message: n(d)("inventory.recipe.bulkEditor.summary.nothingToSubmit")
3165
- }, null, 8, ["message"])) : U("", !0)
3202
+ }, null, 8, ["message"])) : T("", !0)
3166
3203
  ]),
3167
- (b(!0), B(X, null, me(i.value, (w) => (b(), B("div", {
3168
- key: w.recipeId,
3204
+ (y(!0), E(X, null, me(i.value, (g) => (y(), E("div", {
3205
+ key: g.recipeId,
3169
3206
  class: "rounded-lg border border-fm-color-border-default overflow-hidden"
3170
3207
  }, [
3171
- y("button", {
3208
+ v("button", {
3172
3209
  type: "button",
3173
- class: Be(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(w.recipeId) }]),
3174
- onClick: (F) => $(w.recipeId)
3210
+ class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(g.recipeId) }]),
3211
+ onClick: (B) => $(g.recipeId)
3175
3212
  }, [
3176
- k(x, {
3177
- name: p(w.recipeId) ? "expand_less" : "expand_more",
3213
+ h(z, {
3214
+ name: p(g.recipeId) ? "expand_less" : "expand_more",
3178
3215
  size: "sm",
3179
3216
  class: "text-fm-color-typo-secondary flex-shrink-0"
3180
3217
  }, null, 8, ["name"]),
3181
- y("span", Ki, D(w.recipeName), 1),
3182
- w.original.version === "v2" ? (b(), Y(c, {
3218
+ v("span", Hi, U(g.recipeName), 1),
3219
+ g.original.version === "v2" ? (y(), Y(c, {
3183
3220
  key: 0,
3184
3221
  size: "sm",
3185
3222
  label: "V2",
3186
3223
  variant: "info"
3187
- })) : U("", !0),
3188
- k(c, {
3224
+ })) : T("", !0),
3225
+ h(c, {
3189
3226
  size: "sm",
3190
- label: S(w.status),
3191
- variant: v(w.status)
3227
+ label: S(g.status),
3228
+ variant: b(g.status)
3192
3229
  }, null, 8, ["label", "variant"])
3193
- ], 10, ji),
3194
- p(w.recipeId) ? (b(), B(X, { key: 0 }, [
3195
- n(t).applyErrors.has(w.recipeId) ? (b(), B("div", qi, [
3196
- k(z, {
3230
+ ], 10, Ji),
3231
+ p(g.recipeId) ? (y(), E(X, { key: 0 }, [
3232
+ n(t).applyErrors.has(g.recipeId) ? (y(), E("div", Qi, [
3233
+ h(N, {
3197
3234
  type: "error",
3198
- message: n(t).applyErrors.get(w.recipeId)
3235
+ message: n(t).applyErrors.get(g.recipeId)
3199
3236
  }, null, 8, ["message"])
3200
- ])) : U("", !0),
3201
- y("div", Wi, [
3202
- w.projected ? (_.value.get(w.recipeId) ?? []).length > 0 ? (b(!0), B(X, { key: 1 }, me(_.value.get(w.recipeId), (F, N) => (b(), B("span", {
3203
- key: N,
3204
- class: Be(["fm-typo-en-body-sm-400", {
3205
- "text-fm-color-typo-secondary": F.kind === "unchanged",
3206
- "line-through text-fm-color-error font-medium": F.kind === "removed",
3207
- "text-fm-color-success font-medium": F.kind === "added"
3237
+ ])) : T("", !0),
3238
+ v("div", Xi, [
3239
+ g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (y(!0), E(X, { key: 1 }, me(k.value.get(g.recipeId), (B, F) => (y(), E("span", {
3240
+ key: F,
3241
+ class: Ce(["fm-typo-en-body-sm-400", {
3242
+ "text-fm-color-typo-secondary": B.kind === "unchanged",
3243
+ "line-through text-fm-color-error font-medium": B.kind === "removed",
3244
+ "text-fm-color-success font-medium": B.kind === "added"
3208
3245
  }])
3209
- }, D(F.text), 3))), 128)) : (b(), B("span", Yi, D(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (b(!0), B(X, { key: 0 }, me(C(w.original), (F, N) => (b(), B("span", {
3210
- key: N,
3246
+ }, U(B.text), 3))), 128)) : (y(), E("span", Zi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (y(!0), E(X, { key: 0 }, me(C(g.original), (B, F) => (y(), E("span", {
3247
+ key: F,
3211
3248
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
3212
- }, D(F.text), 1))), 128))
3249
+ }, U(B.text), 1))), 128))
3213
3250
  ]),
3214
- y("div", Ji, [
3215
- w.counts.applied > 0 ? (b(), B("span", Hi, D(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: w.counts.applied })), 1)) : U("", !0),
3216
- w.counts.satisfied > 0 ? (b(), B("span", Qi, D(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: w.counts.satisfied })), 1)) : U("", !0),
3217
- w.counts.ignored > 0 ? (b(), B("span", Xi, D(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: w.counts.ignored })), 1)) : U("", !0),
3218
- w.counts.blocked > 0 ? (b(), B("span", Zi, D(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: w.counts.blocked })), 1)) : U("", !0),
3219
- w.counts.applied === 0 && w.counts.satisfied === 0 && w.counts.ignored === 0 && w.counts.blocked === 0 ? (b(), B("span", el, D(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : U("", !0)
3251
+ v("div", el, [
3252
+ g.counts.applied > 0 ? (y(), E("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: g.counts.applied })), 1)) : T("", !0),
3253
+ g.counts.satisfied > 0 ? (y(), E("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: g.counts.satisfied })), 1)) : T("", !0),
3254
+ g.counts.ignored > 0 ? (y(), E("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: g.counts.ignored })), 1)) : T("", !0),
3255
+ g.counts.blocked > 0 ? (y(), E("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: g.counts.blocked })), 1)) : T("", !0),
3256
+ g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (y(), E("span", ll, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
3220
3257
  ])
3221
- ], 64)) : U("", !0)
3258
+ ], 64)) : T("", !0)
3222
3259
  ]))), 128))
3223
3260
  ]);
3224
3261
  };
3225
3262
  }
3226
- }), nl = { class: "flex items-center gap-12" }, ol = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, il = {
3263
+ }), al = { class: "flex items-center gap-12" }, sl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, dl = {
3227
3264
  key: 0,
3228
3265
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
3229
- }, ll = {
3266
+ }, ul = {
3230
3267
  key: 1,
3231
3268
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
3232
- }, al = {
3269
+ }, cl = {
3233
3270
  key: 2,
3234
3271
  class: "h-[calc(98vh-120px)] overflow-y-auto px-24 py-20"
3235
- }, rl = {
3272
+ }, pl = {
3236
3273
  key: 0,
3237
3274
  class: "flex items-center gap-8 px-4"
3238
- }, sl = {
3275
+ }, ml = {
3239
3276
  key: 1,
3240
3277
  class: "flex items-center gap-8 px-4"
3241
- }, dl = {
3278
+ }, fl = {
3242
3279
  key: 2,
3243
3280
  class: "flex items-center gap-8 px-4"
3244
- }, ul = /* @__PURE__ */ ie({
3281
+ }, vl = /* @__PURE__ */ le({
3245
3282
  __name: "RecipeBulkEditorDialog",
3246
3283
  props: {
3247
3284
  show: { type: Boolean }
3248
3285
  },
3249
3286
  emits: ["update:show"],
3250
3287
  setup(m, { emit: d }) {
3251
- const l = m, { t } = oe(), i = ge(), a = Ge(l, "show"), h = Le(), u = R(() => i.currentStep === 1), o = R(() => i.currentStep === 2), s = R(() => i.currentStep === 3);
3252
- function r() {
3288
+ const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u = A(() => i.currentStep === 1), o = A(() => i.currentStep === 2), s = A(() => i.currentStep === 3);
3289
+ function a() {
3253
3290
  i.currentStep = 2;
3254
3291
  }
3255
3292
  function p() {
@@ -3262,7 +3299,7 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3262
3299
  i.backToStep2();
3263
3300
  }
3264
3301
  function I() {
3265
- h.open({
3302
+ x.open({
3266
3303
  title: t("inventory.recipe.bulkEditor.step3.confirmTitle"),
3267
3304
  message: t("inventory.recipe.bulkEditor.step3.confirmMessage"),
3268
3305
  primaryActions: {
@@ -3279,14 +3316,14 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3279
3316
  });
3280
3317
  }
3281
3318
  function f() {
3282
- a.value = !1, i.reset();
3319
+ r.value = !1, i.reset();
3283
3320
  }
3284
- return (_, S) => {
3285
- const v = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
3286
- return b(), Y(V, {
3287
- modelValue: n(a),
3321
+ return (k, S) => {
3322
+ const b = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
3323
+ return y(), Y(V, {
3324
+ modelValue: n(r),
3288
3325
  "onUpdate:modelValue": [
3289
- S[0] || (S[0] = (c) => De(a) ? a.value = c : null),
3326
+ S[0] || (S[0] = (c) => De(r) ? r.value = c : null),
3290
3327
  S[1] || (S[1] = (c) => {
3291
3328
  c || n(i).reset();
3292
3329
  })
@@ -3297,9 +3334,9 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3297
3334
  "max-height": "98vh"
3298
3335
  }, {
3299
3336
  "dialog-header": J(() => [
3300
- y("div", nl, [
3301
- y("span", ol, D(n(t)("inventory.recipe.bulkEditor.title")), 1),
3302
- k(v, {
3337
+ v("div", al, [
3338
+ v("span", sl, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
3339
+ h(b, {
3303
3340
  size: "sm",
3304
3341
  label: n(t)("inventory.recipe.bulkEditor.stepIndicator", { step: n(i).currentStep, total: 3 }),
3305
3342
  variant: "neutral"
@@ -3307,118 +3344,118 @@ const Bi = { class: "flex flex-col gap-16" }, Ci = { class: "rounded-lg border b
3307
3344
  ])
3308
3345
  ]),
3309
3346
  "dialog-footer": J(() => [
3310
- u.value ? (b(), B("div", rl, [
3311
- k(e, {
3347
+ u.value ? (y(), E("div", pl, [
3348
+ h(e, {
3312
3349
  label: n(t)("common.next"),
3313
3350
  disabled: !n(i).canGoToStep2,
3314
- onClick: r
3351
+ onClick: a
3315
3352
  }, null, 8, ["label", "disabled"]),
3316
- k(e, {
3353
+ h(e, {
3317
3354
  label: n(t)("common.close"),
3318
3355
  variant: "tertiary",
3319
3356
  onClick: f
3320
3357
  }, null, 8, ["label"])
3321
- ])) : o.value ? (b(), B("div", sl, [
3322
- k(e, {
3358
+ ])) : o.value ? (y(), E("div", ml, [
3359
+ h(e, {
3323
3360
  label: n(t)("inventory.recipe.bulkEditor.step2.reviewButton"),
3324
3361
  disabled: !n(i).canGoToStep3,
3325
3362
  onClick: $
3326
3363
  }, null, 8, ["label", "disabled"]),
3327
- k(e, {
3364
+ h(e, {
3328
3365
  label: n(t)("common.back"),
3329
3366
  variant: "secondary",
3330
3367
  onClick: p
3331
3368
  }, null, 8, ["label"]),
3332
- k(e, {
3369
+ h(e, {
3333
3370
  label: n(t)("common.close"),
3334
3371
  variant: "tertiary",
3335
3372
  onClick: f
3336
3373
  }, null, 8, ["label"])
3337
- ])) : s.value ? (b(), B("div", dl, [
3338
- k(e, {
3374
+ ])) : s.value ? (y(), E("div", fl, [
3375
+ h(e, {
3339
3376
  label: n(t)("inventory.recipe.bulkEditor.step3.confirmButton"),
3340
3377
  disabled: n(i).isSaving,
3341
3378
  loading: n(i).isSaving,
3342
3379
  onClick: I
3343
3380
  }, null, 8, ["label", "disabled", "loading"]),
3344
- k(e, {
3381
+ h(e, {
3345
3382
  label: n(t)("common.back"),
3346
3383
  variant: "secondary",
3347
3384
  disabled: n(i).isSaving,
3348
3385
  onClick: C
3349
3386
  }, null, 8, ["label", "disabled"]),
3350
- k(e, {
3387
+ h(e, {
3351
3388
  label: n(t)("common.close"),
3352
3389
  variant: "tertiary",
3353
3390
  disabled: n(i).isSaving,
3354
3391
  onClick: f
3355
3392
  }, null, 8, ["label", "disabled"])
3356
- ])) : U("", !0)
3393
+ ])) : T("", !0)
3357
3394
  ]),
3358
3395
  default: J(() => [
3359
- u.value ? (b(), B("div", il, [
3360
- k(Mo)
3361
- ])) : o.value ? (b(), B("div", ll, [
3362
- k(Ei)
3363
- ])) : s.value ? (b(), B("div", al, [
3364
- k(tl)
3365
- ])) : U("", !0)
3396
+ u.value ? (y(), E("div", dl, [
3397
+ h(Oo)
3398
+ ])) : o.value ? (y(), E("div", ul, [
3399
+ h(Fi)
3400
+ ])) : s.value ? (y(), E("div", cl, [
3401
+ h(rl)
3402
+ ])) : T("", !0)
3366
3403
  ]),
3367
3404
  _: 1
3368
3405
  }, 8, ["modelValue"]);
3369
3406
  };
3370
3407
  }
3371
3408
  });
3372
- function cl(m) {
3409
+ function yl(m) {
3373
3410
  return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
3374
3411
  }
3375
- function pl() {
3376
- const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, a = d.flatMap((o, s) => {
3412
+ function bl() {
3413
+ const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, r = d.flatMap((o, s) => {
3377
3414
  var p;
3378
- const r = cl(o.customAttributes);
3415
+ const a = yl(o.customAttributes);
3379
3416
  if ((p = o.contains) != null && p.length) {
3380
3417
  const $ = o.contains.filter((f) => f.type === "RECIPE"), C = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
3381
3418
  return [
3382
3419
  ...s === 0 ? [] : [["", "", "", "", "", "", ""]],
3383
3420
  ...$.map(
3384
- (f, _) => {
3421
+ (f, k) => {
3385
3422
  var S;
3386
3423
  return [
3387
- _ === 0 ? o.name : "",
3424
+ k === 0 ? o.name : "",
3388
3425
  "RECIPE",
3389
3426
  "",
3390
3427
  (S = l[f.id]) == null ? void 0 : S.name,
3391
3428
  Q(f.amount),
3392
3429
  "UNIT",
3393
- _ === 0 ? r : ""
3430
+ k === 0 ? a : ""
3394
3431
  ];
3395
3432
  }
3396
3433
  ),
3397
3434
  ...C.map(
3398
- (f, _) => {
3399
- var S, v, e, V;
3435
+ (f, k) => {
3436
+ var S, b, e, V;
3400
3437
  return [
3401
- !$.length && _ === 0 ? o.name : "",
3438
+ !$.length && k === 0 ? o.name : "",
3402
3439
  "INGREDIENT",
3403
3440
  (S = t[f.id]) == null ? void 0 : S.code,
3404
- (v = t[f.id]) == null ? void 0 : v.name,
3441
+ (b = t[f.id]) == null ? void 0 : b.name,
3405
3442
  Q(f.amount),
3406
3443
  f.measurement ? f.measurement.abbrev : (V = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : V.abbrev,
3407
- !$.length && _ === 0 ? r : ""
3444
+ !$.length && k === 0 ? a : ""
3408
3445
  ];
3409
3446
  }
3410
3447
  ),
3411
3448
  ...I.map(
3412
- (f, _) => {
3413
- var S, v;
3449
+ (f, k) => {
3450
+ var S, b;
3414
3451
  return [
3415
- $.length === 0 && C.length === 0 && _ === 0 ? o.name : "",
3452
+ $.length === 0 && C.length === 0 && k === 0 ? o.name : "",
3416
3453
  "SKU_GROUP",
3417
3454
  ((S = i[f.id]) == null ? void 0 : S.ref) || "",
3418
- (v = i[f.id]) == null ? void 0 : v.name,
3455
+ (b = i[f.id]) == null ? void 0 : b.name,
3419
3456
  Q(f.amount),
3420
3457
  "UNIT",
3421
- $.length === 0 && C.length === 0 && _ === 0 ? r : ""
3458
+ $.length === 0 && C.length === 0 && k === 0 ? a : ""
3422
3459
  ];
3423
3460
  }
3424
3461
  )
@@ -3426,27 +3463,27 @@ function pl() {
3426
3463
  }
3427
3464
  return [
3428
3465
  ...s === 0 ? [] : [["", "", "", "", "", "", ""]],
3429
- [o.name, "No bindings", "", "", "", "", r]
3466
+ [o.name, "No bindings", "", "", "", "", a]
3430
3467
  ];
3431
- }), u = rt(a, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
3468
+ }), u = at(r, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
3432
3469
  st(u, `RECIPE_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
3433
3470
  }
3434
- const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kl = /* @__PURE__ */ ie({
3471
+ const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hl = /* @__PURE__ */ le({
3435
3472
  __name: "RecipeView",
3436
3473
  setup(m) {
3437
- const d = ne(), l = R(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: a } = ze(), { recipeDialogProps: h, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), r = R(() => s(l.value)), p = ge(), $ = We();
3438
- K(!1);
3474
+ const d = ne(), l = A(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: x, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = A(() => s(l.value)), p = ge(), $ = We();
3475
+ W(!1);
3439
3476
  function C(c) {
3440
3477
  if (c === "add")
3441
3478
  return i();
3442
3479
  if (c === "export")
3443
- return pl();
3480
+ return bl();
3444
3481
  c === "bulk-edit" && p.openDialog();
3445
3482
  }
3446
- const I = K(""), f = R(() => u.value), { breakpoints: _ } = xt(), S = R(() => _.value.xs || _.value.sm), v = R(() => S.value ? 10 : 20), e = Bt(), { t: V } = oe();
3447
- return (c, g) => {
3448
- const z = G("FmTable");
3449
- return b(), Y(Ct, {
3483
+ const I = W(""), f = A(() => u.value), { breakpoints: k } = xt(), S = A(() => k.value.xs || k.value.sm), b = A(() => S.value ? 10 : 20), e = Ct(), { t: V } = ie();
3484
+ return (c, _) => {
3485
+ const N = G("FmTable");
3486
+ return y(), Y(Bt, {
3450
3487
  title: n(V)("inventory.recipe.title"),
3451
3488
  actions: [
3452
3489
  {
@@ -3461,8 +3498,8 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3461
3498
  "onClick:action": C
3462
3499
  }, {
3463
3500
  default: J(() => [
3464
- y("div", {
3465
- class: Be([
3501
+ v("div", {
3502
+ class: Ce([
3466
3503
  "flex flex-col gap-8 max-h-full",
3467
3504
  {
3468
3505
  "p-0": S.value,
@@ -3470,40 +3507,40 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3470
3507
  }
3471
3508
  ])
3472
3509
  }, [
3473
- k(jt, {
3510
+ h(jt, {
3474
3511
  searchable: "",
3475
3512
  search: I.value,
3476
- "onUpdate:search": g[0] || (g[0] = (x) => I.value = x)
3513
+ "onUpdate:search": _[0] || (_[0] = (z) => I.value = z)
3477
3514
  }, null, 8, ["search"]),
3478
- (b(), Y(z, {
3515
+ (y(), Y(N, {
3479
3516
  style: vt(n(e).tableHeight),
3480
3517
  "column-defs": n(o),
3481
- "row-data": r.value,
3518
+ "row-data": a.value,
3482
3519
  "search-value": I.value,
3483
3520
  loading: !n(t)._currentLocation || f.value,
3484
- onRowClick: g[1] || (g[1] = (x) => n(a)(x.original.original)),
3521
+ onRowClick: _[1] || (_[1] = (z) => n(r)(z.original.original)),
3485
3522
  key: l.value.length,
3486
- "page-size": v.value
3523
+ "page-size": b.value
3487
3524
  }, {
3488
- "list-row": J((x) => [
3489
- k(Lt, {
3490
- row: x,
3491
- onRowClick: (w) => n(a)(w.original)
3525
+ "list-row": J((z) => [
3526
+ h(Lt, {
3527
+ row: z,
3528
+ onRowClick: (g) => n(r)(g.original)
3492
3529
  }, {
3493
- default: J((w) => {
3494
- var F, N, T, P, W, H, Z, A, L, O;
3530
+ default: J((g) => {
3531
+ var B, F, R, P, K, H, ee, O, M, L;
3495
3532
  return [
3496
- y("div", ml, [
3497
- y("div", fl, [
3498
- k(n(Qe), {
3499
- render: (T = (N = (F = w.recipe) == null ? void 0 : F.column) == null ? void 0 : N.columnDef) == null ? void 0 : T.cell,
3500
- props: (W = (P = w.recipe) == null ? void 0 : P.getContext) == null ? void 0 : W.call(P)
3533
+ v("div", gl, [
3534
+ v("div", _l, [
3535
+ h(n(Qe), {
3536
+ render: (R = (F = (B = g.recipe) == null ? void 0 : B.column) == null ? void 0 : F.columnDef) == null ? void 0 : R.cell,
3537
+ props: (K = (P = g.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
3501
3538
  }, null, 8, ["render", "props"])
3502
3539
  ]),
3503
- y("div", vl, [
3504
- k(n(Qe), {
3505
- render: (A = (Z = (H = w.ingredients) == null ? void 0 : H.column) == null ? void 0 : Z.columnDef) == null ? void 0 : A.cell,
3506
- props: (O = (L = w.ingredients) == null ? void 0 : L.getContext) == null ? void 0 : O.call(L)
3540
+ v("div", kl, [
3541
+ h(n(Qe), {
3542
+ render: (O = (ee = (H = g.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
3543
+ props: (L = (M = g.ingredients) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
3507
3544
  }, null, 8, ["render", "props"])
3508
3545
  ])
3509
3546
  ])
@@ -3515,13 +3552,13 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3515
3552
  _: 1
3516
3553
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
3517
3554
  ], 2),
3518
- (b(), Y(yt, { to: "body" }, [
3519
- k(uo, bt(gt(n(h))), null, 16),
3520
- n($).enableBulkEditRecipes ? (b(), Y(ul, {
3555
+ (y(), Y(yt, { to: "body" }, [
3556
+ h(vo, bt(gt(n(x))), null, 16),
3557
+ n($).enableBulkEditRecipes ? (y(), Y(vl, {
3521
3558
  key: 0,
3522
3559
  show: n(p).show,
3523
- "onUpdate:show": g[2] || (g[2] = (x) => n(p).show = x)
3524
- }, null, 8, ["show"])) : U("", !0)
3560
+ "onUpdate:show": _[2] || (_[2] = (z) => n(p).show = z)
3561
+ }, null, 8, ["show"])) : T("", !0)
3525
3562
  ]))
3526
3563
  ]),
3527
3564
  _: 1
@@ -3530,5 +3567,5 @@ const ml = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-lg-60
3530
3567
  }
3531
3568
  });
3532
3569
  export {
3533
- Kl as default
3570
+ Hl as default
3534
3571
  };