@feedmepos/mf-inventory-portal 1.0.36-dev.7 → 1.0.37-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{App-Cw7dAyRr.js → App-DomXC0uh.js} +46 -47
  2. package/dist/{ApprovalView-uzxVamAD.js → ApprovalView-DnINEwhh.js} +20 -20
  3. package/dist/{BindingsDialog-CjAyz7qd.js → BindingsDialog-MstJl2hJ.js} +10 -10
  4. package/dist/{BindingsPicker-VWQEClDc.js → BindingsPicker-BCgoeZK5.js} +1 -1
  5. package/dist/{BindingsTable-D_AidNg-.js → BindingsTable-knJs1DaE.js} +4 -4
  6. package/dist/{ClosingDraftView-DnPQE4xl.js → ClosingDraftView-Cg4siKrJ.js} +27 -27
  7. package/dist/{ClosingTemplateView-BzeUoP0S.js → ClosingTemplateView-D7nxxW1T.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-CQBfbvjK.js → DeliveryOrderPrintPreview-DUqWxzpS.js} +4 -4
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C5iYx065.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DMeIIyKI.js} +11 -11
  10. package/dist/{FmMultiselectDialog-DLZju68a.js → FmMultiselectDialog-H6rOzolY.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-elcx6AO6.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BAk4KHnz.js} +31 -31
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DMmGsyfI.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-SxPkPzU1.js} +1 -1
  13. package/dist/{IngredientGroupView-bFYU22r_.js → IngredientGroupView-CAA69KE_.js} +21 -21
  14. package/dist/{IngredientsView-BrfeKO6V.js → IngredientsView-BYhDmhQb.js} +42 -43
  15. package/dist/IntegrationView-CGBFyLWN.js +3303 -0
  16. package/dist/{InventoryBindingForm-DrNO6vLb.js → InventoryBindingForm-X-CFcWEY.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DU_Nt6VM.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CwV5nKPo.js} +18 -18
  18. package/dist/{InventoryBindingSummary-BztWC0Gi.js → InventoryBindingSummary-Cch1pODC.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-OvRfk02N.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Uc6h5Apn.js} +4 -4
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BsbrYUky.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BcWa_Dww.js} +10 -10
  21. package/dist/{PublishView-BwmvDibM.js → PublishView-DCAdzucX.js} +19 -19
  22. package/dist/{PurchaseOrderPrintPreview-DRo0ctOc.js → PurchaseOrderPrintPreview-IDiFQ15P.js} +12 -12
  23. package/dist/{ReceiveRequestView-yb4E_Dg6.js → ReceiveRequestView-7eslFHYc.js} +106 -107
  24. package/dist/{RecipeView-Dyf9kDoR.js → RecipeView-DOLJ5Gsx.js} +38 -39
  25. package/dist/{StockView-Cg-KD9qT.js → StockView-vCgmnyKT.js} +68 -69
  26. package/dist/{SupplierView-BtVTg_Ht.js → SupplierView-B6xdSB6T.js} +11 -12
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-lNmQ3zTi.js → TransferDetails.vue_vue_type_script_setup_true_lang-DrfHulTL.js} +105 -106
  28. package/dist/{TransferTemplateView-AUp2tI1x.js → TransferTemplateView-g1V3JX-5.js} +143 -144
  29. package/dist/{UnitView-BgbQjCfN.js → UnitView-BD28XnQL.js} +19 -19
  30. package/dist/{WarehouseView-BedfDS6s.js → WarehouseView-Cjgl43Xz.js} +14 -14
  31. package/dist/api/netsuite.d.ts +2 -0
  32. package/dist/app-dN4odAZ8.js +124833 -0
  33. package/dist/app.js +6 -6
  34. package/dist/{decimal-uKQOh7Qw.js → decimal-Blq-Ws2M.js} +1 -1
  35. package/dist/{format-unit-display-EMi6Weg0.js → format-unit-display-CzANmeBd.js} +13 -13
  36. package/dist/{index-B4jwhkHY.js → index-61_R9xfw.js} +3 -4
  37. package/dist/{index-BN_lVBL8.js → index-B8dsKHa4.js} +1 -1
  38. package/dist/{stock-SaEl13YM.js → stock-D7E6dj7b.js} +1 -1
  39. package/dist/stores/feature.d.ts +2 -0
  40. package/dist/stores/integration/netsuite.d.ts +1 -0
  41. package/dist/{supplier-hdrIxTLp.js → supplier-UeD3tjJh.js} +25 -26
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{use-ingredient-select-dialog-B7XYGX1J.js → use-ingredient-select-dialog-CydPG1Ol.js} +1 -1
  44. package/dist/{use-inventory-binding-dialog-t7XQb2UV.js → use-inventory-binding-dialog-DzRlrnI6.js} +1 -1
  45. package/dist/views/integration/components/netsuite/InventoryTransferOutTable.vue.d.ts +2 -0
  46. package/dist/{vue-i18n-DBsdCMy_.js → vue-i18n-D64xeCoR.js} +285 -285
  47. package/package.json +1 -1
  48. package/dist/IntegrationView-KlnDvvRE.js +0 -6531
  49. package/dist/app-nDgEuY-Q.js +0 -102338
  50. package/dist/feature-_ggdK-7_.js +0 -19100
@@ -0,0 +1,3303 @@
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 k, createElementBlock as R, createElementVNode as l, toDisplayString as T, unref as x, createVNode as I, createBlock as _, withCtx as D, Fragment as J, renderList as te, normalizeClass as q, normalizeStyle as Oe, createSlots as ne, createCommentVNode as X, withModifiers as Te, reactive as fe, watch as pe, isRef as oe, Teleport as ue, h as N, createTextVNode as Z, watchEffect as ze } from "vue";
2
+ import { E as He } from "./empty-placeholder-wf6-BWE8.js";
3
+ import { aY as Xe, aN as _e, f as $, u as W, aZ as Ue, b as le, j as Qe, aV as Se, al as ve, ay as ge, a as Ae, a2 as Ye, Q as P, $ as we, a_ as ke, aE as Be, aQ as Ce, s as Ee, y as Fe, a0 as re, c as Le, _ as Je, C as Ke } from "./app-dN4odAZ8.js";
4
+ import { useDialogChild as Ze, useDialog as ye, useProxiedModel as se, useSnackbar as ae, useBreakpoints as Ve, components as ee } from "@feedmepos/ui-library";
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-61_R9xfw.js";
7
+ import { u as de } from "./vue-i18n-D64xeCoR.js";
8
+ import { _ as $e, F as et } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BAk4KHnz.js";
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
+ var Ne = { exports: {} };
11
+ (function(F, g) {
12
+ (function() {
13
+ var s = {};
14
+ F.exports = s, s.simpleFilter = function(r, n) {
15
+ return n.filter(function(t) {
16
+ return s.test(r, t);
17
+ });
18
+ }, s.test = function(r, n) {
19
+ return s.match(r, n) !== null;
20
+ }, s.match = function(r, n, t) {
21
+ t = t || {};
22
+ var a = 0, d = [], b = n.length, A = 0, S = 0, p = t.pre || "", v = t.post || "", h = t.caseSensitive && n || n.toLowerCase(), C;
23
+ r = t.caseSensitive && r || r.toLowerCase();
24
+ for (var w = 0; w < b; w++)
25
+ C = n[w], h[w] === r[a] ? (C = p + C + v, a += 1, S += 1 + S) : S = 0, A += S, d[d.length] = C;
26
+ return a === r.length ? (A = h === r ? 1 / 0 : A, { rendered: d.join(""), score: A }) : null;
27
+ }, s.filter = function(r, n, t) {
28
+ return !n || n.length === 0 ? [] : typeof r != "string" ? n : (t = t || {}, n.reduce(function(a, d, b, A) {
29
+ var S = d;
30
+ t.extract && (S = t.extract(d));
31
+ var p = s.match(r, S, t);
32
+ return p != null && (a[a.length] = {
33
+ string: p.rendered,
34
+ score: p.score,
35
+ index: b,
36
+ original: d
37
+ }), a;
38
+ }, []).sort(function(a, d) {
39
+ var b = d.score - a.score;
40
+ return b || a.index - d.index;
41
+ }));
42
+ };
43
+ })();
44
+ })(Ne);
45
+ var nt = Ne.exports;
46
+ const Re = /* @__PURE__ */ Xe(nt);
47
+ function be(F, g) {
48
+ return Re.filter(F, g).length > 0;
49
+ }
50
+ function ot(F, g) {
51
+ if (!F)
52
+ return {
53
+ label: g,
54
+ segments: [
55
+ {
56
+ isMatch: !1,
57
+ segment: g
58
+ }
59
+ ],
60
+ matched: !1
61
+ };
62
+ const [s] = Re.filter(F.toLocaleLowerCase(), [g], {
63
+ pre: "|",
64
+ post: "|"
65
+ });
66
+ if (!s)
67
+ return {
68
+ label: g,
69
+ segments: [{ segment: g, isMatch: !1 }],
70
+ matched: !1
71
+ };
72
+ const r = s.string.toString().replace(/\|\|/g, "").split("|").reduce((n, t, a) => (n.push({
73
+ segment: t,
74
+ isMatch: a % 2 !== 0
75
+ //e.g. index 1, 3, 5, ...
76
+ }), n), new Array());
77
+ return {
78
+ label: g,
79
+ segments: r,
80
+ matched: !0
81
+ };
82
+ }
83
+ function K(F) {
84
+ return Object.prototype.hasOwnProperty.call(F, "children");
85
+ }
86
+ const st = { class: "flex flex-col gap-12 h-[350px]" }, at = { class: "flex items-center" }, lt = {
87
+ class: "flex-1",
88
+ "data-cy": "items-selected"
89
+ }, it = {
90
+ class: "flex-1",
91
+ "data-cy": "filter-field"
92
+ }, rt = ["data-cy"], ut = { class: "flex flex-col" }, dt = { class: "fm-typo-en-body-md-400" }, ct = {
93
+ key: 1,
94
+ class: "w-full py-16 text-fm-color-typo-disabled fm-typo-en-body-md-400 text-center"
95
+ }, De = /* @__PURE__ */ Y({
96
+ __name: "FmNestedMultiselectDialog",
97
+ props: /* @__PURE__ */ je({
98
+ modelValue: {}
99
+ }, {
100
+ modelValue: {},
101
+ modelModifiers: {}
102
+ }),
103
+ emits: ["update:modelValue"],
104
+ setup(F) {
105
+ const g = xe(F, "modelValue"), s = Ze();
106
+ me(() => {
107
+ s.emitData(g.value);
108
+ });
109
+ const r = j(""), { t: n } = G();
110
+ function t(e) {
111
+ return be(
112
+ r.value,
113
+ e.sublabel ? [e.label, e.sublabel] : [e.label]
114
+ );
115
+ }
116
+ function a(e) {
117
+ return t(e) ? !0 : K(e) ? e.children.some(a) : !1;
118
+ }
119
+ function d(e, o) {
120
+ if (!r.value)
121
+ return !0;
122
+ const [B, ...L] = e;
123
+ if (typeof B != "number")
124
+ return !1;
125
+ const V = o[B];
126
+ return be(
127
+ r.value,
128
+ V.sublabel ? [V.label, V.sublabel] : [V.label]
129
+ ) ? !0 : L.length === 0 ? a(V) : K(V) ? d(L, V.children) : !1;
130
+ }
131
+ function b(e, o, B = 0, L = !1) {
132
+ if (K(e) && e.children.length) {
133
+ const { children: V, ...H } = e, U = V.flatMap(
134
+ (M, O) => b(M, [...o, O], B + 1, L || e.disabled)
135
+ );
136
+ return [
137
+ {
138
+ ...H,
139
+ keys: o,
140
+ indent: B,
141
+ collapsible: !0,
142
+ disabled: L || e.disabled
143
+ },
144
+ ...U
145
+ ];
146
+ }
147
+ return [
148
+ {
149
+ ...e,
150
+ keys: o,
151
+ indent: B,
152
+ collapsible: !1,
153
+ disabled: L || e.disabled
154
+ }
155
+ ];
156
+ }
157
+ const A = z(() => g.value.flatMap(
158
+ (e, o) => b(e, [o]).filter((B) => d(B.keys, g.value))
159
+ ));
160
+ function S(e) {
161
+ if (K(e)) {
162
+ if (a(e)) {
163
+ const o = t(e) ? e.children : e.children.filter(a);
164
+ return o.length === 0 ? !1 : o.every(S);
165
+ }
166
+ return e.children.every(S);
167
+ }
168
+ return e.active ?? !1;
169
+ }
170
+ function p(e, o) {
171
+ const [B, ...L] = e;
172
+ if (typeof B != "number")
173
+ return !1;
174
+ const V = o[B];
175
+ return L.length === 0 ? S(V ?? []) : K(V) ? p(L, V.children ?? []) : !1;
176
+ }
177
+ function v(e) {
178
+ if (K(e)) {
179
+ if (a(e)) {
180
+ const o = t(e) ? e.children : e.children.filter(a);
181
+ return o.length === 0 ? !1 : o.some(S) && !o.every(S);
182
+ }
183
+ return !1;
184
+ }
185
+ return !1;
186
+ }
187
+ function h(e, o) {
188
+ const [B, ...L] = e;
189
+ if (typeof B != "number")
190
+ return !1;
191
+ const V = o[B];
192
+ return L.length === 0 ? v(V ?? []) : K(V) ? h(L, (V == null ? void 0 : V.children) ?? []) : !1;
193
+ }
194
+ function C(e, o) {
195
+ if (e.disabled)
196
+ return e;
197
+ if (K(e)) {
198
+ if (a(e)) {
199
+ const B = t(e) ? e.children : e.children.filter(a);
200
+ return {
201
+ ...e,
202
+ children: e.children.map((L) => B.find((H) => _e(H.value, L.value)) ? C(L, o) : L)
203
+ };
204
+ }
205
+ return {
206
+ ...e,
207
+ children: e.children.map((B) => C(B, o))
208
+ };
209
+ }
210
+ return {
211
+ ...e,
212
+ active: o
213
+ };
214
+ }
215
+ function w(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(
218
+ (H, U) => L === U && K(H) ? {
219
+ ...H,
220
+ children: w(V, H.children, B)
221
+ } : H
222
+ );
223
+ }
224
+ const f = j(new Array());
225
+ function c(e) {
226
+ const o = e.join();
227
+ return f.value.find((B) => o === B);
228
+ }
229
+ function u(e) {
230
+ const o = e.join();
231
+ c(e) ? f.value = f.value.filter((B) => B !== o) : f.value = [...f.value, o];
232
+ }
233
+ function i(e) {
234
+ const o = e.join();
235
+ return f.value.find((B) => o.startsWith(B) && o !== B);
236
+ }
237
+ const y = z(
238
+ () => A.value.filter((e) => d(e.keys, g.value) && e.active).length
239
+ );
240
+ function m(e, o, B) {
241
+ g.value = w(e, o, B), s.emitData(g.value);
242
+ }
243
+ return (e, o) => {
244
+ const B = E("FmSearch"), L = E("FmCheckbox"), V = E("FmButton"), H = E("FmListItem"), U = E("FmList");
245
+ return k(), R("div", st, [
246
+ l("div", at, [
247
+ l("div", lt, T(x(n)("inventory.formField.itemsSelected", { count: y.value })), 1),
248
+ l("div", it, [
249
+ I(B, {
250
+ modelValue: r.value,
251
+ "onUpdate:modelValue": o[0] || (o[0] = (M) => r.value = M),
252
+ placeholder: x(n)("inventory.formField.filterItems")
253
+ }, null, 8, ["modelValue", "placeholder"])
254
+ ])
255
+ ]),
256
+ A.value.length ? (k(), _(U, {
257
+ key: 0,
258
+ class: "flex-1 overflow-y-auto"
259
+ }, {
260
+ default: D(() => [
261
+ (k(!0), R(J, null, te(A.value, (M) => (k(), R("div", {
262
+ key: M.keys.join(),
263
+ class: q([
264
+ "transition-all overflow-y-clip",
265
+ i(M.keys) ? "max-h-0 opacity-0" : "max-h-[50px] opacity-100"
266
+ ]),
267
+ "data-cy": `nested-${M.keys.join("-")}-${M.label}`
268
+ }, [
269
+ I(H, {
270
+ clickable: M.selectable !== !1,
271
+ onClick: () => M.selectable === !1 || M.disabled || m(M.keys, g.value, !p(M.keys, g.value)),
272
+ style: Oe({
273
+ paddingLeft: `${16 + M.indent * 16}px`,
274
+ paddingTop: "4px",
275
+ paddingBottom: "4px"
276
+ }),
277
+ disabled: M.selectable !== !1 && M.disabled
278
+ }, ne({
279
+ default: D(() => [
280
+ l("div", ut, [
281
+ l("div", dt, [
282
+ (k(!0), R(J, null, te(x(ot)(r.value, M.label).segments, (O, Q) => (k(), R("span", {
283
+ key: Q,
284
+ class: q({
285
+ "font-bold": O.isMatch
286
+ })
287
+ }, T(O.segment), 3))), 128))
288
+ ]),
289
+ M.sublabel ? (k(), R("div", {
290
+ key: 0,
291
+ class: q([
292
+ "fm-typo-en-body-sm-400",
293
+ M.disabled ? "" : "text-fm-color-typo-secondary"
294
+ ])
295
+ }, T(M.sublabel), 3)) : X("", !0)
296
+ ])
297
+ ]),
298
+ _: 2
299
+ }, [
300
+ M.selectable !== !1 ? {
301
+ name: "prepend",
302
+ fn: D(() => [
303
+ I(L, {
304
+ disabled: M.disabled,
305
+ "model-value": p(M.keys, g.value),
306
+ value: M.keys,
307
+ indeterminate: h(M.keys, g.value)
308
+ }, null, 8, ["disabled", "model-value", "value", "indeterminate"])
309
+ ]),
310
+ key: "0"
311
+ } : void 0,
312
+ M.collapsible ? {
313
+ name: "append",
314
+ fn: D(() => [
315
+ I(V, {
316
+ "prepend-icon": c(M.keys) ? "expand_less" : "expand_more",
317
+ size: "md",
318
+ variant: "tertiary",
319
+ onClick: Te(() => u(M.keys), ["stop"])
320
+ }, null, 8, ["prepend-icon", "onClick"])
321
+ ]),
322
+ key: "1"
323
+ } : void 0
324
+ ]), 1032, ["clickable", "onClick", "style", "disabled"])
325
+ ], 10, rt))), 128))
326
+ ]),
327
+ _: 1
328
+ })) : (k(), R("div", ct, T(x(n)("inventory.formField.noItemsFound")), 1))
329
+ ]);
330
+ };
331
+ }
332
+ }), mt = { class: "flex flex-col rounded border border-fm-color-neutral-gray-100 px-5 py-5 gap-5" }, ft = { class: "flex items-center" }, pt = { class: "text-lg font-bold flex-grow" }, vt = {
333
+ key: 0,
334
+ class: "table-auto w-full"
335
+ }, gt = { class: "text-left" }, At = { class: "min-w-64" }, yt = { class: "flex flex-col" }, bt = { class: "fm-typo-en-body-md-400" }, ht = {
336
+ key: 0,
337
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
338
+ }, It = { class: "w-1" }, xt = /* @__PURE__ */ Y({
339
+ __name: "ApplyAddon",
340
+ props: {
341
+ groups: {
342
+ type: Array,
343
+ required: !0
344
+ },
345
+ modifiers: {
346
+ type: Array,
347
+ required: !0
348
+ },
349
+ items: {
350
+ type: Array,
351
+ required: !0
352
+ },
353
+ loading: {
354
+ type: Boolean
355
+ }
356
+ },
357
+ emits: ["update:modifiers"],
358
+ setup(F, { emit: g }) {
359
+ const s = F, r = g, n = ye(), t = z(() => {
360
+ const p = s.groups.flatMap((v) => v.items.map((h) => {
361
+ const C = s.items.find((w) => w._id === h._id);
362
+ return {
363
+ ...h,
364
+ groupName: v.name,
365
+ name: h.name ?? (C == null ? void 0 : C.name) ?? "-"
366
+ };
367
+ }));
368
+ return s.modifiers.map((v) => {
369
+ const h = p.find((f) => f.selection === v.selection), C = (h == null ? void 0 : h.name) ?? "-", w = (h == null ? void 0 : h.groupName) ?? "";
370
+ return {
371
+ ...v,
372
+ name: C,
373
+ groupName: w
374
+ };
375
+ });
376
+ }), a = z(() => s.groups.flatMap((p) => p.items.map((v) => ({ ...v, groupId: p._id }))));
377
+ function d({ selection: p }) {
378
+ r(
379
+ "update:modifiers",
380
+ s.modifiers.filter((v) => v.selection !== p)
381
+ );
382
+ }
383
+ function b({ selection: p }, v) {
384
+ const h = s.modifiers.find((C) => C.selection === p);
385
+ h && (h.code = v);
386
+ }
387
+ function A() {
388
+ let p = [];
389
+ s.groups.forEach((h) => {
390
+ let C = !1;
391
+ h.items.every((w) => w._id.startsWith("item")) && (C = !0), p.push({
392
+ label: h.name,
393
+ sublabel: "Group",
394
+ value: h._id,
395
+ disabled: C,
396
+ children: h.items.reduce((w, f) => {
397
+ var i;
398
+ const c = s.items.find((y) => y._id === f._id), u = (i = c == null ? void 0 : c.variant) == null ? void 0 : i.variantCombinations.find(
399
+ (y) => y.combinationKey === (f == null ? void 0 : f.combinationKey)
400
+ );
401
+ return [
402
+ ...w,
403
+ {
404
+ label: `${f.name ?? (c == null ? void 0 : c.name)} ${u ? `(${u.name})` : ""}`,
405
+ value: `${f.selection}${u ? `/${u == null ? void 0 : u.combinationKey}` : ""}`,
406
+ disabled: C,
407
+ active: !!s.modifiers.find(({ selection: y }) => y === f.selection)
408
+ }
409
+ ];
410
+ }, [])
411
+ });
412
+ });
413
+ const v = {
414
+ modelValue: p
415
+ };
416
+ n.open({
417
+ title: "Select Addons",
418
+ contentComponent: De,
419
+ contentComponentProps: v,
420
+ primaryActions: {
421
+ text: "Confirm",
422
+ close: !0
423
+ }
424
+ }).onPrimary((h) => {
425
+ const C = $(s.modifiers);
426
+ let w = [];
427
+ function f(c, u) {
428
+ if (u(c), K(c))
429
+ for (let i of c.children)
430
+ f(i, u);
431
+ }
432
+ h.forEach((c) => {
433
+ f(c, (u) => {
434
+ var e;
435
+ if (s.groups.find(({ _id: o }) => o === u.value)) return;
436
+ const y = a.value.find(({ selection: o }) => o === u.value), m = w.find(({ selection: o }) => u.value === o);
437
+ !K(u) && u.active && m === void 0 && w.push({
438
+ addonGroupId: (y == null ? void 0 : y.groupId) ?? "",
439
+ selection: u.value,
440
+ code: ((e = C.find(({ selection: o }) => u.value === o)) == null ? void 0 : e.code) ?? ""
441
+ });
442
+ });
443
+ }), r("update:modifiers", w);
444
+ });
445
+ }
446
+ const { t: S } = G();
447
+ return (p, v) => {
448
+ const h = E("FmButton"), C = E("FmTextField");
449
+ return k(), R("div", mt, [
450
+ l("div", ft, [
451
+ l("div", pt, T(x(S)("inventory.integration.apply.addons")), 1),
452
+ I(h, {
453
+ type: "button",
454
+ variant: "plain",
455
+ size: "md",
456
+ icon: "link",
457
+ label: x(S)("inventory.integration.apply.applyAddon"),
458
+ onClick: v[0] || (v[0] = (w) => A())
459
+ }, null, 8, ["label"])
460
+ ]),
461
+ l("div", null, [
462
+ t.value.length > 0 ? (k(), R("table", vt, [
463
+ l("tr", gt, [
464
+ l("th", At, T(x(S)("inventory.integration.apply.name")), 1),
465
+ l("th", null, T(x(S)("inventory.integration.apply.code")), 1),
466
+ v[1] || (v[1] = l("th", { class: "w-1" }, " ", -1))
467
+ ]),
468
+ (k(!0), R(J, null, te(t.value, (w, f) => (k(), R(J, { key: f }, [
469
+ v[2] || (v[2] = l("tr", { class: "block h-8" }, null, -1)),
470
+ l("tr", null, [
471
+ l("td", null, [
472
+ l("div", yt, [
473
+ l("div", bt, T(w.name), 1),
474
+ w.groupName ? (k(), R("div", ht, T(w.groupName), 1)) : X("", !0)
475
+ ])
476
+ ]),
477
+ l("td", null, [
478
+ I(C, {
479
+ disabled: F.loading,
480
+ "model-value": w.code,
481
+ "onUpdate:modelValue": [(c) => w.code = c, (c) => b(w, c)],
482
+ rules: [
483
+ function(u) {
484
+ return !!u || "Required";
485
+ }
486
+ ]
487
+ }, null, 8, ["disabled", "model-value", "onUpdate:modelValue", "rules"])
488
+ ]),
489
+ l("td", It, [
490
+ I(h, {
491
+ disabled: F.loading,
492
+ type: "button",
493
+ variant: "tertiary",
494
+ icon: "delete",
495
+ "icon-color": "#000000",
496
+ size: "md",
497
+ onClick: (c) => d(w)
498
+ }, null, 8, ["disabled", "onClick"])
499
+ ])
500
+ ])
501
+ ], 64))), 128))
502
+ ])) : X("", !0)
503
+ ])
504
+ ]);
505
+ };
506
+ }
507
+ });
508
+ function St(F, g = []) {
509
+ const s = g.map((n) => F.find((t) => t._id === n)).filter((n) => !!n);
510
+ return kt(s).reduce((n, t) => (n[t.combinationKey] = t.selectionName.join(" / "), n), {});
511
+ }
512
+ function wt(F, g, s) {
513
+ const r = s.reduce((t, a) => {
514
+ var S, p, v;
515
+ const d = a.category || "", b = St(g, (S = a.variant) == null ? void 0 : S.variantGroupIds), A = {
516
+ ...a,
517
+ codeName: [a.code, a.name].filter((h) => !!h).join(" "),
518
+ variant: {
519
+ variantGroupIds: ((p = a.variant) == null ? void 0 : p.variantGroupIds) || [],
520
+ variantCombinations: (((v = a.variant) == null ? void 0 : v.variantCombinations) || []).map((h) => {
521
+ const C = h.code, w = h.name || b[h.combinationKey || ""];
522
+ return {
523
+ ...h,
524
+ codeName: [C, w].filter((f) => !!f).join(" ").trim() || "-"
525
+ };
526
+ })
527
+ }
528
+ };
529
+ return t[d] = t[d] ? [...t[d], A] : [A], t;
530
+ }, {}), n = Object.values(r)[0];
531
+ return F.length === 0 && n ? n.map((t) => ({
532
+ id: t._id,
533
+ name: t.name ?? "",
534
+ items: r[t._id || ""] || []
535
+ })) || [] : F.map((t) => ({
536
+ id: t._id,
537
+ name: t.name ?? "",
538
+ items: r[t._id || ""] || []
539
+ }));
540
+ }
541
+ function Me(F, g) {
542
+ if (F.length == 1)
543
+ return F[0];
544
+ const s = F[0], r = F.slice(1, F.length), n = Me(r, g);
545
+ return s.reduce((a, d) => [...a, ...n.map((b) => g(d, b))], new Array());
546
+ }
547
+ function kt(F) {
548
+ if (F.length === 0) return [];
549
+ const g = F.map(
550
+ (r) => (r.options ?? []).map(
551
+ (n) => ({
552
+ combinationKey: [`${r._id}/${n._id}`],
553
+ selectionName: [n.name ?? ""]
554
+ })
555
+ )
556
+ );
557
+ return Me(g, (r, n) => ({
558
+ combinationKey: [...r.combinationKey, ...n.combinationKey],
559
+ selectionName: [...r.selectionName, ...n.selectionName]
560
+ })).map((r) => {
561
+ const n = [...r.combinationKey];
562
+ return n.sort(), {
563
+ combinationKey: n.join("/"),
564
+ active: !0,
565
+ selectionName: r.selectionName
566
+ };
567
+ });
568
+ }
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
+ key: 0,
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 = {
573
+ key: 0,
574
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400"
575
+ }, Mt = { class: "w-1" }, ce = /* @__PURE__ */ Y({
576
+ __name: "ApplyProduct",
577
+ props: {
578
+ isAddon: {
579
+ type: Boolean,
580
+ default: !1
581
+ },
582
+ bindings: {
583
+ type: Array,
584
+ required: !0
585
+ },
586
+ categories: {
587
+ type: Array,
588
+ required: !0
589
+ },
590
+ variants: {
591
+ type: Object,
592
+ required: !0
593
+ },
594
+ menus: {
595
+ type: Array,
596
+ required: !0
597
+ }
598
+ },
599
+ emits: ["update:bindings"],
600
+ setup(F, { emit: g }) {
601
+ const s = F, r = g, n = ye(), t = z(() => s.isAddon ? "Addons" : "Products"), a = z(() => s.isAddon ? [] : s.categories), d = z(
602
+ () => wt(a.value, s.variants, s.menus)
603
+ ), b = z(() => {
604
+ if (s.isAddon)
605
+ return s.bindings.map((u) => {
606
+ const i = s.menus.find((m) => m._id === u.productId), y = (i == null ? void 0 : i.name) ?? "-";
607
+ return {
608
+ ...u,
609
+ name: y,
610
+ itemCode: (i == null ? void 0 : i.code) ?? "-"
611
+ };
612
+ });
613
+ const c = d.value.flatMap((u) => u.items);
614
+ return s.bindings.map((u) => {
615
+ var o;
616
+ const i = c.find((B) => B._id === u.productId), y = (i == null ? void 0 : i.name) ?? "-";
617
+ let m = (i == null ? void 0 : i.code) ?? "-", e;
618
+ if (u.combinationKey) {
619
+ const B = (((o = i == null ? void 0 : i.variant) == null ? void 0 : o.variantCombinations) || []).find(
620
+ (L) => L.combinationKey === u.combinationKey
621
+ );
622
+ e = (B == null ? void 0 : B.name) ?? (B == null ? void 0 : B.codeName) ?? "", m = (B == null ? void 0 : B.code) ?? m;
623
+ }
624
+ return {
625
+ ...u,
626
+ name: y,
627
+ itemCode: m,
628
+ variantName: e
629
+ };
630
+ });
631
+ });
632
+ function A(c) {
633
+ r(
634
+ "update:bindings",
635
+ s.bindings.filter(
636
+ (u) => u.productId !== c.productId || u.combinationKey !== c.combinationKey
637
+ )
638
+ );
639
+ }
640
+ function S({ productId: c, combinationKey: u }, i) {
641
+ const y = s.bindings.find(
642
+ (m) => m.productId === c && m.combinationKey === u
643
+ );
644
+ y && (y.code = i);
645
+ }
646
+ function p() {
647
+ return d.value.map((c) => ({
648
+ label: c.name,
649
+ sublabel: "Category",
650
+ value: c.name,
651
+ disabled: !1,
652
+ children: c.items.map((u) => {
653
+ var y;
654
+ const i = (y = u.variant) == null ? void 0 : y.variantCombinations;
655
+ return i != null && i.length ? {
656
+ label: u.name ?? "",
657
+ value: u._id,
658
+ sublabel: "Product",
659
+ children: [
660
+ {
661
+ label: u.codeName ?? "",
662
+ value: {
663
+ productId: u._id
664
+ },
665
+ active: !!s.bindings.find(
666
+ ({ productId: m, combinationKey: e }) => u._id === m && !e
667
+ )
668
+ },
669
+ ...i.map((m) => ({
670
+ label: m.codeName ?? "",
671
+ value: {
672
+ productId: u._id,
673
+ combinationKey: m.combinationKey
674
+ },
675
+ sublabel: "Variant",
676
+ active: !!s.bindings.find(
677
+ ({ productId: e, combinationKey: o }) => u._id === e && m.combinationKey === o
678
+ )
679
+ }))
680
+ ]
681
+ } : {
682
+ label: u.codeName ?? "",
683
+ value: {
684
+ productId: u._id
685
+ },
686
+ active: !!s.bindings.find(
687
+ ({ productId: m, combinationKey: e }) => u._id === m && !e
688
+ )
689
+ };
690
+ })
691
+ }));
692
+ }
693
+ function v() {
694
+ return s.menus.map((c) => ({
695
+ label: c.name,
696
+ value: { productId: c._id },
697
+ active: !!s.bindings.find(
698
+ ({ productId: u, combinationKey: i }) => c._id === u && !i
699
+ )
700
+ }));
701
+ }
702
+ function h(c) {
703
+ const u = $(s.bindings);
704
+ return c.flatMap((i) => i.children.flatMap((y) => {
705
+ var e;
706
+ if (K(y))
707
+ return y.children.filter((o) => o.active).map((o) => {
708
+ var V, H;
709
+ const { productId: B, combinationKey: L } = o.value;
710
+ return L ? {
711
+ productId: B,
712
+ combinationKey: L,
713
+ code: ((V = u.find(
714
+ ({ productId: U, combinationKey: M }) => B === U && L === M
715
+ )) == null ? void 0 : V.code) ?? ""
716
+ } : {
717
+ productId: B,
718
+ code: ((H = u.find(({ productId: U, combinationKey: M }) => B === U && !M)) == null ? void 0 : H.code) ?? ""
719
+ };
720
+ });
721
+ if (!y.active)
722
+ return [];
723
+ const { productId: m } = y.value;
724
+ return [
725
+ {
726
+ productId: m,
727
+ code: ((e = u.find(({ productId: o, combinationKey: B }) => m === o && !B)) == null ? void 0 : e.code) ?? ""
728
+ }
729
+ ];
730
+ }));
731
+ }
732
+ function C(c) {
733
+ const u = $(s.bindings);
734
+ return c.filter((i) => i.active).map(
735
+ (i) => {
736
+ var y;
737
+ return {
738
+ productId: i.value.productId,
739
+ code: ((y = u.find(({ productId: m }) => m === i.value.productId)) == null ? void 0 : y.code) ?? ""
740
+ };
741
+ }
742
+ );
743
+ }
744
+ function w() {
745
+ let c;
746
+ s.isAddon ? c = v() : c = p();
747
+ const u = {
748
+ modelValue: c
749
+ };
750
+ n.open({
751
+ title: `Select ${t.value}`,
752
+ contentComponent: De,
753
+ contentComponentProps: u,
754
+ primaryActions: {
755
+ text: "Confirm",
756
+ close: !0
757
+ }
758
+ }).onPrimary((i) => {
759
+ let y;
760
+ s.isAddon ? y = C(i) : y = h(i), r("update:bindings", y);
761
+ });
762
+ }
763
+ const { t: f } = G();
764
+ return (c, u) => {
765
+ const i = E("FmButton"), y = E("FmTextField");
766
+ return k(), R("div", Bt, [
767
+ l("div", Ct, [
768
+ l("div", Et, T(F.isAddon ? x(f)("inventory.integration.apply.addons") : x(f)("inventory.integration.apply.products")), 1),
769
+ I(i, {
770
+ type: "button",
771
+ variant: "plain",
772
+ size: "md",
773
+ icon: "link",
774
+ label: F.isAddon ? x(f)("inventory.integration.apply.applyAddon") : x(f)("inventory.integration.apply.applyProduct"),
775
+ onClick: u[0] || (u[0] = (m) => w())
776
+ }, null, 8, ["label"])
777
+ ]),
778
+ l("div", null, [
779
+ b.value.length > 0 ? (k(), R("table", Ft, [
780
+ l("thead", null, [
781
+ l("tr", Lt, [
782
+ l("th", Vt, T(x(f)("inventory.integration.apply.name")), 1),
783
+ l("th", null, T(x(f)("inventory.integration.apply.code")), 1),
784
+ u[1] || (u[1] = l("th", { class: "w-1" }, " ", -1))
785
+ ])
786
+ ]),
787
+ l("tbody", null, [
788
+ (k(!0), R(J, null, te(b.value, (m, e) => (k(), R(J, { key: e }, [
789
+ u[2] || (u[2] = l("tr", { class: "block h-8" }, null, -1)),
790
+ l("tr", null, [
791
+ l("td", null, [
792
+ l("div", Nt, [
793
+ l("div", Rt, T(m.itemCode) + " " + T(m.name), 1),
794
+ m.variantName ? (k(), R("div", Dt, T(m.variantName), 1)) : X("", !0)
795
+ ])
796
+ ]),
797
+ l("td", null, [
798
+ I(y, {
799
+ "model-value": m.code,
800
+ "onUpdate:modelValue": [(o) => m.code = o, (o) => S(m, o)],
801
+ rules: [
802
+ function(B) {
803
+ return !!B || "Required";
804
+ }
805
+ ]
806
+ }, null, 8, ["model-value", "onUpdate:modelValue", "rules"])
807
+ ]),
808
+ l("td", Mt, [
809
+ I(i, {
810
+ type: "button",
811
+ variant: "tertiary",
812
+ icon: "delete",
813
+ "icon-color": "#000000",
814
+ size: "md",
815
+ onClick: (o) => A(m)
816
+ }, null, 8, ["onClick"])
817
+ ])
818
+ ])
819
+ ], 64))), 128))
820
+ ])
821
+ ])) : X("", !0)
822
+ ])
823
+ ]);
824
+ };
825
+ }
826
+ }), jt = { class: "flex flex-col gap-8 w-full" }, Ot = /* @__PURE__ */ Y({
827
+ __name: "ApplyProductDialog",
828
+ props: {
829
+ categories: { default: () => [] },
830
+ variants: { default: () => [] },
831
+ menus: { default: () => [] },
832
+ groups: { default: () => [] },
833
+ setting: {},
834
+ show: { type: Boolean },
835
+ loading: { type: Boolean }
836
+ },
837
+ emits: ["update:setting", "update:show", "submit"],
838
+ setup(F, { emit: g }) {
839
+ const s = F, r = g, n = fe($(s.setting));
840
+ pe([() => s.show], ([S]) => {
841
+ if (S)
842
+ for (const p of Object.keys(s.setting))
843
+ n[p] = s.setting[p];
844
+ });
845
+ const t = j(), a = se(s, "show");
846
+ function d() {
847
+ var S, p;
848
+ (p = (S = t.value) == null ? void 0 : S.validateInputs) == null || p.call(S);
849
+ }
850
+ function b() {
851
+ r("update:setting", $(n)), r("submit");
852
+ }
853
+ const { t: A } = G();
854
+ return (S, p) => {
855
+ const v = E("FmChip"), h = E("FmForm"), C = E("FmButton"), w = E("FmSideSheet");
856
+ return k(), _(w, {
857
+ modelValue: x(a),
858
+ "onUpdate:modelValue": p[4] || (p[4] = (f) => oe(a) ? a.value = f : null),
859
+ header: x(A)("inventory.integration.apply.title"),
860
+ "dismiss-away": "",
861
+ "close-button": "",
862
+ "max-width": 500
863
+ }, {
864
+ default: D(() => [
865
+ l("div", jt, [
866
+ l("div", null, [
867
+ I(v, { label: "Menu v3" })
868
+ ]),
869
+ I(h, {
870
+ ref_key: "formRef",
871
+ ref: t,
872
+ onValidationSuccess: p[2] || (p[2] = (f) => b())
873
+ }, {
874
+ default: D(() => [
875
+ I(ce, {
876
+ bindings: n.bindings,
877
+ categories: S.categories,
878
+ variants: S.variants,
879
+ menus: S.menus,
880
+ "onUpdate:bindings": p[0] || (p[0] = (f) => n.bindings = f)
881
+ }, null, 8, ["bindings", "categories", "variants", "menus"]),
882
+ I(xt, {
883
+ form: t.value,
884
+ modifiers: n.modifiers ?? [],
885
+ groups: S.groups ?? [],
886
+ items: S.menus ?? [],
887
+ "onUpdate:modifiers": p[1] || (p[1] = (f) => n.modifiers = f)
888
+ }, null, 8, ["form", "modifiers", "groups", "items"])
889
+ ]),
890
+ _: 1
891
+ }, 512)
892
+ ])
893
+ ]),
894
+ "side-sheet-footer": D(() => [
895
+ I(C, {
896
+ loading: S.loading,
897
+ type: "submit",
898
+ label: x(A)("common.confirm"),
899
+ onClick: p[3] || (p[3] = (f) => d())
900
+ }, null, 8, ["loading", "label"])
901
+ ]),
902
+ _: 1
903
+ }, 8, ["modelValue", "header"]);
904
+ };
905
+ }
906
+ }), Tt = { class: "flex flex-col gap-8 w-full" }, zt = /* @__PURE__ */ Y({
907
+ __name: "ApplyProductDialogV4",
908
+ props: {
909
+ categories: { default: () => [] },
910
+ variants: { default: () => [] },
911
+ menus: { default: () => [] },
912
+ groups: { default: () => [] },
913
+ setting: {},
914
+ show: { type: Boolean },
915
+ loading: { type: Boolean }
916
+ },
917
+ emits: ["update:setting", "update:show", "submit"],
918
+ setup(F, { emit: g }) {
919
+ const s = F, r = g, n = fe($(s.setting));
920
+ pe([() => s.show], ([f]) => {
921
+ if (f)
922
+ for (const c of Object.keys(s.setting))
923
+ n[c] = s.setting[c];
924
+ });
925
+ const t = z(() => s.menus.filter((f) => (f == null ? void 0 : f.category) === null)), a = z(() => n.bindings.filter((f) => {
926
+ const c = s.menus.find((u) => u._id === f.productId);
927
+ return c ? (c == null ? void 0 : c.category) === null : !1;
928
+ })), d = z(() => s.menus.filter((f) => (f == null ? void 0 : f.category) !== null)), b = z(() => n.bindings.filter((f) => {
929
+ const c = s.menus.find((u) => u._id === f.productId);
930
+ return c ? (c == null ? void 0 : c.category) !== null : !1;
931
+ }));
932
+ function A(f) {
933
+ n.bindings = [...a.value, ...f];
934
+ }
935
+ function S(f) {
936
+ n.bindings = [...b.value, ...f];
937
+ }
938
+ const p = j(), v = se(s, "show");
939
+ function h() {
940
+ var f, c;
941
+ (c = (f = p.value) == null ? void 0 : f.validateInputs) == null || c.call(f);
942
+ }
943
+ function C() {
944
+ r("update:setting", $(n)), r("submit");
945
+ }
946
+ const { t: w } = G();
947
+ return (f, c) => {
948
+ const u = E("FmChip"), i = E("FmForm"), y = E("FmButton"), m = E("FmSideSheet");
949
+ return k(), _(m, {
950
+ modelValue: x(v),
951
+ "onUpdate:modelValue": c[4] || (c[4] = (e) => oe(v) ? v.value = e : null),
952
+ header: x(w)("inventory.integration.apply.title"),
953
+ "dismiss-away": "",
954
+ "close-button": "",
955
+ "max-width": 500
956
+ }, {
957
+ default: D(() => [
958
+ l("div", Tt, [
959
+ l("div", null, [
960
+ I(u, { label: "Menu v4" })
961
+ ]),
962
+ I(i, {
963
+ ref_key: "formRef",
964
+ ref: p,
965
+ onValidationSuccess: c[2] || (c[2] = (e) => C())
966
+ }, {
967
+ default: D(() => [
968
+ I(ce, {
969
+ categories: f.categories,
970
+ variants: f.variants,
971
+ bindings: b.value,
972
+ menus: d.value,
973
+ "onUpdate:bindings": c[0] || (c[0] = (e) => A(e))
974
+ }, null, 8, ["categories", "variants", "bindings", "menus"]),
975
+ I(ce, {
976
+ "is-addon": !0,
977
+ categories: [],
978
+ variants: f.variants,
979
+ bindings: a.value,
980
+ menus: t.value,
981
+ "onUpdate:bindings": c[1] || (c[1] = (e) => S(e))
982
+ }, null, 8, ["variants", "bindings", "menus"])
983
+ ]),
984
+ _: 1
985
+ }, 512)
986
+ ])
987
+ ]),
988
+ "side-sheet-footer": D(() => [
989
+ I(y, {
990
+ loading: f.loading,
991
+ type: "submit",
992
+ label: x(w)("common.confirm"),
993
+ onClick: c[3] || (c[3] = (e) => h())
994
+ }, null, 8, ["loading", "label"])
995
+ ]),
996
+ _: 1
997
+ }, 8, ["modelValue", "header"]);
998
+ };
999
+ }
1000
+ }), Ht = { key: 0 }, Xt = { class: "flex justify-center" }, _t = ["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
+ __name: "FoodMarketHub",
1002
+ setup(F) {
1003
+ const g = ie(), s = ae(), r = W(), n = j(!1), t = qe(), a = z(() => t.state.menu ?? []), d = z(() => t.state.group ?? []), b = z(() => t.state.variants ?? []), A = z(() => t.state.categories ?? []), S = Ue(), p = z(() => {
1004
+ var i;
1005
+ return (i = g.currentBusiness.value) == null ? void 0 : i.menuVersion;
1006
+ });
1007
+ r.watchLocation(t.init);
1008
+ const v = j(!1);
1009
+ async function h() {
1010
+ v.value = !0;
1011
+ }
1012
+ const { breakpoints: C } = Ve(), w = z(() => C.value.xs || C.value.sm), f = z(() => w.value);
1013
+ async function c() {
1014
+ const i = t.state.setting;
1015
+ if (i) {
1016
+ n.value = !0;
1017
+ try {
1018
+ await S.updateSetting(i), s.open({
1019
+ title: "Success",
1020
+ message: "Your changes has been saved",
1021
+ type: "success"
1022
+ }), v.value = !1, await t.init();
1023
+ return;
1024
+ } catch (y) {
1025
+ s.open({
1026
+ title: "Something went wrong",
1027
+ message: "Cannot update integration info. Please try again.",
1028
+ type: "error"
1029
+ }), console.error("Error at updating integration info", y);
1030
+ } finally {
1031
+ n.value = !1;
1032
+ }
1033
+ }
1034
+ }
1035
+ const { t: u } = G();
1036
+ return (i, y) => {
1037
+ const m = E("FmCardSection"), e = E("FmCard");
1038
+ return x(t).isEnabled && !x(t).isBusinessLocation ? (k(), R("div", Ht, [
1039
+ I(e, {
1040
+ class: q({
1041
+ "w-full": f.value,
1042
+ "w-1/2": !f.value,
1043
+ border: !0,
1044
+ "border-fm-color-neutral-gray-100": !0,
1045
+ "cursor-pointer": !0,
1046
+ "hover:border-fm-color-primary": !0
1047
+ }),
1048
+ onClick: y[0] || (y[0] = (o) => h())
1049
+ }, {
1050
+ default: D(() => [
1051
+ I(m, null, {
1052
+ default: D(() => [
1053
+ l("div", Xt, [
1054
+ l("img", {
1055
+ src: x(tt),
1056
+ alt: "Food Market Hub"
1057
+ }, null, 8, _t)
1058
+ ]),
1059
+ l("div", Ut, [
1060
+ l("div", Qt, T(x(u)("inventory.integration.fmh.title")), 1),
1061
+ l("div", Yt, T(x(u)("inventory.integration.fmh.description")), 1)
1062
+ ])
1063
+ ]),
1064
+ _: 1
1065
+ })
1066
+ ]),
1067
+ _: 1
1068
+ }, 8, ["class"]),
1069
+ x(t).state.setting ? (k(), R("div", Jt, [
1070
+ (k(), _(ue, { to: "body" }, [
1071
+ p.value === "v3" ? (k(), _(Ot, {
1072
+ key: 0,
1073
+ menus: a.value,
1074
+ variants: b.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: v.value,
1079
+ "onUpdate:show": y[2] || (y[2] = (o) => v.value = o),
1080
+ groups: d.value,
1081
+ loading: n.value,
1082
+ onSubmit: y[3] || (y[3] = (o) => c())
1083
+ }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"])) : (k(), _(zt, {
1084
+ key: 1,
1085
+ menus: a.value,
1086
+ variants: b.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: v.value,
1091
+ "onUpdate:show": y[5] || (y[5] = (o) => v.value = o),
1092
+ groups: d.value,
1093
+ loading: n.value,
1094
+ onSubmit: y[6] || (y[6] = (o) => c())
1095
+ }, null, 8, ["menus", "variants", "categories", "setting", "show", "groups", "loading"]))
1096
+ ]))
1097
+ ])) : X("", !0)
1098
+ ])) : X("", !0);
1099
+ };
1100
+ }
1101
+ }), Zt = "data:image/svg+xml,%3csvg%20width='200'%20height='100'%20viewBox='0%200%20200%20100'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='200'%20height='100'%20fill='url(%23pattern0_1500_58879)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_1500_58879'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1500_58879'%20transform='matrix(0.002%200%200%200.004%200%200.046)'/%3e%3c/pattern%3e%3cimage%20id='image0_1500_58879'%20width='500'%20height='227'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAADjCAYAAABzcuYdAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB9KADAAQAAAABAAAA4wAAAABu8la3AABAAElEQVR4Ae2dCYAcVZnH61V191w5yDU5CDAkIXN0z0wC7C4uAorKpeyysugiuLqKooKIBwsCcguCFwoogqwrIHhzLIKigDeIQDLT3XMlmYSQBHKQhITM1V319v+6p/qorup+1VPd0z3zFXSm6r3vvfe9X1W9792lKHQQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIgMKIAREgApVLoKmp6aCGhoZZqrp/fzi8eU/lakqaEQEiMNkEpqNBZ8Fg00JVr13AfcpizrX5uAlLVVVlhmHwybohSF/lnA/jtwU6bIcu24eHh3du2rRpbzl0CgaDJzLGjsFPn0wObvOqqqJSyncIbmrM2DyqKNv6+/v3u42nkuRxL+ZqzHi/orD3IHNNnLFZClf243wLntBHRmOxnwwMDOyqJJ2L1QV5nYFHv1HX9QX4uwTxLMIzOBvPoFFsnK7CqXLJqIpaw7n+VCTS99fM+JcsWVI/Z86c86F7IN97gzz58Yz+NhqNPp8ZfrqeB4NKgLHlCzmvnQsGh4HPfPway3bfx8GrivX+qwmfDNcAHP6O+/ab8SAV/cdX0dp5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76JtlK4crc95IjBnPsNQngj39DziKjKUIVjueCyeoxPAEPv55uYhVT92GXGpxK35F8823vQtMOZfQZrS75Rb/VpaWuZhB7ZGZvibUCk/DK3ieRhzX2LHLDNur/ll55/58Rw+73VFJlN/OicCRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARyCTAMi/onAgQgWwCra2th6mqulBTlEWKYjRyVZ2nKspcnHPO1bjCjW0IsVvhbKvO2OvDw8NbBwcH38iOha6IABEgAqUnULUGvb390DlcmXEbMrCQK8wwUWncPEv9DegKvycS6bk/5eLRSbC99VKmqKcgujEzSpv0GVd4zFD0qyOR/hdMOae/HStWLGW1tfcoijUjukMQmBoXB5TJOrjNE8AZV3Ujfnk0OvD3LGFctLW1BX2qcgtTmB+Xltis0t5f5+pvkwEFDwRjXwyHwy+61SAYDAY0wzhS0dT3KIwfh3wuRxww5ooM6L1AspVz5WXG2J+4zp8Z1fWe/v7+/UXocaimql9HuIMY56nnG9cBQH+4OxL5lts43cqvWLGipq6u5ivg0AEV4iK8eL7xzPjwT7/Oey+ORtPPvlP8TU1NtbNmNIh42g2FJeIRsoxxHzdYH3h9NhqNpt4hazzt7cGPI9mz4T5m835Zxct2DZ1qUKG7vzva+/18iXaEgncj78sYT+c9n7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VdGJiSHD09PVFELH7fFB854YHAUYpqYMtTFZ8MVY6AcTwUf8XYo5js5vSe6DpnMVVhw3gOEBfrRr6ewdT4p2FwdyNcyY+uaN9vkMhvVgdXdoLtyaiciHH/ozFwehD+Cv2d+pRjOlOgKkfXPXuOM/57roz+LhLZ8ArCeHro8+fHVEO5D8vi/oqnNz25EApDvZc3bdqUcvM04fHIsIlPRGG+xETWzOcOzyEGS5h4Bkp7cP59PNQHZ06sNBNE5Sn1zppusn+Tb3Kh95n5cX+flo2T5KqbgFn+V3cuSHsi4B0BtnTp0trZODTDWMJ9yiKU+qL1PhstvUTpid3ZGGaNjzBFfw3Dk6/C5r8SiUSEAY95p0bRMSWW0tXW1h4Ma7kcOi+AvjOydGdsN3okdijKyODu3UOvbtu2bajo1CggESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiAARIAJEgAgQASJABIgAESACRIAIEAEiQASIABEgAkSACBABIkAEiIBHBP4fA65iItIh5WIAAAAASUVORK5CYII='/%3e%3c/defs%3e%3c/svg%3e", qt = { class: "flex-col items-center" }, Gt = { class: "flex gap-2" }, Pt = {
1102
+ key: 0,
1103
+ class: "text-xs text-red-500 mt-2"
1104
+ }, Wt = {
1105
+ key: 1,
1106
+ class: "flex items-center mt-2"
1107
+ }, $t = { class: "flex flex-col" }, en = { class: "font-medium" }, tn = { class: "text-xs text-gray-400" }, nn = { class: "text-xs text-gray-400" }, on = /* @__PURE__ */ Y({
1108
+ __name: "NetSuiteLocationField",
1109
+ props: {
1110
+ isDuplicate: { type: Boolean, default: !1 },
1111
+ nsLocationOptions: {},
1112
+ fmLocation: {},
1113
+ modelValue: { default: () => ({
1114
+ netsuiteId: "",
1115
+ name: "",
1116
+ subsidiaryName: "",
1117
+ subsidiaryId: ""
1118
+ }) }
1119
+ },
1120
+ emits: ["update:modelValue"],
1121
+ setup(F, { emit: g }) {
1122
+ const s = F, r = z(() => s.modelValue), n = g;
1123
+ return (t, a) => {
1124
+ const d = E("FmSelect"), b = E("FmButton"), A = E("FmIcon");
1125
+ return k(), R("div", qt, [
1126
+ l("div", Gt, [
1127
+ I(d, {
1128
+ placeholder: "Select NetSuite Location",
1129
+ items: t.nsLocationOptions,
1130
+ searchable: "",
1131
+ searchTarget: "label",
1132
+ "model-value": r.value,
1133
+ "onUpdate:modelValue": a[0] || (a[0] = (S) => n("update:modelValue", S))
1134
+ }, null, 8, ["items", "model-value"]),
1135
+ r.value.netsuiteId ? (k(), _(b, {
1136
+ key: 0,
1137
+ variant: "secondary",
1138
+ label: "Clear",
1139
+ onClick: a[1] || (a[1] = (S) => n("update:modelValue", {
1140
+ netsuiteId: "",
1141
+ name: "",
1142
+ subsidiaryName: "",
1143
+ subsidiaryId: ""
1144
+ }))
1145
+ })) : X("", !0)
1146
+ ]),
1147
+ t.isDuplicate ? (k(), R("div", Pt, " NetSuite location being used by another FeedMe location. ")) : X("", !0),
1148
+ r.value.netsuiteId ? (k(), R("div", Wt, [
1149
+ I(A, {
1150
+ name: "cloud",
1151
+ color: "neutral-gray-400",
1152
+ size: "md",
1153
+ class: "mr-2",
1154
+ outline: ""
1155
+ }),
1156
+ l("div", $t, [
1157
+ l("span", en, T(r.value.name), 1),
1158
+ l("span", tn, "ID: " + T(r.value.netsuiteId), 1),
1159
+ l("span", nn, "Subsidiary: " + T(r.value.subsidiaryName), 1)
1160
+ ])
1161
+ ])) : X("", !0)
1162
+ ]);
1163
+ };
1164
+ }
1165
+ }), sn = /* @__PURE__ */ Y({
1166
+ __name: "AddLocationDialog",
1167
+ props: {
1168
+ showDialog: {
1169
+ type: Boolean,
1170
+ required: !0
1171
+ },
1172
+ fmLocationNotYetConfigured: {
1173
+ type: Array,
1174
+ required: !0
1175
+ },
1176
+ nsLocationsNotBeingUsed: {
1177
+ type: Array,
1178
+ required: !0
1179
+ },
1180
+ formRef: {
1181
+ type: Object,
1182
+ default: null
1183
+ }
1184
+ },
1185
+ emits: ["update:loading", "update:showDialog"],
1186
+ setup(F, { emit: g }) {
1187
+ const s = le(), r = ae(), n = [
1188
+ {
1189
+ id: "fmLocation",
1190
+ header: "FeedMe Location",
1191
+ cell(h) {
1192
+ const C = h.row.original, w = N(ee.FmIcon, {
1193
+ name: C.type,
1194
+ color: "neutral-gray-400",
1195
+ size: "md",
1196
+ class: "mr-2",
1197
+ outline: !0
1198
+ });
1199
+ return N("div", { class: "flex items-center" }, [
1200
+ w,
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)
1204
+ ])
1205
+ ]);
1206
+ }
1207
+ },
1208
+ {
1209
+ id: "nsLocation",
1210
+ header: "NetSuite Location",
1211
+ cell(h) {
1212
+ const C = h.row.original, w = d.value[C.dbName], f = Object.entries(d.value).some(
1213
+ ([c, u]) => c !== C.dbName && u.netsuiteId === (w == null ? void 0 : w.netsuiteId)
1214
+ );
1215
+ return N(on, {
1216
+ isDuplicate: f,
1217
+ nsLocationOptions: S.value,
1218
+ modelValue: w,
1219
+ fmLocation: C,
1220
+ "onUpdate:modelValue": (c) => {
1221
+ c.netsuiteId ? d.value = {
1222
+ ...d.value,
1223
+ [C.dbName]: {
1224
+ netsuiteId: c.netsuiteId,
1225
+ name: c.name,
1226
+ subsidiaryName: c.subsidiaryName,
1227
+ subsidiaryId: c.subsidiaryId
1228
+ }
1229
+ } : delete d.value[C.dbName];
1230
+ }
1231
+ });
1232
+ }
1233
+ }
1234
+ ], t = F, a = g, d = j({}), b = j(), A = j(""), S = z(() => t.nsLocationsNotBeingUsed.map((h) => ({
1235
+ label: h.name,
1236
+ value: h
1237
+ }))), p = z(() => Object.values(d.value).length === 0 || Object.values(d.value).some(
1238
+ (h) => Object.values(d.value).filter((C) => C.netsuiteId === h.netsuiteId).length > 1
1239
+ ));
1240
+ async function v() {
1241
+ try {
1242
+ a("update:loading", !0), await s.updateLocationConfigs(d.value), r.open({
1243
+ message: "Locations updated successfully",
1244
+ type: "success"
1245
+ }), a("update:showDialog", !1);
1246
+ } catch {
1247
+ r.open({
1248
+ message: "Failed to update locations. Please try again.",
1249
+ type: "error"
1250
+ });
1251
+ } finally {
1252
+ a("update:loading", !1);
1253
+ }
1254
+ }
1255
+ return (h, C) => {
1256
+ const w = E("FmTable"), f = E("FmForm"), c = E("FmSpacer"), u = E("FmButton"), i = E("FmDialog");
1257
+ return k(), _(i, {
1258
+ modelValue: F.showDialog,
1259
+ "onUpdate:modelValue": C[2] || (C[2] = (y) => h.$emit("update:showDialog", y)),
1260
+ overlay: !0,
1261
+ "max-width": "900px"
1262
+ }, {
1263
+ "dialog-header": D(() => C[3] || (C[3] = [
1264
+ l("div", null, "Add locations", -1)
1265
+ ])),
1266
+ "dialog-footer": D(() => [
1267
+ I(c, { class: "sm:hidden xs:hidden" }),
1268
+ I(u, {
1269
+ class: "sm:w-full xs:w-full",
1270
+ label: "Submit",
1271
+ size: "md",
1272
+ disabled: p.value,
1273
+ onClick: v
1274
+ }, null, 8, ["disabled"])
1275
+ ]),
1276
+ default: D(() => [
1277
+ I(f, {
1278
+ ref: "formRef",
1279
+ class: "mb-4",
1280
+ "model-value": b.value,
1281
+ "onUpdate:modelValue": C[1] || (C[1] = (y) => b.value = y)
1282
+ }, {
1283
+ default: D(() => [
1284
+ I(w, {
1285
+ modelValue: b.value,
1286
+ "onUpdate:modelValue": C[0] || (C[0] = (y) => b.value = y),
1287
+ "row-data": t.fmLocationNotYetConfigured,
1288
+ "column-defs": n,
1289
+ "search-value": A.value,
1290
+ "shrink-at": !1
1291
+ }, null, 8, ["modelValue", "row-data", "search-value"])
1292
+ ]),
1293
+ _: 1
1294
+ }, 8, ["model-value"])
1295
+ ]),
1296
+ _: 1
1297
+ }, 8, ["modelValue"]);
1298
+ };
1299
+ }
1300
+ }), an = { key: 0 }, ln = {
1301
+ key: 1,
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({
1304
+ __name: "BusinessNetSuiteSideSheet",
1305
+ props: {
1306
+ setting: {},
1307
+ nsLocations: {},
1308
+ show: { type: Boolean },
1309
+ loading: { type: Boolean }
1310
+ },
1311
+ emits: ["update:setting", "update:show", "update:loading", "submit"],
1312
+ setup(F, { emit: g }) {
1313
+ const s = ie(), r = W(), n = j(!1), t = F, a = g, d = fe($(t.setting));
1314
+ pe([() => t.show], ([u]) => {
1315
+ if (u)
1316
+ for (const i of Object.keys(t.setting))
1317
+ d[i] = t.setting[i];
1318
+ });
1319
+ const b = j(), A = se(t, "show"), S = j(), p = j(""), v = z(() => t.setting.locations.filter(
1320
+ (u) => u.name.toLowerCase().includes(p.value.toLowerCase()) || u.netSuiteId.toLowerCase().includes(p.value.toLowerCase())
1321
+ )), h = [
1322
+ {
1323
+ id: "location",
1324
+ header: () => "FeedMe Location",
1325
+ cell(u) {
1326
+ const i = u.row.original, y = r.locations.find(
1327
+ (e) => e.type === i.type && e.doc._id === i.id
1328
+ );
1329
+ if (!y)
1330
+ return N("div", "Unknown Location");
1331
+ const m = N(ee.FmIcon, {
1332
+ name: y.type,
1333
+ color: "neutral-gray-400",
1334
+ size: "md",
1335
+ class: "mr-2",
1336
+ outline: !0
1337
+ });
1338
+ return N("div", { class: "flex items-center" }, [
1339
+ m,
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)
1343
+ ])
1344
+ ]);
1345
+ }
1346
+ },
1347
+ {
1348
+ id: "netsuite",
1349
+ header: () => "NetSuite Location",
1350
+ cell(u) {
1351
+ var e;
1352
+ const i = u.row.original, y = (e = t.nsLocations.find(
1353
+ (o) => o.netsuiteId === i.netSuiteId
1354
+ )) == null ? void 0 : e.subsidiaryName, m = N(ee.FmIcon, {
1355
+ name: "cloud",
1356
+ color: "neutral-gray-400",
1357
+ size: "md",
1358
+ class: "mr-2",
1359
+ outline: !0
1360
+ });
1361
+ return N("div", { class: "flex items-center" }, [
1362
+ m,
1363
+ N("div", { class: "flex flex-col" }, [
1364
+ N("span", { class: "font-medium" }, i.name),
1365
+ N("span", { class: "text-xs text-gray-400" }, `ID: ${i.netSuiteId}`),
1366
+ N("span", { class: "text-xs text-gray-400" }, `Subsidiary: ${y}`)
1367
+ ])
1368
+ ]);
1369
+ }
1370
+ }
1371
+ ], { t: C } = G(), w = [
1372
+ "Unit Type",
1373
+ "Inventory Item",
1374
+ "Location",
1375
+ "Vendor",
1376
+ "Subsidiary",
1377
+ "Purchase Order",
1378
+ "Transfer Order",
1379
+ "Inventory Transfer"
1380
+ ], f = z(() => r.locations.filter(
1381
+ (u) => !t.setting.locations.some(
1382
+ (i) => i.id === u.doc._id && i.type === u.type
1383
+ )
1384
+ )), c = z(() => t.nsLocations.filter(
1385
+ (u) => !t.setting.locations.some((i) => i.netSuiteId === u.netsuiteId)
1386
+ ));
1387
+ return (u, i) => {
1388
+ const y = E("FmChip"), m = E("FmSearch"), e = E("FmTable"), o = E("FmButton"), B = E("FmSideSheet");
1389
+ return k(), _(B, {
1390
+ modelValue: x(A),
1391
+ "onUpdate:modelValue": i[6] || (i[6] = (L) => oe(A) ? A.value = L : null),
1392
+ header: x(C)("inventory.integration.netsuite.title"),
1393
+ "dismiss-away": "",
1394
+ "close-button": "",
1395
+ "max-width": 800
1396
+ }, {
1397
+ default: D(() => {
1398
+ var L;
1399
+ return [
1400
+ (L = x(s).sessionUser.value) != null && L.role.isAdmin ? (k(), R("div", ln, [
1401
+ i[7] || (i[7] = l("div", { class: "text-sm" }, " This integration keeps your FeedMe system and NetSuite in sync for the following modules: ", -1)),
1402
+ l("div", rn, [
1403
+ (k(), R(J, null, te(w, (V) => I(y, {
1404
+ key: V,
1405
+ label: V,
1406
+ compact: ""
1407
+ }, null, 8, ["label"])), 64))
1408
+ ]),
1409
+ i[8] || (i[8] = l("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
+ i[9] || (i[9] = l("hr", { class: "my-3" }, null, -1)),
1411
+ l("div", un, [
1412
+ I(m, {
1413
+ placeholder: "Search by [NetSuite Location]",
1414
+ class: "w-[300px]",
1415
+ modelValue: p.value,
1416
+ "onUpdate:modelValue": i[0] || (i[0] = (V) => p.value = V)
1417
+ }, null, 8, ["modelValue"])
1418
+ ]),
1419
+ I(e, {
1420
+ modelValue: S.value,
1421
+ "onUpdate:modelValue": i[1] || (i[1] = (V) => S.value = V),
1422
+ "row-data": v.value,
1423
+ "column-defs": h,
1424
+ "shrink-at": !1,
1425
+ "search-value": p.value
1426
+ }, null, 8, ["modelValue", "row-data", "search-value"])
1427
+ ])) : (k(), R("div", an, " Please contact your administrator to apply the changes. ")),
1428
+ I(sn, {
1429
+ "show-dialog": n.value,
1430
+ "onUpdate:showDialog": [
1431
+ i[2] || (i[2] = (V) => n.value = V),
1432
+ i[3] || (i[3] = (V) => n.value = V)
1433
+ ],
1434
+ formRef: b.value,
1435
+ fmLocationNotYetConfigured: f.value,
1436
+ nsLocationsNotBeingUsed: c.value
1437
+ }, null, 8, ["show-dialog", "formRef", "fmLocationNotYetConfigured", "nsLocationsNotBeingUsed"])
1438
+ ];
1439
+ }),
1440
+ "side-sheet-footer": D(() => [
1441
+ l("div", dn, [
1442
+ I(o, {
1443
+ label: "Add location",
1444
+ onClick: i[4] || (i[4] = (L) => n.value = !0),
1445
+ loading: u.loading,
1446
+ disabled: u.loading
1447
+ }, null, 8, ["loading", "disabled"]),
1448
+ I(o, {
1449
+ variant: "tertiary",
1450
+ label: x(C)("common.close"),
1451
+ onClick: i[5] || (i[5] = (L) => a("update:show", !1))
1452
+ }, null, 8, ["label"])
1453
+ ])
1454
+ ]),
1455
+ _: 1
1456
+ }, 8, ["modelValue", "header"]);
1457
+ };
1458
+ }
1459
+ }), mn = /* @__PURE__ */ Y({
1460
+ __name: "InventoryTransferIngredientTable",
1461
+ props: {
1462
+ modelValue: { default: [] },
1463
+ modelModifiers: {}
1464
+ },
1465
+ emits: ["update:modelValue"],
1466
+ setup(F) {
1467
+ const { t: g } = de(), s = xe(F, "modelValue"), r = [
1468
+ {
1469
+ id: "Code",
1470
+ header: () => g("inventory.transfer.form.items.table.Code"),
1471
+ accessorKey: "code",
1472
+ size: 200,
1473
+ cell(n) {
1474
+ const t = n.row.original;
1475
+ return N(
1476
+ ee.FmTooltip,
1477
+ {
1478
+ content: t.code,
1479
+ placement: "top",
1480
+ variant: "plain",
1481
+ zIndex: 50
1482
+ },
1483
+ N(
1484
+ "span",
1485
+ {
1486
+ class: "flex-auto line-clamp-2 text-ellipsis break-all"
1487
+ },
1488
+ t.code
1489
+ )
1490
+ );
1491
+ },
1492
+ enableSorting: !1
1493
+ },
1494
+ {
1495
+ id: "Name",
1496
+ header: () => g("inventory.transfer.form.items.table.Name"),
1497
+ minSize: 300,
1498
+ cell(n) {
1499
+ const t = n.row.original;
1500
+ return N(
1501
+ ee.FmTooltip,
1502
+ {
1503
+ content: t.name,
1504
+ placement: "top",
1505
+ variant: "plain",
1506
+ zIndex: 50
1507
+ },
1508
+ N(
1509
+ "span",
1510
+ {
1511
+ class: "flex-auto line-clamp-2 text-ellipsis break-all"
1512
+ },
1513
+ t.name
1514
+ )
1515
+ );
1516
+ },
1517
+ enableSorting: !1
1518
+ },
1519
+ {
1520
+ id: "Amount",
1521
+ header: () => g("inventory.transfer.form.items.table.Amount"),
1522
+ minSize: 200,
1523
+ cell(n) {
1524
+ const t = n.row.original, a = n.row.index;
1525
+ return N($e, {
1526
+ style: {
1527
+ flex: "1 1 0%"
1528
+ },
1529
+ modelValue: {
1530
+ amount: t.quantity ?? { amount: 1, precision: 0 },
1531
+ measurement: t.measurement ?? null
1532
+ },
1533
+ key: t.sku._id,
1534
+ unit: t.sku.unit,
1535
+ "onUpdate:modelValue": (d) => {
1536
+ if (!d) return;
1537
+ const b = {
1538
+ ...t,
1539
+ quantity: d.amount,
1540
+ measurement: d.measurement
1541
+ };
1542
+ s.value = [
1543
+ ...s.value.slice(0, a),
1544
+ b,
1545
+ ...s.value.slice(a + 1)
1546
+ ];
1547
+ },
1548
+ rules: [et(+Qe({ amount: 1, precision: 0 }))],
1549
+ applyDefaultRules: !0
1550
+ });
1551
+ },
1552
+ enableSorting: !1
1553
+ },
1554
+ {
1555
+ id: "Delete",
1556
+ header: "",
1557
+ cell(n) {
1558
+ const t = n.row.original, a = n.row.index;
1559
+ return N("div", { class: "flex justify-end" }, [
1560
+ N(ee.FmButton, {
1561
+ key: t.sku._id,
1562
+ class: "delete-button",
1563
+ type: "button",
1564
+ icon: "delete",
1565
+ variant: "tertiary",
1566
+ size: "md",
1567
+ onClick: () => {
1568
+ s.value = [...s.value.slice(0, a), ...s.value.slice(a + 1)];
1569
+ }
1570
+ })
1571
+ ]);
1572
+ },
1573
+ enableSorting: !1,
1574
+ size: 40,
1575
+ meta: {
1576
+ cellClass: "",
1577
+ headerClass: ""
1578
+ }
1579
+ }
1580
+ ];
1581
+ return (n, t) => {
1582
+ const a = E("FmTable");
1583
+ return k(), _(a, {
1584
+ "column-defs": r,
1585
+ "row-data": s.value,
1586
+ "row-key": (d) => d.sku._id,
1587
+ "empty-text": x(g)("inventory.transfer.form.items.table.empty"),
1588
+ pagination: !1,
1589
+ "virtual-scroll": { enabled: !0, itemSize: 48 }
1590
+ }, null, 8, ["row-data", "row-key", "empty-text"]);
1591
+ };
1592
+ }
1593
+ }), fn = /* @__PURE__ */ Y({
1594
+ __name: "InventoryTransferOutTable",
1595
+ setup(F) {
1596
+ const g = j([]), s = Se(), r = j(!1);
1597
+ me(async () => {
1598
+ const a = W(), d = /* @__PURE__ */ new Date(), b = /* @__PURE__ */ new Date();
1599
+ b.setDate(b.getDate() - 30), r.value = !0;
1600
+ try {
1601
+ const A = await s.getInventoryTransferHistory(
1602
+ a.currentLocationDBName,
1603
+ b,
1604
+ d
1605
+ );
1606
+ g.value = A;
1607
+ } catch (A) {
1608
+ console.error("Error fetching inventory transfer history:", A);
1609
+ } finally {
1610
+ r.value = !1;
1611
+ }
1612
+ });
1613
+ const n = [
1614
+ // {
1615
+ // id: 'type',
1616
+ // header: 'Type',
1617
+ // cell: (props: any) => {
1618
+ // return props.row.original.type ? sentenceCase(props.row.original.type) : 'N/A'
1619
+ // }
1620
+ // },
1621
+ {
1622
+ id: "destinationLocation",
1623
+ header: "Destination Location",
1624
+ cell: (a) => {
1625
+ const d = a.row.original.destinationLocation.netSuiteName;
1626
+ return d ? N(
1627
+ ee.FmTooltip,
1628
+ { zIndex: 51 },
1629
+ {
1630
+ content() {
1631
+ return d;
1632
+ },
1633
+ default() {
1634
+ return N("div", { class: "line-clamp-2 fm-typo-en-body-sm-400" }, d);
1635
+ }
1636
+ }
1637
+ ) : "N/A";
1638
+ }
1639
+ },
1640
+ {
1641
+ id: "netsuite",
1642
+ header: () => "NetSuite",
1643
+ cell(a) {
1644
+ return N("div", { class: "flex flex-col" }, [
1645
+ N(
1646
+ "span",
1647
+ { class: "fm-typo-en-body-sm-400" },
1648
+ `ID: ${a.row.original.netsuiteId ?? "N/A"}`
1649
+ ),
1650
+ N(
1651
+ "span",
1652
+ { class: "fm-typo-en-body-sm-400" },
1653
+ `Transaction ID: ${a.row.original.netsuiteTranId ?? "N/A"}`
1654
+ ),
1655
+ N(
1656
+ "span",
1657
+ { class: "fm-typo-en-body-sm-400" },
1658
+ `Transaction Date: ${a.row.original.netsuiteTranDate ?? "N/A"}`
1659
+ )
1660
+ ]);
1661
+ }
1662
+ },
1663
+ {
1664
+ id: "adjustment",
1665
+ header: () => "Adjustment (FeedMe)",
1666
+ cell(a) {
1667
+ const d = a.row.original.adjustmentId;
1668
+ return N("div", { class: "flex flex-col" }, [
1669
+ N("span", { class: "fm-typo-en-body-sm-400" }, `ID: ${d ?? "N/A"}`),
1670
+ N(
1671
+ "span",
1672
+ { class: "fm-typo-en-body-sm-400" },
1673
+ `Date: ${d ? ve(ge(d)) : "N/A"}`
1674
+ )
1675
+ ]);
1676
+ }
1677
+ },
1678
+ {
1679
+ id: "items",
1680
+ header: () => "Items",
1681
+ cell(a) {
1682
+ const d = a.row.original.items;
1683
+ return N(
1684
+ "div",
1685
+ { class: "overflow-auto" },
1686
+ N("ul", { class: "list-disc pl-5" }, [
1687
+ d == null ? void 0 : d.map(
1688
+ (b) => N(
1689
+ "li",
1690
+ { class: "fm-typo-en-body-sm-400" },
1691
+ `[${b == null ? void 0 : b.itemId}] ${b == null ? void 0 : b.itemName}: ${b == null ? void 0 : b.quantity} ${(b == null ? void 0 : b.uomName) ?? "N/A"}`
1692
+ )
1693
+ )
1694
+ ])
1695
+ );
1696
+ },
1697
+ size: 150
1698
+ }
1699
+ ], t = j();
1700
+ return (a, d) => {
1701
+ const b = E("FmTable");
1702
+ return k(), R(J, null, [
1703
+ d[1] || (d[1] = l("div", null, "Last 30 Days:", -1)),
1704
+ I(b, {
1705
+ modelValue: t.value,
1706
+ "onUpdate:modelValue": d[0] || (d[0] = (A) => t.value = A),
1707
+ "row-data": g.value,
1708
+ "column-defs": n,
1709
+ loading: r.value
1710
+ }, null, 8, ["modelValue", "row-data", "loading"])
1711
+ ], 64);
1712
+ };
1713
+ }
1714
+ }), pn = { class: "flex flex-col gap-8" }, vn = {
1715
+ key: 0,
1716
+ class: "flex flex-col gap-4"
1717
+ }, gn = { class: "flex gap-2" }, An = {
1718
+ key: 1,
1719
+ class: "flex items-center my-2 border rounded-lg p-2"
1720
+ }, yn = { class: "flex flex-col" }, bn = { class: "font-medium" }, hn = { class: "text-xs text-gray-400" }, In = { class: "text-xs text-gray-400" }, xn = { class: "flex my-4" }, Sn = { class: "flex" }, wn = {
1721
+ key: 1,
1722
+ class: "flex flex-col"
1723
+ }, kn = {
1724
+ key: 1,
1725
+ class: "flex flex-col"
1726
+ }, Bn = /* @__PURE__ */ Y({
1727
+ __name: "InventoryTransfer",
1728
+ props: {
1729
+ nsLocations: {},
1730
+ currentLocationSetting: {},
1731
+ currentLocationSubsidiary: {}
1732
+ },
1733
+ setup(F) {
1734
+ const g = ye(), s = le(), r = Ae(), n = Se(), t = ae(), { t: a } = de(), d = j([]), b = [{ label: "Transfer Out" }, { label: "History" }], A = j(b[0]), S = j(!1), p = j(null), v = j(null), h = F, C = z(() => {
1735
+ const y = s.currentLocationSetting, m = s.configuredLocations;
1736
+ return h.nsLocations.map((e) => ({
1737
+ label: e.name,
1738
+ value: e,
1739
+ disabled: m.some((o) => o.netSuiteId === e.netsuiteId) || e.subsidiaryId !== (y == null ? void 0 : y.subsidiaryId)
1740
+ }));
1741
+ }), w = z({
1742
+ get() {
1743
+ return p.value ? p.value.toISOString().slice(0, 10) : "";
1744
+ },
1745
+ set(y) {
1746
+ if (!y) {
1747
+ p.value = null;
1748
+ return;
1749
+ }
1750
+ const m = p.value ?? /* @__PURE__ */ new Date(), e = new Date(y);
1751
+ m.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), p.value = new Date(m);
1752
+ }
1753
+ }), f = z({
1754
+ get() {
1755
+ if (!p.value) return null;
1756
+ const y = String(p.value.getHours()).padStart(2, "0"), m = String(p.value.getMinutes()).padStart(2, "0");
1757
+ return `${y}:${m}`;
1758
+ },
1759
+ set(y) {
1760
+ if (!y) return;
1761
+ const [m, e] = y.split(":").map(Number), o = p.value ?? /* @__PURE__ */ new Date();
1762
+ o.setHours(m, e), p.value = new Date(o);
1763
+ }
1764
+ }), c = z(() => w.value && f.value && v.value && d.value.length > 0 && !S.value);
1765
+ async function u() {
1766
+ if (c.value) {
1767
+ if (!h.currentLocationSetting) {
1768
+ t.open({
1769
+ message: "Current location setting is not available",
1770
+ type: "error"
1771
+ });
1772
+ return;
1773
+ }
1774
+ S.value = !0;
1775
+ try {
1776
+ const y = {
1777
+ items: d.value,
1778
+ date: p.value.toISOString(),
1779
+ netsuiteLocationId: v.value.netsuiteId,
1780
+ netsuiteLocationName: v.value.name
1781
+ }, m = `${h.currentLocationSetting.type}_${h.currentLocationSetting.id}`;
1782
+ await n.createInventoryTransfer(m, y), d.value = [], p.value = null, v.value = null, t.open({
1783
+ message: "Inventort transfer created successfully",
1784
+ type: "success"
1785
+ });
1786
+ } catch {
1787
+ t.open({
1788
+ message: "Failed to create inventory transfer",
1789
+ type: "error"
1790
+ });
1791
+ } finally {
1792
+ S.value = !1;
1793
+ }
1794
+ }
1795
+ }
1796
+ function i() {
1797
+ const y = s.currentLocationSubsidiary(), m = s.getAvailableItems(y.id), e = r.skus.filter((L) => m.includes(L._id)).map((L) => L._id), o = r.skus.map(
1798
+ (L) => ({
1799
+ label: L.name,
1800
+ sublabel: L.code,
1801
+ value: L,
1802
+ disabled: !e.includes(L._id)
1803
+ })
1804
+ ), B = o.filter((L) => {
1805
+ var V;
1806
+ return (V = d.value) == null ? void 0 : V.find((H) => H.sku._id === L.value._id);
1807
+ }).map((L) => L.value);
1808
+ g.open({
1809
+ title: a("inventory.transfer.form.items.selectItem"),
1810
+ closeButton: !0,
1811
+ contentComponent: Ye,
1812
+ contentComponentProps: {
1813
+ modelValue: B,
1814
+ items: o,
1815
+ virtualScroll: !0
1816
+ },
1817
+ primaryActions: {
1818
+ text: a("common.confirm"),
1819
+ close: !0
1820
+ },
1821
+ secondaryActions: {
1822
+ text: a("common.close"),
1823
+ close: !0,
1824
+ variant: "tertiary"
1825
+ }
1826
+ }).onPrimary((L) => {
1827
+ const V = d.value, H = L.map((U) => {
1828
+ const M = V.find((Q) => Q.sku._id === U._id);
1829
+ return M || {
1830
+ sku: U,
1831
+ code: U.code,
1832
+ name: U.name,
1833
+ quantity: {
1834
+ amount: 1,
1835
+ precision: 0
1836
+ }
1837
+ };
1838
+ });
1839
+ H.sort((U, M) => U.sku.code.localeCompare(M.sku.code)), d.value = H;
1840
+ });
1841
+ }
1842
+ return (y, m) => {
1843
+ 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");
1844
+ return k(), R("div", pn, [
1845
+ I(e, {
1846
+ modelValue: A.value,
1847
+ "onUpdate:modelValue": m[0] || (m[0] = (O) => A.value = O),
1848
+ items: b
1849
+ }, null, 8, ["modelValue"]),
1850
+ A.value.label === "Transfer Out" ? (k(), R(J, { key: 0 }, [
1851
+ x(s).inventoryTransferOutEnabled ? (k(), R("div", vn, [
1852
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1853
+ default: D(() => m[6] || (m[6] = [
1854
+ Z("Type")
1855
+ ])),
1856
+ _: 1
1857
+ }),
1858
+ I(B, {
1859
+ class: "my-4",
1860
+ disabled: "",
1861
+ "prepend-icon": "lock"
1862
+ }, {
1863
+ default: D(() => m[7] || (m[7] = [
1864
+ Z("Transfer out")
1865
+ ])),
1866
+ _: 1
1867
+ }),
1868
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1869
+ default: D(() => m[8] || (m[8] = [
1870
+ Z("Subsidiary")
1871
+ ])),
1872
+ _: 1
1873
+ }),
1874
+ I(B, {
1875
+ class: "my-4",
1876
+ disabled: "",
1877
+ "prepend-icon": "lock"
1878
+ }, {
1879
+ default: D(() => [
1880
+ Z(T(y.currentLocationSubsidiary.fullName), 1)
1881
+ ]),
1882
+ _: 1
1883
+ }),
1884
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1885
+ default: D(() => m[9] || (m[9] = [
1886
+ Z("Transaction date")
1887
+ ])),
1888
+ _: 1
1889
+ }),
1890
+ I(L, {
1891
+ modelValue: w.value,
1892
+ "onUpdate:modelValue": m[1] || (m[1] = (O) => w.value = O)
1893
+ }, null, 8, ["modelValue"]),
1894
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1895
+ default: D(() => m[10] || (m[10] = [
1896
+ Z("Transaction time")
1897
+ ])),
1898
+ _: 1
1899
+ }),
1900
+ I(V, {
1901
+ modelValue: f.value,
1902
+ "onUpdate:modelValue": m[2] || (m[2] = (O) => f.value = O)
1903
+ }, null, 8, ["modelValue"]),
1904
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1905
+ default: D(() => m[11] || (m[11] = [
1906
+ Z("NetSuite Location")
1907
+ ])),
1908
+ _: 1
1909
+ }),
1910
+ l("div", gn, [
1911
+ v.value ? X("", !0) : (k(), _(H, {
1912
+ key: 0,
1913
+ class: "my-4 w-full",
1914
+ modelValue: v.value,
1915
+ "onUpdate:modelValue": m[3] || (m[3] = (O) => v.value = O),
1916
+ searchable: "",
1917
+ searchTarget: "label",
1918
+ items: C.value
1919
+ }, null, 8, ["modelValue", "items"])),
1920
+ v.value ? (k(), R("div", An, [
1921
+ I(U, {
1922
+ name: "cloud",
1923
+ color: "neutral-gray-400",
1924
+ size: "md",
1925
+ class: "mr-2",
1926
+ outline: ""
1927
+ }),
1928
+ l("div", yn, [
1929
+ l("span", bn, T(v.value.name), 1),
1930
+ l("span", hn, "ID: " + T(v.value.netsuiteId), 1),
1931
+ l("span", In, "Subsidiary: " + T(v.value.subsidiaryName), 1)
1932
+ ]),
1933
+ I(M, {
1934
+ class: "ml-2",
1935
+ variant: "secondary",
1936
+ label: "Clear",
1937
+ onClick: m[4] || (m[4] = (O) => v.value = null)
1938
+ })
1939
+ ])) : X("", !0)
1940
+ ]),
1941
+ l("div", xn, [
1942
+ I(M, {
1943
+ class: "ml-auto",
1944
+ variant: "secondary",
1945
+ "prepend-icon": "add",
1946
+ label: "Ingredients",
1947
+ onClick: i
1948
+ })
1949
+ ]),
1950
+ I(mn, {
1951
+ modelValue: d.value,
1952
+ "onUpdate:modelValue": m[5] || (m[5] = (O) => d.value = O)
1953
+ }, null, 8, ["modelValue"]),
1954
+ l("div", Sn, [
1955
+ I(M, {
1956
+ class: "ml-auto mt-4",
1957
+ variant: "primary",
1958
+ "prepend-icon": "add",
1959
+ label: "Create",
1960
+ disabled: !c.value,
1961
+ loading: S.value,
1962
+ onClick: u
1963
+ }, null, 8, ["disabled", "loading"])
1964
+ ])
1965
+ ])) : (k(), R("div", wn, [
1966
+ I(o, { class: "fm-typo-en-body-md-600" }, {
1967
+ default: D(() => m[12] || (m[12] = [
1968
+ Z(" Feature is not enabled. Please contact your administrator. ")
1969
+ ])),
1970
+ _: 1
1971
+ })
1972
+ ]))
1973
+ ], 64)) : X("", !0),
1974
+ A.value.label === "History" ? (k(), R("div", kn, [
1975
+ I(fn)
1976
+ ])) : X("", !0)
1977
+ ]);
1978
+ };
1979
+ }
1980
+ }), Cn = { class: "flex flex-col gap-8 w-full" }, En = { class: "flex gap-4 justify-between" }, Fn = { 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" }, Ln = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Vn = { key: 0 }, Nn = { class: "flex gap-8 items-center justify-start" }, Rn = /* @__PURE__ */ Y({
1981
+ __name: "NetSuiteSideSheet",
1982
+ props: {
1983
+ nsLocations: {},
1984
+ show: { type: Boolean },
1985
+ loading: { type: Boolean }
1986
+ },
1987
+ emits: ["update:show"],
1988
+ setup(F, { emit: g }) {
1989
+ var w;
1990
+ const s = ie(), r = le(), n = F, t = se(n, "show"), { t: a } = G(), d = g, b = W(), A = ((w = b._currentLocation) == null ? void 0 : w.type) || "", S = [
1991
+ {
1992
+ label: "Inventory Transfer (Out)",
1993
+ value: "inventoryTransfer"
1994
+ /* INVENTORY_TRANSFER */
1995
+ }
1996
+ ], p = j(S[0].value), v = z(() => r.currentLocationSubsidiary()), h = z(() => r.currentLocationSetting), C = z(() => n.nsLocations.filter(
1997
+ (f) => f.subsidiaryId === v.value.id || f.netsuiteId === v.value.id
1998
+ ));
1999
+ return (f, c) => {
2000
+ var e;
2001
+ const u = E("FmIcon"), i = E("FmTabs"), y = E("FmButton"), m = E("FmSideSheet");
2002
+ return k(), _(m, {
2003
+ modelValue: x(t),
2004
+ "onUpdate:modelValue": c[2] || (c[2] = (o) => oe(t) ? t.value = o : null),
2005
+ header: "Data migration (Xilnex)",
2006
+ "dismiss-away": "",
2007
+ "close-button": "",
2008
+ "max-width": 800
2009
+ }, ne({
2010
+ default: D(() => [
2011
+ x(r).isCurrentLocationBindedToNetSuite ? X("", !0) : (k(), R("div", Vn, " Netsuite is not configured for this location. Please contact your administrator. ")),
2012
+ p.value === "inventoryTransfer" ? (k(), _(Bn, {
2013
+ key: 1,
2014
+ currentLocationSetting: h.value,
2015
+ nsLocations: C.value,
2016
+ currentLocationSubsidiary: v.value
2017
+ }, null, 8, ["currentLocationSetting", "nsLocations", "currentLocationSubsidiary"])) : X("", !0)
2018
+ ]),
2019
+ "side-sheet-footer": D(() => [
2020
+ l("div", Nn, [
2021
+ I(y, {
2022
+ variant: "tertiary",
2023
+ label: x(a)("common.close"),
2024
+ onClick: c[1] || (c[1] = (o) => d("update:show", !1))
2025
+ }, null, 8, ["label"])
2026
+ ])
2027
+ ]),
2028
+ _: 2
2029
+ }, [
2030
+ (e = x(s).sessionUser.value) != null && e.role.isAdmin ? {
2031
+ name: "side-sheet-header",
2032
+ fn: D(() => {
2033
+ var o;
2034
+ return [
2035
+ l("div", Cn, [
2036
+ l("div", En, [
2037
+ c[3] || (c[3] = l("div", { class: "fm-typo-en-title-md-600" }, "NetSuite Integration", -1)),
2038
+ l("div", Fn, [
2039
+ I(u, {
2040
+ name: x(A),
2041
+ size: "sm"
2042
+ }, null, 8, ["name"]),
2043
+ l("div", Ln, T((o = x(b)._currentLocation) == null ? void 0 : o.name), 1)
2044
+ ])
2045
+ ]),
2046
+ I(i, {
2047
+ "model-value": p.value,
2048
+ "onUpdate:modelValue": c[0] || (c[0] = (B) => p.value = B),
2049
+ items: S
2050
+ }, null, 8, ["model-value"])
2051
+ ])
2052
+ ];
2053
+ }),
2054
+ key: "0"
2055
+ } : void 0
2056
+ ]), 1032, ["modelValue"]);
2057
+ };
2058
+ }
2059
+ }), Dn = { class: "flex justify-center" }, Mn = ["src"], jn = { class: "flex flex-col items-center gap-2" }, On = { class: "text-lg font-bold" }, Tn = { class: "text-fm-color-neutral-gray-300" }, zn = /* @__PURE__ */ Y({
2060
+ __name: "NetSuite",
2061
+ setup(F) {
2062
+ const g = le(), s = ae(), r = j(!1), n = j(!1);
2063
+ async function t() {
2064
+ n.value = !0;
2065
+ }
2066
+ const a = j([]);
2067
+ ze(async () => {
2068
+ if (g.isReady && g.isEnabled) {
2069
+ r.value = !0;
2070
+ try {
2071
+ const b = await g.getNetSuiteLocationOptions();
2072
+ a.value = b;
2073
+ } catch {
2074
+ s.open({
2075
+ message: "Failed to fetch NetSuite locations",
2076
+ type: "error"
2077
+ });
2078
+ } finally {
2079
+ r.value = !1;
2080
+ }
2081
+ }
2082
+ });
2083
+ const { t: d } = G();
2084
+ return (b, A) => {
2085
+ const S = E("FmCardSection"), p = E("FmCard");
2086
+ return x(g).isEnabled ? (k(), R(J, { key: 0 }, [
2087
+ I(p, {
2088
+ class: q({
2089
+ "w-full": !0,
2090
+ border: !0,
2091
+ "border-fm-color-neutral-gray-100": !0,
2092
+ "cursor-pointer": !0,
2093
+ "hover:border-fm-color-primary": !0
2094
+ }),
2095
+ onClick: A[0] || (A[0] = (v) => t())
2096
+ }, {
2097
+ default: D(() => [
2098
+ I(S, null, {
2099
+ default: D(() => [
2100
+ l("div", Dn, [
2101
+ l("img", {
2102
+ src: x(Zt),
2103
+ alt: "NetSuite"
2104
+ }, null, 8, Mn)
2105
+ ]),
2106
+ l("div", jn, [
2107
+ l("div", On, T(x(d)("inventory.integration.netsuite.title")), 1),
2108
+ l("div", Tn, T(x(d)("inventory.integration.netsuite.description")), 1)
2109
+ ])
2110
+ ]),
2111
+ _: 1
2112
+ })
2113
+ ]),
2114
+ _: 1
2115
+ }),
2116
+ x(g).state.setting ? (k(), _(ue, {
2117
+ key: 0,
2118
+ to: "body"
2119
+ }, [
2120
+ x(g).isBusinessLocation ? (k(), _(cn, {
2121
+ key: 0,
2122
+ setting: x(g).state.setting,
2123
+ "onUpdate:setting": A[1] || (A[1] = (v) => x(g).state.setting = v),
2124
+ nsLocations: a.value,
2125
+ "onUpdate:nsLocations": A[2] || (A[2] = (v) => a.value = v),
2126
+ show: n.value,
2127
+ "onUpdate:show": [
2128
+ A[3] || (A[3] = (v) => n.value = v),
2129
+ A[4] || (A[4] = (v) => n.value = v)
2130
+ ],
2131
+ loading: r.value,
2132
+ "onUpdate:loading": A[5] || (A[5] = (v) => r.value = v)
2133
+ }, null, 8, ["setting", "nsLocations", "show", "loading"])) : (k(), _(Rn, {
2134
+ key: 1,
2135
+ setting: x(g).state.setting,
2136
+ "onUpdate:setting": A[6] || (A[6] = (v) => x(g).state.setting = v),
2137
+ nsLocations: a.value,
2138
+ "onUpdate:nsLocations": A[7] || (A[7] = (v) => a.value = v),
2139
+ show: n.value,
2140
+ "onUpdate:show": [
2141
+ A[8] || (A[8] = (v) => n.value = v),
2142
+ A[9] || (A[9] = (v) => n.value = v)
2143
+ ],
2144
+ loading: r.value,
2145
+ "onUpdate:loading": A[10] || (A[10] = (v) => r.value = v)
2146
+ }, null, 8, ["setting", "nsLocations", "show", "loading"]))
2147
+ ])) : X("", !0)
2148
+ ], 64)) : X("", !0);
2149
+ };
2150
+ }
2151
+ }), he = [
2152
+ "store",
2153
+ "issueBy",
2154
+ "verifiedBy",
2155
+ "stockTakeId",
2156
+ "date",
2157
+ "status",
2158
+ "c_field",
2159
+ "itemCode",
2160
+ "itemName",
2161
+ "physicalQty",
2162
+ "ohQty",
2163
+ "customCost",
2164
+ "totalPhysicalCustomCost",
2165
+ "schemeFranchiseePrice",
2166
+ "physicalSchemeTotalFranchiseePrice"
2167
+ ];
2168
+ async function Hn(F, g, s) {
2169
+ var a;
2170
+ const r = await Xn(s), n = [], t = {};
2171
+ for (const d in r) {
2172
+ const b = r[d];
2173
+ for (let A = 0; A < b.length; A++) {
2174
+ const S = b[A], p = S.itemCode, v = S.itemName, h = S.physicalQty, C = S.customCost;
2175
+ if (p === "" || p === "undefined") {
2176
+ n.push({
2177
+ row: S.excelRow,
2178
+ itemCode: p,
2179
+ itemName: v,
2180
+ message: "Item code is empty or undefined"
2181
+ });
2182
+ continue;
2183
+ }
2184
+ const w = g.find((y) => y.code === p);
2185
+ if (!w) {
2186
+ n.push({
2187
+ row: S.excelRow,
2188
+ itemCode: p,
2189
+ itemName: v,
2190
+ qty: h,
2191
+ message: "Item not found in inventory"
2192
+ }), console.error(`${S.excelRow} Item not found: ${p} ${v} ${h}`);
2193
+ continue;
2194
+ }
2195
+ let f = Number(S.totalPhysicalCustomCost);
2196
+ const c = F[w._id];
2197
+ c && (f = c * Number(h));
2198
+ const u = P.fromNumber(Number(h)), i = {
2199
+ amount: u,
2200
+ cost: {
2201
+ ...P.fromNumber(Number(f)),
2202
+ currency: "MYR"
2203
+ }
2204
+ };
2205
+ h != "0" && C == "0" && console.warn(`Item ${p} ${v} has 0 cost.`), t[a = w._id] ?? (t[a] = {
2206
+ skuAdjustment: {
2207
+ sku: w,
2208
+ fromBalance: P.fromNumber(0),
2209
+ amounts: [
2210
+ {
2211
+ _id: null,
2212
+ type: we.Enum.CLOSING,
2213
+ remark: "Opening Balance",
2214
+ amount: u,
2215
+ measurement: null,
2216
+ // always the smallest unit
2217
+ cost: i.cost
2218
+ }
2219
+ ],
2220
+ toBalance: u,
2221
+ toCostBalances: [i]
2222
+ },
2223
+ skuBalance: {
2224
+ id: w._id,
2225
+ balance: u,
2226
+ costs: [i]
2227
+ }
2228
+ });
2229
+ }
2230
+ }
2231
+ return {
2232
+ errors: n,
2233
+ rows: t
2234
+ };
2235
+ }
2236
+ async function Xn(F) {
2237
+ const g = await new Promise((t, a) => {
2238
+ const d = new FileReader();
2239
+ d.onload = (b) => t(b.target.result), d.onerror = a, d.readAsArrayBuffer(F);
2240
+ }), s = ke(g, { type: "array" }), r = s.SheetNames, n = {};
2241
+ for (const t of r) {
2242
+ const a = await _n(s.Sheets[t]);
2243
+ n[t] = a;
2244
+ }
2245
+ return n;
2246
+ }
2247
+ async function _n(F) {
2248
+ const g = Be.sheet_to_json(F, {
2249
+ header: he,
2250
+ range: 12
2251
+ }), s = [];
2252
+ for (let r = 0; r < g.length; r++) {
2253
+ const n = g[r], t = {};
2254
+ for (const a of he)
2255
+ t[a] = String(n[a]).trim();
2256
+ s.push({
2257
+ ...t,
2258
+ excelRow: r + 13
2259
+ // Excel rows start from 1, and we skip the first 12 rows
2260
+ });
2261
+ }
2262
+ return s;
2263
+ }
2264
+ const Un = { class: "flex flex-col gap-4" }, Qn = { class: "flex flex-col" }, Yn = {
2265
+ key: 0,
2266
+ class: "flex flex-col gap-4 my-5"
2267
+ }, Jn = { class: "flex flex-col gap-8" }, Kn = { class: "flex flex-col gap-8" }, Zn = {
2268
+ class: /* @__PURE__ */ q(["fm-corner-radius-md p-16 flex items-center gap-16"])
2269
+ }, qn = {
2270
+ class: /* @__PURE__ */ q(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
2271
+ }, Gn = { class: "line-clamp-2 text-ellipsis break-all" }, Pn = { class: "flex flex-col" }, Wn = { class: "font-medium" }, $n = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, eo = { class: "flex" }, to = { class: "flex" }, no = { key: 1 }, oo = /* @__PURE__ */ Y({
2272
+ __name: "XilnexOpeningImport",
2273
+ setup(F) {
2274
+ const g = Ge(), s = le(), r = Ae(), n = Ce(), t = ae(), a = z(() => [
2275
+ {
2276
+ value: "xilnex",
2277
+ label: "Xilnex",
2278
+ subLabel: "Based on Xilnex's item cost from excel file"
2279
+ },
2280
+ ...s.isEnabled ? [
2281
+ {
2282
+ value: "netsuite",
2283
+ label: "NetSuite",
2284
+ subLabel: "Based on NetSuite's item current average cost by location. If not available, it will fallback to excel's cost",
2285
+ disabled: !s.isCurrentLocationBindedToNetSuite,
2286
+ disabledReason: "Current location is not binded to NetSuite"
2287
+ }
2288
+ ] : []
2289
+ ]), d = j(a.value[0].value), { t: b } = de(), A = j(null), S = j(), p = j(""), v = j([]), h = j([]), C = [
2290
+ {
2291
+ id: "ingredient",
2292
+ header: () => "Ingredient",
2293
+ cell(e) {
2294
+ const o = e.row.original;
2295
+ return N("div", { class: "flex flex-col" }, [
2296
+ N("span", { class: "font-medium" }, o.skuAdjustment.sku.name),
2297
+ N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2298
+ o.skuAdjustment.sku.code
2299
+ ])
2300
+ ]);
2301
+ }
2302
+ },
2303
+ {
2304
+ id: "openingBalance",
2305
+ header: () => "Opening Balance",
2306
+ cell(e) {
2307
+ const o = e.row.original;
2308
+ return N("div", { class: "flex flex-col" }, [
2309
+ N(
2310
+ "span",
2311
+ { class: "font-medium" },
2312
+ P.toFormatString({
2313
+ value: o.skuAdjustment.amounts[0].amount
2314
+ })
2315
+ )
2316
+ ]);
2317
+ }
2318
+ },
2319
+ {
2320
+ id: "unit",
2321
+ header: () => "Unit",
2322
+ cell(e) {
2323
+ const o = e.row.original, B = !o.skuAdjustment.amounts[0].measurement;
2324
+ let L = o.skuAdjustment.sku.unit.name;
2325
+ if (!B) {
2326
+ const V = o.skuAdjustment.sku.unit.measurements.find(
2327
+ (H) => H.id === o.skuAdjustment.amounts[0].measurement.id
2328
+ );
2329
+ L = V ? V.name : "Error: Measurement not found";
2330
+ }
2331
+ return N("div", { class: "flex flex-col" }, [
2332
+ N("span", { class: "font-medium" }, L),
2333
+ B ? null : N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2334
+ `Base unit: ${o.skuAdjustment.sku.unit.name}`
2335
+ ])
2336
+ ]);
2337
+ }
2338
+ },
2339
+ {
2340
+ id: "totalCost",
2341
+ header: () => "Total Cost",
2342
+ cell(e) {
2343
+ const o = e.row.original, { currency: B, ...L } = o.skuAdjustment.amounts[0].cost ?? {
2344
+ amount: 0,
2345
+ precision: 0,
2346
+ currency: ""
2347
+ };
2348
+ return N("div", { class: "flex flex-col" }, [
2349
+ N(
2350
+ "span",
2351
+ { class: "font-medium" },
2352
+ P.toFormatString({
2353
+ value: L
2354
+ })
2355
+ )
2356
+ ]);
2357
+ }
2358
+ }
2359
+ ], w = [
2360
+ {
2361
+ accessorKey: "row",
2362
+ header: "Row"
2363
+ },
2364
+ {
2365
+ accessorKey: "itemCode",
2366
+ header: "Item Code"
2367
+ },
2368
+ {
2369
+ accessorKey: "itemName",
2370
+ header: "Item Name"
2371
+ },
2372
+ {
2373
+ accessorKey: "qty",
2374
+ header: "Quantity"
2375
+ },
2376
+ {
2377
+ accessorKey: "message",
2378
+ header: "Error Message"
2379
+ }
2380
+ ], f = j(!1);
2381
+ async function c() {
2382
+ if (A.value) {
2383
+ f.value = !0;
2384
+ try {
2385
+ let e = {};
2386
+ d.value === "netsuite" && (e = await s.getItemAverageCosts());
2387
+ const { errors: o, rows: B } = await Hn(
2388
+ e,
2389
+ r.skus,
2390
+ A.value
2391
+ );
2392
+ v.value = o, h.value = Object.values(B);
2393
+ } catch {
2394
+ t.open({
2395
+ message: "Error verifying file",
2396
+ type: "error"
2397
+ });
2398
+ } finally {
2399
+ f.value = !1;
2400
+ }
2401
+ }
2402
+ }
2403
+ async function u() {
2404
+ if (A.value) {
2405
+ f.value = !0;
2406
+ try {
2407
+ if (!y.value) {
2408
+ t.open({
2409
+ message: "Please select a date for the opening balance",
2410
+ type: "error"
2411
+ });
2412
+ return;
2413
+ }
2414
+ await n.setOpeningBalance({
2415
+ effectiveAt: y.value,
2416
+ skuAdjustments: h.value.map((e) => e.skuAdjustment),
2417
+ skuBalances: h.value.map((e) => e.skuBalance)
2418
+ }), t.open({
2419
+ message: "Opening balance imported successfully",
2420
+ type: "success"
2421
+ }), await g.fetchClosingDocumentId();
2422
+ } catch {
2423
+ t.open({
2424
+ message: "Error importing opening balance",
2425
+ type: "error"
2426
+ });
2427
+ } finally {
2428
+ f.value = !1;
2429
+ }
2430
+ }
2431
+ }
2432
+ const i = j(""), y = z({
2433
+ get() {
2434
+ return i.value;
2435
+ },
2436
+ set(e) {
2437
+ i.value = `${e}T15:59:59.999Z`;
2438
+ }
2439
+ }), m = z(() => {
2440
+ if (!i.value) return null;
2441
+ const e = new Date(i.value);
2442
+ return isNaN(e.getTime()) ? null : ve(e);
2443
+ });
2444
+ return (e, o) => {
2445
+ const B = E("FmLabel"), L = E("FmField"), V = E("FmSimpleDatePicker"), H = E("FmButton"), U = E("FmRadio"), M = E("FmRadioGroup"), O = E("FmTable");
2446
+ return k(), R("div", Un, [
2447
+ l("div", Qn, [
2448
+ I(B, { label: "Latest closing" })
2449
+ ]),
2450
+ I(L, {
2451
+ "prepend-icon": "lock_outline",
2452
+ disabled: ""
2453
+ }, {
2454
+ default: D(() => [
2455
+ Z(T(x(g).state.closingDocumentId ? `${x(Ee)(new Date(x(ge)(x(g).state.closingDocumentId)))}` : "No closing found"), 1)
2456
+ ]),
2457
+ _: 1
2458
+ }),
2459
+ x(g).state.closingDocumentId ? (k(), R("div", no, o[6] || (o[6] = [
2460
+ l("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)
2461
+ ]))) : (k(), R("div", Yn, [
2462
+ I(V, {
2463
+ modelValue: y.value,
2464
+ "onUpdate:modelValue": o[0] || (o[0] = (Q) => y.value = Q),
2465
+ label: "Last closing time"
2466
+ }, {
2467
+ "trigger-button": D(() => [
2468
+ I(L, {
2469
+ "prepend-icon": "calendar_today",
2470
+ readonly: "",
2471
+ label: "Last closing time"
2472
+ }, {
2473
+ default: D(() => [
2474
+ Z(T(m.value), 1)
2475
+ ]),
2476
+ _: 1
2477
+ })
2478
+ ]),
2479
+ _: 1
2480
+ }, 8, ["modelValue"]),
2481
+ l("div", Jn, [
2482
+ I(B, { label: "Stock take file" })
2483
+ ]),
2484
+ I(Fe, {
2485
+ onFileUpload: o[1] || (o[1] = (Q) => {
2486
+ Q && (A.value = Q);
2487
+ }),
2488
+ accept: ".xlsx, .xls, .csv"
2489
+ }, ne({ _: 2 }, [
2490
+ A.value ? {
2491
+ name: "default",
2492
+ fn: D(({ openFileDialog: Q }) => [
2493
+ l("div", Kn, [
2494
+ l("div", Zn, [
2495
+ l("div", qn, [
2496
+ l("div", Gn, T(A.value.name), 1),
2497
+ I(H, {
2498
+ label: x(b)("inventory.ingredient.import.replaceFile"),
2499
+ variant: "secondary",
2500
+ "prepend-icon": "autorenew",
2501
+ onClick: Q
2502
+ }, null, 8, ["label", "onClick"])
2503
+ ])
2504
+ ])
2505
+ ])
2506
+ ]),
2507
+ key: "0"
2508
+ } : void 0
2509
+ ]), 1024),
2510
+ I(M, {
2511
+ modelValue: d.value,
2512
+ "onUpdate:modelValue": o[2] || (o[2] = (Q) => d.value = Q),
2513
+ label: "Retrieve cost from",
2514
+ class: "my-5"
2515
+ }, {
2516
+ default: D(() => [
2517
+ (k(!0), R(J, null, te(a.value, (Q) => (k(), _(U, {
2518
+ key: Q.value,
2519
+ value: Q.value,
2520
+ label: Q.label,
2521
+ sublabel: Q.subLabel,
2522
+ disabled: Q.disabled
2523
+ }, {
2524
+ label: D(() => [
2525
+ l("div", Pn, [
2526
+ l("span", Wn, T(Q.label), 1),
2527
+ l("span", $n, T(Q.disabled ? Q.disabledReason : Q.subLabel), 1)
2528
+ ])
2529
+ ]),
2530
+ _: 2
2531
+ }, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
2532
+ ]),
2533
+ _: 1
2534
+ }, 8, ["modelValue"]),
2535
+ l("div", eo, [
2536
+ I(H, {
2537
+ class: "ml-auto mt-4",
2538
+ variant: "secondary",
2539
+ "prepend-icon": "troubleshoot",
2540
+ label: "Verify",
2541
+ disabled: !A.value && !f.value,
2542
+ loading: f.value,
2543
+ onClick: c
2544
+ }, null, 8, ["disabled", "loading"])
2545
+ ]),
2546
+ A.value && h.value.length > 0 ? (k(), R(J, { key: 0 }, [
2547
+ o[4] || (o[4] = l("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
2548
+ I(O, {
2549
+ modelValue: S.value,
2550
+ "onUpdate:modelValue": o[3] || (o[3] = (Q) => S.value = Q),
2551
+ "row-data": h.value,
2552
+ "column-defs": C,
2553
+ "shrink-at": !1,
2554
+ "search-value": p.value
2555
+ }, null, 8, ["modelValue", "row-data", "search-value"])
2556
+ ], 64)) : X("", !0),
2557
+ v.value.length > 0 ? (k(), R(J, { key: 1 }, [
2558
+ o[5] || (o[5] = l("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
2559
+ I(O, {
2560
+ "row-data": v.value,
2561
+ "column-defs": w
2562
+ }, null, 8, ["row-data"])
2563
+ ], 64)) : X("", !0),
2564
+ l("div", to, [
2565
+ h.value.length > 0 && !x(g).state.closingDocumentId ? (k(), _(H, {
2566
+ key: 0,
2567
+ class: "ml-auto mt-4",
2568
+ "prepend-icon": "file_upload",
2569
+ variant: "primary",
2570
+ label: "Import Opening Balance",
2571
+ disabled: !A.value || f.value,
2572
+ onClick: u
2573
+ }, null, 8, ["disabled"])) : X("", !0)
2574
+ ])
2575
+ ]))
2576
+ ]);
2577
+ };
2578
+ }
2579
+ }), so = { class: "flex flex-col gap-8 w-full" }, ao = { class: "flex gap-4 justify-between" }, lo = { 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" }, io = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, ro = { key: 0 }, uo = {
2580
+ key: 1,
2581
+ class: "flex flex-col gap-8 w-full"
2582
+ }, co = { key: 1 }, mo = { class: "flex gap-8 items-center justify-start" }, fo = /* @__PURE__ */ Y({
2583
+ __name: "XilnexSideSheet",
2584
+ props: {
2585
+ show: { type: Boolean },
2586
+ loading: { type: Boolean }
2587
+ },
2588
+ emits: ["update:show"],
2589
+ setup(F, { emit: g }) {
2590
+ var p;
2591
+ const s = ie(), n = se(F, "show"), { t } = G(), a = g, d = W(), b = ((p = d._currentLocation) == null ? void 0 : p.type) || "", A = [
2592
+ { label: re(
2593
+ "openingBalance"
2594
+ /* OPENING_BALANCE */
2595
+ ) },
2596
+ { label: re(
2597
+ "transferNote"
2598
+ /* TRANSFER_NOTE */
2599
+ ) }
2600
+ ], S = j(A[0]);
2601
+ return (v, h) => {
2602
+ var u;
2603
+ const C = E("FmIcon"), w = E("FmButtonGroup"), f = E("FmButton"), c = E("FmSideSheet");
2604
+ return k(), _(c, {
2605
+ modelValue: x(n),
2606
+ "onUpdate:modelValue": h[2] || (h[2] = (i) => oe(n) ? n.value = i : null),
2607
+ header: "Data migration (Xilnex)",
2608
+ "dismiss-away": "",
2609
+ "close-button": "",
2610
+ "max-width": 800
2611
+ }, ne({
2612
+ default: D(() => {
2613
+ var i;
2614
+ return [
2615
+ (i = x(s).sessionUser.value) != null && i.role.isAdmin ? (k(), R("div", uo, [
2616
+ S.value.label === x(re)(
2617
+ "openingBalance"
2618
+ /* OPENING_BALANCE */
2619
+ ) ? (k(), _(oo, { key: 0 })) : X("", !0),
2620
+ S.value.label === x(re)(
2621
+ "transferNote"
2622
+ /* TRANSFER_NOTE */
2623
+ ) ? (k(), R("div", co, " Not available yet. ")) : X("", !0)
2624
+ ])) : (k(), R("div", ro, " Please contact your administrator to apply the changes. "))
2625
+ ];
2626
+ }),
2627
+ "side-sheet-footer": D(() => [
2628
+ l("div", mo, [
2629
+ I(f, {
2630
+ variant: "tertiary",
2631
+ label: x(t)("common.close"),
2632
+ onClick: h[1] || (h[1] = (i) => a("update:show", !1))
2633
+ }, null, 8, ["label"])
2634
+ ])
2635
+ ]),
2636
+ _: 2
2637
+ }, [
2638
+ (u = x(s).sessionUser.value) != null && u.role.isAdmin ? {
2639
+ name: "side-sheet-header",
2640
+ fn: D(() => {
2641
+ var i;
2642
+ return [
2643
+ l("div", so, [
2644
+ l("div", ao, [
2645
+ h[3] || (h[3] = l("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Xilnex)", -1)),
2646
+ l("div", lo, [
2647
+ I(C, {
2648
+ name: x(b),
2649
+ size: "sm"
2650
+ }, null, 8, ["name"]),
2651
+ l("div", io, T((i = x(d)._currentLocation) == null ? void 0 : i.name), 1)
2652
+ ])
2653
+ ]),
2654
+ I(w, {
2655
+ modelValue: S.value,
2656
+ "onUpdate:modelValue": h[0] || (h[0] = (y) => S.value = y),
2657
+ items: A
2658
+ }, null, 8, ["modelValue"])
2659
+ ])
2660
+ ];
2661
+ }),
2662
+ key: "0"
2663
+ } : void 0
2664
+ ]), 1032, ["modelValue"]);
2665
+ };
2666
+ }
2667
+ }), po = /* @__PURE__ */ Y({
2668
+ __name: "XilnexView",
2669
+ setup(F) {
2670
+ const g = Le(), s = W(), r = j(!1);
2671
+ async function n() {
2672
+ r.value = !0, console.log("Opening Xilnex migration dialog");
2673
+ }
2674
+ return (t, a) => {
2675
+ const d = E("FmCardSection"), b = E("FmCard");
2676
+ return x(g).enabledXilnexOpeningMigration && !x(s).businessLevel ? (k(), R(J, { key: 0 }, [
2677
+ I(b, {
2678
+ class: q({
2679
+ "w-full": !0,
2680
+ border: !0,
2681
+ "border-fm-color-neutral-gray-100": !0,
2682
+ "cursor-pointer": !0,
2683
+ "hover:border-fm-color-primary": !0
2684
+ }),
2685
+ onClick: a[0] || (a[0] = (A) => n())
2686
+ }, {
2687
+ default: D(() => [
2688
+ I(d, null, {
2689
+ default: D(() => a[2] || (a[2] = [
2690
+ l("div", { class: "flex justify-center" }, [
2691
+ l("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
2692
+ l("span", { class: "text-lg font-bold text-gray-600" }, "Xilnex")
2693
+ ])
2694
+ ], -1),
2695
+ l("div", { class: "flex flex-col items-center gap-2" }, [
2696
+ l("div", { class: "text-lg font-bold" }, "Xilnex"),
2697
+ l("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Xilnex")
2698
+ ], -1)
2699
+ ])),
2700
+ _: 1
2701
+ })
2702
+ ]),
2703
+ _: 1
2704
+ }),
2705
+ (k(), _(ue, { to: "body" }, [
2706
+ I(fo, {
2707
+ show: r.value,
2708
+ "onUpdate:show": a[1] || (a[1] = (A) => r.value = A)
2709
+ }, null, 8, ["show"])
2710
+ ]))
2711
+ ], 64)) : X("", !0);
2712
+ };
2713
+ }
2714
+ }), Ie = [
2715
+ "bin",
2716
+ "group",
2717
+ "code",
2718
+ "description",
2719
+ "unitcost",
2720
+ "convertUom",
2721
+ "quantity",
2722
+ "total"
2723
+ ];
2724
+ async function vo(F, g, s) {
2725
+ var b;
2726
+ const r = await go(s), n = [], t = {}, a = Object.keys(r)[0], d = r[a];
2727
+ for (let A = 0; A < d.length; A++) {
2728
+ const S = d[A], p = S.code, v = S.description, h = S.quantity, C = S.unitcost;
2729
+ if (p === "" || p === "undefined") {
2730
+ n.push({
2731
+ row: S.excelRow,
2732
+ itemCode: p,
2733
+ itemName: v,
2734
+ message: "Item code is empty or undefined"
2735
+ });
2736
+ continue;
2737
+ }
2738
+ const w = g.find((y) => y.code === p);
2739
+ if (!w) {
2740
+ n.push({
2741
+ row: S.excelRow,
2742
+ itemCode: p,
2743
+ itemName: v,
2744
+ qty: h,
2745
+ message: "Item not found in inventory"
2746
+ }), console.error(`${S.excelRow} Item not found: ${p} ${v} ${h}`);
2747
+ continue;
2748
+ }
2749
+ let f = Number(S.total);
2750
+ const c = F[w._id];
2751
+ c && (f = c * Number(h));
2752
+ const u = P.fromNumber(Number(h)), i = {
2753
+ amount: u,
2754
+ cost: {
2755
+ ...P.fromNumber(Number(f)),
2756
+ currency: "MYR"
2757
+ }
2758
+ };
2759
+ h != "0" && C == "0" && console.warn(`Item ${p} ${v} has 0 cost.`), t[b = w._id] ?? (t[b] = {
2760
+ skuAdjustment: {
2761
+ sku: w,
2762
+ fromBalance: P.fromNumber(0),
2763
+ amounts: [
2764
+ {
2765
+ _id: null,
2766
+ type: we.Enum.CLOSING,
2767
+ remark: "Opening Balance",
2768
+ amount: u,
2769
+ measurement: null,
2770
+ // always the smallest unit
2771
+ cost: i.cost
2772
+ }
2773
+ ],
2774
+ toBalance: u,
2775
+ toCostBalances: [i]
2776
+ },
2777
+ skuBalance: {
2778
+ id: w._id,
2779
+ balance: u,
2780
+ costs: [i]
2781
+ }
2782
+ });
2783
+ }
2784
+ return {
2785
+ errors: n,
2786
+ rows: t
2787
+ };
2788
+ }
2789
+ async function go(F) {
2790
+ const g = await new Promise((t, a) => {
2791
+ const d = new FileReader();
2792
+ d.onload = (b) => t(b.target.result), d.onerror = a, d.readAsArrayBuffer(F);
2793
+ }), s = ke(g, { type: "array" }), r = s.SheetNames, n = {};
2794
+ for (const t of r) {
2795
+ const a = await Ao(s.Sheets[t]);
2796
+ n[t] = a;
2797
+ }
2798
+ return n;
2799
+ }
2800
+ async function Ao(F) {
2801
+ const g = Be.sheet_to_json(F, {
2802
+ header: Ie,
2803
+ range: 1
2804
+ }), s = [];
2805
+ for (let r = 0; r < g.length; r++) {
2806
+ const n = g[r], t = {};
2807
+ for (const a of Ie)
2808
+ t[a] = String(n[a]).trim();
2809
+ s.push({
2810
+ ...t,
2811
+ excelRow: r + 2
2812
+ // Excel rows start from 1, and we skip the first row
2813
+ });
2814
+ }
2815
+ return s;
2816
+ }
2817
+ const yo = { class: "flex flex-col gap-4" }, bo = { class: "flex flex-col" }, ho = {
2818
+ key: 0,
2819
+ class: "flex flex-col gap-4 my-5"
2820
+ }, Io = { class: "flex flex-col gap-8" }, xo = { class: "flex flex-col gap-8" }, So = {
2821
+ class: /* @__PURE__ */ q(["fm-corner-radius-md p-16 flex items-center gap-16"])
2822
+ }, wo = {
2823
+ class: /* @__PURE__ */ q(["fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center gap-3"])
2824
+ }, ko = { class: "line-clamp-2 text-ellipsis break-all" }, Bo = { class: "flex flex-col" }, Co = { class: "font-medium" }, Eo = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, Fo = { class: "flex" }, Lo = { class: "flex" }, Vo = { key: 1 }, No = /* @__PURE__ */ Y({
2825
+ __name: "SynergyOpeningImport",
2826
+ setup(F) {
2827
+ const g = Pe(), s = Ae(), r = Ce(), n = ae(), t = z(() => [
2828
+ {
2829
+ value: "synergy",
2830
+ label: "Synergy",
2831
+ subLabel: "Based on Synergy's item cost from excel file"
2832
+ }
2833
+ ]), a = j(t.value[0].value), { t: d } = de(), b = j(null), A = j(), S = j(""), p = j([]), v = j([]), h = [
2834
+ {
2835
+ id: "ingredient",
2836
+ header: () => "Ingredient",
2837
+ cell(m) {
2838
+ const e = m.row.original;
2839
+ return N("div", { class: "flex flex-col" }, [
2840
+ N("span", { class: "font-medium" }, e.skuAdjustment.sku.name),
2841
+ N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2842
+ e.skuAdjustment.sku.code
2843
+ ])
2844
+ ]);
2845
+ }
2846
+ },
2847
+ {
2848
+ id: "openingBalance",
2849
+ header: () => "Opening Balance",
2850
+ cell(m) {
2851
+ const e = m.row.original;
2852
+ return N("div", { class: "flex flex-col" }, [
2853
+ N(
2854
+ "span",
2855
+ { class: "font-medium" },
2856
+ P.toFormatString({
2857
+ value: e.skuAdjustment.amounts[0].amount
2858
+ })
2859
+ )
2860
+ ]);
2861
+ }
2862
+ },
2863
+ {
2864
+ id: "unit",
2865
+ header: () => "Unit",
2866
+ cell(m) {
2867
+ const e = m.row.original, o = !e.skuAdjustment.amounts[0].measurement;
2868
+ let B = e.skuAdjustment.sku.unit.name;
2869
+ if (!o) {
2870
+ const L = e.skuAdjustment.sku.unit.measurements.find(
2871
+ (V) => V.id === e.skuAdjustment.amounts[0].measurement.id
2872
+ );
2873
+ B = L ? L.name : "Error: Measurement not found";
2874
+ }
2875
+ return N("div", { class: "flex flex-col" }, [
2876
+ N("span", { class: "font-medium" }, B),
2877
+ o ? null : N("span", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, [
2878
+ `Base unit: ${e.skuAdjustment.sku.unit.name}`
2879
+ ])
2880
+ ]);
2881
+ }
2882
+ },
2883
+ {
2884
+ id: "totalCost",
2885
+ header: () => "Total Cost",
2886
+ cell(m) {
2887
+ const e = m.row.original, { currency: o, ...B } = e.skuAdjustment.amounts[0].cost ?? {
2888
+ amount: 0,
2889
+ precision: 0,
2890
+ currency: ""
2891
+ };
2892
+ return N("div", { class: "flex flex-col" }, [
2893
+ N(
2894
+ "span",
2895
+ { class: "font-medium" },
2896
+ P.toFormatString({
2897
+ value: B
2898
+ })
2899
+ )
2900
+ ]);
2901
+ }
2902
+ }
2903
+ ], C = [
2904
+ {
2905
+ accessorKey: "row",
2906
+ header: "Row"
2907
+ },
2908
+ {
2909
+ accessorKey: "itemCode",
2910
+ header: "Item Code"
2911
+ },
2912
+ {
2913
+ accessorKey: "itemName",
2914
+ header: "Item Name"
2915
+ },
2916
+ {
2917
+ accessorKey: "qty",
2918
+ header: "Quantity"
2919
+ },
2920
+ {
2921
+ accessorKey: "message",
2922
+ header: "Error Message"
2923
+ }
2924
+ ], w = j(!1);
2925
+ async function f() {
2926
+ if (b.value) {
2927
+ w.value = !0;
2928
+ try {
2929
+ let m = {};
2930
+ const { errors: e, rows: o } = await vo(
2931
+ m,
2932
+ s.skus,
2933
+ b.value
2934
+ );
2935
+ p.value = e, v.value = Object.values(o);
2936
+ } catch {
2937
+ n.open({
2938
+ message: "Error verifying file",
2939
+ type: "error"
2940
+ });
2941
+ } finally {
2942
+ w.value = !1;
2943
+ }
2944
+ }
2945
+ }
2946
+ async function c() {
2947
+ if (b.value) {
2948
+ w.value = !0;
2949
+ try {
2950
+ if (!i.value) {
2951
+ n.open({
2952
+ message: "Please select a date for the opening balance",
2953
+ type: "error"
2954
+ });
2955
+ return;
2956
+ }
2957
+ await r.setOpeningBalance({
2958
+ effectiveAt: i.value,
2959
+ skuAdjustments: v.value.map((m) => m.skuAdjustment),
2960
+ skuBalances: v.value.map((m) => m.skuBalance)
2961
+ }), n.open({
2962
+ message: "Opening balance imported successfully",
2963
+ type: "success"
2964
+ }), await g.fetchClosingDocumentId();
2965
+ } catch {
2966
+ n.open({
2967
+ message: "Error importing opening balance",
2968
+ type: "error"
2969
+ });
2970
+ } finally {
2971
+ w.value = !1;
2972
+ }
2973
+ }
2974
+ }
2975
+ const u = j(""), i = z({
2976
+ get() {
2977
+ return u.value;
2978
+ },
2979
+ set(m) {
2980
+ u.value = `${m}T15:59:59.999Z`;
2981
+ }
2982
+ }), y = z(() => {
2983
+ if (!u.value) return null;
2984
+ const m = new Date(u.value);
2985
+ return isNaN(m.getTime()) ? null : ve(m);
2986
+ });
2987
+ return (m, e) => {
2988
+ const o = E("FmLabel"), B = E("FmField"), L = E("FmSimpleDatePicker"), V = E("FmButton"), H = E("FmRadio"), U = E("FmRadioGroup"), M = E("FmTable");
2989
+ return k(), R("div", yo, [
2990
+ l("div", bo, [
2991
+ I(o, { label: "Latest closing" })
2992
+ ]),
2993
+ I(B, {
2994
+ "prepend-icon": "lock_outline",
2995
+ disabled: ""
2996
+ }, {
2997
+ default: D(() => [
2998
+ Z(T(x(g).state.closingDocumentId ? `${x(Ee)(new Date(x(ge)(x(g).state.closingDocumentId)))}` : "No closing found"), 1)
2999
+ ]),
3000
+ _: 1
3001
+ }),
3002
+ x(g).state.closingDocumentId ? (k(), R("div", Vo, e[6] || (e[6] = [
3003
+ l("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)
3004
+ ]))) : (k(), R("div", ho, [
3005
+ I(L, {
3006
+ modelValue: i.value,
3007
+ "onUpdate:modelValue": e[0] || (e[0] = (O) => i.value = O),
3008
+ label: "Last closing time"
3009
+ }, {
3010
+ "trigger-button": D(() => [
3011
+ I(B, {
3012
+ "prepend-icon": "calendar_today",
3013
+ readonly: "",
3014
+ label: "Last closing time"
3015
+ }, {
3016
+ default: D(() => [
3017
+ Z(T(y.value), 1)
3018
+ ]),
3019
+ _: 1
3020
+ })
3021
+ ]),
3022
+ _: 1
3023
+ }, 8, ["modelValue"]),
3024
+ l("div", Io, [
3025
+ I(o, { label: "Stock take file" })
3026
+ ]),
3027
+ I(Fe, {
3028
+ onFileUpload: e[1] || (e[1] = (O) => {
3029
+ O && (b.value = O);
3030
+ }),
3031
+ accept: ".xlsx, .xls, .csv"
3032
+ }, ne({ _: 2 }, [
3033
+ b.value ? {
3034
+ name: "default",
3035
+ fn: D(({ openFileDialog: O }) => [
3036
+ l("div", xo, [
3037
+ l("div", So, [
3038
+ l("div", wo, [
3039
+ l("div", ko, T(b.value.name), 1),
3040
+ I(V, {
3041
+ label: x(d)("inventory.ingredient.import.replaceFile"),
3042
+ variant: "secondary",
3043
+ "prepend-icon": "autorenew",
3044
+ onClick: O
3045
+ }, null, 8, ["label", "onClick"])
3046
+ ])
3047
+ ])
3048
+ ])
3049
+ ]),
3050
+ key: "0"
3051
+ } : void 0
3052
+ ]), 1024),
3053
+ I(U, {
3054
+ modelValue: a.value,
3055
+ "onUpdate:modelValue": e[2] || (e[2] = (O) => a.value = O),
3056
+ label: "Retrieve cost from",
3057
+ class: "my-5"
3058
+ }, {
3059
+ default: D(() => [
3060
+ (k(!0), R(J, null, te(t.value, (O) => (k(), _(H, {
3061
+ key: O.value,
3062
+ value: O.value,
3063
+ label: O.label,
3064
+ sublabel: O.subLabel,
3065
+ disabled: O.disabled
3066
+ }, {
3067
+ label: D(() => [
3068
+ l("div", Bo, [
3069
+ l("span", Co, T(O.label), 1),
3070
+ l("span", Eo, T(O.disabled ? O.disabledReason : O.subLabel), 1)
3071
+ ])
3072
+ ]),
3073
+ _: 2
3074
+ }, 1032, ["value", "label", "sublabel", "disabled"]))), 128))
3075
+ ]),
3076
+ _: 1
3077
+ }, 8, ["modelValue"]),
3078
+ l("div", Fo, [
3079
+ I(V, {
3080
+ class: "ml-auto mt-4",
3081
+ variant: "secondary",
3082
+ "prepend-icon": "troubleshoot",
3083
+ label: "Verify",
3084
+ disabled: !b.value && !w.value,
3085
+ loading: w.value,
3086
+ onClick: f
3087
+ }, null, 8, ["disabled", "loading"])
3088
+ ]),
3089
+ b.value && v.value.length > 0 ? (k(), R(J, { key: 0 }, [
3090
+ e[4] || (e[4] = l("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4" }, "Results", -1)),
3091
+ I(M, {
3092
+ modelValue: A.value,
3093
+ "onUpdate:modelValue": e[3] || (e[3] = (O) => A.value = O),
3094
+ "row-data": v.value,
3095
+ "column-defs": h,
3096
+ "shrink-at": !1,
3097
+ "search-value": S.value
3098
+ }, null, 8, ["modelValue", "row-data", "search-value"])
3099
+ ], 64)) : X("", !0),
3100
+ p.value.length > 0 ? (k(), R(J, { key: 1 }, [
3101
+ e[5] || (e[5] = l("h2", { class: "fm-typo-en-title-md-800 mt-8 mb-4 text-red-600" }, "Errors", -1)),
3102
+ I(M, {
3103
+ "row-data": p.value,
3104
+ "column-defs": C
3105
+ }, null, 8, ["row-data"])
3106
+ ], 64)) : X("", !0),
3107
+ l("div", Lo, [
3108
+ v.value.length > 0 && !x(g).state.closingDocumentId ? (k(), _(V, {
3109
+ key: 0,
3110
+ class: "ml-auto mt-4",
3111
+ "prepend-icon": "file_upload",
3112
+ variant: "primary",
3113
+ label: "Import Opening Balance",
3114
+ disabled: !b.value || w.value,
3115
+ onClick: c
3116
+ }, null, 8, ["disabled"])) : X("", !0)
3117
+ ])
3118
+ ]))
3119
+ ]);
3120
+ };
3121
+ }
3122
+ }), Ro = { class: "flex flex-col gap-8 w-full" }, Do = { 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" }, jo = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, Oo = { key: 0 }, To = {
3123
+ key: 1,
3124
+ class: "flex flex-col gap-8 w-full"
3125
+ }, zo = { class: "flex gap-8 items-center justify-start" }, Ho = /* @__PURE__ */ Y({
3126
+ __name: "SynergySideSheet",
3127
+ props: {
3128
+ show: { type: Boolean },
3129
+ loading: { type: Boolean }
3130
+ },
3131
+ emits: ["update:show"],
3132
+ setup(F, { emit: g }) {
3133
+ var A;
3134
+ const s = ie(), n = se(F, "show"), { t } = G(), a = g, d = W(), b = ((A = d._currentLocation) == null ? void 0 : A.type) || "";
3135
+ return (S, p) => {
3136
+ var w;
3137
+ const v = E("FmIcon"), h = E("FmButton"), C = E("FmSideSheet");
3138
+ return k(), _(C, {
3139
+ modelValue: x(n),
3140
+ "onUpdate:modelValue": p[1] || (p[1] = (f) => oe(n) ? n.value = f : null),
3141
+ header: "Data migration (Synergy)",
3142
+ "dismiss-away": "",
3143
+ "close-button": "",
3144
+ "max-width": 800
3145
+ }, ne({
3146
+ default: D(() => {
3147
+ var f;
3148
+ return [
3149
+ (f = x(s).sessionUser.value) != null && f.role.isAdmin ? (k(), R("div", To, [
3150
+ I(No)
3151
+ ])) : (k(), R("div", Oo, " Please contact your administrator to apply the changes. "))
3152
+ ];
3153
+ }),
3154
+ "side-sheet-footer": D(() => [
3155
+ l("div", zo, [
3156
+ I(h, {
3157
+ variant: "tertiary",
3158
+ label: x(t)("common.close"),
3159
+ onClick: p[0] || (p[0] = (f) => a("update:show", !1))
3160
+ }, null, 8, ["label"])
3161
+ ])
3162
+ ]),
3163
+ _: 2
3164
+ }, [
3165
+ (w = x(s).sessionUser.value) != null && w.role.isAdmin ? {
3166
+ name: "side-sheet-header",
3167
+ fn: D(() => {
3168
+ var f;
3169
+ return [
3170
+ l("div", Ro, [
3171
+ l("div", Do, [
3172
+ p[2] || (p[2] = l("div", { class: "fm-typo-en-title-md-600" }, "Data migration (Synergy)", -1)),
3173
+ l("div", Mo, [
3174
+ I(v, {
3175
+ name: x(b),
3176
+ size: "sm"
3177
+ }, null, 8, ["name"]),
3178
+ l("div", jo, T((f = x(d)._currentLocation) == null ? void 0 : f.name), 1)
3179
+ ])
3180
+ ])
3181
+ ])
3182
+ ];
3183
+ }),
3184
+ key: "0"
3185
+ } : void 0
3186
+ ]), 1032, ["modelValue"]);
3187
+ };
3188
+ }
3189
+ }), Xo = /* @__PURE__ */ Y({
3190
+ __name: "SynergyView",
3191
+ setup(F) {
3192
+ const g = Le(), s = W(), r = j(!1);
3193
+ async function n() {
3194
+ r.value = !0, console.log("Opening Synergy migration dialog");
3195
+ }
3196
+ return (t, a) => {
3197
+ const d = E("FmCardSection"), b = E("FmCard");
3198
+ return x(g).enabledSynergyOpeningMigration && !x(s).businessLevel ? (k(), R(J, { key: 0 }, [
3199
+ I(b, {
3200
+ class: q({
3201
+ "w-full": !0,
3202
+ border: !0,
3203
+ "border-fm-color-neutral-gray-100": !0,
3204
+ "cursor-pointer": !0,
3205
+ "hover:border-fm-color-primary": !0
3206
+ }),
3207
+ onClick: a[0] || (a[0] = (A) => n())
3208
+ }, {
3209
+ default: D(() => [
3210
+ I(d, null, {
3211
+ default: D(() => a[2] || (a[2] = [
3212
+ l("div", { class: "flex justify-center" }, [
3213
+ l("div", { class: "size-[100px] bg-gray-200 rounded-lg flex items-center justify-center" }, [
3214
+ l("span", { class: "text-lg font-bold text-gray-600" }, "Synergy")
3215
+ ])
3216
+ ], -1),
3217
+ l("div", { class: "flex flex-col items-center gap-2" }, [
3218
+ l("div", { class: "text-lg font-bold" }, "Synergy"),
3219
+ l("div", { class: "text-fm-color-neutral-gray-300" }, "Data migration from Synergy")
3220
+ ], -1)
3221
+ ])),
3222
+ _: 1
3223
+ })
3224
+ ]),
3225
+ _: 1
3226
+ }),
3227
+ (k(), _(ue, { to: "body" }, [
3228
+ I(Ho, {
3229
+ show: r.value,
3230
+ "onUpdate:show": a[1] || (a[1] = (A) => r.value = A)
3231
+ }, null, 8, ["show"])
3232
+ ]))
3233
+ ], 64)) : X("", !0);
3234
+ };
3235
+ }
3236
+ }), _o = { key: 0 }, Uo = {
3237
+ key: 1,
3238
+ class: "flex flex-col items-center my-10 gap-5"
3239
+ }, Qo = ["src"], Yo = {
3240
+ class: "text-xs text-neutral-400 text-center",
3241
+ style: { "max-width": "25rem" }
3242
+ }, Jo = {
3243
+ key: 2,
3244
+ class: "grid grid-cols-2 gap-5"
3245
+ }, ts = /* @__PURE__ */ Y({
3246
+ __name: "IntegrationView",
3247
+ setup(F) {
3248
+ const g = W(), s = j(!1), r = We(), { breakpoints: n } = Ve(), t = z(() => n.value.xs || n.value.sm), { t: a } = G();
3249
+ return me(async () => {
3250
+ if (g._currentLocation) {
3251
+ s.value = !0;
3252
+ try {
3253
+ await r.fetchFoodMarketHubSetting(), await r.fetchNetSuiteSetting();
3254
+ } finally {
3255
+ s.value = !1;
3256
+ }
3257
+ }
3258
+ }), (d, b) => {
3259
+ const A = E("FmCircularProgress");
3260
+ return k(), _(Je, {
3261
+ title: x(a)("inventory.integration.title")
3262
+ }, {
3263
+ default: D(() => [
3264
+ l("div", {
3265
+ class: q([
3266
+ "flex flex-col gap-8 max-h-full",
3267
+ {
3268
+ "p-0": t.value,
3269
+ "px-24 ": !t.value
3270
+ }
3271
+ ])
3272
+ }, [
3273
+ I(Ke, {
3274
+ "change-location": "",
3275
+ showBusiness: ""
3276
+ }),
3277
+ !x(g)._currentLocation || s.value ? (k(), R("div", _o, [
3278
+ I(A, { size: "lg" })
3279
+ ])) : x(r).enabledIntegrations == 0 ? (k(), R("div", Uo, [
3280
+ l("div", null, [
3281
+ l("img", {
3282
+ src: x(He),
3283
+ alt: "List is empty"
3284
+ }, null, 8, Qo)
3285
+ ]),
3286
+ b[0] || (b[0] = l("div", { class: "font-bold text-lg" }, "Integration", -1)),
3287
+ l("div", Yo, T(x(a)("inventory.integration.description")), 1)
3288
+ ])) : (k(), R("div", Jo, [
3289
+ I(zn),
3290
+ I(Kt),
3291
+ I(po),
3292
+ I(Xo)
3293
+ ]))
3294
+ ], 2)
3295
+ ]),
3296
+ _: 1
3297
+ }, 8, ["title"]);
3298
+ };
3299
+ }
3300
+ });
3301
+ export {
3302
+ ts as default
3303
+ };