@feedmepos/mf-inventory-portal 1.1.3-dev.3 → 1.1.4

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 (45) hide show
  1. package/dist/{App-D3ktIdhO.js → App-CWly44Cw.js} +1 -1
  2. package/dist/{ApprovalView-Dk3M-s5h.js → ApprovalView-BvNL_PkW.js} +2 -2
  3. package/dist/{BindingsDialog-BmXhSgAd.js → BindingsDialog-C1WfUo1d.js} +2 -2
  4. package/dist/{BindingsPicker-CS7VHxnD.js → BindingsPicker-B9cxaEAQ.js} +1 -1
  5. package/dist/{BindingsTable-C-8ZbR0L.js → BindingsTable-BIG538-m.js} +1 -1
  6. package/dist/{ClosingDraftView-U5BIY1rA.js → ClosingDraftView-fxIkO0qv.js} +2 -2
  7. package/dist/{ClosingTemplateView-JFlvnVpp.js → ClosingTemplateView-tFcvCzUt.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-CjWKPoeQ.js → DeliveryOrderPrintPreview-ChCusfMS.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D5BZtCXg.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C9nf-Bvv.js} +3 -3
  10. package/dist/{FmMultiselectDialog-dcCjalMB.js → FmMultiselectDialog-B88ntsa7.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B4Zwubfq.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BXokJA-1.js} +1 -1
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CJTE5gia.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-SnZRXnGT.js} +1 -1
  13. package/dist/{IngredientGroupView-YBD2Nzi6.js → IngredientGroupView-BbQJH6wG.js} +2 -2
  14. package/dist/{IngredientsView-blrQy-Bu.js → IngredientsView-DuRBYR4c.js} +4 -4
  15. package/dist/{IntegrationView-C1pKuIyX.js → IntegrationView-HWsrefRe.js} +1272 -1210
  16. package/dist/{InventoryBindingForm-7QLaBlzM.js → InventoryBindingForm-2KEHVzvO.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D_OKoXdH.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cclzuz1Y.js} +3 -3
  18. package/dist/{InventoryBindingSummary-B3tc3879.js → InventoryBindingSummary-CWs5HgWm.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DNxw33yO.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-rXndajqj.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CzsFEnzT.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DVifBu9J.js} +1 -1
  21. package/dist/{PublishView-CrajUFt0.js → PublishView-P7K2kgWN.js} +2 -2
  22. package/dist/{PurchaseOrderPrintPreview-COKraBcA.js → PurchaseOrderPrintPreview-CDXyqt-T.js} +1 -1
  23. package/dist/{ReceiveRequestView-CQ6FMWKA.js → ReceiveRequestView-CXxyChNa.js} +9 -9
  24. package/dist/{RecipeView-Cx_xNvQH.js → RecipeView-DNJypRUA.js} +3 -3
  25. package/dist/{StockView-BAjMAkxc.js → StockView-gG5rmqtK.js} +6 -6
  26. package/dist/{SupplierView-Cm-NGi1B.js → SupplierView-3XnnzuU-.js} +3 -3
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DFohejfq.js → TransferDetails.vue_vue_type_script_setup_true_lang-BY0O0xOh.js} +5 -5
  28. package/dist/{TransferTemplateView-DufbnR3r.js → TransferTemplateView-BqZIeHXq.js} +6 -6
  29. package/dist/{UnitView-CHYKTvhH.js → UnitView-DVP_J89e.js} +3 -3
  30. package/dist/{WarehouseView-BJ17oKBn.js → WarehouseView-CrW_FwAy.js} +1 -1
  31. package/dist/api/netsuite.d.ts +1 -0
  32. package/dist/{app-Ci0LAaWG.js → app-C94dIU_J.js} +16 -11
  33. package/dist/app.js +1 -1
  34. package/dist/{decimal-B1CJmvUi.js → decimal-D0e4N7PE.js} +1 -1
  35. package/dist/{format-unit-display-CNtdkBZc.js → format-unit-display-DKtx102F.js} +2 -2
  36. package/dist/{index-Dm0ozpyH.js → index-BxbnRGBe.js} +1 -1
  37. package/dist/{index-WKMcXjN2.js → index-CSsaj5DD.js} +1 -1
  38. package/dist/{stock-SX2Kkz7m.js → stock-C5gzau0Q.js} +1 -1
  39. package/dist/{supplier-CsswP8b4.js → supplier-Dqc19jEh.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-B08c6u9d.js → use-ingredient-select-dialog-CNndD6oV.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-CbHjVmKL.js → use-inventory-binding-dialog-Df93j5R7.js} +1 -1
  43. package/dist/views/integration/components/netsuite/TransferOrder.vue.d.ts +48 -0
  44. package/dist/{vue-i18n-DnrpzaGO.js → vue-i18n-Baz9B8gA.js} +316 -316
  45. package/package.json +3 -3
@@ -1,82 +1,82 @@
1
- import { defineComponent as Y, mergeModels as je, useModel as xe, onMounted as me, ref as j, computed as z, resolveComponent as E, openBlock as w, createElementBlock as R, createElementVNode as a, toDisplayString as T, unref as x, createVNode as I, createBlock as X, withCtx as D, Fragment as J, renderList as te, normalizeClass as q, normalizeStyle as Oe, createSlots as oe, createCommentVNode as _, withModifiers as Te, reactive as fe, watch as pe, isRef as se, Teleport as ue, h as N, createTextVNode as Z, watchEffect as ze } from "vue";
1
+ import { defineComponent as Y, mergeModels as Oe, useModel as Se, onMounted as fe, ref as M, computed as z, resolveComponent as E, openBlock as w, createElementBlock as V, createElementVNode as a, toDisplayString as j, unref as I, createVNode as x, createBlock as X, withCtx as R, Fragment as J, renderList as $, normalizeClass as q, normalizeStyle as je, createSlots as oe, createCommentVNode as _, withModifiers as Te, reactive as pe, watch as ve, isRef as se, Teleport as ue, h as D, createTextVNode as Z, watchEffect as ze } from "vue";
2
2
  import { E as He } from "./empty-placeholder-wf6-BWE8.js";
3
- import { aZ as _e, aN as Xe, f as $, u as W, a_ as Ue, b as le, j as Qe, aW as Se, al as ve, ay as ge, a as ye, a2 as Ye, Q as P, $ as we, a$ as ke, aE as Be, aR as Ce, s as Ee, y as Fe, a0 as re, c as Le, _ as Je, C as Ke } from "./app-Ci0LAaWG.js";
4
- import { useDialogChild as Ze, useDialog as Ae, useProxiedModel as ae, useSnackbar as ne, useBreakpoints as Ve, components as ee } from "@feedmepos/ui-library";
3
+ import { aZ as _e, aN as Xe, f as ee, u as W, a_ as Ue, b as le, j as Qe, aW as ge, al as ye, ay as Ae, a as be, a2 as Ye, Q as P, $ as we, a$ as ke, aE as Be, aR as Ce, s as Ee, y as Fe, a0 as re, c as Le, _ as Je, C as Ke } from "./app-C94dIU_J.js";
4
+ import { useDialogChild as Ze, useDialog as ce, useProxiedModel as ae, useSnackbar as te, useBreakpoints as Ve, components as ne } from "@feedmepos/ui-library";
5
5
  import { useI18n as G, useCoreStore as ie } from "@feedmepos/mf-common";
6
- import { a as qe, b as Ge, c as Pe, u as We } from "./index-WKMcXjN2.js";
7
- import { u as de } from "./vue-i18n-DnrpzaGO.js";
8
- import { _ as $e, F as et } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B4Zwubfq.js";
6
+ import { a as qe, b as Ge, c as Pe, u as We } from "./index-CSsaj5DD.js";
7
+ import { u as de } from "./vue-i18n-Baz9B8gA.js";
8
+ import { _ as $e, F as et } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BXokJA-1.js";
9
9
  const tt = "data:image/svg+xml,%3csvg%20width='200'%20height='101'%20viewBox='0%200%20200%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M98.9161%2038.4456V24.1772H108.527V27.1988H102.12V30.2202H107.347V32.7382H102.12V38.4456H98.9161Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.382%2031.2276C110.382%2027.5345%20113.249%2024.1772%20117.127%2024.1772C121.174%2024.1772%20123.872%2027.7024%20123.872%2031.3953C123.872%2035.0884%20121.005%2038.6133%20117.127%2038.6133C113.08%2038.4456%20110.382%2034.9204%20110.382%2031.2276ZM117.127%2035.5919C119.487%2035.5919%20120.499%2033.4096%20120.499%2031.2276C120.499%2029.0452%20119.319%2027.0309%20117.127%2027.0309C114.935%2027.0309%20113.754%2029.213%20113.754%2031.2276C113.754%2033.5776%20114.935%2035.5919%20117.127%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M126.232%2031.2276C126.232%2027.5345%20129.099%2024.1772%20132.977%2024.1772C137.024%2024.1772%20139.722%2027.7024%20139.722%2031.3953C139.722%2035.0884%20136.855%2038.6133%20132.977%2038.6133C128.93%2038.4456%20126.232%2034.9204%20126.232%2031.2276ZM132.977%2035.5919C135.337%2035.5919%20136.349%2033.4096%20136.349%2031.2276C136.349%2029.0452%20135.169%2027.0309%20132.977%2027.0309C130.785%2027.0309%20129.604%2029.213%20129.604%2031.2276C129.604%2033.5776%20130.785%2035.5919%20132.977%2035.5919Z'%20fill='%235D5359'/%3e%3cpath%20d='M142.926%2038.4455V24.345H148.153C152.874%2024.345%20155.235%2027.5343%20155.235%2031.3952C155.235%2035.5918%20152.368%2038.4455%20148.153%2038.4455H142.926ZM148.153%2027.0308H146.129V35.4238H148.153C150.513%2035.4238%20151.862%2033.5775%20151.862%2031.2272C151.862%2028.8773%20150.513%2027.0308%20148.153%2027.0308Z'%20fill='%235D5359'/%3e%3cpath%20d='M110.045%2057.5607V49.1676L107.009%2055.2107H105.324L102.12%2049.1676V57.5607H98.9161V43.4604H102.457L106.167%2050.8465L109.876%2043.4604H113.417V57.5607H110.045Z'%20fill='%235D5359'/%3e%3cpath%20d='M115.947%2057.5607L121.342%2043.4604H124.04L129.436%2057.5607H125.895L124.715%2054.3716H120.331L119.319%2057.5607H115.947ZM122.691%2046.9856L121.005%2052.1893H124.378L122.691%2046.9856Z'%20fill='%235D5359'/%3e%3cpath%20d='M131.965%2057.5607V43.4604H138.373C141.07%2043.4604%20142.925%2045.8105%20142.925%2048.1605C142.925%2049.8393%20142.082%2051.5179%20140.565%2052.1893L143.768%2057.393H140.059L137.192%2052.8607H135V57.393H131.965V57.5607ZM135.169%2050.175H138.204C139.047%2050.175%20139.553%2049.3356%20139.553%2048.1605C139.553%2046.9856%20138.71%2046.3142%20138.035%2046.3142H135.169V50.175Z'%20fill='%235D5359'/%3e%3cpath%20d='M146.635%2057.5607V43.4604H150.007V49.8393L155.403%2043.4604H158.776L153.548%2049.6713L159.281%2057.5607H155.74L151.693%2051.5179L150.007%2053.3642V57.5607H146.635Z'%20fill='%235D5359'/%3e%3cpath%20d='M171.422%2054.7073V57.5607H161.474V43.4604H171.253V46.3142H164.677V48.9999H170.242V51.6856H164.677V54.7073H171.422Z'%20fill='%235D5359'/%3e%3cpath%20d='M185.417%2046.3142H181.202V57.5607H177.829V46.3142H173.614V43.4604H185.417V46.3142Z'%20fill='%235D5359'/%3e%3cpath%20d='M111.057%2062.5967V76.6973H107.853V70.9898H102.12V76.6973H98.9161V62.5967H102.12V68.1361H107.853V62.5967H111.057Z'%20fill='%235D5359'/%3e%3cpath%20d='M124.04%2069.815V62.5967H127.244V69.815C127.244%2073.6758%20125.389%2076.865%20121.005%2076.865C116.453%2076.865%20114.766%2073.5078%20114.766%2069.815V62.5967H117.97V69.815C117.97%2071.997%20118.813%2074.0115%20121.005%2074.0115C123.366%2074.0115%20124.04%2071.997%20124.04%2069.815Z'%20fill='%235D5359'/%3e%3cpath%20d='M138.036%2076.6973H131.122V62.5967H139.047C141.071%2062.5967%20142.251%2064.4433%20142.251%2066.2898C142.251%2067.6327%20141.576%2068.9755%20140.228%2069.4793C141.914%2069.9827%20142.926%2071.1578%20142.926%2073.1721C142.757%2075.5221%20140.733%2076.6973%20138.036%2076.6973ZM134.326%2065.4504V68.3041H137.53C138.204%2068.3041%20138.879%2067.8004%20138.879%2066.7933C138.879%2065.7861%20138.373%2065.2827%20137.698%2065.2827H134.326V65.4504ZM138.204%2070.8221H134.494V73.8435H138.204C139.047%2073.8435%20139.722%2073.1721%20139.722%2072.3327C139.553%2071.6613%20138.879%2070.8221%20138.204%2070.8221Z'%20fill='%235D5359'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M73.4753%2051.4994C78.7281%2050.5396%2082.8911%2046.4891%2083.9954%2041.3137L84.1232%2040.7134L83.9445%2040.1256C80.5804%2029.066%2071.9945%2020.2704%2061.0373%2016.5726C57.4%2015.3451%2053.5046%2014.6804%2049.458%2014.6804C45.4112%2014.6804%2041.5158%2015.3451%2037.8784%2016.5726C26.9214%2020.2704%2018.3354%2029.066%2014.9712%2040.1256L14.7924%2040.7134L14.9206%2041.3137C16.0247%2046.4891%2020.1875%2050.5396%2025.4405%2051.4994V58.8839H14.4183C14.6758%2059.9557%2014.9818%2061.0088%2015.3337%2062.0411C20.1553%2076.1811%2033.6083%2086.3619%2049.458%2086.3619C65.3074%2086.3619%2078.7606%2076.1811%2083.5822%2062.0411C83.9342%2061.0088%2084.2399%2059.9557%2084.4974%2058.8839H73.4753V51.4994ZM41.0517%2020.5973V38.5742C41.0517%2043.1931%2044.8155%2046.9371%2049.458%2046.9371C54.1005%2046.9371%2057.8641%2043.1931%2057.8641%2038.5742V20.5973C55.1919%2019.856%2052.3732%2019.4592%2049.458%2019.4592C46.5428%2019.4592%2043.7241%2019.856%2041.0517%2020.5973ZM62.6675%2022.3673V38.5742C62.6675%2043.1931%2066.431%2046.9371%2071.0735%2046.9371C74.9051%2046.9371%2078.1425%2044.3848%2079.1528%2040.8942C76.4672%2032.6902%2070.4379%2025.9824%2062.6675%2022.3673ZM60.2658%2046.1322C57.8753%2049.5094%2053.9255%2051.7159%2049.458%2051.7159C44.9902%2051.7159%2041.0408%2049.5094%2038.65%2046.1322C36.6982%2048.8894%2033.7074%2050.8662%2030.2439%2051.4994V58.8839H68.6718V51.4994C65.2083%2050.8662%2062.2175%2048.8894%2060.2658%2046.1322ZM21.1583%2063.6628C26.1349%2074.2514%2036.9382%2081.5834%2049.458%2081.5834C61.9776%2081.5834%2072.781%2074.2514%2077.7574%2063.6628H21.1583ZM36.2482%2038.5742V22.3673C28.4779%2025.9824%2022.4486%2032.6902%2019.7631%2040.8942C20.7733%2044.3848%2024.0106%2046.9371%2027.8422%2046.9371C32.4847%2046.9371%2036.2482%2043.1931%2036.2482%2038.5742Z'%20fill='%23FFC35D'/%3e%3c/svg%3e";
10
10
  var Ne = { exports: {} };
11
- (function(F, v) {
11
+ (function(F, g) {
12
12
  (function() {
13
13
  var s = {};
14
- F.exports = s, s.simpleFilter = function(d, n) {
14
+ F.exports = s, s.simpleFilter = function(i, n) {
15
15
  return n.filter(function(t) {
16
- return s.test(d, t);
16
+ return s.test(i, t);
17
17
  });
18
- }, s.test = function(d, n) {
19
- return s.match(d, n) !== null;
20
- }, s.match = function(d, n, t) {
18
+ }, s.test = function(i, n) {
19
+ return s.match(i, n) !== null;
20
+ }, s.match = function(i, n, t) {
21
21
  t = t || {};
22
- var r = 0, h = [], k = n.length, A = 0, g = 0, l = t.pre || "", i = t.post || "", b = t.caseSensitive && n || n.toLowerCase(), C;
23
- d = t.caseSensitive && d || d.toLowerCase();
24
- for (var S = 0; S < k; S++)
25
- C = n[S], b[S] === d[r] ? (C = l + C + i, r += 1, g += 1 + g) : g = 0, A += g, h[h.length] = C;
26
- return r === d.length ? (A = b === d ? 1 / 0 : A, { rendered: h.join(""), score: A }) : null;
27
- }, s.filter = function(d, n, t) {
28
- return !n || n.length === 0 ? [] : typeof d != "string" ? n : (t = t || {}, n.reduce(function(r, h, k, A) {
29
- var g = h;
30
- t.extract && (g = t.extract(h));
31
- var l = s.match(d, g, t);
32
- return l != null && (r[r.length] = {
22
+ var u = 0, b = [], S = n.length, y = 0, v = 0, l = t.pre || "", r = t.post || "", h = t.caseSensitive && n || n.toLowerCase(), C;
23
+ i = t.caseSensitive && i || i.toLowerCase();
24
+ for (var k = 0; k < S; k++)
25
+ C = n[k], h[k] === i[u] ? (C = l + C + r, u += 1, v += 1 + v) : v = 0, y += v, b[b.length] = C;
26
+ return u === i.length ? (y = h === i ? 1 / 0 : y, { rendered: b.join(""), score: y }) : null;
27
+ }, s.filter = function(i, n, t) {
28
+ return !n || n.length === 0 ? [] : typeof i != "string" ? n : (t = t || {}, n.reduce(function(u, b, S, y) {
29
+ var v = b;
30
+ t.extract && (v = t.extract(b));
31
+ var l = s.match(i, v, t);
32
+ return l != null && (u[u.length] = {
33
33
  string: l.rendered,
34
34
  score: l.score,
35
- index: k,
36
- original: h
37
- }), r;
38
- }, []).sort(function(r, h) {
39
- var k = h.score - r.score;
40
- return k || r.index - h.index;
35
+ index: S,
36
+ original: b
37
+ }), u;
38
+ }, []).sort(function(u, b) {
39
+ var S = b.score - u.score;
40
+ return S || u.index - b.index;
41
41
  }));
42
42
  };
43
43
  })();
44
44
  })(Ne);
45
45
  var nt = Ne.exports;
46
- const Re = /* @__PURE__ */ _e(nt);
47
- function be(F, v) {
48
- return Re.filter(F, v).length > 0;
46
+ const De = /* @__PURE__ */ _e(nt);
47
+ function he(F, g) {
48
+ return De.filter(F, g).length > 0;
49
49
  }
50
- function ot(F, v) {
50
+ function ot(F, g) {
51
51
  if (!F)
52
52
  return {
53
- label: v,
53
+ label: g,
54
54
  segments: [
55
55
  {
56
56
  isMatch: !1,
57
- segment: v
57
+ segment: g
58
58
  }
59
59
  ],
60
60
  matched: !1
61
61
  };
62
- const [s] = Re.filter(F.toLocaleLowerCase(), [v], {
62
+ const [s] = De.filter(F.toLocaleLowerCase(), [g], {
63
63
  pre: "|",
64
64
  post: "|"
65
65
  });
66
66
  if (!s)
67
67
  return {
68
- label: v,
69
- segments: [{ segment: v, isMatch: !1 }],
68
+ label: g,
69
+ segments: [{ segment: g, isMatch: !1 }],
70
70
  matched: !1
71
71
  };
72
- const d = s.string.toString().replace(/\|\|/g, "").split("|").reduce((n, t, r) => (n.push({
72
+ const i = s.string.toString().replace(/\|\|/g, "").split("|").reduce((n, t, u) => (n.push({
73
73
  segment: t,
74
- isMatch: r % 2 !== 0
74
+ isMatch: u % 2 !== 0
75
75
  //e.g. index 1, 3, 5, ...
76
76
  }), n), new Array());
77
77
  return {
78
- label: v,
79
- segments: d,
78
+ label: g,
79
+ segments: i,
80
80
  matched: !0
81
81
  };
82
82
  }
@@ -89,12 +89,12 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
89
89
  }, it = {
90
90
  class: "flex-1",
91
91
  "data-cy": "filter-field"
92
- }, rt = ["data-cy"], ut = { class: "flex flex-col" }, dt = { class: "fm-typo-en-body-md-400" }, ct = {
92
+ }, rt = ["data-cy"], ut = { class: "flex flex-col" }, ct = { class: "fm-typo-en-body-md-400" }, dt = {
93
93
  key: 1,
94
94
  class: "w-full py-16 text-fm-color-typo-disabled fm-typo-en-body-md-400 text-center"
95
- }, De = /* @__PURE__ */ Y({
95
+ }, Re = /* @__PURE__ */ Y({
96
96
  __name: "FmNestedMultiselectDialog",
97
- props: /* @__PURE__ */ je({
97
+ props: /* @__PURE__ */ Oe({
98
98
  modelValue: {}
99
99
  }, {
100
100
  modelValue: {},
@@ -102,36 +102,36 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
102
102
  }),
103
103
  emits: ["update:modelValue"],
104
104
  setup(F) {
105
- const v = xe(F, "modelValue"), s = Ze();
106
- me(() => {
107
- s.emitData(v.value);
105
+ const g = Se(F, "modelValue"), s = Ze();
106
+ fe(() => {
107
+ s.emitData(g.value);
108
108
  });
109
- const d = j(""), { t: n } = G();
109
+ const i = M(""), { t: n } = G();
110
110
  function t(e) {
111
- return be(
112
- d.value,
111
+ return he(
112
+ i.value,
113
113
  e.sublabel ? [e.label, e.sublabel] : [e.label]
114
114
  );
115
115
  }
116
- function r(e) {
117
- return t(e) ? !0 : K(e) ? e.children.some(r) : !1;
116
+ function u(e) {
117
+ return t(e) ? !0 : K(e) ? e.children.some(u) : !1;
118
118
  }
119
- function h(e, o) {
120
- if (!d.value)
119
+ function b(e, o) {
120
+ if (!i.value)
121
121
  return !0;
122
122
  const [B, ...L] = e;
123
123
  if (typeof B != "number")
124
124
  return !1;
125
- const V = o[B];
126
- return be(
127
- d.value,
128
- V.sublabel ? [V.label, V.sublabel] : [V.label]
129
- ) ? !0 : L.length === 0 ? r(V) : K(V) ? h(L, V.children) : !1;
125
+ const N = o[B];
126
+ return he(
127
+ i.value,
128
+ N.sublabel ? [N.label, N.sublabel] : [N.label]
129
+ ) ? !0 : L.length === 0 ? u(N) : K(N) ? b(L, N.children) : !1;
130
130
  }
131
- function k(e, o, B = 0, L = !1) {
131
+ function S(e, o, B = 0, L = !1) {
132
132
  if (K(e) && e.children.length) {
133
- const { children: V, ...H } = e, U = V.flatMap(
134
- (M, O) => k(M, [...o, O], B + 1, L || e.disabled)
133
+ const { children: N, ...H } = e, U = N.flatMap(
134
+ (O, T) => S(O, [...o, T], B + 1, L || e.disabled)
135
135
  );
136
136
  return [
137
137
  {
@@ -154,16 +154,16 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
154
154
  }
155
155
  ];
156
156
  }
157
- const A = z(() => v.value.flatMap(
158
- (e, o) => k(e, [o]).filter((B) => h(B.keys, v.value))
157
+ const y = z(() => g.value.flatMap(
158
+ (e, o) => S(e, [o]).filter((B) => b(B.keys, g.value))
159
159
  ));
160
- function g(e) {
160
+ function v(e) {
161
161
  if (K(e)) {
162
- if (r(e)) {
163
- const o = t(e) ? e.children : e.children.filter(r);
164
- return o.length === 0 ? !1 : o.every(g);
162
+ if (u(e)) {
163
+ const o = t(e) ? e.children : e.children.filter(u);
164
+ return o.length === 0 ? !1 : o.every(v);
165
165
  }
166
- return e.children.every(g);
166
+ return e.children.every(v);
167
167
  }
168
168
  return e.active ?? !1;
169
169
  }
@@ -171,32 +171,32 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
171
171
  const [B, ...L] = e;
172
172
  if (typeof B != "number")
173
173
  return !1;
174
- const V = o[B];
175
- return L.length === 0 ? g(V ?? []) : K(V) ? l(L, V.children ?? []) : !1;
174
+ const N = o[B];
175
+ return L.length === 0 ? v(N ?? []) : K(N) ? l(L, N.children ?? []) : !1;
176
176
  }
177
- function i(e) {
177
+ function r(e) {
178
178
  if (K(e)) {
179
- if (r(e)) {
180
- const o = t(e) ? e.children : e.children.filter(r);
181
- return o.length === 0 ? !1 : o.some(g) && !o.every(g);
179
+ if (u(e)) {
180
+ const o = t(e) ? e.children : e.children.filter(u);
181
+ return o.length === 0 ? !1 : o.some(v) && !o.every(v);
182
182
  }
183
183
  return !1;
184
184
  }
185
185
  return !1;
186
186
  }
187
- function b(e, o) {
187
+ function h(e, o) {
188
188
  const [B, ...L] = e;
189
189
  if (typeof B != "number")
190
190
  return !1;
191
- const V = o[B];
192
- return L.length === 0 ? i(V ?? []) : K(V) ? b(L, (V == null ? void 0 : V.children) ?? []) : !1;
191
+ const N = o[B];
192
+ return L.length === 0 ? r(N ?? []) : K(N) ? h(L, (N == null ? void 0 : N.children) ?? []) : !1;
193
193
  }
194
194
  function C(e, o) {
195
195
  if (e.disabled)
196
196
  return e;
197
197
  if (K(e)) {
198
- if (r(e)) {
199
- const B = t(e) ? e.children : e.children.filter(r);
198
+ if (u(e)) {
199
+ const B = t(e) ? e.children : e.children.filter(u);
200
200
  return {
201
201
  ...e,
202
202
  children: e.children.map((L) => B.find((H) => Xe(H.value, L.value)) ? C(L, o) : L)
@@ -212,111 +212,111 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
212
212
  active: o
213
213
  };
214
214
  }
215
- function S(e, o, B) {
216
- const [L, ...V] = e;
217
- return typeof L != "number" ? o : V.length === 0 ? o.map((H, U) => L !== U ? H : C(H, B)) : o.map(
215
+ function k(e, o, B) {
216
+ const [L, ...N] = e;
217
+ return typeof L != "number" ? o : N.length === 0 ? o.map((H, U) => L !== U ? H : C(H, B)) : o.map(
218
218
  (H, U) => L === U && K(H) ? {
219
219
  ...H,
220
- children: S(V, H.children, B)
220
+ children: k(N, H.children, B)
221
221
  } : H
222
222
  );
223
223
  }
224
- const p = j(new Array());
224
+ const p = M(new Array());
225
225
  function m(e) {
226
226
  const o = e.join();
227
227
  return p.value.find((B) => o === B);
228
228
  }
229
- function c(e) {
229
+ function d(e) {
230
230
  const o = e.join();
231
231
  m(e) ? p.value = p.value.filter((B) => B !== o) : p.value = [...p.value, o];
232
232
  }
233
- function u(e) {
233
+ function c(e) {
234
234
  const o = e.join();
235
235
  return p.value.find((B) => o.startsWith(B) && o !== B);
236
236
  }
237
- const y = z(
238
- () => A.value.filter((e) => h(e.keys, v.value) && e.active).length
237
+ const A = z(
238
+ () => y.value.filter((e) => b(e.keys, g.value) && e.active).length
239
239
  );
240
240
  function f(e, o, B) {
241
- v.value = S(e, o, B), s.emitData(v.value);
241
+ g.value = k(e, o, B), s.emitData(g.value);
242
242
  }
243
243
  return (e, o) => {
244
- const B = E("FmSearch"), L = E("FmCheckbox"), V = E("FmButton"), H = E("FmListItem"), U = E("FmList");
245
- return w(), R("div", st, [
244
+ const B = E("FmSearch"), L = E("FmCheckbox"), N = E("FmButton"), H = E("FmListItem"), U = E("FmList");
245
+ return w(), V("div", st, [
246
246
  a("div", at, [
247
- a("div", lt, T(x(n)("inventory.formField.itemsSelected", { count: y.value })), 1),
247
+ a("div", lt, j(I(n)("inventory.formField.itemsSelected", { count: A.value })), 1),
248
248
  a("div", it, [
249
- I(B, {
250
- modelValue: d.value,
251
- "onUpdate:modelValue": o[0] || (o[0] = (M) => d.value = M),
252
- placeholder: x(n)("inventory.formField.filterItems")
249
+ x(B, {
250
+ modelValue: i.value,
251
+ "onUpdate:modelValue": o[0] || (o[0] = (O) => i.value = O),
252
+ placeholder: I(n)("inventory.formField.filterItems")
253
253
  }, null, 8, ["modelValue", "placeholder"])
254
254
  ])
255
255
  ]),
256
- A.value.length ? (w(), X(U, {
256
+ y.value.length ? (w(), X(U, {
257
257
  key: 0,
258
258
  class: "flex-1 overflow-y-auto"
259
259
  }, {
260
- default: D(() => [
261
- (w(!0), R(J, null, te(A.value, (M) => (w(), R("div", {
262
- key: M.keys.join(),
260
+ default: R(() => [
261
+ (w(!0), V(J, null, $(y.value, (O) => (w(), V("div", {
262
+ key: O.keys.join(),
263
263
  class: q([
264
264
  "transition-all overflow-y-clip",
265
- u(M.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
265
+ c(O.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
266
266
  ]),
267
- "data-cy": `nested-${M.keys.join("-")}-${M.label}`
267
+ "data-cy": `nested-${O.keys.join("-")}-${O.label}`
268
268
  }, [
269
- I(H, {
270
- clickable: M.selectable !== !1,
271
- onClick: () => M.selectable === !1 || M.disabled || f(M.keys, v.value, !l(M.keys, v.value)),
272
- style: Oe({
273
- paddingLeft: `${16 + M.indent * 16}px`,
269
+ x(H, {
270
+ clickable: O.selectable !== !1,
271
+ onClick: () => O.selectable === !1 || O.disabled || f(O.keys, g.value, !l(O.keys, g.value)),
272
+ style: je({
273
+ paddingLeft: `${16 + O.indent * 16}px`,
274
274
  paddingTop: "4px",
275
275
  paddingBottom: "4px"
276
276
  }),
277
- disabled: M.selectable !== !1 && M.disabled
277
+ disabled: O.selectable !== !1 && O.disabled
278
278
  }, oe({
279
- default: D(() => [
279
+ default: R(() => [
280
280
  a("div", ut, [
281
- a("div", dt, [
282
- (w(!0), R(J, null, te(x(ot)(d.value, M.label).segments, (O, Q) => (w(), R("span", {
281
+ a("div", ct, [
282
+ (w(!0), V(J, null, $(I(ot)(i.value, O.label).segments, (T, Q) => (w(), V("span", {
283
283
  key: Q,
284
284
  class: q({
285
- "font-bold": O.isMatch
285
+ "font-bold": T.isMatch
286
286
  })
287
- }, T(O.segment), 3))), 128))
287
+ }, j(T.segment), 3))), 128))
288
288
  ]),
289
- M.sublabel ? (w(), R("div", {
289
+ O.sublabel ? (w(), V("div", {
290
290
  key: 0,
291
291
  class: q([
292
292
  "fm-typo-en-body-sm-400",
293
- M.disabled ? "" : "text-fm-color-typo-secondary"
293
+ O.disabled ? "" : "text-fm-color-typo-secondary"
294
294
  ])
295
- }, T(M.sublabel), 3)) : _("", !0)
295
+ }, j(O.sublabel), 3)) : _("", !0)
296
296
  ])
297
297
  ]),
298
298
  _: 2
299
299
  }, [
300
- M.selectable !== !1 ? {
300
+ O.selectable !== !1 ? {
301
301
  name: "prepend",
302
- fn: D(() => [
303
- I(L, {
304
- disabled: M.disabled,
305
- "model-value": l(M.keys, v.value),
306
- value: M.keys,
307
- indeterminate: b(M.keys, v.value)
302
+ fn: R(() => [
303
+ x(L, {
304
+ disabled: O.disabled,
305
+ "model-value": l(O.keys, g.value),
306
+ value: O.keys,
307
+ indeterminate: h(O.keys, g.value)
308
308
  }, null, 8, ["disabled", "model-value", "value", "indeterminate"])
309
309
  ]),
310
310
  key: "0"
311
311
  } : void 0,
312
- M.collapsible ? {
312
+ O.collapsible ? {
313
313
  name: "append",
314
- fn: D(() => [
315
- I(V, {
316
- "prepend-icon": m(M.keys) ? "expand_less" : "expand_more",
314
+ fn: R(() => [
315
+ x(N, {
316
+ "prepend-icon": m(O.keys) ? "expand_less" : "expand_more",
317
317
  size: "md",
318
318
  variant: "tertiary",
319
- onClick: Te(() => c(M.keys), ["stop"])
319
+ onClick: Te(() => d(O.keys), ["stop"])
320
320
  }, null, 8, ["prepend-icon", "onClick"])
321
321
  ]),
322
322
  key: "1"
@@ -325,7 +325,7 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
325
325
  ], 10, rt))), 128))
326
326
  ]),
327
327
  _: 1
328
- })) : (w(), R("div", ct, T(x(n)("inventory.formField.noItemsFound")), 1))
328
+ })) : (w(), V("div", dt, j(I(n)("inventory.formField.noItemsFound")), 1))
329
329
  ]);
330
330
  };
331
331
  }
@@ -335,7 +335,7 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
335
335
  }, gt = { class: "text-left" }, yt = { class: "min-w-64" }, At = { class: "flex flex-col" }, bt = { class: "fm-typo-en-body-md-400" }, ht = {
336
336
  key: 0,
337
337
  class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
338
- }, It = { class: "w-1" }, xt = /* @__PURE__ */ Y({
338
+ }, xt = { class: "w-1" }, It = /* @__PURE__ */ Y({
339
339
  __name: "ApplyAddon",
340
340
  props: {
341
341
  groups: {
@@ -355,146 +355,146 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
355
355
  }
356
356
  },
357
357
  emits: ["update:modifiers"],
358
- setup(F, { emit: v }) {
359
- const s = F, d = v, n = Ae(), t = z(() => {
360
- const l = s.groups.flatMap((i) => i.items.map((b) => {
361
- const C = s.items.find((S) => S._id === b._id);
358
+ setup(F, { emit: g }) {
359
+ const s = F, i = g, n = ce(), t = z(() => {
360
+ const l = s.groups.flatMap((r) => r.items.map((h) => {
361
+ const C = s.items.find((k) => k._id === h._id);
362
362
  return {
363
- ...b,
364
- groupName: i.name,
365
- name: b.name ?? (C == null ? void 0 : C.name) ?? "-"
363
+ ...h,
364
+ groupName: r.name,
365
+ name: h.name ?? (C == null ? void 0 : C.name) ?? "-"
366
366
  };
367
367
  }));
368
- return s.modifiers.map((i) => {
369
- const b = l.find((p) => p.selection === i.selection), C = (b == null ? void 0 : b.name) ?? "-", S = (b == null ? void 0 : b.groupName) ?? "";
368
+ return s.modifiers.map((r) => {
369
+ const h = l.find((p) => p.selection === r.selection), C = (h == null ? void 0 : h.name) ?? "-", k = (h == null ? void 0 : h.groupName) ?? "";
370
370
  return {
371
- ...i,
371
+ ...r,
372
372
  name: C,
373
- groupName: S
373
+ groupName: k
374
374
  };
375
375
  });
376
- }), r = z(() => s.groups.flatMap((l) => l.items.map((i) => ({ ...i, groupId: l._id }))));
377
- function h({ selection: l }) {
378
- d(
376
+ }), u = z(() => s.groups.flatMap((l) => l.items.map((r) => ({ ...r, groupId: l._id }))));
377
+ function b({ selection: l }) {
378
+ i(
379
379
  "update:modifiers",
380
- s.modifiers.filter((i) => i.selection !== l)
380
+ s.modifiers.filter((r) => r.selection !== l)
381
381
  );
382
382
  }
383
- function k({ selection: l }, i) {
384
- const b = s.modifiers.find((C) => C.selection === l);
385
- b && (b.code = i);
383
+ function S({ selection: l }, r) {
384
+ const h = s.modifiers.find((C) => C.selection === l);
385
+ h && (h.code = r);
386
386
  }
387
- function A() {
387
+ function y() {
388
388
  let l = [];
389
- s.groups.forEach((b) => {
389
+ s.groups.forEach((h) => {
390
390
  let C = !1;
391
- b.items.every((S) => S._id.startsWith("item")) && (C = !0), l.push({
392
- label: b.name,
391
+ h.items.every((k) => k._id.startsWith("item")) && (C = !0), l.push({
392
+ label: h.name,
393
393
  sublabel: "Group",
394
- value: b._id,
394
+ value: h._id,
395
395
  disabled: C,
396
- children: b.items.reduce((S, p) => {
397
- var u;
398
- const m = s.items.find((y) => y._id === p._id), c = (u = m == null ? void 0 : m.variant) == null ? void 0 : u.variantCombinations.find(
399
- (y) => y.combinationKey === (p == null ? void 0 : p.combinationKey)
396
+ children: h.items.reduce((k, p) => {
397
+ var c;
398
+ const m = s.items.find((A) => A._id === p._id), d = (c = m == null ? void 0 : m.variant) == null ? void 0 : c.variantCombinations.find(
399
+ (A) => A.combinationKey === (p == null ? void 0 : p.combinationKey)
400
400
  );
401
401
  return [
402
- ...S,
402
+ ...k,
403
403
  {
404
- label: `${p.name ?? (m == null ? void 0 : m.name)} ${c ? `(${c.name})` : ""}`,
405
- value: `${p.selection}${c ? `/${c == null ? void 0 : c.combinationKey}` : ""}`,
404
+ label: `${p.name ?? (m == null ? void 0 : m.name)} ${d ? `(${d.name})` : ""}`,
405
+ value: `${p.selection}${d ? `/${d == null ? void 0 : d.combinationKey}` : ""}`,
406
406
  disabled: C,
407
- active: !!s.modifiers.find(({ selection: y }) => y === p.selection)
407
+ active: !!s.modifiers.find(({ selection: A }) => A === p.selection)
408
408
  }
409
409
  ];
410
410
  }, [])
411
411
  });
412
412
  });
413
- const i = {
413
+ const r = {
414
414
  modelValue: l
415
415
  };
416
416
  n.open({
417
417
  title: "Select Addons",
418
- contentComponent: De,
419
- contentComponentProps: i,
418
+ contentComponent: Re,
419
+ contentComponentProps: r,
420
420
  primaryActions: {
421
421
  text: "Confirm",
422
422
  close: !0
423
423
  }
424
- }).onPrimary((b) => {
425
- const C = $(s.modifiers);
426
- let S = [];
427
- function p(m, c) {
428
- if (c(m), K(m))
429
- for (let u of m.children)
430
- p(u, c);
424
+ }).onPrimary((h) => {
425
+ const C = ee(s.modifiers);
426
+ let k = [];
427
+ function p(m, d) {
428
+ if (d(m), K(m))
429
+ for (let c of m.children)
430
+ p(c, d);
431
431
  }
432
- b.forEach((m) => {
433
- p(m, (c) => {
432
+ h.forEach((m) => {
433
+ p(m, (d) => {
434
434
  var e;
435
- if (s.groups.find(({ _id: o }) => o === c.value)) return;
436
- const y = r.value.find(({ selection: o }) => o === c.value), f = S.find(({ selection: o }) => c.value === o);
437
- !K(c) && c.active && f === void 0 && S.push({
438
- addonGroupId: (y == null ? void 0 : y.groupId) ?? "",
439
- selection: c.value,
440
- code: ((e = C.find(({ selection: o }) => c.value === o)) == null ? void 0 : e.code) ?? ""
435
+ if (s.groups.find(({ _id: o }) => o === d.value)) return;
436
+ const A = u.value.find(({ selection: o }) => o === d.value), f = k.find(({ selection: o }) => d.value === o);
437
+ !K(d) && d.active && f === void 0 && k.push({
438
+ addonGroupId: (A == null ? void 0 : A.groupId) ?? "",
439
+ selection: d.value,
440
+ code: ((e = C.find(({ selection: o }) => d.value === o)) == null ? void 0 : e.code) ?? ""
441
441
  });
442
442
  });
443
- }), d("update:modifiers", S);
443
+ }), i("update:modifiers", k);
444
444
  });
445
445
  }
446
- const { t: g } = G();
447
- return (l, i) => {
448
- const b = E("FmButton"), C = E("FmTextField");
449
- return w(), R("div", mt, [
446
+ const { t: v } = G();
447
+ return (l, r) => {
448
+ const h = E("FmButton"), C = E("FmTextField");
449
+ return w(), V("div", mt, [
450
450
  a("div", ft, [
451
- a("div", pt, T(x(g)("inventory.integration.apply.addons")), 1),
452
- I(b, {
451
+ a("div", pt, j(I(v)("inventory.integration.apply.addons")), 1),
452
+ x(h, {
453
453
  type: "button",
454
454
  variant: "plain",
455
455
  size: "md",
456
456
  icon: "link",
457
- label: x(g)("inventory.integration.apply.applyAddon"),
458
- onClick: i[0] || (i[0] = (S) => A())
457
+ label: I(v)("inventory.integration.apply.applyAddon"),
458
+ onClick: r[0] || (r[0] = (k) => y())
459
459
  }, null, 8, ["label"])
460
460
  ]),
461
461
  a("div", null, [
462
- t.value.length > 0 ? (w(), R("table", vt, [
462
+ t.value.length > 0 ? (w(), V("table", vt, [
463
463
  a("tr", gt, [
464
- a("th", yt, T(x(g)("inventory.integration.apply.name")), 1),
465
- a("th", null, T(x(g)("inventory.integration.apply.code")), 1),
466
- i[1] || (i[1] = a("th", { class: "w-1" }, " ", -1))
464
+ a("th", yt, j(I(v)("inventory.integration.apply.name")), 1),
465
+ a("th", null, j(I(v)("inventory.integration.apply.code")), 1),
466
+ r[1] || (r[1] = a("th", { class: "w-1" }, " ", -1))
467
467
  ]),
468
- (w(!0), R(J, null, te(t.value, (S, p) => (w(), R(J, { key: p }, [
469
- i[2] || (i[2] = a("tr", { class: "block h-8" }, null, -1)),
468
+ (w(!0), V(J, null, $(t.value, (k, p) => (w(), V(J, { key: p }, [
469
+ r[2] || (r[2] = a("tr", { class: "block h-8" }, null, -1)),
470
470
  a("tr", null, [
471
471
  a("td", null, [
472
472
  a("div", At, [
473
- a("div", bt, T(S.name), 1),
474
- S.groupName ? (w(), R("div", ht, T(S.groupName), 1)) : _("", !0)
473
+ a("div", bt, j(k.name), 1),
474
+ k.groupName ? (w(), V("div", ht, j(k.groupName), 1)) : _("", !0)
475
475
  ])
476
476
  ]),
477
477
  a("td", null, [
478
- I(C, {
478
+ x(C, {
479
479
  disabled: F.loading,
480
- "model-value": S.code,
481
- "onUpdate:modelValue": [(m) => S.code = m, (m) => k(S, m)],
480
+ "model-value": k.code,
481
+ "onUpdate:modelValue": [(m) => k.code = m, (m) => S(k, m)],
482
482
  rules: [
483
- function(c) {
484
- return !!c || "Required";
483
+ function(d) {
484
+ return !!d || "Required";
485
485
  }
486
486
  ]
487
487
  }, null, 8, ["disabled", "model-value", "onUpdate:modelValue", "rules"])
488
488
  ]),
489
- a("td", It, [
490
- I(b, {
489
+ a("td", xt, [
490
+ x(h, {
491
491
  disabled: F.loading,
492
492
  type: "button",
493
493
  variant: "tertiary",
494
494
  icon: "delete",
495
495
  "icon-color": "#000000",
496
496
  size: "md",
497
- onClick: (m) => h(S)
497
+ onClick: (m) => b(k)
498
498
  }, null, 8, ["disabled", "onClick"])
499
499
  ])
500
500
  ])
@@ -505,74 +505,74 @@ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex item
505
505
  };
506
506
  }
507
507
  });
508
- function St(F, v = []) {
509
- const s = v.map((n) => F.find((t) => t._id === n)).filter((n) => !!n);
508
+ function St(F, g = []) {
509
+ const s = g.map((n) => F.find((t) => t._id === n)).filter((n) => !!n);
510
510
  return kt(s).reduce((n, t) => (n[t.combinationKey] = t.selectionName.join(" / "), n), {});
511
511
  }
512
- function wt(F, v, s) {
513
- const d = s.reduce((t, r) => {
514
- var g, l, i;
515
- const h = r.category || "", k = St(v, (g = r.variant) == null ? void 0 : g.variantGroupIds), A = {
516
- ...r,
517
- codeName: [r.code, r.name].filter((b) => !!b).join(" "),
512
+ function wt(F, g, s) {
513
+ const i = s.reduce((t, u) => {
514
+ var v, l, r;
515
+ const b = u.category || "", S = St(g, (v = u.variant) == null ? void 0 : v.variantGroupIds), y = {
516
+ ...u,
517
+ codeName: [u.code, u.name].filter((h) => !!h).join(" "),
518
518
  variant: {
519
- variantGroupIds: ((l = r.variant) == null ? void 0 : l.variantGroupIds) || [],
520
- variantCombinations: (((i = r.variant) == null ? void 0 : i.variantCombinations) || []).map((b) => {
521
- const C = b.code, S = b.name || k[b.combinationKey || ""];
519
+ variantGroupIds: ((l = u.variant) == null ? void 0 : l.variantGroupIds) || [],
520
+ variantCombinations: (((r = u.variant) == null ? void 0 : r.variantCombinations) || []).map((h) => {
521
+ const C = h.code, k = h.name || S[h.combinationKey || ""];
522
522
  return {
523
- ...b,
524
- codeName: [C, S].filter((p) => !!p).join(" ").trim() || "-"
523
+ ...h,
524
+ codeName: [C, k].filter((p) => !!p).join(" ").trim() || "-"
525
525
  };
526
526
  })
527
527
  }
528
528
  };
529
- return t[h] = t[h] ? [...t[h], A] : [A], t;
530
- }, {}), n = Object.values(d)[0];
529
+ return t[b] = t[b] ? [...t[b], y] : [y], t;
530
+ }, {}), n = Object.values(i)[0];
531
531
  return F.length === 0 && n ? n.map((t) => ({
532
532
  id: t._id,
533
533
  name: t.name ?? "",
534
- items: d[t._id || ""] || []
534
+ items: i[t._id || ""] || []
535
535
  })) || [] : F.map((t) => ({
536
536
  id: t._id,
537
537
  name: t.name ?? "",
538
- items: d[t._id || ""] || []
538
+ items: i[t._id || ""] || []
539
539
  }));
540
540
  }
541
- function Me(F, v) {
541
+ function Me(F, g) {
542
542
  if (F.length == 1)
543
543
  return F[0];
544
- const s = F[0], d = F.slice(1, F.length), n = Me(d, v);
545
- return s.reduce((r, h) => [...r, ...n.map((k) => v(h, k))], new Array());
544
+ const s = F[0], i = F.slice(1, F.length), n = Me(i, g);
545
+ return s.reduce((u, b) => [...u, ...n.map((S) => g(b, S))], new Array());
546
546
  }
547
547
  function kt(F) {
548
548
  if (F.length === 0) return [];
549
- const v = F.map(
550
- (d) => (d.options ?? []).map(
549
+ const g = F.map(
550
+ (i) => (i.options ?? []).map(
551
551
  (n) => ({
552
- combinationKey: [`${d._id}/${n._id}`],
552
+ combinationKey: [`${i._id}/${n._id}`],
553
553
  selectionName: [n.name ?? ""]
554
554
  })
555
555
  )
556
556
  );
557
- return Me(v, (d, n) => ({
558
- combinationKey: [...d.combinationKey, ...n.combinationKey],
559
- selectionName: [...d.selectionName, ...n.selectionName]
560
- })).map((d) => {
561
- const n = [...d.combinationKey];
557
+ return Me(g, (i, n) => ({
558
+ combinationKey: [...i.combinationKey, ...n.combinationKey],
559
+ selectionName: [...i.selectionName, ...n.selectionName]
560
+ })).map((i) => {
561
+ const n = [...i.combinationKey];
562
562
  return n.sort(), {
563
563
  combinationKey: n.join("/"),
564
564
  active: !0,
565
- selectionName: d.selectionName
565
+ selectionName: i.selectionName
566
566
  };
567
567
  });
568
568
  }
569
569
  const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5 mb-3" }, Ct = { class: "flex items-center" }, Et = { class: "text-lg font-bold flex-grow" }, Ft = {
570
570
  key: 0,
571
571
  class: "table-auto w-full"
572
- }, Lt = { class: "text-left" }, Vt = { class: "min-w-64" }, Nt = { class: "flex flex-col" }, Rt = { class: "fm-typo-en-body-md-400" }, Dt = {
572
+ }, Lt = { class: "text-left" }, Vt = { class: "min-w-64" }, Nt = { class: "flex flex-col" }, Dt = { class: "fm-typo-en-body-md-400" }, Rt = {
573
573
  key: 0,
574
574
  class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
575
- }, Mt = { class: "w-1" }, ce = /* @__PURE__ */ Y({
575
+ }, Mt = { class: "w-1" }, me = /* @__PURE__ */ Y({
576
576
  __name: "ApplyProduct",
577
577
  props: {
578
578
  isAddon: {
@@ -597,207 +597,207 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
597
597
  }
598
598
  },
599
599
  emits: ["update:bindings"],
600
- setup(F, { emit: v }) {
601
- const s = F, d = v, n = Ae(), t = z(() => s.isAddon ? "Addons" : "Products"), r = z(() => s.isAddon ? [] : s.categories), h = z(
602
- () => wt(r.value, s.variants, s.menus)
603
- ), k = z(() => {
600
+ setup(F, { emit: g }) {
601
+ const s = F, i = g, n = ce(), t = z(() => s.isAddon ? "Addons" : "Products"), u = z(() => s.isAddon ? [] : s.categories), b = z(
602
+ () => wt(u.value, s.variants, s.menus)
603
+ ), S = z(() => {
604
604
  if (s.isAddon)
605
- return s.bindings.map((c) => {
606
- const u = s.menus.find((f) => f._id === c.productId), y = (u == null ? void 0 : u.name) ?? "-";
605
+ return s.bindings.map((d) => {
606
+ const c = s.menus.find((f) => f._id === d.productId), A = (c == null ? void 0 : c.name) ?? "-";
607
607
  return {
608
- ...c,
609
- name: y,
610
- itemCode: (u == null ? void 0 : u.code) ?? "-"
608
+ ...d,
609
+ name: A,
610
+ itemCode: (c == null ? void 0 : c.code) ?? "-"
611
611
  };
612
612
  });
613
- const m = h.value.flatMap((c) => c.items);
614
- return s.bindings.map((c) => {
613
+ const m = b.value.flatMap((d) => d.items);
614
+ return s.bindings.map((d) => {
615
615
  var o;
616
- const u = m.find((B) => B._id === c.productId), y = (u == null ? void 0 : u.name) ?? "-";
617
- let f = (u == null ? void 0 : u.code) ?? "-", e;
618
- if (c.combinationKey) {
619
- const B = (((o = u == null ? void 0 : u.variant) == null ? void 0 : o.variantCombinations) || []).find(
620
- (L) => L.combinationKey === c.combinationKey
616
+ const c = m.find((B) => B._id === d.productId), A = (c == null ? void 0 : c.name) ?? "-";
617
+ let f = (c == null ? void 0 : c.code) ?? "-", e;
618
+ if (d.combinationKey) {
619
+ const B = (((o = c == null ? void 0 : c.variant) == null ? void 0 : o.variantCombinations) || []).find(
620
+ (L) => L.combinationKey === d.combinationKey
621
621
  );
622
622
  e = (B == null ? void 0 : B.name) ?? (B == null ? void 0 : B.codeName) ?? "", f = (B == null ? void 0 : B.code) ?? f;
623
623
  }
624
624
  return {
625
- ...c,
626
- name: y,
625
+ ...d,
626
+ name: A,
627
627
  itemCode: f,
628
628
  variantName: e
629
629
  };
630
630
  });
631
631
  });
632
- function A(m) {
633
- d(
632
+ function y(m) {
633
+ i(
634
634
  "update:bindings",
635
635
  s.bindings.filter(
636
- (c) => c.productId !== m.productId || c.combinationKey !== m.combinationKey
636
+ (d) => d.productId !== m.productId || d.combinationKey !== m.combinationKey
637
637
  )
638
638
  );
639
639
  }
640
- function g({ productId: m, combinationKey: c }, u) {
641
- const y = s.bindings.find(
642
- (f) => f.productId === m && f.combinationKey === c
640
+ function v({ productId: m, combinationKey: d }, c) {
641
+ const A = s.bindings.find(
642
+ (f) => f.productId === m && f.combinationKey === d
643
643
  );
644
- y && (y.code = u);
644
+ A && (A.code = c);
645
645
  }
646
646
  function l() {
647
- return h.value.map((m) => ({
647
+ return b.value.map((m) => ({
648
648
  label: m.name,
649
649
  sublabel: "Category",
650
650
  value: m.name,
651
651
  disabled: !1,
652
- children: m.items.map((c) => {
653
- var y;
654
- const u = (y = c.variant) == null ? void 0 : y.variantCombinations;
655
- return u != null && u.length ? {
656
- label: c.name ?? "",
657
- value: c._id,
652
+ children: m.items.map((d) => {
653
+ var A;
654
+ const c = (A = d.variant) == null ? void 0 : A.variantCombinations;
655
+ return c != null && c.length ? {
656
+ label: d.name ?? "",
657
+ value: d._id,
658
658
  sublabel: "Product",
659
659
  children: [
660
660
  {
661
- label: c.codeName ?? "",
661
+ label: d.codeName ?? "",
662
662
  value: {
663
- productId: c._id
663
+ productId: d._id
664
664
  },
665
665
  active: !!s.bindings.find(
666
- ({ productId: f, combinationKey: e }) => c._id === f && !e
666
+ ({ productId: f, combinationKey: e }) => d._id === f && !e
667
667
  )
668
668
  },
669
- ...u.map((f) => ({
669
+ ...c.map((f) => ({
670
670
  label: f.codeName ?? "",
671
671
  value: {
672
- productId: c._id,
672
+ productId: d._id,
673
673
  combinationKey: f.combinationKey
674
674
  },
675
675
  sublabel: "Variant",
676
676
  active: !!s.bindings.find(
677
- ({ productId: e, combinationKey: o }) => c._id === e && f.combinationKey === o
677
+ ({ productId: e, combinationKey: o }) => d._id === e && f.combinationKey === o
678
678
  )
679
679
  }))
680
680
  ]
681
681
  } : {
682
- label: c.codeName ?? "",
682
+ label: d.codeName ?? "",
683
683
  value: {
684
- productId: c._id
684
+ productId: d._id
685
685
  },
686
686
  active: !!s.bindings.find(
687
- ({ productId: f, combinationKey: e }) => c._id === f && !e
687
+ ({ productId: f, combinationKey: e }) => d._id === f && !e
688
688
  )
689
689
  };
690
690
  })
691
691
  }));
692
692
  }
693
- function i() {
693
+ function r() {
694
694
  return s.menus.map((m) => ({
695
695
  label: m.name,
696
696
  value: { productId: m._id },
697
697
  active: !!s.bindings.find(
698
- ({ productId: c, combinationKey: u }) => m._id === c && !u
698
+ ({ productId: d, combinationKey: c }) => m._id === d && !c
699
699
  )
700
700
  }));
701
701
  }
702
- function b(m) {
703
- const c = $(s.bindings);
704
- return m.flatMap((u) => u.children.flatMap((y) => {
702
+ function h(m) {
703
+ const d = ee(s.bindings);
704
+ return m.flatMap((c) => c.children.flatMap((A) => {
705
705
  var e;
706
- if (K(y))
707
- return y.children.filter((o) => o.active).map((o) => {
708
- var V, H;
706
+ if (K(A))
707
+ return A.children.filter((o) => o.active).map((o) => {
708
+ var N, H;
709
709
  const { productId: B, combinationKey: L } = o.value;
710
710
  return L ? {
711
711
  productId: B,
712
712
  combinationKey: L,
713
- code: ((V = c.find(
714
- ({ productId: U, combinationKey: M }) => B === U && L === M
715
- )) == null ? void 0 : V.code) ?? ""
713
+ code: ((N = d.find(
714
+ ({ productId: U, combinationKey: O }) => B === U && L === O
715
+ )) == null ? void 0 : N.code) ?? ""
716
716
  } : {
717
717
  productId: B,
718
- code: ((H = c.find(({ productId: U, combinationKey: M }) => B === U && !M)) == null ? void 0 : H.code) ?? ""
718
+ code: ((H = d.find(({ productId: U, combinationKey: O }) => B === U && !O)) == null ? void 0 : H.code) ?? ""
719
719
  };
720
720
  });
721
- if (!y.active)
721
+ if (!A.active)
722
722
  return [];
723
- const { productId: f } = y.value;
723
+ const { productId: f } = A.value;
724
724
  return [
725
725
  {
726
726
  productId: f,
727
- code: ((e = c.find(({ productId: o, combinationKey: B }) => f === o && !B)) == null ? void 0 : e.code) ?? ""
727
+ code: ((e = d.find(({ productId: o, combinationKey: B }) => f === o && !B)) == null ? void 0 : e.code) ?? ""
728
728
  }
729
729
  ];
730
730
  }));
731
731
  }
732
732
  function C(m) {
733
- const c = $(s.bindings);
734
- return m.filter((u) => u.active).map(
735
- (u) => {
736
- var y;
733
+ const d = ee(s.bindings);
734
+ return m.filter((c) => c.active).map(
735
+ (c) => {
736
+ var A;
737
737
  return {
738
- productId: u.value.productId,
739
- code: ((y = c.find(({ productId: f }) => f === u.value.productId)) == null ? void 0 : y.code) ?? ""
738
+ productId: c.value.productId,
739
+ code: ((A = d.find(({ productId: f }) => f === c.value.productId)) == null ? void 0 : A.code) ?? ""
740
740
  };
741
741
  }
742
742
  );
743
743
  }
744
- function S() {
744
+ function k() {
745
745
  let m;
746
- s.isAddon ? m = i() : m = l();
747
- const c = {
746
+ s.isAddon ? m = r() : m = l();
747
+ const d = {
748
748
  modelValue: m
749
749
  };
750
750
  n.open({
751
751
  title: `Select ${t.value}`,
752
- contentComponent: De,
753
- contentComponentProps: c,
752
+ contentComponent: Re,
753
+ contentComponentProps: d,
754
754
  primaryActions: {
755
755
  text: "Confirm",
756
756
  close: !0
757
757
  }
758
- }).onPrimary((u) => {
759
- let y;
760
- s.isAddon ? y = C(u) : y = b(u), d("update:bindings", y);
758
+ }).onPrimary((c) => {
759
+ let A;
760
+ s.isAddon ? A = C(c) : A = h(c), i("update:bindings", A);
761
761
  });
762
762
  }
763
763
  const { t: p } = G();
764
- return (m, c) => {
765
- const u = E("FmButton"), y = E("FmTextField");
766
- return w(), R("div", Bt, [
764
+ return (m, d) => {
765
+ const c = E("FmButton"), A = E("FmTextField");
766
+ return w(), V("div", Bt, [
767
767
  a("div", Ct, [
768
- a("div", Et, T(F.isAddon ? x(p)("inventory.integration.apply.addons") : x(p)("inventory.integration.apply.products")), 1),
769
- I(u, {
768
+ a("div", Et, j(F.isAddon ? I(p)("inventory.integration.apply.addons") : I(p)("inventory.integration.apply.products")), 1),
769
+ x(c, {
770
770
  type: "button",
771
771
  variant: "plain",
772
772
  size: "md",
773
773
  icon: "link",
774
- label: F.isAddon ? x(p)("inventory.integration.apply.applyAddon") : x(p)("inventory.integration.apply.applyProduct"),
775
- onClick: c[0] || (c[0] = (f) => S())
774
+ label: F.isAddon ? I(p)("inventory.integration.apply.applyAddon") : I(p)("inventory.integration.apply.applyProduct"),
775
+ onClick: d[0] || (d[0] = (f) => k())
776
776
  }, null, 8, ["label"])
777
777
  ]),
778
778
  a("div", null, [
779
- k.value.length > 0 ? (w(), R("table", Ft, [
779
+ S.value.length > 0 ? (w(), V("table", Ft, [
780
780
  a("thead", null, [
781
781
  a("tr", Lt, [
782
- a("th", Vt, T(x(p)("inventory.integration.apply.name")), 1),
783
- a("th", null, T(x(p)("inventory.integration.apply.code")), 1),
784
- c[1] || (c[1] = a("th", { class: "w-1" }, " ", -1))
782
+ a("th", Vt, j(I(p)("inventory.integration.apply.name")), 1),
783
+ a("th", null, j(I(p)("inventory.integration.apply.code")), 1),
784
+ d[1] || (d[1] = a("th", { class: "w-1" }, " ", -1))
785
785
  ])
786
786
  ]),
787
787
  a("tbody", null, [
788
- (w(!0), R(J, null, te(k.value, (f, e) => (w(), R(J, { key: e }, [
789
- c[2] || (c[2] = a("tr", { class: "block h-8" }, null, -1)),
788
+ (w(!0), V(J, null, $(S.value, (f, e) => (w(), V(J, { key: e }, [
789
+ d[2] || (d[2] = a("tr", { class: "block h-8" }, null, -1)),
790
790
  a("tr", null, [
791
791
  a("td", null, [
792
792
  a("div", Nt, [
793
- a("div", Rt, T(f.itemCode) + " " + T(f.name), 1),
794
- f.variantName ? (w(), R("div", Dt, T(f.variantName), 1)) : _("", !0)
793
+ a("div", Dt, j(f.itemCode) + " " + j(f.name), 1),
794
+ f.variantName ? (w(), V("div", Rt, j(f.variantName), 1)) : _("", !0)
795
795
  ])
796
796
  ]),
797
797
  a("td", null, [
798
- I(y, {
798
+ x(A, {
799
799
  "model-value": f.code,
800
- "onUpdate:modelValue": [(o) => f.code = o, (o) => g(f, o)],
800
+ "onUpdate:modelValue": [(o) => f.code = o, (o) => v(f, o)],
801
801
  rules: [
802
802
  function(B) {
803
803
  return !!B || "Required";
@@ -806,13 +806,13 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
806
806
  }, null, 8, ["model-value", "onUpdate:modelValue", "rules"])
807
807
  ]),
808
808
  a("td", Mt, [
809
- I(u, {
809
+ x(c, {
810
810
  type: "button",
811
811
  variant: "tertiary",
812
812
  icon: "delete",
813
813
  "icon-color": "#000000",
814
814
  size: "md",
815
- onClick: (o) => A(f)
815
+ onClick: (o) => y(f)
816
816
  }, null, 8, ["onClick"])
817
817
  ])
818
818
  ])
@@ -823,7 +823,7 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
823
823
  ]);
824
824
  };
825
825
  }
826
- }), jt = { class: "flex flex-col gap-8 w-full" }, Ot = /* @__PURE__ */ Y({
826
+ }), Ot = { class: "flex flex-col gap-8 w-full" }, jt = /* @__PURE__ */ Y({
827
827
  __name: "ApplyProductDialog",
828
828
  props: {
829
829
  categories: { default: () => [] },
@@ -835,55 +835,55 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
835
835
  loading: { type: Boolean }
836
836
  },
837
837
  emits: ["update:setting", "update:show", "submit"],
838
- setup(F, { emit: v }) {
839
- const s = F, d = v, n = fe($(s.setting));
840
- pe([() => s.show], ([g]) => {
841
- if (g)
838
+ setup(F, { emit: g }) {
839
+ const s = F, i = g, n = pe(ee(s.setting));
840
+ ve([() => s.show], ([v]) => {
841
+ if (v)
842
842
  for (const l of Object.keys(s.setting))
843
843
  n[l] = s.setting[l];
844
844
  });
845
- const t = j(), r = ae(s, "show");
846
- function h() {
847
- var g, l;
848
- (l = (g = t.value) == null ? void 0 : g.validateInputs) == null || l.call(g);
845
+ const t = M(), u = ae(s, "show");
846
+ function b() {
847
+ var v, l;
848
+ (l = (v = t.value) == null ? void 0 : v.validateInputs) == null || l.call(v);
849
849
  }
850
- function k() {
851
- d("update:setting", $(n)), d("submit");
850
+ function S() {
851
+ i("update:setting", ee(n)), i("submit");
852
852
  }
853
- const { t: A } = G();
854
- return (g, l) => {
855
- const i = E("FmChip"), b = E("FmForm"), C = E("FmButton"), S = E("FmSideSheet");
856
- return w(), X(S, {
857
- modelValue: x(r),
858
- "onUpdate:modelValue": l[4] || (l[4] = (p) => se(r) ? r.value = p : null),
859
- header: x(A)("inventory.integration.apply.title"),
853
+ const { t: y } = G();
854
+ return (v, l) => {
855
+ const r = E("FmChip"), h = E("FmForm"), C = E("FmButton"), k = E("FmSideSheet");
856
+ return w(), X(k, {
857
+ modelValue: I(u),
858
+ "onUpdate:modelValue": l[4] || (l[4] = (p) => se(u) ? u.value = p : null),
859
+ header: I(y)("inventory.integration.apply.title"),
860
860
  "dismiss-away": "",
861
861
  "close-button": "",
862
862
  "max-width": 500
863
863
  }, {
864
- default: D(() => [
865
- a("div", jt, [
864
+ default: R(() => [
865
+ a("div", Ot, [
866
866
  a("div", null, [
867
- I(i, { label: "Menu v3" })
867
+ x(r, { label: "Menu v3" })
868
868
  ]),
869
- I(b, {
869
+ x(h, {
870
870
  ref_key: "formRef",
871
871
  ref: t,
872
- onValidationSuccess: l[2] || (l[2] = (p) => k())
872
+ onValidationSuccess: l[2] || (l[2] = (p) => S())
873
873
  }, {
874
- default: D(() => [
875
- I(ce, {
874
+ default: R(() => [
875
+ x(me, {
876
876
  bindings: n.bindings,
877
- categories: g.categories,
878
- variants: g.variants,
879
- menus: g.menus,
877
+ categories: v.categories,
878
+ variants: v.variants,
879
+ menus: v.menus,
880
880
  "onUpdate:bindings": l[0] || (l[0] = (p) => n.bindings = p)
881
881
  }, null, 8, ["bindings", "categories", "variants", "menus"]),
882
- I(xt, {
882
+ x(It, {
883
883
  form: t.value,
884
884
  modifiers: n.modifiers ?? [],
885
- groups: g.groups ?? [],
886
- items: g.menus ?? [],
885
+ groups: v.groups ?? [],
886
+ items: v.menus ?? [],
887
887
  "onUpdate:modifiers": l[1] || (l[1] = (p) => n.modifiers = p)
888
888
  }, null, 8, ["form", "modifiers", "groups", "items"])
889
889
  ]),
@@ -891,12 +891,12 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
891
891
  }, 512)
892
892
  ])
893
893
  ]),
894
- "side-sheet-footer": D(() => [
895
- I(C, {
896
- loading: g.loading,
894
+ "side-sheet-footer": R(() => [
895
+ x(C, {
896
+ loading: v.loading,
897
897
  type: "submit",
898
- label: x(A)("common.confirm"),
899
- onClick: l[3] || (l[3] = (p) => h())
898
+ label: I(y)("common.confirm"),
899
+ onClick: l[3] || (l[3] = (p) => b())
900
900
  }, null, 8, ["loading", "label"])
901
901
  ]),
902
902
  _: 1
@@ -915,82 +915,82 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
915
915
  loading: { type: Boolean }
916
916
  },
917
917
  emits: ["update:setting", "update:show", "submit"],
918
- setup(F, { emit: v }) {
919
- const s = F, d = v, n = fe($(s.setting));
920
- pe([() => s.show], ([p]) => {
918
+ setup(F, { emit: g }) {
919
+ const s = F, i = g, n = pe(ee(s.setting));
920
+ ve([() => s.show], ([p]) => {
921
921
  if (p)
922
922
  for (const m of Object.keys(s.setting))
923
923
  n[m] = s.setting[m];
924
924
  });
925
- const t = z(() => s.menus.filter((p) => (p == null ? void 0 : p.category) === null)), r = z(() => n.bindings.filter((p) => {
926
- const m = s.menus.find((c) => c._id === p.productId);
925
+ const t = z(() => s.menus.filter((p) => (p == null ? void 0 : p.category) === null)), u = z(() => n.bindings.filter((p) => {
926
+ const m = s.menus.find((d) => d._id === p.productId);
927
927
  return m ? (m == null ? void 0 : m.category) === null : !1;
928
- })), h = z(() => s.menus.filter((p) => (p == null ? void 0 : p.category) !== null)), k = z(() => n.bindings.filter((p) => {
929
- const m = s.menus.find((c) => c._id === p.productId);
928
+ })), b = z(() => s.menus.filter((p) => (p == null ? void 0 : p.category) !== null)), S = z(() => n.bindings.filter((p) => {
929
+ const m = s.menus.find((d) => d._id === p.productId);
930
930
  return m ? (m == null ? void 0 : m.category) !== null : !1;
931
931
  }));
932
- function A(p) {
933
- n.bindings = [...r.value, ...p];
932
+ function y(p) {
933
+ n.bindings = [...u.value, ...p];
934
934
  }
935
- function g(p) {
936
- n.bindings = [...k.value, ...p];
935
+ function v(p) {
936
+ n.bindings = [...S.value, ...p];
937
937
  }
938
- const l = j(), i = ae(s, "show");
939
- function b() {
938
+ const l = M(), r = ae(s, "show");
939
+ function h() {
940
940
  var p, m;
941
941
  (m = (p = l.value) == null ? void 0 : p.validateInputs) == null || m.call(p);
942
942
  }
943
943
  function C() {
944
- d("update:setting", $(n)), d("submit");
944
+ i("update:setting", ee(n)), i("submit");
945
945
  }
946
- const { t: S } = G();
946
+ const { t: k } = G();
947
947
  return (p, m) => {
948
- const c = E("FmChip"), u = E("FmForm"), y = E("FmButton"), f = E("FmSideSheet");
948
+ const d = E("FmChip"), c = E("FmForm"), A = E("FmButton"), f = E("FmSideSheet");
949
949
  return w(), X(f, {
950
- modelValue: x(i),
951
- "onUpdate:modelValue": m[4] || (m[4] = (e) => se(i) ? i.value = e : null),
952
- header: x(S)("inventory.integration.apply.title"),
950
+ modelValue: I(r),
951
+ "onUpdate:modelValue": m[4] || (m[4] = (e) => se(r) ? r.value = e : null),
952
+ header: I(k)("inventory.integration.apply.title"),
953
953
  "dismiss-away": "",
954
954
  "close-button": "",
955
955
  "max-width": 500
956
956
  }, {
957
- default: D(() => [
957
+ default: R(() => [
958
958
  a("div", Tt, [
959
959
  a("div", null, [
960
- I(c, { label: "Menu v4" })
960
+ x(d, { label: "Menu v4" })
961
961
  ]),
962
- I(u, {
962
+ x(c, {
963
963
  ref_key: "formRef",
964
964
  ref: l,
965
965
  onValidationSuccess: m[2] || (m[2] = (e) => C())
966
966
  }, {
967
- default: D(() => [
968
- I(ce, {
967
+ default: R(() => [
968
+ x(me, {
969
969
  categories: p.categories,
970
970
  variants: p.variants,
971
- bindings: k.value,
972
- menus: h.value,
973
- "onUpdate:bindings": m[0] || (m[0] = (e) => A(e))
971
+ bindings: S.value,
972
+ menus: b.value,
973
+ "onUpdate:bindings": m[0] || (m[0] = (e) => y(e))
974
974
  }, null, 8, ["categories", "variants", "bindings", "menus"]),
975
- I(ce, {
975
+ x(me, {
976
976
  "is-addon": !0,
977
977
  categories: [],
978
978
  variants: p.variants,
979
- bindings: r.value,
979
+ bindings: u.value,
980
980
  menus: t.value,
981
- "onUpdate:bindings": m[1] || (m[1] = (e) => g(e))
981
+ "onUpdate:bindings": m[1] || (m[1] = (e) => v(e))
982
982
  }, null, 8, ["variants", "bindings", "menus"])
983
983
  ]),
984
984
  _: 1
985
985
  }, 512)
986
986
  ])
987
987
  ]),
988
- "side-sheet-footer": D(() => [
989
- I(y, {
988
+ "side-sheet-footer": R(() => [
989
+ x(A, {
990
990
  loading: p.loading,
991
991
  type: "submit",
992
- label: x(S)("common.confirm"),
993
- onClick: m[3] || (m[3] = (e) => b())
992
+ label: I(k)("common.confirm"),
993
+ onClick: m[3] || (m[3] = (e) => h())
994
994
  }, null, 8, ["loading", "label"])
995
995
  ]),
996
996
  _: 1
@@ -1000,43 +1000,43 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1000
1000
  }), Ht = { key: 0 }, _t = { class: "flex justify-center" }, Xt = ["src"], Ut = { class: "flex flex-col items-center gap-2" }, Qt = { class: "text-lg font-bold" }, Yt = { class: "text-fm-color-neutral-gray-300" }, Jt = { key: 0 }, Kt = /* @__PURE__ */ Y({
1001
1001
  __name: "FoodMarketHub",
1002
1002
  setup(F) {
1003
- const v = ie(), s = ne(), d = W(), n = j(!1), t = qe(), r = z(() => t.state.menu ?? []), h = z(() => t.state.group ?? []), k = z(() => t.state.variants ?? []), A = z(() => t.state.categories ?? []), g = Ue(), l = z(() => {
1004
- var u;
1005
- return (u = v.currentBusiness.value) == null ? void 0 : u.menuVersion;
1003
+ const g = ie(), s = te(), i = W(), n = M(!1), t = qe(), u = z(() => t.state.menu ?? []), b = z(() => t.state.group ?? []), S = z(() => t.state.variants ?? []), y = z(() => t.state.categories ?? []), v = Ue(), l = z(() => {
1004
+ var c;
1005
+ return (c = g.currentBusiness.value) == null ? void 0 : c.menuVersion;
1006
1006
  });
1007
- d.watchLocation(t.init);
1008
- const i = j(!1);
1009
- async function b() {
1010
- i.value = !0;
1007
+ i.watchLocation(t.init);
1008
+ const r = M(!1);
1009
+ async function h() {
1010
+ r.value = !0;
1011
1011
  }
1012
- const { breakpoints: C } = Ve(), S = z(() => C.value.xs || C.value.sm), p = z(() => S.value);
1012
+ const { breakpoints: C } = Ve(), k = z(() => C.value.xs || C.value.sm), p = z(() => k.value);
1013
1013
  async function m() {
1014
- const u = t.state.setting;
1015
- if (u) {
1014
+ const c = t.state.setting;
1015
+ if (c) {
1016
1016
  n.value = !0;
1017
1017
  try {
1018
- await g.updateSetting(u), s.open({
1018
+ await v.updateSetting(c), s.open({
1019
1019
  title: "Success",
1020
1020
  message: "Your changes has been saved",
1021
1021
  type: "success"
1022
- }), i.value = !1, await t.init();
1022
+ }), r.value = !1, await t.init();
1023
1023
  return;
1024
- } catch (y) {
1024
+ } catch (A) {
1025
1025
  s.open({
1026
1026
  title: "Something went wrong",
1027
1027
  message: "Cannot update integration info. Please try again.",
1028
1028
  type: "error"
1029
- }), console.error("Error at updating integration info", y);
1029
+ }), console.error("Error at updating integration info", A);
1030
1030
  } finally {
1031
1031
  n.value = !1;
1032
1032
  }
1033
1033
  }
1034
1034
  }
1035
- const { t: c } = G();
1036
- return (u, y) => {
1035
+ const { t: d } = G();
1036
+ return (c, A) => {
1037
1037
  const f = E("FmCardSection"), e = E("FmCard");
1038
- return x(t).isEnabled && !x(t).isBusinessLocation ? (w(), R("div", Ht, [
1039
- I(e, {
1038
+ return I(t).isEnabled && !I(t).isBusinessLocation ? (w(), V("div", Ht, [
1039
+ x(e, {
1040
1040
  class: q({
1041
1041
  "w-full": p.value,
1042
1042
  "w-1/2": !p.value,
@@ -1045,20 +1045,20 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1045
1045
  "cursor-pointer": !0,
1046
1046
  "hover:border-fm-color-primary": !0
1047
1047
  }),
1048
- onClick: y[0] || (y[0] = (o) => b())
1048
+ onClick: A[0] || (A[0] = (o) => h())
1049
1049
  }, {
1050
- default: D(() => [
1051
- I(f, null, {
1052
- default: D(() => [
1050
+ default: R(() => [
1051
+ x(f, null, {
1052
+ default: R(() => [
1053
1053
  a("div", _t, [
1054
1054
  a("img", {
1055
- src: x(tt),
1055
+ src: I(tt),
1056
1056
  alt: "Food Market Hub"
1057
1057
  }, null, 8, Xt)
1058
1058
  ]),
1059
1059
  a("div", Ut, [
1060
- a("div", Qt, T(x(c)("inventory.integration.fmh.title")), 1),
1061
- a("div", Yt, T(x(c)("inventory.integration.fmh.description")), 1)
1060
+ a("div", Qt, j(I(d)("inventory.integration.fmh.title")), 1),
1061
+ a("div", Yt, j(I(d)("inventory.integration.fmh.description")), 1)
1062
1062
  ])
1063
1063
  ]),
1064
1064
  _: 1
@@ -1066,32 +1066,32 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1066
1066
  ]),
1067
1067
  _: 1
1068
1068
  }, 8, ["class"]),
1069
- x(t).state.setting ? (w(), R("div", Jt, [
1069
+ I(t).state.setting ? (w(), V("div", Jt, [
1070
1070
  (w(), X(ue, { to: "body" }, [
1071
- l.value === "v3" ? (w(), X(Ot, {
1071
+ l.value === "v3" ? (w(), X(jt, {
1072
1072
  key: 0,
1073
- menus: r.value,
1074
- variants: k.value,
1075
- categories: A.value,
1076
- setting: x(t).state.setting,
1077
- "onUpdate:setting": y[1] || (y[1] = (o) => x(t).state.setting = o),
1078
- show: i.value,
1079
- "onUpdate:show": y[2] || (y[2] = (o) => i.value = o),
1080
- groups: h.value,
1073
+ menus: u.value,
1074
+ variants: S.value,
1075
+ categories: y.value,
1076
+ setting: I(t).state.setting,
1077
+ "onUpdate:setting": A[1] || (A[1] = (o) => I(t).state.setting = o),
1078
+ show: r.value,
1079
+ "onUpdate:show": A[2] || (A[2] = (o) => r.value = o),
1080
+ groups: b.value,
1081
1081
  loading: n.value,
1082
- onSubmit: y[3] || (y[3] = (o) => m())
1082
+ onSubmit: A[3] || (A[3] = (o) => m())
1083
1083
  }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"])) : (w(), X(zt, {
1084
1084
  key: 1,
1085
- menus: r.value,
1086
- variants: k.value,
1087
- categories: A.value,
1088
- setting: x(t).state.setting,
1089
- "onUpdate:setting": y[4] || (y[4] = (o) => x(t).state.setting = o),
1090
- show: i.value,
1091
- "onUpdate:show": y[5] || (y[5] = (o) => i.value = o),
1092
- groups: h.value,
1085
+ menus: u.value,
1086
+ variants: S.value,
1087
+ categories: y.value,
1088
+ setting: I(t).state.setting,
1089
+ "onUpdate:setting": A[4] || (A[4] = (o) => I(t).state.setting = o),
1090
+ show: r.value,
1091
+ "onUpdate:show": A[5] || (A[5] = (o) => r.value = o),
1092
+ groups: b.value,
1093
1093
  loading: n.value,
1094
- onSubmit: y[6] || (y[6] = (o) => m())
1094
+ onSubmit: A[6] || (A[6] = (o) => m())
1095
1095
  }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"]))
1096
1096
  ]))
1097
1097
  ])) : _("", !0)
@@ -1118,25 +1118,25 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1118
1118
  }) }
1119
1119
  },
1120
1120
  emits: ["update:modelValue"],
1121
- setup(F, { emit: v }) {
1122
- const s = F, d = z(() => s.modelValue), n = v;
1123
- return (t, r) => {
1124
- const h = E("FmSelect"), k = E("FmButton"), A = E("FmIcon");
1125
- return w(), R("div", qt, [
1121
+ setup(F, { emit: g }) {
1122
+ const s = F, i = z(() => s.modelValue), n = g;
1123
+ return (t, u) => {
1124
+ const b = E("FmSelect"), S = E("FmButton"), y = E("FmIcon");
1125
+ return w(), V("div", qt, [
1126
1126
  a("div", Gt, [
1127
- I(h, {
1127
+ x(b, {
1128
1128
  placeholder: "Select NetSuite Location",
1129
1129
  items: t.nsLocationOptions,
1130
1130
  searchable: "",
1131
1131
  searchTarget: "label",
1132
- "model-value": d.value,
1133
- "onUpdate:modelValue": r[0] || (r[0] = (g) => n("update:modelValue", g))
1132
+ "model-value": i.value,
1133
+ "onUpdate:modelValue": u[0] || (u[0] = (v) => n("update:modelValue", v))
1134
1134
  }, null, 8, ["items", "model-value"]),
1135
- d.value.netsuiteId ? (w(), X(k, {
1135
+ i.value.netsuiteId ? (w(), X(S, {
1136
1136
  key: 0,
1137
1137
  variant: "secondary",
1138
1138
  label: "Clear",
1139
- onClick: r[1] || (r[1] = (g) => n("update:modelValue", {
1139
+ onClick: u[1] || (u[1] = (v) => n("update:modelValue", {
1140
1140
  netsuiteId: "",
1141
1141
  name: "",
1142
1142
  subsidiaryName: "",
@@ -1144,9 +1144,9 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1144
1144
  }))
1145
1145
  })) : _("", !0)
1146
1146
  ]),
1147
- t.isDuplicate ? (w(), R("div", Pt, " NetSuite location being used by another FeedMe location. ")) : _("", !0),
1148
- d.value.netsuiteId ? (w(), R("div", Wt, [
1149
- I(A, {
1147
+ t.isDuplicate ? (w(), V("div", Pt, " NetSuite location being used by another FeedMe location. ")) : _("", !0),
1148
+ i.value.netsuiteId ? (w(), V("div", Wt, [
1149
+ x(y, {
1150
1150
  name: "cloud",
1151
1151
  color: "neutral-gray-400",
1152
1152
  size: "md",
@@ -1154,9 +1154,9 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1154
1154
  outline: ""
1155
1155
  }),
1156
1156
  a("div", $t, [
1157
- a("span", en, T(d.value.name), 1),
1158
- a("span", tn, "ID: " + T(d.value.netsuiteId), 1),
1159
- a("span", nn, "Subsidiary: " + T(d.value.subsidiaryName), 1)
1157
+ a("span", en, j(i.value.name), 1),
1158
+ a("span", tn, "ID: " + j(i.value.netsuiteId), 1),
1159
+ a("span", nn, "Subsidiary: " + j(i.value.subsidiaryName), 1)
1160
1160
  ])
1161
1161
  ])) : _("", !0)
1162
1162
  ]);
@@ -1183,24 +1183,24 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1183
1183
  }
1184
1184
  },
1185
1185
  emits: ["update:loading", "update:showDialog"],
1186
- setup(F, { emit: v }) {
1187
- const s = le(), d = ne(), n = [
1186
+ setup(F, { emit: g }) {
1187
+ const s = le(), i = te(), n = [
1188
1188
  {
1189
1189
  id: "fmLocation",
1190
1190
  header: "FeedMe Location",
1191
- cell(b) {
1192
- const C = b.row.original, S = N(ee.FmIcon, {
1191
+ cell(h) {
1192
+ const C = h.row.original, k = D(ne.FmIcon, {
1193
1193
  name: C.type,
1194
1194
  color: "neutral-gray-400",
1195
1195
  size: "md",
1196
1196
  class: "mr-2",
1197
1197
  outline: !0
1198
1198
  });
1199
- return N("div", { class: "flex items-center" }, [
1200
- S,
1201
- N("div", { class: "flex flex-col" }, [
1202
- N("span", { class: "font-medium" }, C.name),
1203
- N("span", { class: "text-xs text-gray-400" }, C.doc._id)
1199
+ return D("div", { class: "flex items-center" }, [
1200
+ k,
1201
+ D("div", { class: "flex flex-col" }, [
1202
+ D("span", { class: "font-medium" }, C.name),
1203
+ D("span", { class: "text-xs text-gray-400" }, C.doc._id)
1204
1204
  ])
1205
1205
  ]);
1206
1206
  }
@@ -1208,85 +1208,85 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1208
1208
  {
1209
1209
  id: "nsLocation",
1210
1210
  header: "NetSuite Location",
1211
- cell(b) {
1212
- const C = b.row.original, S = h.value[C.dbName], p = Object.entries(h.value).some(
1213
- ([m, c]) => m !== C.dbName && c.netsuiteId === (S == null ? void 0 : S.netsuiteId)
1211
+ cell(h) {
1212
+ const C = h.row.original, k = b.value[C.dbName], p = Object.entries(b.value).some(
1213
+ ([m, d]) => m !== C.dbName && d.netsuiteId === (k == null ? void 0 : k.netsuiteId)
1214
1214
  );
1215
- return N(on, {
1215
+ return D(on, {
1216
1216
  isDuplicate: p,
1217
- nsLocationOptions: g.value,
1218
- modelValue: S,
1217
+ nsLocationOptions: v.value,
1218
+ modelValue: k,
1219
1219
  fmLocation: C,
1220
1220
  "onUpdate:modelValue": (m) => {
1221
- m.netsuiteId ? h.value = {
1222
- ...h.value,
1221
+ m.netsuiteId ? b.value = {
1222
+ ...b.value,
1223
1223
  [C.dbName]: {
1224
1224
  netsuiteId: m.netsuiteId,
1225
1225
  name: m.name,
1226
1226
  subsidiaryName: m.subsidiaryName,
1227
1227
  subsidiaryId: m.subsidiaryId
1228
1228
  }
1229
- } : delete h.value[C.dbName];
1229
+ } : delete b.value[C.dbName];
1230
1230
  }
1231
1231
  });
1232
1232
  }
1233
1233
  }
1234
- ], t = F, r = v, h = j({}), k = j(), A = j(""), g = z(() => t.nsLocationsNotBeingUsed.map((b) => ({
1235
- label: b.name,
1236
- value: b
1237
- }))), l = z(() => Object.values(h.value).length === 0 || Object.values(h.value).some(
1238
- (b) => Object.values(h.value).filter((C) => C.netsuiteId === b.netsuiteId).length > 1
1234
+ ], t = F, u = g, b = M({}), S = M(), y = M(""), v = z(() => t.nsLocationsNotBeingUsed.map((h) => ({
1235
+ label: h.name,
1236
+ value: h
1237
+ }))), l = z(() => Object.values(b.value).length === 0 || Object.values(b.value).some(
1238
+ (h) => Object.values(b.value).filter((C) => C.netsuiteId === h.netsuiteId).length > 1
1239
1239
  ));
1240
- async function i() {
1240
+ async function r() {
1241
1241
  try {
1242
- r("update:loading", !0), await s.updateLocationConfigs(h.value), d.open({
1242
+ u("update:loading", !0), await s.updateLocationConfigs(b.value), i.open({
1243
1243
  message: "Locations updated successfully",
1244
1244
  type: "success"
1245
- }), r("update:showDialog", !1);
1245
+ }), u("update:showDialog", !1);
1246
1246
  } catch {
1247
- d.open({
1247
+ i.open({
1248
1248
  message: "Failed to update locations. Please try again.",
1249
1249
  type: "error"
1250
1250
  });
1251
1251
  } finally {
1252
- r("update:loading", !1);
1252
+ u("update:loading", !1);
1253
1253
  }
1254
1254
  }
1255
- return (b, C) => {
1256
- const S = E("FmTable"), p = E("FmForm"), m = E("FmSpacer"), c = E("FmButton"), u = E("FmDialog");
1257
- return w(), X(u, {
1255
+ return (h, C) => {
1256
+ const k = E("FmTable"), p = E("FmForm"), m = E("FmSpacer"), d = E("FmButton"), c = E("FmDialog");
1257
+ return w(), X(c, {
1258
1258
  modelValue: F.showDialog,
1259
- "onUpdate:modelValue": C[2] || (C[2] = (y) => b.$emit("update:showDialog", y)),
1259
+ "onUpdate:modelValue": C[2] || (C[2] = (A) => h.$emit("update:showDialog", A)),
1260
1260
  overlay: !0,
1261
1261
  "max-width": "900px"
1262
1262
  }, {
1263
- "dialog-header": D(() => C[3] || (C[3] = [
1263
+ "dialog-header": R(() => C[3] || (C[3] = [
1264
1264
  a("div", null, "Add locations", -1)
1265
1265
  ])),
1266
- "dialog-footer": D(() => [
1267
- I(m, { class: "sm:hidden xs:hidden" }),
1268
- I(c, {
1266
+ "dialog-footer": R(() => [
1267
+ x(m, { class: "sm:hidden xs:hidden" }),
1268
+ x(d, {
1269
1269
  class: "sm:w-full xs:w-full",
1270
1270
  label: "Submit",
1271
1271
  size: "md",
1272
1272
  disabled: l.value,
1273
- onClick: i
1273
+ onClick: r
1274
1274
  }, null, 8, ["disabled"])
1275
1275
  ]),
1276
- default: D(() => [
1277
- I(p, {
1276
+ default: R(() => [
1277
+ x(p, {
1278
1278
  ref: "formRef",
1279
1279
  class: "mb-4",
1280
- "model-value": k.value,
1281
- "onUpdate:modelValue": C[1] || (C[1] = (y) => k.value = y)
1280
+ "model-value": S.value,
1281
+ "onUpdate:modelValue": C[1] || (C[1] = (A) => S.value = A)
1282
1282
  }, {
1283
- default: D(() => [
1284
- I(S, {
1285
- modelValue: k.value,
1286
- "onUpdate:modelValue": C[0] || (C[0] = (y) => k.value = y),
1283
+ default: R(() => [
1284
+ x(k, {
1285
+ modelValue: S.value,
1286
+ "onUpdate:modelValue": C[0] || (C[0] = (A) => S.value = A),
1287
1287
  "row-data": t.fmLocationNotYetConfigured,
1288
1288
  "column-defs": n,
1289
- "search-value": A.value,
1289
+ "search-value": y.value,
1290
1290
  "shrink-at": !1
1291
1291
  }, null, 8, ["modelValue", "row-data", "search-value"])
1292
1292
  ]),
@@ -1300,7 +1300,7 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1300
1300
  }), an = { key: 0 }, ln = {
1301
1301
  key: 1,
1302
1302
  class: "flex flex-col gap-8 w-full"
1303
- }, rn = { class: "flex gap-2 flex-wrap" }, un = { class: "p-8" }, dn = { class: "flex gap-8 items-center justify-start" }, cn = /* @__PURE__ */ Y({
1303
+ }, rn = { class: "flex gap-2 flex-wrap" }, un = { class: "p-8" }, cn = { class: "flex gap-8 items-center justify-start" }, dn = /* @__PURE__ */ Y({
1304
1304
  __name: "BusinessNetSuiteSideSheet",
1305
1305
  props: {
1306
1306
  setting: {},
@@ -1309,37 +1309,37 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1309
1309
  loading: { type: Boolean }
1310
1310
  },
1311
1311
  emits: ["update:setting", "update:show", "update:loading", "submit"],
1312
- setup(F, { emit: v }) {
1313
- const s = ie(), d = W(), n = j(!1), t = F, r = v, h = fe($(t.setting));
1314
- pe([() => t.show], ([c]) => {
1315
- if (c)
1316
- for (const u of Object.keys(t.setting))
1317
- h[u] = t.setting[u];
1312
+ setup(F, { emit: g }) {
1313
+ const s = ie(), i = W(), n = M(!1), t = F, u = g, b = pe(ee(t.setting));
1314
+ ve([() => t.show], ([d]) => {
1315
+ if (d)
1316
+ for (const c of Object.keys(t.setting))
1317
+ b[c] = t.setting[c];
1318
1318
  });
1319
- const k = j(), A = ae(t, "show"), g = j(), l = j(""), i = z(() => t.setting.locations.filter(
1320
- (c) => c.name.toLowerCase().includes(l.value.toLowerCase()) || c.netSuiteId.toLowerCase().includes(l.value.toLowerCase())
1321
- )), b = [
1319
+ const S = M(), y = ae(t, "show"), v = M(), l = M(""), r = z(() => t.setting.locations.filter(
1320
+ (d) => d.name.toLowerCase().includes(l.value.toLowerCase()) || d.netSuiteId.toLowerCase().includes(l.value.toLowerCase())
1321
+ )), h = [
1322
1322
  {
1323
1323
  id: "location",
1324
1324
  header: () => "FeedMe Location",
1325
- cell(c) {
1326
- const u = c.row.original, y = d.locations.find(
1327
- (e) => e.type === u.type && e.doc._id === u.id
1325
+ cell(d) {
1326
+ const c = d.row.original, A = i.locations.find(
1327
+ (e) => e.type === c.type && e.doc._id === c.id
1328
1328
  );
1329
- if (!y)
1330
- return N("div", "Unknown Location");
1331
- const f = N(ee.FmIcon, {
1332
- name: y.type,
1329
+ if (!A)
1330
+ return D("div", "Unknown Location");
1331
+ const f = D(ne.FmIcon, {
1332
+ name: A.type,
1333
1333
  color: "neutral-gray-400",
1334
1334
  size: "md",
1335
1335
  class: "mr-2",
1336
1336
  outline: !0
1337
1337
  });
1338
- return N("div", { class: "flex items-center" }, [
1338
+ return D("div", { class: "flex items-center" }, [
1339
1339
  f,
1340
- N("div", { class: "flex flex-col" }, [
1341
- N("span", { class: "font-medium" }, y.name),
1342
- N("span", { class: "text-xs text-gray-400" }, y.doc._id)
1340
+ D("div", { class: "flex flex-col" }, [
1341
+ D("span", { class: "font-medium" }, A.name),
1342
+ D("span", { class: "text-xs text-gray-400" }, A.doc._id)
1343
1343
  ])
1344
1344
  ]);
1345
1345
  }
@@ -1347,28 +1347,28 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1347
1347
  {
1348
1348
  id: "netsuite",
1349
1349
  header: () => "NetSuite Location",
1350
- cell(c) {
1350
+ cell(d) {
1351
1351
  var e;
1352
- const u = c.row.original, y = (e = t.nsLocations.find(
1353
- (o) => o.netsuiteId === u.netSuiteId
1354
- )) == null ? void 0 : e.subsidiaryName, f = N(ee.FmIcon, {
1352
+ const c = d.row.original, A = (e = t.nsLocations.find(
1353
+ (o) => o.netsuiteId === c.netSuiteId
1354
+ )) == null ? void 0 : e.subsidiaryName, f = D(ne.FmIcon, {
1355
1355
  name: "cloud",
1356
1356
  color: "neutral-gray-400",
1357
1357
  size: "md",
1358
1358
  class: "mr-2",
1359
1359
  outline: !0
1360
1360
  });
1361
- return N("div", { class: "flex items-center" }, [
1361
+ return D("div", { class: "flex items-center" }, [
1362
1362
  f,
1363
- N("div", { class: "flex flex-col" }, [
1364
- N("span", { class: "font-medium" }, u.name),
1365
- N("span", { class: "text-xs text-gray-400" }, `ID: ${u.netSuiteId}`),
1366
- N("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${y}`)
1363
+ D("div", { class: "flex flex-col" }, [
1364
+ D("span", { class: "font-medium" }, c.name),
1365
+ D("span", { class: "text-xs text-gray-400" }, `ID: ${c.netSuiteId}`),
1366
+ D("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${A}`)
1367
1367
  ])
1368
1368
  ]);
1369
1369
  }
1370
1370
  }
1371
- ], { t: C } = G(), S = [
1371
+ ], { t: C } = G(), k = [
1372
1372
  "Unit Type",
1373
1373
  "Inventory Item",
1374
1374
  "Location",
@@ -1377,78 +1377,78 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1377
1377
  "Purchase Order",
1378
1378
  "Transfer Order",
1379
1379
  "Inventory Transfer"
1380
- ], p = z(() => d.locations.filter(
1381
- (c) => !t.setting.locations.some(
1382
- (u) => u.id === c.doc._id && u.type === c.type
1380
+ ], p = z(() => i.locations.filter(
1381
+ (d) => !t.setting.locations.some(
1382
+ (c) => c.id === d.doc._id && c.type === d.type
1383
1383
  )
1384
1384
  )), m = z(() => t.nsLocations.filter(
1385
- (c) => !t.setting.locations.some((u) => u.netSuiteId === c.netsuiteId)
1385
+ (d) => !t.setting.locations.some((c) => c.netSuiteId === d.netsuiteId)
1386
1386
  ));
1387
- return (c, u) => {
1388
- const y = E("FmChip"), f = E("FmSearch"), e = E("FmTable"), o = E("FmButton"), B = E("FmSideSheet");
1387
+ return (d, c) => {
1388
+ const A = E("FmChip"), f = E("FmSearch"), e = E("FmTable"), o = E("FmButton"), B = E("FmSideSheet");
1389
1389
  return w(), X(B, {
1390
- modelValue: x(A),
1391
- "onUpdate:modelValue": u[6] || (u[6] = (L) => se(A) ? A.value = L : null),
1392
- header: x(C)("inventory.integration.netsuite.title"),
1390
+ modelValue: I(y),
1391
+ "onUpdate:modelValue": c[6] || (c[6] = (L) => se(y) ? y.value = L : null),
1392
+ header: I(C)("inventory.integration.netsuite.title"),
1393
1393
  "dismiss-away": "",
1394
1394
  "close-button": "",
1395
1395
  "max-width": 800
1396
1396
  }, {
1397
- default: D(() => {
1397
+ default: R(() => {
1398
1398
  var L;
1399
1399
  return [
1400
- (L = x(s).sessionUser.value) != null && L.role.isAdmin ? (w(), R("div", ln, [
1401
- u[7] || (u[7] = a("div", { class: "text-sm" }, " This integration keeps your FeedMe system and NetSuite in sync for the following modules: ", -1)),
1400
+ (L = I(s).sessionUser.value) != null && L.role.isAdmin ? (w(), V("div", ln, [
1401
+ c[7] || (c[7] = a("div", { class: "text-sm" }, " This integration keeps your FeedMe system and NetSuite in sync for the following modules: ", -1)),
1402
1402
  a("div", rn, [
1403
- (w(), R(J, null, te(S, (V) => I(y, {
1404
- key: V,
1405
- label: V,
1403
+ (w(), V(J, null, $(k, (N) => x(A, {
1404
+ key: N,
1405
+ label: N,
1406
1406
  compact: ""
1407
1407
  }, null, 8, ["label"])), 64))
1408
1408
  ]),
1409
- u[8] || (u[8] = a("div", { class: "text-xs mt-2" }, " Changes made in FeedMe or NetSuite will be reflected in both systems, ensuring data consistency and streamlined operations. ", -1)),
1410
- u[9] || (u[9] = a("hr", { class: "my-3" }, null, -1)),
1409
+ c[8] || (c[8] = a("div", { class: "text-xs mt-2" }, " Changes made in FeedMe or NetSuite will be reflected in both systems, ensuring data consistency and streamlined operations. ", -1)),
1410
+ c[9] || (c[9] = a("hr", { class: "my-3" }, null, -1)),
1411
1411
  a("div", un, [
1412
- I(f, {
1412
+ x(f, {
1413
1413
  placeholder: "Search by [NetSuite Location]",
1414
1414
  class: "w-[300px]",
1415
1415
  modelValue: l.value,
1416
- "onUpdate:modelValue": u[0] || (u[0] = (V) => l.value = V)
1416
+ "onUpdate:modelValue": c[0] || (c[0] = (N) => l.value = N)
1417
1417
  }, null, 8, ["modelValue"])
1418
1418
  ]),
1419
- I(e, {
1420
- modelValue: g.value,
1421
- "onUpdate:modelValue": u[1] || (u[1] = (V) => g.value = V),
1422
- "row-data": i.value,
1423
- "column-defs": b,
1419
+ x(e, {
1420
+ modelValue: v.value,
1421
+ "onUpdate:modelValue": c[1] || (c[1] = (N) => v.value = N),
1422
+ "row-data": r.value,
1423
+ "column-defs": h,
1424
1424
  "shrink-at": !1,
1425
1425
  "search-value": l.value
1426
1426
  }, null, 8, ["modelValue", "row-data", "search-value"])
1427
- ])) : (w(), R("div", an, " Please contact your administrator to apply the changes. ")),
1428
- I(sn, {
1427
+ ])) : (w(), V("div", an, " Please contact your administrator to apply the changes. ")),
1428
+ x(sn, {
1429
1429
  "show-dialog": n.value,
1430
1430
  "onUpdate:showDialog": [
1431
- u[2] || (u[2] = (V) => n.value = V),
1432
- u[3] || (u[3] = (V) => n.value = V)
1431
+ c[2] || (c[2] = (N) => n.value = N),
1432
+ c[3] || (c[3] = (N) => n.value = N)
1433
1433
  ],
1434
- formRef: k.value,
1434
+ formRef: S.value,
1435
1435
  fmLocationNotYetConfigured: p.value,
1436
1436
  nsLocationsNotBeingUsed: m.value
1437
1437
  }, null, 8, ["show-dialog", "formRef", "fmLocationNotYetConfigured", "nsLocationsNotBeingUsed"])
1438
1438
  ];
1439
1439
  }),
1440
- "side-sheet-footer": D(() => [
1441
- a("div", dn, [
1442
- I(o, {
1440
+ "side-sheet-footer": R(() => [
1441
+ a("div", cn, [
1442
+ x(o, {
1443
1443
  label: "Add location",
1444
- onClick: u[4] || (u[4] = (L) => n.value = !0),
1445
- loading: c.loading,
1446
- disabled: c.loading
1444
+ onClick: c[4] || (c[4] = (L) => n.value = !0),
1445
+ loading: d.loading,
1446
+ disabled: d.loading
1447
1447
  }, null, 8, ["loading", "disabled"]),
1448
- I(o, {
1448
+ x(o, {
1449
1449
  variant: "tertiary",
1450
- label: x(C)("common.close"),
1451
- onClick: u[5] || (u[5] = (L) => r("update:show", !1))
1450
+ label: I(C)("common.close"),
1451
+ onClick: c[5] || (c[5] = (L) => u("update:show", !1))
1452
1452
  }, null, 8, ["label"])
1453
1453
  ])
1454
1454
  ]),
@@ -1464,23 +1464,23 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1464
1464
  },
1465
1465
  emits: ["update:modelValue"],
1466
1466
  setup(F) {
1467
- const { t: v } = de(), s = xe(F, "modelValue"), d = [
1467
+ const { t: g } = de(), s = Se(F, "modelValue"), i = [
1468
1468
  {
1469
1469
  id: "Code",
1470
- header: () => v("inventory.transfer.form.items.table.Code"),
1470
+ header: () => g("inventory.transfer.form.items.table.Code"),
1471
1471
  accessorKey: "code",
1472
1472
  size: 200,
1473
1473
  cell(n) {
1474
1474
  const t = n.row.original;
1475
- return N(
1476
- ee.FmTooltip,
1475
+ return D(
1476
+ ne.FmTooltip,
1477
1477
  {
1478
1478
  content: t.code,
1479
1479
  placement: "top",
1480
1480
  variant: "plain",
1481
1481
  zIndex: 50
1482
1482
  },
1483
- N(
1483
+ D(
1484
1484
  "span",
1485
1485
  {
1486
1486
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
@@ -1493,19 +1493,19 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1493
1493
  },
1494
1494
  {
1495
1495
  id: "Name",
1496
- header: () => v("inventory.transfer.form.items.table.Name"),
1496
+ header: () => g("inventory.transfer.form.items.table.Name"),
1497
1497
  minSize: 300,
1498
1498
  cell(n) {
1499
1499
  const t = n.row.original;
1500
- return N(
1501
- ee.FmTooltip,
1500
+ return D(
1501
+ ne.FmTooltip,
1502
1502
  {
1503
1503
  content: t.name,
1504
1504
  placement: "top",
1505
1505
  variant: "plain",
1506
1506
  zIndex: 50
1507
1507
  },
1508
- N(
1508
+ D(
1509
1509
  "span",
1510
1510
  {
1511
1511
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
@@ -1518,11 +1518,11 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1518
1518
  },
1519
1519
  {
1520
1520
  id: "Amount",
1521
- header: () => v("inventory.transfer.form.items.table.Amount"),
1521
+ header: () => g("inventory.transfer.form.items.table.Amount"),
1522
1522
  minSize: 200,
1523
1523
  cell(n) {
1524
- const t = n.row.original, r = n.row.index;
1525
- return N($e, {
1524
+ const t = n.row.original, u = n.row.index;
1525
+ return D($e, {
1526
1526
  style: {
1527
1527
  flex: "1 1 0%"
1528
1528
  },
@@ -1532,17 +1532,17 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1532
1532
  },
1533
1533
  key: t.sku._id,
1534
1534
  unit: t.sku.unit,
1535
- "onUpdate:modelValue": (h) => {
1536
- if (!h) return;
1537
- const k = {
1535
+ "onUpdate:modelValue": (b) => {
1536
+ if (!b) return;
1537
+ const S = {
1538
1538
  ...t,
1539
- quantity: h.amount,
1540
- measurement: h.measurement
1539
+ quantity: b.amount,
1540
+ measurement: b.measurement
1541
1541
  };
1542
1542
  s.value = [
1543
- ...s.value.slice(0, r),
1544
- k,
1545
- ...s.value.slice(r + 1)
1543
+ ...s.value.slice(0, u),
1544
+ S,
1545
+ ...s.value.slice(u + 1)
1546
1546
  ];
1547
1547
  },
1548
1548
  rules: [et(+Qe({ amount: 1, precision: 0 }))],
@@ -1555,9 +1555,9 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1555
1555
  id: "Delete",
1556
1556
  header: "",
1557
1557
  cell(n) {
1558
- const t = n.row.original, r = n.row.index;
1559
- return N("div", { class: "flex justify-end" }, [
1560
- N(ee.FmButton, {
1558
+ const t = n.row.original, u = n.row.index;
1559
+ return D("div", { class: "flex justify-end" }, [
1560
+ D(ne.FmButton, {
1561
1561
  key: t.sku._id,
1562
1562
  class: "delete-button",
1563
1563
  type: "button",
@@ -1565,7 +1565,7 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1565
1565
  variant: "tertiary",
1566
1566
  size: "md",
1567
1567
  onClick: () => {
1568
- s.value = [...s.value.slice(0, r), ...s.value.slice(r + 1)];
1568
+ s.value = [...s.value.slice(0, u), ...s.value.slice(u + 1)];
1569
1569
  }
1570
1570
  })
1571
1571
  ]);
@@ -1579,12 +1579,12 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1579
1579
  }
1580
1580
  ];
1581
1581
  return (n, t) => {
1582
- const r = E("FmTable");
1583
- return w(), X(r, {
1584
- "column-defs": d,
1582
+ const u = E("FmTable");
1583
+ return w(), X(u, {
1584
+ "column-defs": i,
1585
1585
  "row-data": s.value,
1586
- "row-key": (h) => h.sku._id,
1587
- "empty-text": x(v)("inventory.transfer.form.items.table.empty"),
1586
+ "row-key": (b) => b.sku._id,
1587
+ "empty-text": I(g)("inventory.transfer.form.items.table.empty"),
1588
1588
  pagination: !1,
1589
1589
  "virtual-scroll": { enabled: !0, itemSize: 48 }
1590
1590
  }, null, 8, ["row-data", "row-key", "empty-text"]);
@@ -1593,41 +1593,41 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1593
1593
  }), fn = { class: "flex items-center gap-8 mb-8" }, pn = /* @__PURE__ */ Y({
1594
1594
  __name: "InventoryTransferOutTable",
1595
1595
  setup(F) {
1596
- const v = j([]), s = Se(), d = j(!1), n = j(!1), t = ne(), r = W();
1597
- me(async () => {
1598
- const g = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1599
- l.setDate(l.getDate() - 30), d.value = !0;
1596
+ const g = M([]), s = ge(), i = M(!1), n = M(!1), t = te(), u = W();
1597
+ fe(async () => {
1598
+ const v = /* @__PURE__ */ new Date(), l = /* @__PURE__ */ new Date();
1599
+ l.setDate(l.getDate() - 30), i.value = !0;
1600
1600
  try {
1601
- const i = await s.getInventoryTransferHistory(
1602
- r.currentLocationDBName,
1601
+ const r = await s.getInventoryTransferHistory(
1602
+ u.currentLocationDBName,
1603
1603
  l,
1604
- g
1604
+ v
1605
1605
  );
1606
- v.value = i;
1607
- } catch (i) {
1608
- console.error("Error fetching inventory transfer history:", i);
1606
+ g.value = r;
1607
+ } catch (r) {
1608
+ console.error("Error fetching inventory transfer history:", r);
1609
1609
  } finally {
1610
- d.value = !1;
1610
+ i.value = !1;
1611
1611
  }
1612
1612
  });
1613
- async function h() {
1613
+ async function b() {
1614
1614
  try {
1615
- n.value = !0, await s.manualSyncInventoryTransfer(r.currentLocationDBName), t == null || t.open({
1615
+ n.value = !0, await s.manualSyncInventoryTransfer(u.currentLocationDBName), t == null || t.open({
1616
1616
  title: "Sync Started",
1617
1617
  message: "Inventory transfers sync queued successfully.",
1618
1618
  type: "success"
1619
1619
  });
1620
- } catch (g) {
1620
+ } catch (v) {
1621
1621
  t == null || t.open({
1622
1622
  title: "Sync Failed",
1623
- message: `Failed to queue inventory transfers sync. ${g == null ? void 0 : g.message}`,
1623
+ message: `Failed to queue inventory transfers sync. ${v == null ? void 0 : v.message}`,
1624
1624
  type: "error"
1625
1625
  });
1626
1626
  } finally {
1627
1627
  n.value = !1;
1628
1628
  }
1629
1629
  }
1630
- const k = [
1630
+ const S = [
1631
1631
  // {
1632
1632
  // id: 'type',
1633
1633
  // header: 'Type',
@@ -1638,17 +1638,17 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1638
1638
  {
1639
1639
  id: "destinationLocation",
1640
1640
  header: "Destination Location",
1641
- cell: (g) => {
1642
- const l = g.row.original.destinationLocation.netSuiteName;
1643
- return l ? N(
1644
- ee.FmTooltip,
1641
+ cell: (v) => {
1642
+ const l = v.row.original.destinationLocation.netSuiteName;
1643
+ return l ? D(
1644
+ ne.FmTooltip,
1645
1645
  { zIndex: 51 },
1646
1646
  {
1647
1647
  content() {
1648
1648
  return l;
1649
1649
  },
1650
1650
  default() {
1651
- return N("div", { class: "line-clamp-2 fm-typo-en-body-sm-400" }, l);
1651
+ return D("div", { class: "line-clamp-2 fm-typo-en-body-sm-400" }, l);
1652
1652
  }
1653
1653
  }
1654
1654
  ) : "N/A";
@@ -1657,22 +1657,22 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1657
1657
  {
1658
1658
  id: "netsuite",
1659
1659
  header: () => "NetSuite",
1660
- cell(g) {
1661
- return N("div", { class: "flex flex-col" }, [
1662
- N(
1660
+ cell(v) {
1661
+ return D("div", { class: "flex flex-col" }, [
1662
+ D(
1663
1663
  "span",
1664
1664
  { class: "fm-typo-en-body-sm-400" },
1665
- `ID: ${g.row.original.netsuiteId ?? "N/A"}`
1665
+ `ID: ${v.row.original.netsuiteId ?? "N/A"}`
1666
1666
  ),
1667
- N(
1667
+ D(
1668
1668
  "span",
1669
1669
  { class: "fm-typo-en-body-sm-400" },
1670
- `Transaction ID: ${g.row.original.netsuiteTranId ?? "N/A"}`
1670
+ `Transaction ID: ${v.row.original.netsuiteTranId ?? "N/A"}`
1671
1671
  ),
1672
- N(
1672
+ D(
1673
1673
  "span",
1674
1674
  { class: "fm-typo-en-body-sm-400" },
1675
- `Transaction Date: ${g.row.original.netsuiteTranDate ?? "N/A"}`
1675
+ `Transaction Date: ${v.row.original.netsuiteTranDate ?? "N/A"}`
1676
1676
  )
1677
1677
  ]);
1678
1678
  }
@@ -1680,14 +1680,14 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1680
1680
  {
1681
1681
  id: "adjustment",
1682
1682
  header: () => "Adjustment (FeedMe)",
1683
- cell(g) {
1684
- const l = g.row.original.adjustmentId;
1685
- return N("div", { class: "flex flex-col" }, [
1686
- N("span", { class: "fm-typo-en-body-sm-400" }, `ID: ${l ?? "N/A"}`),
1687
- N(
1683
+ cell(v) {
1684
+ const l = v.row.original.adjustmentId;
1685
+ return D("div", { class: "flex flex-col" }, [
1686
+ D("span", { class: "fm-typo-en-body-sm-400" }, `ID: ${l ?? "N/A"}`),
1687
+ D(
1688
1688
  "span",
1689
1689
  { class: "fm-typo-en-body-sm-400" },
1690
- `Date: ${l ? ve(ge(l)) : "N/A"}`
1690
+ `Date: ${l ? ye(Ae(l)) : "N/A"}`
1691
1691
  )
1692
1692
  ]);
1693
1693
  }
@@ -1695,17 +1695,17 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1695
1695
  {
1696
1696
  id: "items",
1697
1697
  header: () => "Items",
1698
- cell(g) {
1699
- const l = g.row.original.items;
1700
- return N(
1698
+ cell(v) {
1699
+ const l = v.row.original.items;
1700
+ return D(
1701
1701
  "div",
1702
1702
  { class: "overflow-auto" },
1703
- N("ul", { class: "list-disc pl-5" }, [
1703
+ D("ul", { class: "list-disc pl-5" }, [
1704
1704
  l == null ? void 0 : l.map(
1705
- (i) => N(
1705
+ (r) => D(
1706
1706
  "li",
1707
1707
  { class: "fm-typo-en-body-sm-400" },
1708
- `[${i == null ? void 0 : i.itemId}] ${i == null ? void 0 : i.itemName}: ${i == null ? void 0 : i.quantity} ${(i == null ? void 0 : i.uomName) ?? "N/A"}`
1708
+ `[${r == null ? void 0 : r.itemId}] ${r == null ? void 0 : r.itemName}: ${r == null ? void 0 : r.quantity} ${(r == null ? void 0 : r.uomName) ?? "N/A"}`
1709
1709
  )
1710
1710
  )
1711
1711
  ])
@@ -1713,13 +1713,13 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1713
1713
  },
1714
1714
  size: 150
1715
1715
  }
1716
- ], A = j();
1717
- return (g, l) => {
1718
- const i = E("FmButton"), b = E("FmTable");
1719
- return w(), R(J, null, [
1716
+ ], y = M();
1717
+ return (v, l) => {
1718
+ const r = E("FmButton"), h = E("FmTable");
1719
+ return w(), V(J, null, [
1720
1720
  a("div", fn, [
1721
1721
  l[1] || (l[1] = a("span", null, "Last 30 Days:", -1)),
1722
- I(i, {
1722
+ x(r, {
1723
1723
  "prepend-icon": "sync",
1724
1724
  variant: "secondary",
1725
1725
  label: "Sync",
@@ -1727,15 +1727,15 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1727
1727
  "text-color": "primary",
1728
1728
  "bg-color": "transparent",
1729
1729
  "border-color": "primary",
1730
- onClick: h
1730
+ onClick: b
1731
1731
  }, null, 8, ["loading"])
1732
1732
  ]),
1733
- I(b, {
1734
- modelValue: A.value,
1735
- "onUpdate:modelValue": l[0] || (l[0] = (C) => A.value = C),
1736
- "row-data": v.value,
1737
- "column-defs": k,
1738
- loading: d.value
1733
+ x(h, {
1734
+ modelValue: y.value,
1735
+ "onUpdate:modelValue": l[0] || (l[0] = (C) => y.value = C),
1736
+ "row-data": g.value,
1737
+ "column-defs": S,
1738
+ loading: i.value
1739
1739
  }, null, 8, ["modelValue", "row-data", "loading"])
1740
1740
  ], 64);
1741
1741
  };
@@ -1746,7 +1746,7 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1746
1746
  }, yn = { class: "flex gap-2" }, An = {
1747
1747
  key: 1,
1748
1748
  class: "flex items-center my-2 border rounded-lg p-2"
1749
- }, bn = { class: "flex flex-col" }, hn = { class: "font-medium" }, In = { class: "text-xs text-gray-400" }, xn = { class: "text-xs text-gray-400" }, Sn = { class: "flex my-4" }, wn = { class: "flex" }, kn = {
1749
+ }, bn = { class: "flex flex-col" }, hn = { class: "font-medium" }, xn = { class: "text-xs text-gray-400" }, In = { class: "text-xs text-gray-400" }, Sn = { class: "flex my-4" }, wn = { class: "flex" }, kn = {
1750
1750
  key: 1,
1751
1751
  class: "flex flex-col"
1752
1752
  }, Bn = {
@@ -1760,55 +1760,55 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1760
1760
  currentLocationSubsidiary: {}
1761
1761
  },
1762
1762
  setup(F) {
1763
- const v = Ae(), s = le(), d = ye(), n = Se(), t = ne(), { t: r } = de(), h = j([]), k = [{ label: "Transfer Out" }, { label: "History" }], A = j(k[0]), g = j(!1), l = j(null), i = j(null), b = F, C = z(() => {
1764
- const y = s.currentLocationSetting, f = s.configuredLocations;
1765
- return b.nsLocations.map((e) => ({
1763
+ const g = ce(), s = le(), i = be(), n = ge(), t = te(), { t: u } = de(), b = M([]), S = [{ label: "Transfer Out" }, { label: "History" }], y = M(S[0]), v = M(!1), l = M(null), r = M(null), h = F, C = z(() => {
1764
+ const A = s.currentLocationSetting, f = s.configuredLocations;
1765
+ return h.nsLocations.map((e) => ({
1766
1766
  label: e.name,
1767
1767
  value: e,
1768
- disabled: f.some((o) => o.netSuiteId === e.netsuiteId) || e.subsidiaryId !== (y == null ? void 0 : y.subsidiaryId)
1768
+ disabled: f.some((o) => o.netSuiteId === e.netsuiteId) || e.subsidiaryId !== (A == null ? void 0 : A.subsidiaryId)
1769
1769
  }));
1770
- }), S = z({
1770
+ }), k = z({
1771
1771
  get() {
1772
1772
  return l.value ? l.value.toISOString().slice(0, 10) : "";
1773
1773
  },
1774
- set(y) {
1775
- if (!y) {
1774
+ set(A) {
1775
+ if (!A) {
1776
1776
  l.value = null;
1777
1777
  return;
1778
1778
  }
1779
- const f = l.value ?? /* @__PURE__ */ new Date(), e = new Date(y);
1779
+ const f = l.value ?? /* @__PURE__ */ new Date(), e = new Date(A);
1780
1780
  f.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), l.value = new Date(f);
1781
1781
  }
1782
1782
  }), p = z({
1783
1783
  get() {
1784
1784
  if (!l.value) return null;
1785
- const y = String(l.value.getHours()).padStart(2, "0"), f = String(l.value.getMinutes()).padStart(2, "0");
1786
- return `${y}:${f}`;
1785
+ const A = String(l.value.getHours()).padStart(2, "0"), f = String(l.value.getMinutes()).padStart(2, "0");
1786
+ return `${A}:${f}`;
1787
1787
  },
1788
- set(y) {
1789
- if (!y) return;
1790
- const [f, e] = y.split(":").map(Number), o = l.value ?? /* @__PURE__ */ new Date();
1788
+ set(A) {
1789
+ if (!A) return;
1790
+ const [f, e] = A.split(":").map(Number), o = l.value ?? /* @__PURE__ */ new Date();
1791
1791
  o.setHours(f, e), l.value = new Date(o);
1792
1792
  }
1793
- }), m = z(() => S.value && p.value && i.value && h.value.length > 0 && !g.value);
1794
- async function c() {
1793
+ }), m = z(() => k.value && p.value && r.value && b.value.length > 0 && !v.value);
1794
+ async function d() {
1795
1795
  if (m.value) {
1796
- if (!b.currentLocationSetting) {
1796
+ if (!h.currentLocationSetting) {
1797
1797
  t.open({
1798
1798
  message: "Current location setting is not available",
1799
1799
  type: "error"
1800
1800
  });
1801
1801
  return;
1802
1802
  }
1803
- g.value = !0;
1803
+ v.value = !0;
1804
1804
  try {
1805
- const y = {
1806
- items: h.value,
1805
+ const A = {
1806
+ items: b.value,
1807
1807
  date: l.value.toISOString(),
1808
- netsuiteLocationId: i.value.netsuiteId,
1809
- netsuiteLocationName: i.value.name
1810
- }, f = `${b.currentLocationSetting.type}_${b.currentLocationSetting.id}`;
1811
- await n.createInventoryTransfer(f, y), h.value = [], l.value = null, i.value = null, t.open({
1808
+ netsuiteLocationId: r.value.netsuiteId,
1809
+ netsuiteLocationName: r.value.name
1810
+ }, f = `${h.currentLocationSetting.type}_${h.currentLocationSetting.id}`;
1811
+ await n.createInventoryTransfer(f, A), b.value = [], l.value = null, r.value = null, t.open({
1812
1812
  message: "Inventort transfer created successfully",
1813
1813
  type: "success"
1814
1814
  });
@@ -1818,12 +1818,12 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1818
1818
  type: "error"
1819
1819
  });
1820
1820
  } finally {
1821
- g.value = !1;
1821
+ v.value = !1;
1822
1822
  }
1823
1823
  }
1824
1824
  }
1825
- function u() {
1826
- const y = s.currentLocationSubsidiary(), f = s.getAvailableItems(y.id), e = d.skus.filter((L) => f.includes(L._id)).map((L) => L._id), o = d.skus.map(
1825
+ function c() {
1826
+ const A = s.currentLocationSubsidiary(), f = s.getAvailableItems(A.id), e = i.skus.filter((L) => f.includes(L._id)).map((L) => L._id), o = i.skus.map(
1827
1827
  (L) => ({
1828
1828
  label: L.name,
1829
1829
  sublabel: L.code,
@@ -1831,11 +1831,11 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1831
1831
  disabled: !e.includes(L._id)
1832
1832
  })
1833
1833
  ), B = o.filter((L) => {
1834
- var V;
1835
- return (V = h.value) == null ? void 0 : V.find((H) => H.sku._id === L.value._id);
1834
+ var N;
1835
+ return (N = b.value) == null ? void 0 : N.find((H) => H.sku._id === L.value._id);
1836
1836
  }).map((L) => L.value);
1837
- v.open({
1838
- title: r("inventory.transfer.form.items.selectItem"),
1837
+ g.open({
1838
+ title: u("inventory.transfer.form.items.selectItem"),
1839
1839
  closeButton: !0,
1840
1840
  contentComponent: Ye,
1841
1841
  contentComponentProps: {
@@ -1844,18 +1844,18 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1844
1844
  virtualScroll: !0
1845
1845
  },
1846
1846
  primaryActions: {
1847
- text: r("common.confirm"),
1847
+ text: u("common.confirm"),
1848
1848
  close: !0
1849
1849
  },
1850
1850
  secondaryActions: {
1851
- text: r("common.close"),
1851
+ text: u("common.close"),
1852
1852
  close: !0,
1853
1853
  variant: "tertiary"
1854
1854
  }
1855
1855
  }).onPrimary((L) => {
1856
- const V = h.value, H = L.map((U) => {
1857
- const M = V.find((Q) => Q.sku._id === U._id);
1858
- return M || {
1856
+ const N = b.value, H = L.map((U) => {
1857
+ const O = N.find((Q) => Q.sku._id === U._id);
1858
+ return O || {
1859
1859
  sku: U,
1860
1860
  code: U.code,
1861
1861
  name: U.name,
@@ -1865,89 +1865,89 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1865
1865
  }
1866
1866
  };
1867
1867
  });
1868
- H.sort((U, M) => U.sku.code.localeCompare(M.sku.code)), h.value = H;
1868
+ H.sort((U, O) => U.sku.code.localeCompare(O.sku.code)), b.value = H;
1869
1869
  });
1870
1870
  }
1871
- return (y, f) => {
1872
- const e = E("FmButtonGroup"), o = E("FmLabel"), B = E("FmField"), L = E("FmSimpleDatePicker"), V = E("FmTimePicker"), H = E("FmSelect"), U = E("FmIcon"), M = E("FmButton");
1873
- return w(), R("div", vn, [
1874
- I(e, {
1875
- modelValue: A.value,
1876
- "onUpdate:modelValue": f[0] || (f[0] = (O) => A.value = O),
1877
- items: k
1871
+ return (A, f) => {
1872
+ const e = E("FmButtonGroup"), o = E("FmLabel"), B = E("FmField"), L = E("FmSimpleDatePicker"), N = E("FmTimePicker"), H = E("FmSelect"), U = E("FmIcon"), O = E("FmButton");
1873
+ return w(), V("div", vn, [
1874
+ x(e, {
1875
+ modelValue: y.value,
1876
+ "onUpdate:modelValue": f[0] || (f[0] = (T) => y.value = T),
1877
+ items: S
1878
1878
  }, null, 8, ["modelValue"]),
1879
- A.value.label === "Transfer Out" ? (w(), R(J, { key: 0 }, [
1880
- x(s).inventoryTransferOutEnabled ? (w(), R("div", gn, [
1881
- I(o, { class: "fm-typo-en-body-md-600" }, {
1882
- default: D(() => f[6] || (f[6] = [
1879
+ y.value.label === "Transfer Out" ? (w(), V(J, { key: 0 }, [
1880
+ I(s).inventoryTransferOutEnabled ? (w(), V("div", gn, [
1881
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1882
+ default: R(() => f[6] || (f[6] = [
1883
1883
  Z("Type")
1884
1884
  ])),
1885
1885
  _: 1
1886
1886
  }),
1887
- I(B, {
1887
+ x(B, {
1888
1888
  class: "my-4",
1889
1889
  disabled: "",
1890
1890
  "prepend-icon": "lock"
1891
1891
  }, {
1892
- default: D(() => f[7] || (f[7] = [
1892
+ default: R(() => f[7] || (f[7] = [
1893
1893
  Z("Transfer out")
1894
1894
  ])),
1895
1895
  _: 1
1896
1896
  }),
1897
- I(o, { class: "fm-typo-en-body-md-600" }, {
1898
- default: D(() => f[8] || (f[8] = [
1897
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1898
+ default: R(() => f[8] || (f[8] = [
1899
1899
  Z("Subsidiary")
1900
1900
  ])),
1901
1901
  _: 1
1902
1902
  }),
1903
- I(B, {
1903
+ x(B, {
1904
1904
  class: "my-4",
1905
1905
  disabled: "",
1906
1906
  "prepend-icon": "lock"
1907
1907
  }, {
1908
- default: D(() => [
1909
- Z(T(y.currentLocationSubsidiary.fullName), 1)
1908
+ default: R(() => [
1909
+ Z(j(A.currentLocationSubsidiary.fullName), 1)
1910
1910
  ]),
1911
1911
  _: 1
1912
1912
  }),
1913
- I(o, { class: "fm-typo-en-body-md-600" }, {
1914
- default: D(() => f[9] || (f[9] = [
1913
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1914
+ default: R(() => f[9] || (f[9] = [
1915
1915
  Z("Transaction date")
1916
1916
  ])),
1917
1917
  _: 1
1918
1918
  }),
1919
- I(L, {
1920
- modelValue: S.value,
1921
- "onUpdate:modelValue": f[1] || (f[1] = (O) => S.value = O)
1919
+ x(L, {
1920
+ modelValue: k.value,
1921
+ "onUpdate:modelValue": f[1] || (f[1] = (T) => k.value = T)
1922
1922
  }, null, 8, ["modelValue"]),
1923
- I(o, { class: "fm-typo-en-body-md-600" }, {
1924
- default: D(() => f[10] || (f[10] = [
1923
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1924
+ default: R(() => f[10] || (f[10] = [
1925
1925
  Z("Transaction time")
1926
1926
  ])),
1927
1927
  _: 1
1928
1928
  }),
1929
- I(V, {
1929
+ x(N, {
1930
1930
  modelValue: p.value,
1931
- "onUpdate:modelValue": f[2] || (f[2] = (O) => p.value = O)
1931
+ "onUpdate:modelValue": f[2] || (f[2] = (T) => p.value = T)
1932
1932
  }, null, 8, ["modelValue"]),
1933
- I(o, { class: "fm-typo-en-body-md-600" }, {
1934
- default: D(() => f[11] || (f[11] = [
1933
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1934
+ default: R(() => f[11] || (f[11] = [
1935
1935
  Z("NetSuite Location")
1936
1936
  ])),
1937
1937
  _: 1
1938
1938
  }),
1939
1939
  a("div", yn, [
1940
- i.value ? _("", !0) : (w(), X(H, {
1940
+ r.value ? _("", !0) : (w(), X(H, {
1941
1941
  key: 0,
1942
1942
  class: "my-4 w-full",
1943
- modelValue: i.value,
1944
- "onUpdate:modelValue": f[3] || (f[3] = (O) => i.value = O),
1943
+ modelValue: r.value,
1944
+ "onUpdate:modelValue": f[3] || (f[3] = (T) => r.value = T),
1945
1945
  searchable: "",
1946
1946
  searchTarget: "label",
1947
1947
  items: C.value
1948
1948
  }, null, 8, ["modelValue", "items"])),
1949
- i.value ? (w(), R("div", An, [
1950
- I(U, {
1949
+ r.value ? (w(), V("div", An, [
1950
+ x(U, {
1951
1951
  name: "cloud",
1952
1952
  color: "neutral-gray-400",
1953
1953
  size: "md",
@@ -1955,58 +1955,109 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
1955
1955
  outline: ""
1956
1956
  }),
1957
1957
  a("div", bn, [
1958
- a("span", hn, T(i.value.name), 1),
1959
- a("span", In, "ID: " + T(i.value.netsuiteId), 1),
1960
- a("span", xn, "Subsidiary: " + T(i.value.subsidiaryName), 1)
1958
+ a("span", hn, j(r.value.name), 1),
1959
+ a("span", xn, "ID: " + j(r.value.netsuiteId), 1),
1960
+ a("span", In, "Subsidiary: " + j(r.value.subsidiaryName), 1)
1961
1961
  ]),
1962
- I(M, {
1962
+ x(O, {
1963
1963
  class: "ml-2",
1964
1964
  variant: "secondary",
1965
1965
  label: "Clear",
1966
- onClick: f[4] || (f[4] = (O) => i.value = null)
1966
+ onClick: f[4] || (f[4] = (T) => r.value = null)
1967
1967
  })
1968
1968
  ])) : _("", !0)
1969
1969
  ]),
1970
1970
  a("div", Sn, [
1971
- I(M, {
1971
+ x(O, {
1972
1972
  class: "ml-auto",
1973
1973
  variant: "secondary",
1974
1974
  "prepend-icon": "add",
1975
1975
  label: "Ingredients",
1976
- onClick: u
1976
+ onClick: c
1977
1977
  })
1978
1978
  ]),
1979
- I(mn, {
1980
- modelValue: h.value,
1981
- "onUpdate:modelValue": f[5] || (f[5] = (O) => h.value = O)
1979
+ x(mn, {
1980
+ modelValue: b.value,
1981
+ "onUpdate:modelValue": f[5] || (f[5] = (T) => b.value = T)
1982
1982
  }, null, 8, ["modelValue"]),
1983
1983
  a("div", wn, [
1984
- I(M, {
1984
+ x(O, {
1985
1985
  class: "ml-auto mt-4",
1986
1986
  variant: "primary",
1987
1987
  "prepend-icon": "add",
1988
1988
  label: "Create",
1989
1989
  disabled: !m.value,
1990
- loading: g.value,
1991
- onClick: c
1990
+ loading: v.value,
1991
+ onClick: d
1992
1992
  }, null, 8, ["disabled", "loading"])
1993
1993
  ])
1994
- ])) : (w(), R("div", kn, [
1995
- I(o, { class: "fm-typo-en-body-md-600" }, {
1996
- default: D(() => f[12] || (f[12] = [
1994
+ ])) : (w(), V("div", kn, [
1995
+ x(o, { class: "fm-typo-en-body-md-600" }, {
1996
+ default: R(() => f[12] || (f[12] = [
1997
1997
  Z(" Feature is not enabled. Please contact your administrator. ")
1998
1998
  ])),
1999
1999
  _: 1
2000
2000
  })
2001
2001
  ]))
2002
2002
  ], 64)) : _("", !0),
2003
- A.value.label === "History" ? (w(), R("div", Bn, [
2004
- I(pn)
2003
+ y.value.label === "History" ? (w(), V("div", Bn, [
2004
+ x(pn)
2005
+ ])) : _("", !0)
2006
+ ]);
2007
+ };
2008
+ }
2009
+ }), En = { class: "flex flex-col gap-8" }, Fn = {
2010
+ key: 0,
2011
+ class: "flex flex-col gap-4"
2012
+ }, Ln = { style: { "list-style-type": "initial", "padding-left": "1rem" } }, Vn = /* @__PURE__ */ Y({
2013
+ __name: "TransferOrder",
2014
+ props: {
2015
+ nsLocations: {},
2016
+ currentLocationSetting: {},
2017
+ currentLocationSubsidiary: {}
2018
+ },
2019
+ setup(F) {
2020
+ ce();
2021
+ const g = ge(), s = te(), i = M(!1), n = F, t = M([]);
2022
+ async function u() {
2023
+ var b;
2024
+ i.value = !0;
2025
+ try {
2026
+ const S = ((b = n.currentLocationSetting) == null ? void 0 : b.id) || "", y = await g.getUnSyncTransferInOrders(S);
2027
+ t.value = y, s.open({
2028
+ message: "Check unsync transfer in order successfully",
2029
+ type: "success"
2030
+ });
2031
+ } catch {
2032
+ s.open({
2033
+ message: "Failed to check unsync transfer in order",
2034
+ type: "error"
2035
+ });
2036
+ } finally {
2037
+ i.value = !1;
2038
+ }
2039
+ }
2040
+ return (b, S) => {
2041
+ const y = E("FmButton");
2042
+ return w(), V("div", En, [
2043
+ a("span", null, "Current date and time: " + j((/* @__PURE__ */ new Date()).toLocaleString()), 1),
2044
+ x(y, {
2045
+ label: "Check Unsync Transfer Order (Last 2 months)",
2046
+ variant: "primary",
2047
+ onClick: u,
2048
+ disabled: i.value,
2049
+ loading: i.value
2050
+ }, null, 8, ["disabled", "loading"]),
2051
+ t.value.length > 0 ? (w(), V("div", Fn, [
2052
+ S[0] || (S[0] = a("p", null, "Transfer Order NetSuite ID not match with existing orders", -1)),
2053
+ a("ul", Ln, [
2054
+ (w(!0), V(J, null, $(t.value, (v) => (w(), V("li", { key: v }, j(v), 1))), 128))
2055
+ ])
2005
2056
  ])) : _("", !0)
2006
2057
  ]);
2007
2058
  };
2008
2059
  }
2009
- }), En = { class: "flex flex-col gap-8 w-full" }, Fn = { class: "flex gap-4 justify-between" }, Ln = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, Vn = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Nn = { key: 0 }, Rn = { class: "flex gap-8 items-center justify-start" }, Dn = /* @__PURE__ */ Y({
2060
+ }), Nn = { class: "flex flex-col gap-8 w-full" }, Dn = { class: "flex gap-4 justify-between" }, Rn = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, Mn = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, On = { key: 0 }, jn = { class: "flex gap-8 items-center justify-start" }, Tn = /* @__PURE__ */ Y({
2010
2061
  __name: "NetSuiteSideSheet",
2011
2062
  props: {
2012
2063
  nsLocations: {},
@@ -2014,69 +2065,80 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
2014
2065
  loading: { type: Boolean }
2015
2066
  },
2016
2067
  emits: ["update:show"],
2017
- setup(F, { emit: v }) {
2018
- var S;
2019
- const s = ie(), d = le(), n = F, t = ae(n, "show"), { t: r } = G(), h = v, k = W(), A = ((S = k._currentLocation) == null ? void 0 : S.type) || "", g = [
2068
+ setup(F, { emit: g }) {
2069
+ var k;
2070
+ const s = ie(), i = le(), n = F, t = ae(n, "show"), { t: u } = G(), b = g, S = W(), y = ((k = S._currentLocation) == null ? void 0 : k.type) || "", v = [
2020
2071
  {
2021
2072
  label: "Inventory Transfer (Out)",
2022
2073
  value: "inventoryTransfer"
2023
2074
  /* INVENTORY_TRANSFER */
2075
+ },
2076
+ {
2077
+ label: "Transfer Order",
2078
+ value: "transferOrder"
2079
+ /* TRANSFER_ORDER */
2024
2080
  }
2025
- ], l = j(g[0].value), i = z(() => d.currentLocationSubsidiary()), b = z(() => d.currentLocationSetting), C = z(() => n.nsLocations.filter(
2026
- (p) => p.subsidiaryId === i.value.id || p.netsuiteId === i.value.id
2081
+ ], l = M(v[0].value), r = z(() => i.currentLocationSubsidiary()), h = z(() => i.currentLocationSetting), C = z(() => n.nsLocations.filter(
2082
+ (p) => p.subsidiaryId === r.value.id || p.netsuiteId === r.value.id
2027
2083
  ));
2028
2084
  return (p, m) => {
2029
2085
  var e;
2030
- const c = E("FmIcon"), u = E("FmTabs"), y = E("FmButton"), f = E("FmSideSheet");
2086
+ const d = E("FmIcon"), c = E("FmTabs"), A = E("FmButton"), f = E("FmSideSheet");
2031
2087
  return w(), X(f, {
2032
- modelValue: x(t),
2088
+ modelValue: I(t),
2033
2089
  "onUpdate:modelValue": m[2] || (m[2] = (o) => se(t) ? t.value = o : null),
2034
2090
  header: "Data migration (Xilnex)",
2035
2091
  "dismiss-away": "",
2036
2092
  "close-button": "",
2037
2093
  "max-width": 800
2038
2094
  }, oe({
2039
- default: D(() => [
2040
- x(d).isCurrentLocationBindedToNetSuite ? (w(), R(J, { key: 1 }, [
2095
+ default: R(() => [
2096
+ I(i).isCurrentLocationBindedToNetSuite ? (w(), V(J, { key: 1 }, [
2041
2097
  l.value === "inventoryTransfer" ? (w(), X(Cn, {
2042
2098
  key: 0,
2043
- currentLocationSetting: b.value,
2099
+ currentLocationSetting: h.value,
2100
+ nsLocations: C.value,
2101
+ currentLocationSubsidiary: r.value
2102
+ }, null, 8, ["currentLocationSetting", "nsLocations", "currentLocationSubsidiary"])) : _("", !0),
2103
+ l.value === "transferOrder" ? (w(), X(Vn, {
2104
+ key: 1,
2105
+ currentLocationSetting: h.value,
2044
2106
  nsLocations: C.value,
2045
- currentLocationSubsidiary: i.value
2107
+ currentLocationSubsidiary: r.value
2046
2108
  }, null, 8, ["currentLocationSetting", "nsLocations", "currentLocationSubsidiary"])) : _("", !0)
2047
- ], 64)) : (w(), R("div", Nn, " Netsuite is not configured for this location. Please contact your administrator. "))
2109
+ ], 64)) : (w(), V("div", On, " Netsuite is not configured for this location. Please contact your administrator. "))
2048
2110
  ]),
2049
- "side-sheet-footer": D(() => [
2050
- a("div", Rn, [
2051
- I(y, {
2111
+ "side-sheet-footer": R(() => [
2112
+ a("div", jn, [
2113
+ x(A, {
2052
2114
  variant: "tertiary",
2053
- label: x(r)("common.close"),
2054
- onClick: m[1] || (m[1] = (o) => h("update:show", !1))
2115
+ label: I(u)("common.close"),
2116
+ onClick: m[1] || (m[1] = (o) => b("update:show", !1))
2055
2117
  }, null, 8, ["label"])
2056
2118
  ])
2057
2119
  ]),
2058
2120
  _: 2
2059
2121
  }, [
2060
- (e = x(s).sessionUser.value) != null && e.role.isAdmin ? {
2122
+ (e = I(s).sessionUser.value) != null && e.role.isAdmin ? {
2061
2123
  name: "side-sheet-header",
2062
- fn: D(() => {
2124
+ fn: R(() => {
2063
2125
  var o;
2064
2126
  return [
2065
- a("div", En, [
2066
- a("div", Fn, [
2127
+ a("div", Nn, [
2128
+ a("div", Dn, [
2067
2129
  m[3] || (m[3] = a("div", { class: "fm-typo-en-title-md-600" }, "NetSuite Integration", -1)),
2068
- a("div", Ln, [
2069
- I(c, {
2070
- name: x(A),
2130
+ a("div", Rn, [
2131
+ x(d, {
2132
+ name: I(y),
2071
2133
  size: "sm"
2072
2134
  }, null, 8, ["name"]),
2073
- a("div", Vn, T((o = x(k)._currentLocation) == null ? void 0 : o.name), 1)
2135
+ a("div", Mn, j((o = I(S)._currentLocation) == null ? void 0 : o.name), 1)
2074
2136
  ])
2075
2137
  ]),
2076
- I(u, {
2138
+ x(c, {
2077
2139
  "model-value": l.value,
2078
2140
  "onUpdate:modelValue": m[0] || (m[0] = (B) => l.value = B),
2079
- items: g
2141
+ items: v
2080
2142
  }, null, 8, ["model-value"])
2081
2143
  ])
2082
2144
  ];
@@ -2086,35 +2148,35 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
2086
2148
  ]), 1032, ["modelValue"]);
2087
2149
  };
2088
2150
  }
2089
- }), Mn = { class: "flex justify-center" }, jn = ["src"], On = { class: "flex flex-col items-center gap-2" }, Tn = { class: "text-lg font-bold" }, zn = { class: "text-fm-color-neutral-gray-300" }, Hn = /* @__PURE__ */ Y({
2151
+ }), zn = { class: "flex justify-center" }, Hn = ["src"], _n = { class: "flex flex-col items-center gap-2" }, Xn = { class: "text-lg font-bold" }, Un = { class: "text-fm-color-neutral-gray-300" }, Qn = /* @__PURE__ */ Y({
2090
2152
  __name: "NetSuite",
2091
2153
  setup(F) {
2092
- const v = le(), s = ne(), d = j(!1), n = j(!1);
2154
+ const g = le(), s = te(), i = M(!1), n = M(!1);
2093
2155
  async function t() {
2094
2156
  n.value = !0;
2095
2157
  }
2096
- const r = j([]);
2158
+ const u = M([]);
2097
2159
  ze(async () => {
2098
- if (v.isReady && v.isEnabled) {
2099
- d.value = !0;
2160
+ if (g.isReady && g.isEnabled) {
2161
+ i.value = !0;
2100
2162
  try {
2101
- const k = await v.getNetSuiteLocationOptions();
2102
- r.value = k;
2163
+ const S = await g.getNetSuiteLocationOptions();
2164
+ u.value = S;
2103
2165
  } catch {
2104
2166
  s.open({
2105
2167
  message: "Failed to fetch NetSuite locations",
2106
2168
  type: "error"
2107
2169
  });
2108
2170
  } finally {
2109
- d.value = !1;
2171
+ i.value = !1;
2110
2172
  }
2111
2173
  }
2112
2174
  });
2113
- const { t: h } = G();
2114
- return (k, A) => {
2115
- const g = E("FmCardSection"), l = E("FmCard");
2116
- return x(v).isEnabled ? (w(), R(J, { key: 0 }, [
2117
- I(l, {
2175
+ const { t: b } = G();
2176
+ return (S, y) => {
2177
+ const v = E("FmCardSection"), l = E("FmCard");
2178
+ return I(g).isEnabled ? (w(), V(J, { key: 0 }, [
2179
+ x(l, {
2118
2180
  class: q({
2119
2181
  "w-full": !0,
2120
2182
  border: !0,
@@ -2122,20 +2184,20 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
2122
2184
  "cursor-pointer": !0,
2123
2185
  "hover:border-fm-color-primary": !0
2124
2186
  }),
2125
- onClick: A[0] || (A[0] = (i) => t())
2187
+ onClick: y[0] || (y[0] = (r) => t())
2126
2188
  }, {
2127
- default: D(() => [
2128
- I(g, null, {
2129
- default: D(() => [
2130
- a("div", Mn, [
2189
+ default: R(() => [
2190
+ x(v, null, {
2191
+ default: R(() => [
2192
+ a("div", zn, [
2131
2193
  a("img", {
2132
- src: x(Zt),
2194
+ src: I(Zt),
2133
2195
  alt: "NetSuite"
2134
- }, null, 8, jn)
2196
+ }, null, 8, Hn)
2135
2197
  ]),
2136
- a("div", On, [
2137
- a("div", Tn, T(x(h)("inventory.integration.netsuite.title")), 1),
2138
- a("div", zn, T(x(h)("inventory.integration.netsuite.description")), 1)
2198
+ a("div", _n, [
2199
+ a("div", Xn, j(I(b)("inventory.integration.netsuite.title")), 1),
2200
+ a("div", Un, j(I(b)("inventory.integration.netsuite.description")), 1)
2139
2201
  ])
2140
2202
  ]),
2141
2203
  _: 1
@@ -2143,42 +2205,42 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
2143
2205
  ]),
2144
2206
  _: 1
2145
2207
  }),
2146
- x(v).state.setting ? (w(), X(ue, {
2208
+ I(g).state.setting ? (w(), X(ue, {
2147
2209
  key: 0,
2148
2210
  to: "body"
2149
2211
  }, [
2150
- x(v).isBusinessLocation ? (w(), X(cn, {
2212
+ I(g).isBusinessLocation ? (w(), X(dn, {
2151
2213
  key: 0,
2152
- setting: x(v).state.setting,
2153
- "onUpdate:setting": A[1] || (A[1] = (i) => x(v).state.setting = i),
2154
- nsLocations: r.value,
2155
- "onUpdate:nsLocations": A[2] || (A[2] = (i) => r.value = i),
2214
+ setting: I(g).state.setting,
2215
+ "onUpdate:setting": y[1] || (y[1] = (r) => I(g).state.setting = r),
2216
+ nsLocations: u.value,
2217
+ "onUpdate:nsLocations": y[2] || (y[2] = (r) => u.value = r),
2156
2218
  show: n.value,
2157
2219
  "onUpdate:show": [
2158
- A[3] || (A[3] = (i) => n.value = i),
2159
- A[4] || (A[4] = (i) => n.value = i)
2220
+ y[3] || (y[3] = (r) => n.value = r),
2221
+ y[4] || (y[4] = (r) => n.value = r)
2160
2222
  ],
2161
- loading: d.value,
2162
- "onUpdate:loading": A[5] || (A[5] = (i) => d.value = i)
2163
- }, null, 8, ["setting", "nsLocations", "show", "loading"])) : (w(), X(Dn, {
2223
+ loading: i.value,
2224
+ "onUpdate:loading": y[5] || (y[5] = (r) => i.value = r)
2225
+ }, null, 8, ["setting", "nsLocations", "show", "loading"])) : (w(), X(Tn, {
2164
2226
  key: 1,
2165
- setting: x(v).state.setting,
2166
- "onUpdate:setting": A[6] || (A[6] = (i) => x(v).state.setting = i),
2167
- nsLocations: r.value,
2168
- "onUpdate:nsLocations": A[7] || (A[7] = (i) => r.value = i),
2227
+ setting: I(g).state.setting,
2228
+ "onUpdate:setting": y[6] || (y[6] = (r) => I(g).state.setting = r),
2229
+ nsLocations: u.value,
2230
+ "onUpdate:nsLocations": y[7] || (y[7] = (r) => u.value = r),
2169
2231
  show: n.value,
2170
2232
  "onUpdate:show": [
2171
- A[8] || (A[8] = (i) => n.value = i),
2172
- A[9] || (A[9] = (i) => n.value = i)
2233
+ y[8] || (y[8] = (r) => n.value = r),
2234
+ y[9] || (y[9] = (r) => n.value = r)
2173
2235
  ],
2174
- loading: d.value,
2175
- "onUpdate:loading": A[10] || (A[10] = (i) => d.value = i)
2236
+ loading: i.value,
2237
+ "onUpdate:loading": y[10] || (y[10] = (r) => i.value = r)
2176
2238
  }, null, 8, ["setting", "nsLocations", "show", "loading"]))
2177
2239
  ])) : _("", !0)
2178
2240
  ], 64)) : _("", !0);
2179
2241
  };
2180
2242
  }
2181
- }), he = [
2243
+ }), xe = [
2182
2244
  "store",
2183
2245
  "issueBy",
2184
2246
  "verifiedBy",
@@ -2195,65 +2257,65 @@ const Bt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-1
2195
2257
  "schemeFranchiseePrice",
2196
2258
  "physicalSchemeTotalFranchiseePrice"
2197
2259
  ];
2198
- async function _n(F, v, s) {
2199
- var r;
2200
- const d = await Xn(s), n = [], t = {};
2201
- for (const h in d) {
2202
- const k = d[h];
2203
- for (let A = 0; A < k.length; A++) {
2204
- const g = k[A], l = g.itemCode, i = g.itemName, b = g.physicalQty, C = g.customCost;
2260
+ async function Yn(F, g, s) {
2261
+ var u;
2262
+ const i = await Jn(s), n = [], t = {};
2263
+ for (const b in i) {
2264
+ const S = i[b];
2265
+ for (let y = 0; y < S.length; y++) {
2266
+ const v = S[y], l = v.itemCode, r = v.itemName, h = v.physicalQty, C = v.customCost;
2205
2267
  if (l === "" || l === "undefined") {
2206
2268
  n.push({
2207
- row: g.excelRow,
2269
+ row: v.excelRow,
2208
2270
  itemCode: l,
2209
- itemName: i,
2271
+ itemName: r,
2210
2272
  message: "Item code is empty or undefined"
2211
2273
  });
2212
2274
  continue;
2213
2275
  }
2214
- const S = v.find((y) => y.code === l);
2215
- if (!S) {
2276
+ const k = g.find((A) => A.code === l);
2277
+ if (!k) {
2216
2278
  n.push({
2217
- row: g.excelRow,
2279
+ row: v.excelRow,
2218
2280
  itemCode: l,
2219
- itemName: i,
2220
- qty: b,
2281
+ itemName: r,
2282
+ qty: h,
2221
2283
  message: "Item not found in inventory"
2222
- }), console.error(`${g.excelRow} Item not found: ${l} ${i} ${b}`);
2284
+ }), console.error(`${v.excelRow} Item not found: ${l} ${r} ${h}`);
2223
2285
  continue;
2224
2286
  }
2225
- let p = Number(g.totalPhysicalCustomCost);
2226
- const m = F[S._id];
2227
- m && (p = m * Number(b));
2228
- const c = P.fromNumber(Number(b)), u = {
2229
- amount: c,
2287
+ let p = Number(v.totalPhysicalCustomCost);
2288
+ const m = F[k._id];
2289
+ m && (p = m * Number(h));
2290
+ const d = P.fromNumber(Number(h)), c = {
2291
+ amount: d,
2230
2292
  cost: {
2231
2293
  ...P.fromNumber(Number(p)),
2232
2294
  currency: "MYR"
2233
2295
  }
2234
2296
  };
2235
- b != "0" && C == "0" && console.warn(`Item ${l} ${i} has 0 cost.`), t[r = S._id] ?? (t[r] = {
2297
+ h != "0" && C == "0" && console.warn(`Item ${l} ${r} has 0 cost.`), t[u = k._id] ?? (t[u] = {
2236
2298
  skuAdjustment: {
2237
- sku: S,
2299
+ sku: k,
2238
2300
  fromBalance: P.fromNumber(0),
2239
2301
  amounts: [
2240
2302
  {
2241
2303
  _id: null,
2242
2304
  type: we.Enum.CLOSING,
2243
2305
  remark: "Opening Balance",
2244
- amount: c,
2306
+ amount: d,
2245
2307
  measurement: null,
2246
2308
  // always the smallest unit
2247
- cost: u.cost
2309
+ cost: c.cost
2248
2310
  }
2249
2311
  ],
2250
- toBalance: c,
2251
- toCostBalances: [u]
2312
+ toBalance: d,
2313
+ toCostBalances: [c]
2252
2314
  },
2253
2315
  skuBalance: {
2254
- id: S._id,
2255
- balance: c,
2256
- costs: [u]
2316
+ id: k._id,
2317
+ balance: d,
2318
+ costs: [c]
2257
2319
  }
2258
2320
  });
2259
2321
  }
@@ -2263,45 +2325,45 @@ async function _n(F, v, s) {
2263
2325
  rows: t
2264
2326
  };
2265
2327
  }
2266
- async function Xn(F) {
2267
- const v = await new Promise((t, r) => {
2268
- const h = new FileReader();
2269
- h.onload = (k) => t(k.target.result), h.onerror = r, h.readAsArrayBuffer(F);
2270
- }), s = ke(v, { type: "array" }), d = s.SheetNames, n = {};
2271
- for (const t of d) {
2272
- const r = await Un(s.Sheets[t]);
2273
- n[t] = r;
2328
+ async function Jn(F) {
2329
+ const g = await new Promise((t, u) => {
2330
+ const b = new FileReader();
2331
+ b.onload = (S) => t(S.target.result), b.onerror = u, b.readAsArrayBuffer(F);
2332
+ }), s = ke(g, { type: "array" }), i = s.SheetNames, n = {};
2333
+ for (const t of i) {
2334
+ const u = await Kn(s.Sheets[t]);
2335
+ n[t] = u;
2274
2336
  }
2275
2337
  return n;
2276
2338
  }
2277
- async function Un(F) {
2278
- const v = Be.sheet_to_json(F, {
2279
- header: he,
2339
+ async function Kn(F) {
2340
+ const g = Be.sheet_to_json(F, {
2341
+ header: xe,
2280
2342
  range: 12
2281
2343
  }), s = [];
2282
- for (let d = 0; d < v.length; d++) {
2283
- const n = v[d], t = {};
2284
- for (const r of he)
2285
- t[r] = String(n[r]).trim();
2344
+ for (let i = 0; i < g.length; i++) {
2345
+ const n = g[i], t = {};
2346
+ for (const u of xe)
2347
+ t[u] = String(n[u]).trim();
2286
2348
  s.push({
2287
2349
  ...t,
2288
- excelRow: d + 13
2350
+ excelRow: i + 13
2289
2351
  // Excel rows start from 1, and we skip the first 12 rows
2290
2352
  });
2291
2353
  }
2292
2354
  return s;
2293
2355
  }
2294
- const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn = {
2356
+ const Zn = { class: "flex flex-col gap-4" }, qn = { class: "flex flex-col" }, Gn = {
2295
2357
  key: 0,
2296
2358
  class: "flex flex-col gap-4 my-5"
2297
- }, Kn = { class: "flex flex-col gap-8" }, Zn = { class: "flex flex-col gap-8" }, qn = {
2359
+ }, Pn = { class: "flex flex-col gap-8" }, Wn = { class: "flex flex-col gap-8" }, $n = {
2298
2360
  class: /* @__PURE__ */ q(["fm-corner-radius-md p-16 flex items-center gap-16"])
2299
- }, Gn = {
2361
+ }, eo = {
2300
2362
  class: /* @__PURE__ */ q(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
2301
- }, Pn = { class: "line-clamp-2 text-ellipsis break-all" }, Wn = { class: "flex flex-col" }, $n = { class: "font-medium" }, eo = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, to = { class: "flex" }, no = { class: "flex" }, oo = { key: 1 }, so = /* @__PURE__ */ Y({
2363
+ }, to = { class: "line-clamp-2 text-ellipsis break-all" }, no = { class: "flex flex-col" }, oo = { class: "font-medium" }, so = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, ao = { class: "flex" }, lo = { class: "flex" }, io = { key: 1 }, ro = /* @__PURE__ */ Y({
2302
2364
  __name: "XilnexOpeningImport",
2303
2365
  setup(F) {
2304
- const v = Ge(), s = le(), d = ye(), n = Ce(), t = ne(), r = z(() => [
2366
+ const g = Ge(), s = le(), i = be(), n = Ce(), t = te(), u = z(() => [
2305
2367
  {
2306
2368
  value: "xilnex",
2307
2369
  label: "Xilnex",
@@ -2316,15 +2378,15 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2316
2378
  disabledReason: "Current location is not binded to NetSuite"
2317
2379
  }
2318
2380
  ] : []
2319
- ]), h = j(r.value[0].value), { t: k } = de(), A = j(null), g = j(), l = j(""), i = j([]), b = j([]), C = [
2381
+ ]), b = M(u.value[0].value), { t: S } = de(), y = M(null), v = M(), l = M(""), r = M([]), h = M([]), C = [
2320
2382
  {
2321
2383
  id: "ingredient",
2322
2384
  header: () => "Ingredient",
2323
2385
  cell(e) {
2324
2386
  const o = e.row.original;
2325
- return N("div", { class: "flex flex-col" }, [
2326
- N("span", { class: "font-medium" }, o.skuAdjustment.sku.name),
2327
- N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2387
+ return D("div", { class: "flex flex-col" }, [
2388
+ D("span", { class: "font-medium" }, o.skuAdjustment.sku.name),
2389
+ D("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2328
2390
  o.skuAdjustment.sku.code
2329
2391
  ])
2330
2392
  ]);
@@ -2335,8 +2397,8 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2335
2397
  header: () => "Opening Balance",
2336
2398
  cell(e) {
2337
2399
  const o = e.row.original;
2338
- return N("div", { class: "flex flex-col" }, [
2339
- N(
2400
+ return D("div", { class: "flex flex-col" }, [
2401
+ D(
2340
2402
  "span",
2341
2403
  { class: "font-medium" },
2342
2404
  P.toFormatString({
@@ -2353,14 +2415,14 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2353
2415
  const o = e.row.original, B = !o.skuAdjustment.amounts[0].measurement;
2354
2416
  let L = o.skuAdjustment.sku.unit.name;
2355
2417
  if (!B) {
2356
- const V = o.skuAdjustment.sku.unit.measurements.find(
2418
+ const N = o.skuAdjustment.sku.unit.measurements.find(
2357
2419
  (H) => H.id === o.skuAdjustment.amounts[0].measurement.id
2358
2420
  );
2359
- L = V ? V.name : "Error: Measurement not found";
2421
+ L = N ? N.name : "Error: Measurement not found";
2360
2422
  }
2361
- return N("div", { class: "flex flex-col" }, [
2362
- N("span", { class: "font-medium" }, L),
2363
- B ? null : N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2423
+ return D("div", { class: "flex flex-col" }, [
2424
+ D("span", { class: "font-medium" }, L),
2425
+ B ? null : D("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2364
2426
  `Base unit: ${o.skuAdjustment.sku.unit.name}`
2365
2427
  ])
2366
2428
  ]);
@@ -2375,8 +2437,8 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2375
2437
  precision: 0,
2376
2438
  currency: ""
2377
2439
  };
2378
- return N("div", { class: "flex flex-col" }, [
2379
- N(
2440
+ return D("div", { class: "flex flex-col" }, [
2441
+ D(
2380
2442
  "span",
2381
2443
  { class: "font-medium" },
2382
2444
  P.toFormatString({
@@ -2386,7 +2448,7 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2386
2448
  ]);
2387
2449
  }
2388
2450
  }
2389
- ], S = [
2451
+ ], k = [
2390
2452
  {
2391
2453
  accessorKey: "row",
2392
2454
  header: "Row"
@@ -2407,19 +2469,19 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2407
2469
  accessorKey: "message",
2408
2470
  header: "Error Message"
2409
2471
  }
2410
- ], p = j(!1);
2472
+ ], p = M(!1);
2411
2473
  async function m() {
2412
- if (A.value) {
2474
+ if (y.value) {
2413
2475
  p.value = !0;
2414
2476
  try {
2415
2477
  let e = {};
2416
- h.value === "netsuite" && (e = await s.getItemAverageCosts());
2417
- const { errors: o, rows: B } = await _n(
2478
+ b.value === "netsuite" && (e = await s.getItemAverageCosts());
2479
+ const { errors: o, rows: B } = await Yn(
2418
2480
  e,
2419
- d.skus,
2420
- A.value
2481
+ i.skus,
2482
+ y.value
2421
2483
  );
2422
- i.value = o, b.value = Object.values(B);
2484
+ r.value = o, h.value = Object.values(B);
2423
2485
  } catch {
2424
2486
  t.open({
2425
2487
  message: "Error verifying file",
@@ -2430,11 +2492,11 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2430
2492
  }
2431
2493
  }
2432
2494
  }
2433
- async function c() {
2434
- if (A.value) {
2495
+ async function d() {
2496
+ if (y.value) {
2435
2497
  p.value = !0;
2436
2498
  try {
2437
- if (!y.value) {
2499
+ if (!A.value) {
2438
2500
  t.open({
2439
2501
  message: "Please select a date for the opening balance",
2440
2502
  type: "error"
@@ -2442,13 +2504,13 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2442
2504
  return;
2443
2505
  }
2444
2506
  await n.setOpeningBalance({
2445
- effectiveAt: y.value,
2446
- skuAdjustments: b.value.map((e) => e.skuAdjustment),
2447
- skuBalances: b.value.map((e) => e.skuBalance)
2507
+ effectiveAt: A.value,
2508
+ skuAdjustments: h.value.map((e) => e.skuAdjustment),
2509
+ skuBalances: h.value.map((e) => e.skuBalance)
2448
2510
  }), t.open({
2449
2511
  message: "Opening balance imported successfully",
2450
2512
  type: "success"
2451
- }), await v.fetchClosingDocumentId();
2513
+ }), await g.fetchClosingDocumentId();
2452
2514
  } catch {
2453
2515
  t.open({
2454
2516
  message: "Error importing opening balance",
@@ -2459,73 +2521,73 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2459
2521
  }
2460
2522
  }
2461
2523
  }
2462
- const u = j(""), y = z({
2524
+ const c = M(""), A = z({
2463
2525
  get() {
2464
- return u.value;
2526
+ return c.value;
2465
2527
  },
2466
2528
  set(e) {
2467
- u.value = `${e}T15:59:59.999Z`;
2529
+ c.value = `${e}T15:59:59.999Z`;
2468
2530
  }
2469
2531
  }), f = z(() => {
2470
- if (!u.value) return null;
2471
- const e = new Date(u.value);
2472
- return isNaN(e.getTime()) ? null : ve(e);
2532
+ if (!c.value) return null;
2533
+ const e = new Date(c.value);
2534
+ return isNaN(e.getTime()) ? null : ye(e);
2473
2535
  });
2474
2536
  return (e, o) => {
2475
- const B = E("FmLabel"), L = E("FmField"), V = E("FmSimpleDatePicker"), H = E("FmButton"), U = E("FmRadio"), M = E("FmRadioGroup"), O = E("FmTable");
2476
- return w(), R("div", Qn, [
2477
- a("div", Yn, [
2478
- I(B, { label: "Latest closing" })
2537
+ const B = E("FmLabel"), L = E("FmField"), N = E("FmSimpleDatePicker"), H = E("FmButton"), U = E("FmRadio"), O = E("FmRadioGroup"), T = E("FmTable");
2538
+ return w(), V("div", Zn, [
2539
+ a("div", qn, [
2540
+ x(B, { label: "Latest closing" })
2479
2541
  ]),
2480
- I(L, {
2542
+ x(L, {
2481
2543
  "prepend-icon": "lock_outline",
2482
2544
  disabled: ""
2483
2545
  }, {
2484
- default: D(() => [
2485
- Z(T(x(v).state.closingDocumentId ? `${x(Ee)(new Date(x(ge)(x(v).state.closingDocumentId)))}` : "No closing found"), 1)
2546
+ default: R(() => [
2547
+ Z(j(I(g).state.closingDocumentId ? `${I(Ee)(new Date(I(Ae)(I(g).state.closingDocumentId)))}` : "No closing found"), 1)
2486
2548
  ]),
2487
2549
  _: 1
2488
2550
  }),
2489
- x(v).state.closingDocumentId ? (w(), R("div", oo, o[6] || (o[6] = [
2551
+ I(g).state.closingDocumentId ? (w(), V("div", io, o[6] || (o[6] = [
2490
2552
  a("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Not able to import opening balance as closing document already exists. ", -1)
2491
- ]))) : (w(), R("div", Jn, [
2492
- I(V, {
2493
- modelValue: y.value,
2494
- "onUpdate:modelValue": o[0] || (o[0] = (Q) => y.value = Q),
2553
+ ]))) : (w(), V("div", Gn, [
2554
+ x(N, {
2555
+ modelValue: A.value,
2556
+ "onUpdate:modelValue": o[0] || (o[0] = (Q) => A.value = Q),
2495
2557
  label: "Last closing time"
2496
2558
  }, {
2497
- "trigger-button": D(() => [
2498
- I(L, {
2559
+ "trigger-button": R(() => [
2560
+ x(L, {
2499
2561
  "prepend-icon": "calendar_today",
2500
2562
  readonly: "",
2501
2563
  label: "Last closing time"
2502
2564
  }, {
2503
- default: D(() => [
2504
- Z(T(f.value), 1)
2565
+ default: R(() => [
2566
+ Z(j(f.value), 1)
2505
2567
  ]),
2506
2568
  _: 1
2507
2569
  })
2508
2570
  ]),
2509
2571
  _: 1
2510
2572
  }, 8, ["modelValue"]),
2511
- a("div", Kn, [
2512
- I(B, { label: "Stock take file" })
2573
+ a("div", Pn, [
2574
+ x(B, { label: "Stock take file" })
2513
2575
  ]),
2514
- I(Fe, {
2576
+ x(Fe, {
2515
2577
  onFileUpload: o[1] || (o[1] = (Q) => {
2516
- Q && (A.value = Q);
2578
+ Q && (y.value = Q);
2517
2579
  }),
2518
2580
  accept: ".xlsx, .xls, .csv"
2519
2581
  }, oe({ _: 2 }, [
2520
- A.value ? {
2582
+ y.value ? {
2521
2583
  name: "default",
2522
- fn: D(({ openFileDialog: Q }) => [
2523
- a("div", Zn, [
2524
- a("div", qn, [
2525
- a("div", Gn, [
2526
- a("div", Pn, T(A.value.name), 1),
2527
- I(H, {
2528
- label: x(k)("inventory.ingredient.import.replaceFile"),
2584
+ fn: R(({ openFileDialog: Q }) => [
2585
+ a("div", Wn, [
2586
+ a("div", $n, [
2587
+ a("div", eo, [
2588
+ a("div", to, j(y.value.name), 1),
2589
+ x(H, {
2590
+ label: I(S)("inventory.ingredient.import.replaceFile"),
2529
2591
  variant: "secondary",
2530
2592
  "prepend-icon": "autorenew",
2531
2593
  onClick: Q
@@ -2537,24 +2599,24 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2537
2599
  key: "0"
2538
2600
  } : void 0
2539
2601
  ]), 1024),
2540
- I(M, {
2541
- modelValue: h.value,
2542
- "onUpdate:modelValue": o[2] || (o[2] = (Q) => h.value = Q),
2602
+ x(O, {
2603
+ modelValue: b.value,
2604
+ "onUpdate:modelValue": o[2] || (o[2] = (Q) => b.value = Q),
2543
2605
  label: "Retrieve cost from",
2544
2606
  class: "my-5"
2545
2607
  }, {
2546
- default: D(() => [
2547
- (w(!0), R(J, null, te(r.value, (Q) => (w(), X(U, {
2608
+ default: R(() => [
2609
+ (w(!0), V(J, null, $(u.value, (Q) => (w(), X(U, {
2548
2610
  key: Q.value,
2549
2611
  value: Q.value,
2550
2612
  label: Q.label,
2551
2613
  sublabel: Q.subLabel,
2552
2614
  disabled: Q.disabled
2553
2615
  }, {
2554
- label: D(() => [
2555
- a("div", Wn, [
2556
- a("span", $n, T(Q.label), 1),
2557
- a("span", eo, T(Q.disabled ? Q.disabledReason : Q.subLabel), 1)
2616
+ label: R(() => [
2617
+ a("div", no, [
2618
+ a("span", oo, j(Q.label), 1),
2619
+ a("span", so, j(Q.disabled ? Q.disabledReason : Q.subLabel), 1)
2558
2620
  ])
2559
2621
  ]),
2560
2622
  _: 2
@@ -2562,63 +2624,63 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2562
2624
  ]),
2563
2625
  _: 1
2564
2626
  }, 8, ["modelValue"]),
2565
- a("div", to, [
2566
- I(H, {
2627
+ a("div", ao, [
2628
+ x(H, {
2567
2629
  class: "ml-auto mt-4",
2568
2630
  variant: "secondary",
2569
2631
  "prepend-icon": "troubleshoot",
2570
2632
  label: "Verify",
2571
- disabled: !A.value && !p.value,
2633
+ disabled: !y.value && !p.value,
2572
2634
  loading: p.value,
2573
2635
  onClick: m
2574
2636
  }, null, 8, ["disabled", "loading"])
2575
2637
  ]),
2576
- A.value && b.value.length > 0 ? (w(), R(J, { key: 0 }, [
2638
+ y.value && h.value.length > 0 ? (w(), V(J, { key: 0 }, [
2577
2639
  o[4] || (o[4] = a("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
2578
- I(O, {
2579
- modelValue: g.value,
2580
- "onUpdate:modelValue": o[3] || (o[3] = (Q) => g.value = Q),
2581
- "row-data": b.value,
2640
+ x(T, {
2641
+ modelValue: v.value,
2642
+ "onUpdate:modelValue": o[3] || (o[3] = (Q) => v.value = Q),
2643
+ "row-data": h.value,
2582
2644
  "column-defs": C,
2583
2645
  "shrink-at": !1,
2584
2646
  "search-value": l.value
2585
2647
  }, null, 8, ["modelValue", "row-data", "search-value"])
2586
2648
  ], 64)) : _("", !0),
2587
- i.value.length > 0 ? (w(), R(J, { key: 1 }, [
2649
+ r.value.length > 0 ? (w(), V(J, { key: 1 }, [
2588
2650
  o[5] || (o[5] = a("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
2589
- I(O, {
2590
- "row-data": i.value,
2591
- "column-defs": S
2651
+ x(T, {
2652
+ "row-data": r.value,
2653
+ "column-defs": k
2592
2654
  }, null, 8, ["row-data"])
2593
2655
  ], 64)) : _("", !0),
2594
- a("div", no, [
2595
- b.value.length > 0 && !x(v).state.closingDocumentId ? (w(), X(H, {
2656
+ a("div", lo, [
2657
+ h.value.length > 0 && !I(g).state.closingDocumentId ? (w(), X(H, {
2596
2658
  key: 0,
2597
2659
  class: "ml-auto mt-4",
2598
2660
  "prepend-icon": "file_upload",
2599
2661
  variant: "primary",
2600
2662
  label: "Import Opening Balance",
2601
- disabled: !A.value || p.value,
2602
- onClick: c
2663
+ disabled: !y.value || p.value,
2664
+ onClick: d
2603
2665
  }, null, 8, ["disabled"])) : _("", !0)
2604
2666
  ])
2605
2667
  ]))
2606
2668
  ]);
2607
2669
  };
2608
2670
  }
2609
- }), ao = { class: "flex flex-col gap-8 w-full" }, lo = { class: "flex gap-4 justify-between" }, io = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, ro = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, uo = { key: 0 }, co = {
2671
+ }), uo = { class: "flex flex-col gap-8 w-full" }, co = { class: "flex gap-4 justify-between" }, mo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, fo = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, po = { key: 0 }, vo = {
2610
2672
  key: 1,
2611
2673
  class: "flex flex-col gap-8 w-full"
2612
- }, mo = { key: 1 }, fo = { class: "flex gap-8 items-center justify-start" }, po = /* @__PURE__ */ Y({
2674
+ }, go = { key: 1 }, yo = { class: "flex gap-8 items-center justify-start" }, Ao = /* @__PURE__ */ Y({
2613
2675
  __name: "XilnexSideSheet",
2614
2676
  props: {
2615
2677
  show: { type: Boolean },
2616
2678
  loading: { type: Boolean }
2617
2679
  },
2618
2680
  emits: ["update:show"],
2619
- setup(F, { emit: v }) {
2681
+ setup(F, { emit: g }) {
2620
2682
  var l;
2621
- const s = ie(), n = ae(F, "show"), { t } = G(), r = v, h = W(), k = ((l = h._currentLocation) == null ? void 0 : l.type) || "", A = [
2683
+ const s = ie(), n = ae(F, "show"), { t } = G(), u = g, b = W(), S = ((l = b._currentLocation) == null ? void 0 : l.type) || "", y = [
2622
2684
  { label: re(
2623
2685
  "openingBalance"
2624
2686
  /* OPENING_BALANCE */
@@ -2627,64 +2689,64 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2627
2689
  "transferNote"
2628
2690
  /* TRANSFER_NOTE */
2629
2691
  ) }
2630
- ], g = j(A[0]);
2631
- return (i, b) => {
2632
- var c;
2633
- const C = E("FmIcon"), S = E("FmButtonGroup"), p = E("FmButton"), m = E("FmSideSheet");
2692
+ ], v = M(y[0]);
2693
+ return (r, h) => {
2694
+ var d;
2695
+ const C = E("FmIcon"), k = E("FmButtonGroup"), p = E("FmButton"), m = E("FmSideSheet");
2634
2696
  return w(), X(m, {
2635
- modelValue: x(n),
2636
- "onUpdate:modelValue": b[2] || (b[2] = (u) => se(n) ? n.value = u : null),
2697
+ modelValue: I(n),
2698
+ "onUpdate:modelValue": h[2] || (h[2] = (c) => se(n) ? n.value = c : null),
2637
2699
  header: "Data migration (Xilnex)",
2638
2700
  "dismiss-away": "",
2639
2701
  "close-button": "",
2640
2702
  "max-width": 800
2641
2703
  }, oe({
2642
- default: D(() => {
2643
- var u;
2704
+ default: R(() => {
2705
+ var c;
2644
2706
  return [
2645
- (u = x(s).sessionUser.value) != null && u.role.isAdmin ? (w(), R("div", co, [
2646
- g.value.label === x(re)(
2707
+ (c = I(s).sessionUser.value) != null && c.role.isAdmin ? (w(), V("div", vo, [
2708
+ v.value.label === I(re)(
2647
2709
  "openingBalance"
2648
2710
  /* OPENING_BALANCE */
2649
- ) ? (w(), X(so, { key: 0 })) : _("", !0),
2650
- g.value.label === x(re)(
2711
+ ) ? (w(), X(ro, { key: 0 })) : _("", !0),
2712
+ v.value.label === I(re)(
2651
2713
  "transferNote"
2652
2714
  /* TRANSFER_NOTE */
2653
- ) ? (w(), R("div", mo, " Not available yet. ")) : _("", !0)
2654
- ])) : (w(), R("div", uo, " Please contact your administrator to apply the changes. "))
2715
+ ) ? (w(), V("div", go, " Not available yet. ")) : _("", !0)
2716
+ ])) : (w(), V("div", po, " Please contact your administrator to apply the changes. "))
2655
2717
  ];
2656
2718
  }),
2657
- "side-sheet-footer": D(() => [
2658
- a("div", fo, [
2659
- I(p, {
2719
+ "side-sheet-footer": R(() => [
2720
+ a("div", yo, [
2721
+ x(p, {
2660
2722
  variant: "tertiary",
2661
- label: x(t)("common.close"),
2662
- onClick: b[1] || (b[1] = (u) => r("update:show", !1))
2723
+ label: I(t)("common.close"),
2724
+ onClick: h[1] || (h[1] = (c) => u("update:show", !1))
2663
2725
  }, null, 8, ["label"])
2664
2726
  ])
2665
2727
  ]),
2666
2728
  _: 2
2667
2729
  }, [
2668
- (c = x(s).sessionUser.value) != null && c.role.isAdmin ? {
2730
+ (d = I(s).sessionUser.value) != null && d.role.isAdmin ? {
2669
2731
  name: "side-sheet-header",
2670
- fn: D(() => {
2671
- var u;
2732
+ fn: R(() => {
2733
+ var c;
2672
2734
  return [
2673
- a("div", ao, [
2674
- a("div", lo, [
2675
- b[3] || (b[3] = a("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Xilnex)", -1)),
2676
- a("div", io, [
2677
- I(C, {
2678
- name: x(k),
2735
+ a("div", uo, [
2736
+ a("div", co, [
2737
+ h[3] || (h[3] = a("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Xilnex)", -1)),
2738
+ a("div", mo, [
2739
+ x(C, {
2740
+ name: I(S),
2679
2741
  size: "sm"
2680
2742
  }, null, 8, ["name"]),
2681
- a("div", ro, T((u = x(h)._currentLocation) == null ? void 0 : u.name), 1)
2743
+ a("div", fo, j((c = I(b)._currentLocation) == null ? void 0 : c.name), 1)
2682
2744
  ])
2683
2745
  ]),
2684
- I(S, {
2685
- modelValue: g.value,
2686
- "onUpdate:modelValue": b[0] || (b[0] = (y) => g.value = y),
2687
- items: A
2746
+ x(k, {
2747
+ modelValue: v.value,
2748
+ "onUpdate:modelValue": h[0] || (h[0] = (A) => v.value = A),
2749
+ items: y
2688
2750
  }, null, 8, ["modelValue"])
2689
2751
  ])
2690
2752
  ];
@@ -2694,17 +2756,17 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2694
2756
  ]), 1032, ["modelValue"]);
2695
2757
  };
2696
2758
  }
2697
- }), vo = /* @__PURE__ */ Y({
2759
+ }), bo = /* @__PURE__ */ Y({
2698
2760
  __name: "XilnexView",
2699
2761
  setup(F) {
2700
- const v = Le(), s = W(), d = j(!1);
2762
+ const g = Le(), s = W(), i = M(!1);
2701
2763
  async function n() {
2702
- d.value = !0, console.log("Opening Xilnex migration dialog");
2764
+ i.value = !0, console.log("Opening Xilnex migration dialog");
2703
2765
  }
2704
- return (t, r) => {
2705
- const h = E("FmCardSection"), k = E("FmCard");
2706
- return x(v).enabledXilnexOpeningMigration && !x(s).businessLevel ? (w(), R(J, { key: 0 }, [
2707
- I(k, {
2766
+ return (t, u) => {
2767
+ const b = E("FmCardSection"), S = E("FmCard");
2768
+ return I(g).enabledXilnexOpeningMigration && !I(s).businessLevel ? (w(), V(J, { key: 0 }, [
2769
+ x(S, {
2708
2770
  class: q({
2709
2771
  "w-full": !0,
2710
2772
  border: !0,
@@ -2712,11 +2774,11 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2712
2774
  "cursor-pointer": !0,
2713
2775
  "hover:border-fm-color-primary": !0
2714
2776
  }),
2715
- onClick: r[0] || (r[0] = (A) => n())
2777
+ onClick: u[0] || (u[0] = (y) => n())
2716
2778
  }, {
2717
- default: D(() => [
2718
- I(h, null, {
2719
- default: D(() => r[2] || (r[2] = [
2779
+ default: R(() => [
2780
+ x(b, null, {
2781
+ default: R(() => u[2] || (u[2] = [
2720
2782
  a("div", { class: "flex justify-center" }, [
2721
2783
  a("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
2722
2784
  a("span", { class: "text-lg font-bold text-gray-600" }, "Xilnex")
@@ -2733,9 +2795,9 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2733
2795
  _: 1
2734
2796
  }),
2735
2797
  (w(), X(ue, { to: "body" }, [
2736
- I(po, {
2737
- show: d.value,
2738
- "onUpdate:show": r[1] || (r[1] = (A) => d.value = A)
2798
+ x(Ao, {
2799
+ show: i.value,
2800
+ "onUpdate:show": u[1] || (u[1] = (y) => i.value = y)
2739
2801
  }, null, 8, ["show"])
2740
2802
  ]))
2741
2803
  ], 64)) : _("", !0);
@@ -2751,63 +2813,63 @@ const Qn = { class: "flex flex-col gap-4" }, Yn = { class: "flex flex-col" }, Jn
2751
2813
  "quantity",
2752
2814
  "total"
2753
2815
  ];
2754
- async function go(F, v, s) {
2755
- var k;
2756
- const d = await yo(s), n = [], t = {}, r = Object.keys(d)[0], h = d[r];
2757
- for (let A = 0; A < h.length; A++) {
2758
- const g = h[A], l = g.code, i = g.description, b = g.quantity, C = g.unitcost;
2816
+ async function ho(F, g, s) {
2817
+ var S;
2818
+ const i = await xo(s), n = [], t = {}, u = Object.keys(i)[0], b = i[u];
2819
+ for (let y = 0; y < b.length; y++) {
2820
+ const v = b[y], l = v.code, r = v.description, h = v.quantity, C = v.unitcost;
2759
2821
  if (l === "" || l === "undefined") {
2760
2822
  n.push({
2761
- row: g.excelRow,
2823
+ row: v.excelRow,
2762
2824
  itemCode: l,
2763
- itemName: i,
2825
+ itemName: r,
2764
2826
  message: "Item code is empty or undefined"
2765
2827
  });
2766
2828
  continue;
2767
2829
  }
2768
- const S = v.find((y) => y.code === l);
2769
- if (!S) {
2830
+ const k = g.find((A) => A.code === l);
2831
+ if (!k) {
2770
2832
  n.push({
2771
- row: g.excelRow,
2833
+ row: v.excelRow,
2772
2834
  itemCode: l,
2773
- itemName: i,
2774
- qty: b,
2835
+ itemName: r,
2836
+ qty: h,
2775
2837
  message: "Item not found in inventory"
2776
- }), console.error(`${g.excelRow} Item not found: ${l} ${i} ${b}`);
2838
+ }), console.error(`${v.excelRow} Item not found: ${l} ${r} ${h}`);
2777
2839
  continue;
2778
2840
  }
2779
- let p = Number(g.total);
2780
- const m = F[S._id];
2781
- m && (p = m * Number(b));
2782
- const c = P.fromNumber(Number(b)), u = {
2783
- amount: c,
2841
+ let p = Number(v.total);
2842
+ const m = F[k._id];
2843
+ m && (p = m * Number(h));
2844
+ const d = P.fromNumber(Number(h)), c = {
2845
+ amount: d,
2784
2846
  cost: {
2785
2847
  ...P.fromNumber(Number(p)),
2786
2848
  currency: "MYR"
2787
2849
  }
2788
2850
  };
2789
- b != "0" && C == "0" && console.warn(`Item ${l} ${i} has 0 cost.`), t[k = S._id] ?? (t[k] = {
2851
+ h != "0" && C == "0" && console.warn(`Item ${l} ${r} has 0 cost.`), t[S = k._id] ?? (t[S] = {
2790
2852
  skuAdjustment: {
2791
- sku: S,
2853
+ sku: k,
2792
2854
  fromBalance: P.fromNumber(0),
2793
2855
  amounts: [
2794
2856
  {
2795
2857
  _id: null,
2796
2858
  type: we.Enum.CLOSING,
2797
2859
  remark: "Opening Balance",
2798
- amount: c,
2860
+ amount: d,
2799
2861
  measurement: null,
2800
2862
  // always the smallest unit
2801
- cost: u.cost
2863
+ cost: c.cost
2802
2864
  }
2803
2865
  ],
2804
- toBalance: c,
2805
- toCostBalances: [u]
2866
+ toBalance: d,
2867
+ toCostBalances: [c]
2806
2868
  },
2807
2869
  skuBalance: {
2808
- id: S._id,
2809
- balance: c,
2810
- costs: [u]
2870
+ id: k._id,
2871
+ balance: d,
2872
+ costs: [c]
2811
2873
  }
2812
2874
  });
2813
2875
  }
@@ -2816,59 +2878,59 @@ async function go(F, v, s) {
2816
2878
  rows: t
2817
2879
  };
2818
2880
  }
2819
- async function yo(F) {
2820
- const v = await new Promise((t, r) => {
2821
- const h = new FileReader();
2822
- h.onload = (k) => t(k.target.result), h.onerror = r, h.readAsArrayBuffer(F);
2823
- }), s = ke(v, { type: "array" }), d = s.SheetNames, n = {};
2824
- for (const t of d) {
2825
- const r = await Ao(s.Sheets[t]);
2826
- n[t] = r;
2881
+ async function xo(F) {
2882
+ const g = await new Promise((t, u) => {
2883
+ const b = new FileReader();
2884
+ b.onload = (S) => t(S.target.result), b.onerror = u, b.readAsArrayBuffer(F);
2885
+ }), s = ke(g, { type: "array" }), i = s.SheetNames, n = {};
2886
+ for (const t of i) {
2887
+ const u = await Io(s.Sheets[t]);
2888
+ n[t] = u;
2827
2889
  }
2828
2890
  return n;
2829
2891
  }
2830
- async function Ao(F) {
2831
- const v = Be.sheet_to_json(F, {
2892
+ async function Io(F) {
2893
+ const g = Be.sheet_to_json(F, {
2832
2894
  header: Ie,
2833
2895
  range: 1
2834
2896
  }), s = [];
2835
- for (let d = 0; d < v.length; d++) {
2836
- const n = v[d], t = {};
2837
- for (const r of Ie)
2838
- t[r] = String(n[r]).trim();
2897
+ for (let i = 0; i < g.length; i++) {
2898
+ const n = g[i], t = {};
2899
+ for (const u of Ie)
2900
+ t[u] = String(n[u]).trim();
2839
2901
  s.push({
2840
2902
  ...t,
2841
- excelRow: d + 2
2903
+ excelRow: i + 2
2842
2904
  // Excel rows start from 1, and we skip the first row
2843
2905
  });
2844
2906
  }
2845
2907
  return s;
2846
2908
  }
2847
- const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io = {
2909
+ const So = { class: "flex flex-col gap-4" }, wo = { class: "flex flex-col" }, ko = {
2848
2910
  key: 0,
2849
2911
  class: "flex flex-col gap-4 my-5"
2850
- }, xo = { class: "flex flex-col gap-8" }, So = { class: "flex flex-col gap-8" }, wo = {
2912
+ }, Bo = { class: "flex flex-col gap-8" }, Co = { class: "flex flex-col gap-8" }, Eo = {
2851
2913
  class: /* @__PURE__ */ q(["fm-corner-radius-md p-16 flex items-center gap-16"])
2852
- }, ko = {
2914
+ }, Fo = {
2853
2915
  class: /* @__PURE__ */ q(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
2854
- }, Bo = { class: "line-clamp-2 text-ellipsis break-all" }, Co = { class: "flex flex-col" }, Eo = { class: "font-medium" }, Fo = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Lo = { class: "flex" }, Vo = { class: "flex" }, No = { key: 1 }, Ro = /* @__PURE__ */ Y({
2916
+ }, Lo = { class: "line-clamp-2 text-ellipsis break-all" }, Vo = { class: "flex flex-col" }, No = { class: "font-medium" }, Do = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Ro = { class: "flex" }, Mo = { class: "flex" }, Oo = { key: 1 }, jo = /* @__PURE__ */ Y({
2855
2917
  __name: "SynergyOpeningImport",
2856
2918
  setup(F) {
2857
- const v = Pe(), s = ye(), d = Ce(), n = ne(), t = z(() => [
2919
+ const g = Pe(), s = be(), i = Ce(), n = te(), t = z(() => [
2858
2920
  {
2859
2921
  value: "synergy",
2860
2922
  label: "Synergy",
2861
2923
  subLabel: "Based on Synergy's item cost from excel file"
2862
2924
  }
2863
- ]), r = j(t.value[0].value), { t: h } = de(), k = j(null), A = j(), g = j(""), l = j([]), i = j([]), b = [
2925
+ ]), u = M(t.value[0].value), { t: b } = de(), S = M(null), y = M(), v = M(""), l = M([]), r = M([]), h = [
2864
2926
  {
2865
2927
  id: "ingredient",
2866
2928
  header: () => "Ingredient",
2867
2929
  cell(f) {
2868
2930
  const e = f.row.original;
2869
- return N("div", { class: "flex flex-col" }, [
2870
- N("span", { class: "font-medium" }, e.skuAdjustment.sku.name),
2871
- N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2931
+ return D("div", { class: "flex flex-col" }, [
2932
+ D("span", { class: "font-medium" }, e.skuAdjustment.sku.name),
2933
+ D("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2872
2934
  e.skuAdjustment.sku.code
2873
2935
  ])
2874
2936
  ]);
@@ -2879,8 +2941,8 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
2879
2941
  header: () => "Opening Balance",
2880
2942
  cell(f) {
2881
2943
  const e = f.row.original;
2882
- return N("div", { class: "flex flex-col" }, [
2883
- N(
2944
+ return D("div", { class: "flex flex-col" }, [
2945
+ D(
2884
2946
  "span",
2885
2947
  { class: "font-medium" },
2886
2948
  P.toFormatString({
@@ -2898,13 +2960,13 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
2898
2960
  let B = e.skuAdjustment.sku.unit.name;
2899
2961
  if (!o) {
2900
2962
  const L = e.skuAdjustment.sku.unit.measurements.find(
2901
- (V) => V.id === e.skuAdjustment.amounts[0].measurement.id
2963
+ (N) => N.id === e.skuAdjustment.amounts[0].measurement.id
2902
2964
  );
2903
2965
  B = L ? L.name : "Error: Measurement not found";
2904
2966
  }
2905
- return N("div", { class: "flex flex-col" }, [
2906
- N("span", { class: "font-medium" }, B),
2907
- o ? null : N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2967
+ return D("div", { class: "flex flex-col" }, [
2968
+ D("span", { class: "font-medium" }, B),
2969
+ o ? null : D("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2908
2970
  `Base unit: ${e.skuAdjustment.sku.unit.name}`
2909
2971
  ])
2910
2972
  ]);
@@ -2919,8 +2981,8 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
2919
2981
  precision: 0,
2920
2982
  currency: ""
2921
2983
  };
2922
- return N("div", { class: "flex flex-col" }, [
2923
- N(
2984
+ return D("div", { class: "flex flex-col" }, [
2985
+ D(
2924
2986
  "span",
2925
2987
  { class: "font-medium" },
2926
2988
  P.toFormatString({
@@ -2951,127 +3013,127 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
2951
3013
  accessorKey: "message",
2952
3014
  header: "Error Message"
2953
3015
  }
2954
- ], S = j(!1);
3016
+ ], k = M(!1);
2955
3017
  async function p() {
2956
- if (k.value) {
2957
- S.value = !0;
3018
+ if (S.value) {
3019
+ k.value = !0;
2958
3020
  try {
2959
3021
  let f = {};
2960
- const { errors: e, rows: o } = await go(
3022
+ const { errors: e, rows: o } = await ho(
2961
3023
  f,
2962
3024
  s.skus,
2963
- k.value
3025
+ S.value
2964
3026
  );
2965
- l.value = e, i.value = Object.values(o);
3027
+ l.value = e, r.value = Object.values(o);
2966
3028
  } catch {
2967
3029
  n.open({
2968
3030
  message: "Error verifying file",
2969
3031
  type: "error"
2970
3032
  });
2971
3033
  } finally {
2972
- S.value = !1;
3034
+ k.value = !1;
2973
3035
  }
2974
3036
  }
2975
3037
  }
2976
3038
  async function m() {
2977
- if (k.value) {
2978
- S.value = !0;
3039
+ if (S.value) {
3040
+ k.value = !0;
2979
3041
  try {
2980
- if (!u.value) {
3042
+ if (!c.value) {
2981
3043
  n.open({
2982
3044
  message: "Please select a date for the opening balance",
2983
3045
  type: "error"
2984
3046
  });
2985
3047
  return;
2986
3048
  }
2987
- await d.setOpeningBalance({
2988
- effectiveAt: u.value,
2989
- skuAdjustments: i.value.map((f) => f.skuAdjustment),
2990
- skuBalances: i.value.map((f) => f.skuBalance)
3049
+ await i.setOpeningBalance({
3050
+ effectiveAt: c.value,
3051
+ skuAdjustments: r.value.map((f) => f.skuAdjustment),
3052
+ skuBalances: r.value.map((f) => f.skuBalance)
2991
3053
  }), n.open({
2992
3054
  message: "Opening balance imported successfully",
2993
3055
  type: "success"
2994
- }), await v.fetchClosingDocumentId();
3056
+ }), await g.fetchClosingDocumentId();
2995
3057
  } catch {
2996
3058
  n.open({
2997
3059
  message: "Error importing opening balance",
2998
3060
  type: "error"
2999
3061
  });
3000
3062
  } finally {
3001
- S.value = !1;
3063
+ k.value = !1;
3002
3064
  }
3003
3065
  }
3004
3066
  }
3005
- const c = j(""), u = z({
3067
+ const d = M(""), c = z({
3006
3068
  get() {
3007
- return c.value;
3069
+ return d.value;
3008
3070
  },
3009
3071
  set(f) {
3010
- c.value = `${f}T15:59:59.999Z`;
3072
+ d.value = `${f}T15:59:59.999Z`;
3011
3073
  }
3012
- }), y = z(() => {
3013
- if (!c.value) return null;
3014
- const f = new Date(c.value);
3015
- return isNaN(f.getTime()) ? null : ve(f);
3074
+ }), A = z(() => {
3075
+ if (!d.value) return null;
3076
+ const f = new Date(d.value);
3077
+ return isNaN(f.getTime()) ? null : ye(f);
3016
3078
  });
3017
3079
  return (f, e) => {
3018
- const o = E("FmLabel"), B = E("FmField"), L = E("FmSimpleDatePicker"), V = E("FmButton"), H = E("FmRadio"), U = E("FmRadioGroup"), M = E("FmTable");
3019
- return w(), R("div", bo, [
3020
- a("div", ho, [
3021
- I(o, { label: "Latest closing" })
3080
+ const o = E("FmLabel"), B = E("FmField"), L = E("FmSimpleDatePicker"), N = E("FmButton"), H = E("FmRadio"), U = E("FmRadioGroup"), O = E("FmTable");
3081
+ return w(), V("div", So, [
3082
+ a("div", wo, [
3083
+ x(o, { label: "Latest closing" })
3022
3084
  ]),
3023
- I(B, {
3085
+ x(B, {
3024
3086
  "prepend-icon": "lock_outline",
3025
3087
  disabled: ""
3026
3088
  }, {
3027
- default: D(() => [
3028
- Z(T(x(v).state.closingDocumentId ? `${x(Ee)(new Date(x(ge)(x(v).state.closingDocumentId)))}` : "No closing found"), 1)
3089
+ default: R(() => [
3090
+ Z(j(I(g).state.closingDocumentId ? `${I(Ee)(new Date(I(Ae)(I(g).state.closingDocumentId)))}` : "No closing found"), 1)
3029
3091
  ]),
3030
3092
  _: 1
3031
3093
  }),
3032
- x(v).state.closingDocumentId ? (w(), R("div", No, e[6] || (e[6] = [
3094
+ I(g).state.closingDocumentId ? (w(), V("div", Oo, e[6] || (e[6] = [
3033
3095
  a("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Not able to import opening balance as closing document already exists. ", -1)
3034
- ]))) : (w(), R("div", Io, [
3035
- I(L, {
3036
- modelValue: u.value,
3037
- "onUpdate:modelValue": e[0] || (e[0] = (O) => u.value = O),
3096
+ ]))) : (w(), V("div", ko, [
3097
+ x(L, {
3098
+ modelValue: c.value,
3099
+ "onUpdate:modelValue": e[0] || (e[0] = (T) => c.value = T),
3038
3100
  label: "Last closing time"
3039
3101
  }, {
3040
- "trigger-button": D(() => [
3041
- I(B, {
3102
+ "trigger-button": R(() => [
3103
+ x(B, {
3042
3104
  "prepend-icon": "calendar_today",
3043
3105
  readonly: "",
3044
3106
  label: "Last closing time"
3045
3107
  }, {
3046
- default: D(() => [
3047
- Z(T(y.value), 1)
3108
+ default: R(() => [
3109
+ Z(j(A.value), 1)
3048
3110
  ]),
3049
3111
  _: 1
3050
3112
  })
3051
3113
  ]),
3052
3114
  _: 1
3053
3115
  }, 8, ["modelValue"]),
3054
- a("div", xo, [
3055
- I(o, { label: "Stock take file" })
3116
+ a("div", Bo, [
3117
+ x(o, { label: "Stock take file" })
3056
3118
  ]),
3057
- I(Fe, {
3058
- onFileUpload: e[1] || (e[1] = (O) => {
3059
- O && (k.value = O);
3119
+ x(Fe, {
3120
+ onFileUpload: e[1] || (e[1] = (T) => {
3121
+ T && (S.value = T);
3060
3122
  }),
3061
3123
  accept: ".xlsx, .xls, .csv"
3062
3124
  }, oe({ _: 2 }, [
3063
- k.value ? {
3125
+ S.value ? {
3064
3126
  name: "default",
3065
- fn: D(({ openFileDialog: O }) => [
3066
- a("div", So, [
3067
- a("div", wo, [
3068
- a("div", ko, [
3069
- a("div", Bo, T(k.value.name), 1),
3070
- I(V, {
3071
- label: x(h)("inventory.ingredient.import.replaceFile"),
3127
+ fn: R(({ openFileDialog: T }) => [
3128
+ a("div", Co, [
3129
+ a("div", Eo, [
3130
+ a("div", Fo, [
3131
+ a("div", Lo, j(S.value.name), 1),
3132
+ x(N, {
3133
+ label: I(b)("inventory.ingredient.import.replaceFile"),
3072
3134
  variant: "secondary",
3073
3135
  "prepend-icon": "autorenew",
3074
- onClick: O
3136
+ onClick: T
3075
3137
  }, null, 8, ["label", "onClick"])
3076
3138
  ])
3077
3139
  ])
@@ -3080,24 +3142,24 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3080
3142
  key: "0"
3081
3143
  } : void 0
3082
3144
  ]), 1024),
3083
- I(U, {
3084
- modelValue: r.value,
3085
- "onUpdate:modelValue": e[2] || (e[2] = (O) => r.value = O),
3145
+ x(U, {
3146
+ modelValue: u.value,
3147
+ "onUpdate:modelValue": e[2] || (e[2] = (T) => u.value = T),
3086
3148
  label: "Retrieve cost from",
3087
3149
  class: "my-5"
3088
3150
  }, {
3089
- default: D(() => [
3090
- (w(!0), R(J, null, te(t.value, (O) => (w(), X(H, {
3091
- key: O.value,
3092
- value: O.value,
3093
- label: O.label,
3094
- sublabel: O.subLabel,
3095
- disabled: O.disabled
3151
+ default: R(() => [
3152
+ (w(!0), V(J, null, $(t.value, (T) => (w(), X(H, {
3153
+ key: T.value,
3154
+ value: T.value,
3155
+ label: T.label,
3156
+ sublabel: T.subLabel,
3157
+ disabled: T.disabled
3096
3158
  }, {
3097
- label: D(() => [
3098
- a("div", Co, [
3099
- a("span", Eo, T(O.label), 1),
3100
- a("span", Fo, T(O.disabled ? O.disabledReason : O.subLabel), 1)
3159
+ label: R(() => [
3160
+ a("div", Vo, [
3161
+ a("span", No, j(T.label), 1),
3162
+ a("span", Do, j(T.disabled ? T.disabledReason : T.subLabel), 1)
3101
3163
  ])
3102
3164
  ]),
3103
3165
  _: 2
@@ -3105,43 +3167,43 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3105
3167
  ]),
3106
3168
  _: 1
3107
3169
  }, 8, ["modelValue"]),
3108
- a("div", Lo, [
3109
- I(V, {
3170
+ a("div", Ro, [
3171
+ x(N, {
3110
3172
  class: "ml-auto mt-4",
3111
3173
  variant: "secondary",
3112
3174
  "prepend-icon": "troubleshoot",
3113
3175
  label: "Verify",
3114
- disabled: !k.value && !S.value,
3115
- loading: S.value,
3176
+ disabled: !S.value && !k.value,
3177
+ loading: k.value,
3116
3178
  onClick: p
3117
3179
  }, null, 8, ["disabled", "loading"])
3118
3180
  ]),
3119
- k.value && i.value.length > 0 ? (w(), R(J, { key: 0 }, [
3181
+ S.value && r.value.length > 0 ? (w(), V(J, { key: 0 }, [
3120
3182
  e[4] || (e[4] = a("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
3121
- I(M, {
3122
- modelValue: A.value,
3123
- "onUpdate:modelValue": e[3] || (e[3] = (O) => A.value = O),
3124
- "row-data": i.value,
3125
- "column-defs": b,
3183
+ x(O, {
3184
+ modelValue: y.value,
3185
+ "onUpdate:modelValue": e[3] || (e[3] = (T) => y.value = T),
3186
+ "row-data": r.value,
3187
+ "column-defs": h,
3126
3188
  "shrink-at": !1,
3127
- "search-value": g.value
3189
+ "search-value": v.value
3128
3190
  }, null, 8, ["modelValue", "row-data", "search-value"])
3129
3191
  ], 64)) : _("", !0),
3130
- l.value.length > 0 ? (w(), R(J, { key: 1 }, [
3192
+ l.value.length > 0 ? (w(), V(J, { key: 1 }, [
3131
3193
  e[5] || (e[5] = a("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
3132
- I(M, {
3194
+ x(O, {
3133
3195
  "row-data": l.value,
3134
3196
  "column-defs": C
3135
3197
  }, null, 8, ["row-data"])
3136
3198
  ], 64)) : _("", !0),
3137
- a("div", Vo, [
3138
- i.value.length > 0 && !x(v).state.closingDocumentId ? (w(), X(V, {
3199
+ a("div", Mo, [
3200
+ r.value.length > 0 && !I(g).state.closingDocumentId ? (w(), X(N, {
3139
3201
  key: 0,
3140
3202
  class: "ml-auto mt-4",
3141
3203
  "prepend-icon": "file_upload",
3142
3204
  variant: "primary",
3143
3205
  label: "Import Opening Balance",
3144
- disabled: !k.value || S.value,
3206
+ disabled: !S.value || k.value,
3145
3207
  onClick: m
3146
3208
  }, null, 8, ["disabled"])) : _("", !0)
3147
3209
  ])
@@ -3149,63 +3211,63 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3149
3211
  ]);
3150
3212
  };
3151
3213
  }
3152
- }), Do = { class: "flex flex-col gap-8 w-full" }, Mo = { class: "flex gap-4 justify-between" }, jo = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, Oo = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, To = { key: 0 }, zo = {
3214
+ }), To = { class: "flex flex-col gap-8 w-full" }, zo = { class: "flex gap-4 justify-between" }, Ho = { class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 bg-fm-color-neutral-gray-100 text-fm-color-neutral-gray-400" }, _o = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Xo = { key: 0 }, Uo = {
3153
3215
  key: 1,
3154
3216
  class: "flex flex-col gap-8 w-full"
3155
- }, Ho = { class: "flex gap-8 items-center justify-start" }, _o = /* @__PURE__ */ Y({
3217
+ }, Qo = { class: "flex gap-8 items-center justify-start" }, Yo = /* @__PURE__ */ Y({
3156
3218
  __name: "SynergySideSheet",
3157
3219
  props: {
3158
3220
  show: { type: Boolean },
3159
3221
  loading: { type: Boolean }
3160
3222
  },
3161
3223
  emits: ["update:show"],
3162
- setup(F, { emit: v }) {
3163
- var A;
3164
- const s = ie(), n = ae(F, "show"), { t } = G(), r = v, h = W(), k = ((A = h._currentLocation) == null ? void 0 : A.type) || "";
3165
- return (g, l) => {
3166
- var S;
3167
- const i = E("FmIcon"), b = E("FmButton"), C = E("FmSideSheet");
3224
+ setup(F, { emit: g }) {
3225
+ var y;
3226
+ const s = ie(), n = ae(F, "show"), { t } = G(), u = g, b = W(), S = ((y = b._currentLocation) == null ? void 0 : y.type) || "";
3227
+ return (v, l) => {
3228
+ var k;
3229
+ const r = E("FmIcon"), h = E("FmButton"), C = E("FmSideSheet");
3168
3230
  return w(), X(C, {
3169
- modelValue: x(n),
3231
+ modelValue: I(n),
3170
3232
  "onUpdate:modelValue": l[1] || (l[1] = (p) => se(n) ? n.value = p : null),
3171
3233
  header: "Data migration (Synergy)",
3172
3234
  "dismiss-away": "",
3173
3235
  "close-button": "",
3174
3236
  "max-width": 800
3175
3237
  }, oe({
3176
- default: D(() => {
3238
+ default: R(() => {
3177
3239
  var p;
3178
3240
  return [
3179
- (p = x(s).sessionUser.value) != null && p.role.isAdmin ? (w(), R("div", zo, [
3180
- I(Ro)
3181
- ])) : (w(), R("div", To, " Please contact your administrator to apply the changes. "))
3241
+ (p = I(s).sessionUser.value) != null && p.role.isAdmin ? (w(), V("div", Uo, [
3242
+ x(jo)
3243
+ ])) : (w(), V("div", Xo, " Please contact your administrator to apply the changes. "))
3182
3244
  ];
3183
3245
  }),
3184
- "side-sheet-footer": D(() => [
3185
- a("div", Ho, [
3186
- I(b, {
3246
+ "side-sheet-footer": R(() => [
3247
+ a("div", Qo, [
3248
+ x(h, {
3187
3249
  variant: "tertiary",
3188
- label: x(t)("common.close"),
3189
- onClick: l[0] || (l[0] = (p) => r("update:show", !1))
3250
+ label: I(t)("common.close"),
3251
+ onClick: l[0] || (l[0] = (p) => u("update:show", !1))
3190
3252
  }, null, 8, ["label"])
3191
3253
  ])
3192
3254
  ]),
3193
3255
  _: 2
3194
3256
  }, [
3195
- (S = x(s).sessionUser.value) != null && S.role.isAdmin ? {
3257
+ (k = I(s).sessionUser.value) != null && k.role.isAdmin ? {
3196
3258
  name: "side-sheet-header",
3197
- fn: D(() => {
3259
+ fn: R(() => {
3198
3260
  var p;
3199
3261
  return [
3200
- a("div", Do, [
3201
- a("div", Mo, [
3262
+ a("div", To, [
3263
+ a("div", zo, [
3202
3264
  l[2] || (l[2] = a("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Synergy)", -1)),
3203
- a("div", jo, [
3204
- I(i, {
3205
- name: x(k),
3265
+ a("div", Ho, [
3266
+ x(r, {
3267
+ name: I(S),
3206
3268
  size: "sm"
3207
3269
  }, null, 8, ["name"]),
3208
- a("div", Oo, T((p = x(h)._currentLocation) == null ? void 0 : p.name), 1)
3270
+ a("div", _o, j((p = I(b)._currentLocation) == null ? void 0 : p.name), 1)
3209
3271
  ])
3210
3272
  ])
3211
3273
  ])
@@ -3216,17 +3278,17 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3216
3278
  ]), 1032, ["modelValue"]);
3217
3279
  };
3218
3280
  }
3219
- }), Xo = /* @__PURE__ */ Y({
3281
+ }), Jo = /* @__PURE__ */ Y({
3220
3282
  __name: "SynergyView",
3221
3283
  setup(F) {
3222
- const v = Le(), s = W(), d = j(!1);
3284
+ const g = Le(), s = W(), i = M(!1);
3223
3285
  async function n() {
3224
- d.value = !0, console.log("Opening Synergy migration dialog");
3286
+ i.value = !0, console.log("Opening Synergy migration dialog");
3225
3287
  }
3226
- return (t, r) => {
3227
- const h = E("FmCardSection"), k = E("FmCard");
3228
- return x(v).enabledSynergyOpeningMigration && !x(s).businessLevel ? (w(), R(J, { key: 0 }, [
3229
- I(k, {
3288
+ return (t, u) => {
3289
+ const b = E("FmCardSection"), S = E("FmCard");
3290
+ return I(g).enabledSynergyOpeningMigration && !I(s).businessLevel ? (w(), V(J, { key: 0 }, [
3291
+ x(S, {
3230
3292
  class: q({
3231
3293
  "w-full": !0,
3232
3294
  border: !0,
@@ -3234,11 +3296,11 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3234
3296
  "cursor-pointer": !0,
3235
3297
  "hover:border-fm-color-primary": !0
3236
3298
  }),
3237
- onClick: r[0] || (r[0] = (A) => n())
3299
+ onClick: u[0] || (u[0] = (y) => n())
3238
3300
  }, {
3239
- default: D(() => [
3240
- I(h, null, {
3241
- default: D(() => r[2] || (r[2] = [
3301
+ default: R(() => [
3302
+ x(b, null, {
3303
+ default: R(() => u[2] || (u[2] = [
3242
3304
  a("div", { class: "flex justify-center" }, [
3243
3305
  a("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
3244
3306
  a("span", { class: "text-lg font-bold text-gray-600" }, "Synergy")
@@ -3255,42 +3317,42 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3255
3317
  _: 1
3256
3318
  }),
3257
3319
  (w(), X(ue, { to: "body" }, [
3258
- I(_o, {
3259
- show: d.value,
3260
- "onUpdate:show": r[1] || (r[1] = (A) => d.value = A)
3320
+ x(Yo, {
3321
+ show: i.value,
3322
+ "onUpdate:show": u[1] || (u[1] = (y) => i.value = y)
3261
3323
  }, null, 8, ["show"])
3262
3324
  ]))
3263
3325
  ], 64)) : _("", !0);
3264
3326
  };
3265
3327
  }
3266
- }), Uo = { key: 0 }, Qo = {
3328
+ }), Ko = { key: 0 }, Zo = {
3267
3329
  key: 1,
3268
3330
  class: "flex flex-col items-center my-10 gap-5"
3269
- }, Yo = ["src"], Jo = {
3331
+ }, qo = ["src"], Go = {
3270
3332
  class: "text-xs text-neutral-400 text-center",
3271
3333
  style: { "max-width": "25rem" }
3272
- }, Ko = {
3334
+ }, Po = {
3273
3335
  key: 2,
3274
3336
  class: "grid grid-cols-2 gap-5"
3275
- }, ns = /* @__PURE__ */ Y({
3337
+ }, ls = /* @__PURE__ */ Y({
3276
3338
  __name: "IntegrationView",
3277
3339
  setup(F) {
3278
- const v = W(), s = j(!1), d = We(), { breakpoints: n } = Ve(), t = z(() => n.value.xs || n.value.sm), { t: r } = G();
3279
- return me(async () => {
3280
- if (v._currentLocation) {
3340
+ const g = W(), s = M(!1), i = We(), { breakpoints: n } = Ve(), t = z(() => n.value.xs || n.value.sm), { t: u } = G();
3341
+ return fe(async () => {
3342
+ if (g._currentLocation) {
3281
3343
  s.value = !0;
3282
3344
  try {
3283
- await d.fetchFoodMarketHubSetting(), await d.fetchNetSuiteSetting();
3345
+ await i.fetchFoodMarketHubSetting(), await i.fetchNetSuiteSetting();
3284
3346
  } finally {
3285
3347
  s.value = !1;
3286
3348
  }
3287
3349
  }
3288
- }), (h, k) => {
3289
- const A = E("FmCircularProgress");
3350
+ }), (b, S) => {
3351
+ const y = E("FmCircularProgress");
3290
3352
  return w(), X(Je, {
3291
- title: x(r)("inventory.integration.title")
3353
+ title: I(u)("inventory.integration.title")
3292
3354
  }, {
3293
- default: D(() => [
3355
+ default: R(() => [
3294
3356
  a("div", {
3295
3357
  class: q([
3296
3358
  "flex flex-col gap-8 max-h-full",
@@ -3300,26 +3362,26 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3300
3362
  }
3301
3363
  ])
3302
3364
  }, [
3303
- I(Ke, {
3365
+ x(Ke, {
3304
3366
  "change-location": "",
3305
3367
  showBusiness: ""
3306
3368
  }),
3307
- !x(v)._currentLocation || s.value ? (w(), R("div", Uo, [
3308
- I(A, { size: "lg" })
3309
- ])) : x(d).enabledIntegrations == 0 ? (w(), R("div", Qo, [
3369
+ !I(g)._currentLocation || s.value ? (w(), V("div", Ko, [
3370
+ x(y, { size: "lg" })
3371
+ ])) : I(i).enabledIntegrations == 0 ? (w(), V("div", Zo, [
3310
3372
  a("div", null, [
3311
3373
  a("img", {
3312
- src: x(He),
3374
+ src: I(He),
3313
3375
  alt: "List is empty"
3314
- }, null, 8, Yo)
3376
+ }, null, 8, qo)
3315
3377
  ]),
3316
- k[0] || (k[0] = a("div", { class: "font-bold text-lg" }, "Integration", -1)),
3317
- a("div", Jo, T(x(r)("inventory.integration.description")), 1)
3318
- ])) : (w(), R("div", Ko, [
3319
- I(Hn),
3320
- I(Kt),
3321
- I(vo),
3322
- I(Xo)
3378
+ S[0] || (S[0] = a("div", { class: "font-bold text-lg" }, "Integration", -1)),
3379
+ a("div", Go, j(I(u)("inventory.integration.description")), 1)
3380
+ ])) : (w(), V("div", Po, [
3381
+ x(Qn),
3382
+ x(Kt),
3383
+ x(bo),
3384
+ x(Jo)
3323
3385
  ]))
3324
3386
  ], 2)
3325
3387
  ]),
@@ -3329,5 +3391,5 @@ const bo = { class: "flex flex-col gap-4" }, ho = { class: "flex flex-col" }, Io
3329
3391
  }
3330
3392
  });
3331
3393
  export {
3332
- ns as default
3394
+ ls as default
3333
3395
  };