@feedmepos/mf-inventory-portal 1.2.12-dev.2 → 1.2.12
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.
- package/dist/{App-T4sL7Sy4.js → App-CP0Qx_82.js} +40 -44
- package/dist/{ApprovalView-CfmNwkYs.js → ApprovalView-D8_PzEpZ.js} +30 -30
- package/dist/{BindingsDialog-DDYAQsNs.js → BindingsDialog-BbpKhb0L.js} +2 -2
- package/dist/{BindingsPicker-CXZhlZ4b.js → BindingsPicker-DzDxisHj.js} +1 -1
- package/dist/{BindingsTable-LQ59h-NA.js → BindingsTable-DCXXSY8e.js} +1 -1
- package/dist/{ClosingDraftView-B1J4RCvY.js → ClosingDraftView-CkF-9An8.js} +129 -129
- package/dist/{ClosingTemplateView-6NoqcDMF.js → ClosingTemplateView-Ce1l7n0x.js} +28 -28
- package/dist/{DeliveryOrderPrintPreview--XMB1yg_.js → DeliveryOrderPrintPreview-CFzsECiK.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXxGymbF.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ZSERZzyn.js} +3 -3
- package/dist/{FmMultiselectDialog-DPPNjHO8.js → FmMultiselectDialog-DP992D0Q.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CSgYZv-j.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CzUvuj_c.js} +45 -45
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-tUefDFh2.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DsYwSn0d.js} +1 -1
- package/dist/{IngredientGroupView-BjtjeGay.js → IngredientGroupView-DUiKKpvF.js} +32 -31
- package/dist/IngredientsView-C3ozIXV8.js +2475 -0
- package/dist/{IntegrationView-D8HiAM5K.js → IntegrationView-CydpIwrf.js} +57 -57
- package/dist/{InventoryBindingForm-DCtBdWkM.js → InventoryBindingForm-BVd2FzOW.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-RxoPehX0.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYp_JSBb.js} +31 -31
- package/dist/{InventoryBindingSummary-DGLMoDKd.js → InventoryBindingSummary-Dthool-6.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D0ElZcnn.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DR0_Qtyc.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BNm3V8o4.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BLfGb7mm.js} +1 -1
- package/dist/{PublishView-DQcrQkVJ.js → PublishView-BE_aIhZ6.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-1NMEozJD.js → PurchaseOrderPrintPreview-CGeqqFg-.js} +1 -1
- package/dist/{ReceiveRequestView-BFs8VYre.js → ReceiveRequestView-Bul9Esf1.js} +63 -62
- package/dist/RecipeView-B9AGELV7.js +621 -0
- package/dist/{StockView-B80E0r1r.js → StockView-fpJrx4Bd.js} +166 -165
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CFFDw9Mj.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DeOEgJ1N.js} +1 -1
- package/dist/{SupplierView-E_fX8cgQ.js → SupplierView-cfZTJqef.js} +492 -490
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-m5o77oG-.js +3057 -0
- package/dist/{TransferTemplateView-B-uBdQgp.js → TransferTemplateView-PZ8Mad4D.js} +48 -48
- package/dist/UnitView-C3gJq1Mt.js +667 -0
- package/dist/{WarehouseView-DZSetx-S.js → WarehouseView-CWGQjwJm.js} +32 -32
- package/dist/api/inventory.d.ts +0 -306
- package/dist/api/purchase-order.d.ts +0 -1
- package/dist/{app-CLG8lnmY.js → app-D5PlbdVa.js} +8475 -8810
- package/dist/app.d.ts +0 -169
- package/dist/app.js +1 -1
- package/dist/array-Ca8T3f_G.js +44 -0
- package/dist/{closing-template-CHz79DOu.js → closing-template-C4FizLUw.js} +1 -1
- package/dist/{decimal-BNFgzHyV.js → decimal-Cv7FZ14q.js} +1 -1
- package/dist/{format-unit-display-DYY0F6KV.js → format-unit-display-B0NO6FLh.js} +25 -25
- package/dist/helper/number.d.ts +0 -1
- package/dist/{index-Bu7FmfHi.js → index-BCo2jtpG.js} +1 -1
- package/dist/{index-DiYSFnk1.js → index-DaJ92t7D.js} +1 -1
- package/dist/{purchase-order-template-DtfKTZLV.js → purchase-order-template-DLkR7Mva.js} +1 -1
- package/dist/router/name.d.ts +0 -1
- package/dist/{stock-RE6RExO9.js → stock-AUSAF9Ij.js} +1 -1
- package/dist/stores/feature.d.ts +0 -2
- package/dist/stores/inventory.d.ts +199 -26
- package/dist/{supplier-DkLAGLl7.js → supplier-DBXoP2UX.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Bg_kT9z-.js → use-ingredient-select-dialog-DZQR6jfi.js} +1 -1
- package/dist/{use-inventory-binding-dialog-CpS4GfwM.js → use-inventory-binding-dialog-8PZ37vLV.js} +1 -1
- package/dist/views/ingredients/helper/import-export.helper.d.ts +1 -3
- package/dist/views/recipe/RecipeView.vue.d.ts +0 -1
- package/dist/views/unit/UnitView.vue.d.ts +0 -1
- package/package.json +1 -1
- package/dist/ImportView-ClHIcxRw.js +0 -1195
- package/dist/IngredientsView-BA6Y-uhX.js +0 -2240
- package/dist/RecipeView-DgF_kShy.js +0 -636
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Bxl2Gege.js +0 -3221
- package/dist/UnitView-DOIy_8oz.js +0 -674
- package/dist/import-export.helper-uZNU9S1q.js +0 -243
- package/dist/views/import/ImportView.vue.d.ts +0 -3
- package/dist/views/import/components/ImportDialog.vue.d.ts +0 -2
- package/dist/views/import/helper/import-export.helper.d.ts +0 -4
- package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +0 -17
- package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +0 -16
- package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +0 -2
- package/dist/views/recipe/helper/import-recipe.d.ts +0 -48
- package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +0 -12
- package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +0 -6
- package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +0 -9
- package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +0 -5
- package/dist/views/unit/helper/import-export.helper.d.ts +0 -40
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { b as
|
|
4
|
-
import { useI18n as ee, useCoreStore as
|
|
5
|
-
import { useDialog as
|
|
1
|
+
import { defineComponent as ie, mergeModels as Hd, computed as E, useModel as ed, resolveComponent as D, openBlock as S, createElementBlock as w, createElementVNode as h, createVNode as C, withCtx as B, toDisplayString as A, unref as p, Fragment as oe, renderList as le, ref as k, createBlock as z, createCommentVNode as W, createTextVNode as wd, isRef as dd, normalizeClass as ae, watch as Td, createSlots as jd, normalizeStyle as Kd, Teleport as Wd } from "vue";
|
|
2
|
+
import { u as ce } from "./supplier-DBXoP2UX.js";
|
|
3
|
+
import { b as ke, i as Yd, D as td, j as ye, f as we, a as Ve, r as rd, s as nd, m as Xd, v as Zd, E as Ad, u as Pe, p as Z, c as Ce, e as U, x as qd, z as Rd, B as zd, C as Md, G as Jd, J as Qd, K as et, O as dt, P as tt, Q as rt, T as nt, V as ve } from "./app-D5PlbdVa.js";
|
|
4
|
+
import { useI18n as ee, useCoreStore as Ne } from "@feedmepos/mf-common";
|
|
5
|
+
import { useDialog as Se, useSnackbar as xe, useProxiedModel as od, useDialogChild as ot, useBreakpoints as at } from "@feedmepos/ui-library";
|
|
6
6
|
import { _ as it } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
7
|
-
import { _ as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { u as lt } from "./purchase-order-template-
|
|
7
|
+
import { _ as $t } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CzUvuj_c.js";
|
|
8
|
+
import { u as lt } from "./purchase-order-template-DLkR7Mva.js";
|
|
9
9
|
import { defineStore as st } from "pinia";
|
|
10
10
|
function ut(e, d) {
|
|
11
|
-
const { t } = ee(), r =
|
|
11
|
+
const { t } = ee(), r = ke();
|
|
12
12
|
function n(o, l) {
|
|
13
|
-
if (o ===
|
|
14
|
-
e(
|
|
13
|
+
if (o === ye.Edit) {
|
|
14
|
+
e(we(l));
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
if (o ===
|
|
18
|
-
d(
|
|
17
|
+
if (o === ye.Delete) {
|
|
18
|
+
d(we(l));
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -56,7 +56,7 @@ function ut(e, d) {
|
|
|
56
56
|
header: "",
|
|
57
57
|
cell(o) {
|
|
58
58
|
return Yd(
|
|
59
|
-
[td[
|
|
59
|
+
[td[ye.Edit], td[ye.Delete]],
|
|
60
60
|
(l) => {
|
|
61
61
|
n(l, o.row.original);
|
|
62
62
|
}
|
|
@@ -70,7 +70,7 @@ function ut(e, d) {
|
|
|
70
70
|
}
|
|
71
71
|
] };
|
|
72
72
|
}
|
|
73
|
-
const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, ft = { class: "flex items-center gap-8 py-8" }, mt = { class: "flex-1" }, yt = { class: "fm-typo-en-title-sm-800" }, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex flex-col gap-4" }, ht = { class: "flex-1" }, bt = { class: "flex flex-col" }, _t = { class: "fm-typo-en-body-lg-400" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = { class: "flex-1" }, Nt = { class: "flex" }, St = { class: "text-fm-color-typo-secondary" }, xt = /* @__PURE__ */
|
|
73
|
+
const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, ft = { class: "flex items-center gap-8 py-8" }, mt = { class: "flex-1" }, yt = { class: "fm-typo-en-title-sm-800" }, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex flex-col gap-4" }, ht = { class: "flex-1" }, bt = { class: "flex flex-col" }, _t = { class: "fm-typo-en-body-lg-400" }, Pt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = { class: "flex-1" }, Nt = { class: "flex" }, St = { class: "text-fm-color-typo-secondary" }, xt = /* @__PURE__ */ ie({
|
|
74
74
|
__name: "SupplierSupplyItemField",
|
|
75
75
|
props: /* @__PURE__ */ Hd({
|
|
76
76
|
modelValue: {},
|
|
@@ -83,22 +83,22 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
83
83
|
}),
|
|
84
84
|
emits: ["update:modelValue", "update:autoAppendToTemplates"],
|
|
85
85
|
setup(e) {
|
|
86
|
-
const d =
|
|
86
|
+
const d = Ne(), t = Ve(), r = E(() => t.skus), n = Se(), { t: i } = ee(), o = ed(e, "modelValue");
|
|
87
87
|
ed(e, "autoAppendToTemplates");
|
|
88
88
|
function l() {
|
|
89
|
-
var
|
|
89
|
+
var N;
|
|
90
90
|
const c = t.skus.map((f) => ({
|
|
91
91
|
label: f.name,
|
|
92
92
|
sublabel: f.code,
|
|
93
93
|
value: f._id
|
|
94
|
-
})), y = ((
|
|
94
|
+
})), y = ((N = o.value) == null ? void 0 : N.map((f) => f.skuId)) ?? [], g = E(
|
|
95
95
|
() => {
|
|
96
96
|
var f;
|
|
97
97
|
return ((f = Xd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
n.open({
|
|
101
|
-
title:
|
|
101
|
+
title: i("inventory.supplier.supplyItems.selectItem"),
|
|
102
102
|
closeButton: !0,
|
|
103
103
|
contentComponent: Zd,
|
|
104
104
|
contentComponentProps: {
|
|
@@ -116,11 +116,11 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
116
116
|
}
|
|
117
117
|
}).onPrimary((f) => {
|
|
118
118
|
const O = f.map((F) => t.skuById[F]).filter((F) => F);
|
|
119
|
-
O.sort((F,
|
|
119
|
+
O.sort((F, T) => F.code.localeCompare(T.code));
|
|
120
120
|
const b = O.map((F) => {
|
|
121
121
|
var Y;
|
|
122
|
-
const
|
|
123
|
-
return
|
|
122
|
+
const T = (Y = o.value) == null ? void 0 : Y.find((X) => X.skuId === F._id);
|
|
123
|
+
return T || {
|
|
124
124
|
skuId: F._id,
|
|
125
125
|
defaultCost: F.defaultCost ?? {
|
|
126
126
|
costPerUnit: {
|
|
@@ -139,8 +139,8 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
139
139
|
y.splice(c, 1), o.value = y;
|
|
140
140
|
}
|
|
141
141
|
function u(c) {
|
|
142
|
-
var
|
|
143
|
-
const y = c.skuId, g = (
|
|
142
|
+
var N;
|
|
143
|
+
const y = c.skuId, g = (N = r.value.find((f) => f._id === y)) == null ? void 0 : N.unit;
|
|
144
144
|
if (!g)
|
|
145
145
|
throw new Error(`Cannot find ingredient: ${y}`);
|
|
146
146
|
return g;
|
|
@@ -152,7 +152,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
function m(c, y) {
|
|
155
|
-
const
|
|
155
|
+
const N = (o.value ?? []).map((f) => f.skuId !== c.skuId ? f : {
|
|
156
156
|
...f,
|
|
157
157
|
defaultCost: {
|
|
158
158
|
...f.defaultCost,
|
|
@@ -163,7 +163,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
o.value =
|
|
166
|
+
o.value = N;
|
|
167
167
|
}
|
|
168
168
|
return (c, y) => {
|
|
169
169
|
const g = D("FmButton");
|
|
@@ -171,62 +171,62 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
171
171
|
h("div", pt, [
|
|
172
172
|
h("div", ft, [
|
|
173
173
|
h("div", mt, [
|
|
174
|
-
|
|
175
|
-
default:
|
|
176
|
-
h("div", yt,
|
|
174
|
+
C(it, { "z-index": 50 }, {
|
|
175
|
+
default: B(() => [
|
|
176
|
+
h("div", yt, A(p(i)("inventory.supplier.supplyItems.title")), 1)
|
|
177
177
|
]),
|
|
178
178
|
_: 1
|
|
179
179
|
})
|
|
180
180
|
]),
|
|
181
181
|
h("div", null, [
|
|
182
|
-
|
|
182
|
+
C(g, {
|
|
183
183
|
"prepend-icon": "link",
|
|
184
|
-
label: p(
|
|
184
|
+
label: p(i)("inventory.supplier.supplyItems.addItems"),
|
|
185
185
|
variant: "plain",
|
|
186
186
|
onClick: l
|
|
187
187
|
}, null, 8, ["label"])
|
|
188
188
|
])
|
|
189
189
|
]),
|
|
190
|
-
h("div", vt,
|
|
190
|
+
h("div", vt, A(p(i)("inventory.supplier.supplyItems.overridePriceHint")), 1)
|
|
191
191
|
]),
|
|
192
192
|
h("div", gt, [
|
|
193
|
-
(S(!0), w(
|
|
193
|
+
(S(!0), w(oe, null, le(o.value, (N, f) => {
|
|
194
194
|
var O, b, F;
|
|
195
195
|
return S(), w("div", {
|
|
196
|
-
key:
|
|
196
|
+
key: N.skuId,
|
|
197
197
|
class: "flex"
|
|
198
198
|
}, [
|
|
199
199
|
h("div", ht, [
|
|
200
200
|
h("div", bt, [
|
|
201
|
-
h("div", _t,
|
|
202
|
-
h("div", Pt,
|
|
201
|
+
h("div", _t, A((O = p(t).skuById[N.skuId]) == null ? void 0 : O.name), 1),
|
|
202
|
+
h("div", Pt, A((b = p(t).skuById[N.skuId]) == null ? void 0 : b.code), 1)
|
|
203
203
|
])
|
|
204
204
|
]),
|
|
205
205
|
h("div", Ct, [
|
|
206
206
|
h("div", Nt, [
|
|
207
|
-
|
|
208
|
-
"model-value": v(
|
|
209
|
-
unit: u(
|
|
210
|
-
"onUpdate:modelValue": (
|
|
207
|
+
C($t, {
|
|
208
|
+
"model-value": v(N),
|
|
209
|
+
unit: u(N),
|
|
210
|
+
"onUpdate:modelValue": (T) => m(N, T),
|
|
211
211
|
placement: o.value && f === ((F = o.value) == null ? void 0 : F.length) - 1 ? "top" : "bottom",
|
|
212
212
|
separator: "/",
|
|
213
213
|
"apply-default-rules": "",
|
|
214
214
|
precision: 4,
|
|
215
215
|
"format-minimum-precision": 2
|
|
216
216
|
}, {
|
|
217
|
-
prepend:
|
|
218
|
-
var
|
|
217
|
+
prepend: B(() => {
|
|
218
|
+
var T, V;
|
|
219
219
|
return [
|
|
220
|
-
h("div", St,
|
|
220
|
+
h("div", St, A(p(rd)(((T = p(d).currentCountry) == null ? void 0 : T.value) ?? p(nd)) === "MYR" ? "RM" : p(rd)(((V = p(d).currentCountry) == null ? void 0 : V.value) ?? p(nd))), 1)
|
|
221
221
|
];
|
|
222
222
|
}),
|
|
223
223
|
_: 2
|
|
224
224
|
}, 1032, ["model-value", "unit", "onUpdate:modelValue", "placement"]),
|
|
225
225
|
h("div", null, [
|
|
226
|
-
|
|
226
|
+
C(g, {
|
|
227
227
|
"prepend-icon": "close",
|
|
228
228
|
variant: "tertiary",
|
|
229
|
-
onClick: (
|
|
229
|
+
onClick: (T) => s(f)
|
|
230
230
|
}, null, 8, ["onClick"])
|
|
231
231
|
])
|
|
232
232
|
])
|
|
@@ -237,13 +237,13 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
237
237
|
]);
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
}), Et = { class: "flex flex-col gap-40" }, It = { class: "flex flex-col gap-16" }, Ot = { key: 0 }, Ft = { class: "flex flex-col gap-8" }, wt = { class: "fm-typo-en-title-sm-800" },
|
|
240
|
+
}), Et = { class: "flex flex-col gap-40" }, It = { class: "flex flex-col gap-16" }, Ot = { key: 0 }, Ft = { class: "flex flex-col gap-8" }, wt = { class: "fm-typo-en-title-sm-800" }, Tt = { class: "grid grid-cols-2 gap-24" }, At = { class: "flex flex-col gap-8" }, Rt = { class: "fm-typo-en-title-sm-800" }, Mt = { class: "flex flex-col gap-16" }, Dt = {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: "flex flex-col gap-8"
|
|
243
243
|
}, Lt = { class: "fm-typo-en-title-sm-800" }, kt = { class: "flex flex-col gap-16" }, Vt = {
|
|
244
244
|
key: 1,
|
|
245
245
|
class: "flex flex-col gap-8"
|
|
246
|
-
}, Bt = /* @__PURE__ */
|
|
246
|
+
}, Bt = /* @__PURE__ */ ie({
|
|
247
247
|
__name: "SupplierForm",
|
|
248
248
|
props: {
|
|
249
249
|
modelValue: {},
|
|
@@ -251,277 +251,277 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
251
251
|
},
|
|
252
252
|
emits: ["update:modelValue", "validation-success"],
|
|
253
253
|
setup(e, { expose: d, emit: t }) {
|
|
254
|
-
const r = e, n = t,
|
|
255
|
-
() => u.businessLevel ||
|
|
254
|
+
const r = e, n = t, i = Ce(), o = Ve(), l = E(() => Ad(o.skus, "_id")), { t: s } = ee(), u = Pe(), v = E(
|
|
255
|
+
() => u.businessLevel || i.businessSupplierOnly
|
|
256
256
|
), m = E({
|
|
257
257
|
get() {
|
|
258
|
-
var
|
|
259
|
-
return ((
|
|
258
|
+
var $;
|
|
259
|
+
return (($ = r.modelValue) == null ? void 0 : $.name) ?? "";
|
|
260
260
|
},
|
|
261
|
-
set(
|
|
261
|
+
set($) {
|
|
262
262
|
const a = r.modelValue ?? {};
|
|
263
|
-
a.name =
|
|
263
|
+
a.name = $, n("update:modelValue", a);
|
|
264
264
|
}
|
|
265
265
|
}), c = E({
|
|
266
266
|
get() {
|
|
267
|
-
var
|
|
268
|
-
return ((
|
|
267
|
+
var $;
|
|
268
|
+
return (($ = r.modelValue) == null ? void 0 : $.registrationNumber) ?? "";
|
|
269
269
|
},
|
|
270
|
-
set(
|
|
270
|
+
set($) {
|
|
271
271
|
const a = r.modelValue ?? {};
|
|
272
|
-
a.registrationNumber =
|
|
272
|
+
a.registrationNumber = $, n("update:modelValue", a);
|
|
273
273
|
}
|
|
274
274
|
}), y = E({
|
|
275
275
|
get() {
|
|
276
|
-
var
|
|
277
|
-
return ((a = (
|
|
276
|
+
var $, a;
|
|
277
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.line1) ?? "";
|
|
278
278
|
},
|
|
279
|
-
set(
|
|
279
|
+
set($) {
|
|
280
280
|
const a = r.modelValue ?? {};
|
|
281
|
-
a.address ?? (a.address = {}), a.address.line1 =
|
|
281
|
+
a.address ?? (a.address = {}), a.address.line1 = $, n("update:modelValue", a);
|
|
282
282
|
}
|
|
283
283
|
}), g = E({
|
|
284
284
|
get() {
|
|
285
|
-
var
|
|
286
|
-
return ((a = (
|
|
285
|
+
var $, a;
|
|
286
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.line2) ?? "";
|
|
287
287
|
},
|
|
288
|
-
set(
|
|
288
|
+
set($) {
|
|
289
289
|
const a = r.modelValue ?? {};
|
|
290
|
-
a.address ?? (a.address = {}), a.address.line2 =
|
|
290
|
+
a.address ?? (a.address = {}), a.address.line2 = $, n("update:modelValue", a);
|
|
291
291
|
}
|
|
292
|
-
}),
|
|
292
|
+
}), N = E({
|
|
293
293
|
get() {
|
|
294
|
-
var
|
|
295
|
-
return ((a = (
|
|
294
|
+
var $, a;
|
|
295
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.city) ?? "";
|
|
296
296
|
},
|
|
297
|
-
set(
|
|
297
|
+
set($) {
|
|
298
298
|
const a = r.modelValue ?? {};
|
|
299
|
-
a.address ?? (a.address = {}), a.address.city =
|
|
299
|
+
a.address ?? (a.address = {}), a.address.city = $, n("update:modelValue", a);
|
|
300
300
|
}
|
|
301
301
|
}), f = E({
|
|
302
302
|
get() {
|
|
303
|
-
var
|
|
304
|
-
return ((a = (
|
|
303
|
+
var $, a;
|
|
304
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.postcode) ?? "";
|
|
305
305
|
},
|
|
306
|
-
set(
|
|
306
|
+
set($) {
|
|
307
307
|
const a = r.modelValue ?? {};
|
|
308
|
-
a.address ?? (a.address = {}), a.address.postcode =
|
|
308
|
+
a.address ?? (a.address = {}), a.address.postcode = $, n("update:modelValue", a);
|
|
309
309
|
}
|
|
310
310
|
}), O = E({
|
|
311
311
|
get() {
|
|
312
|
-
var
|
|
313
|
-
return ((a = (
|
|
312
|
+
var $, a;
|
|
313
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.state) ?? "";
|
|
314
314
|
},
|
|
315
|
-
set(
|
|
315
|
+
set($) {
|
|
316
316
|
const a = r.modelValue ?? {};
|
|
317
|
-
a.address ?? (a.address = {}), a.address.state =
|
|
317
|
+
a.address ?? (a.address = {}), a.address.state = $, n("update:modelValue", a);
|
|
318
318
|
}
|
|
319
319
|
}), b = E({
|
|
320
320
|
get() {
|
|
321
|
-
var
|
|
322
|
-
return ((a = (
|
|
321
|
+
var $, a;
|
|
322
|
+
return ((a = ($ = r.modelValue) == null ? void 0 : $.address) == null ? void 0 : a.country) ?? "";
|
|
323
323
|
},
|
|
324
|
-
set(
|
|
324
|
+
set($) {
|
|
325
325
|
const a = r.modelValue ?? {};
|
|
326
|
-
a.address ?? (a.address = {}), a.address.country =
|
|
326
|
+
a.address ?? (a.address = {}), a.address.country = $, n("update:modelValue", a);
|
|
327
327
|
}
|
|
328
328
|
}), F = E({
|
|
329
329
|
get() {
|
|
330
|
-
var
|
|
331
|
-
return ((
|
|
330
|
+
var $;
|
|
331
|
+
return (($ = r.modelValue) == null ? void 0 : $.contactName) ?? "";
|
|
332
332
|
},
|
|
333
|
-
set(
|
|
333
|
+
set($) {
|
|
334
334
|
const a = r.modelValue ?? {};
|
|
335
|
-
a.contactName =
|
|
335
|
+
a.contactName = $, n("update:modelValue", a);
|
|
336
336
|
}
|
|
337
|
-
}),
|
|
337
|
+
}), T = E({
|
|
338
338
|
get() {
|
|
339
|
-
var
|
|
340
|
-
return ((
|
|
339
|
+
var $;
|
|
340
|
+
return (($ = r.modelValue) == null ? void 0 : $.phoneNumber) ?? "";
|
|
341
341
|
},
|
|
342
|
-
set(
|
|
342
|
+
set($) {
|
|
343
343
|
const a = r.modelValue ?? {};
|
|
344
|
-
a.phoneNumber =
|
|
344
|
+
a.phoneNumber = $, n("update:modelValue", a);
|
|
345
345
|
}
|
|
346
346
|
}), V = E({
|
|
347
347
|
get() {
|
|
348
348
|
var a;
|
|
349
|
-
const
|
|
350
|
-
return
|
|
349
|
+
const $ = (a = r.modelValue) == null ? void 0 : a.preparationTime;
|
|
350
|
+
return $ && typeof $ == "object" && "value" in $ ? $.value.toString() : "";
|
|
351
351
|
},
|
|
352
|
-
set(
|
|
352
|
+
set($) {
|
|
353
353
|
const a = r.modelValue ?? {};
|
|
354
354
|
a.preparationTime = {
|
|
355
|
-
value: parseInt(
|
|
355
|
+
value: parseInt($),
|
|
356
356
|
unit: "day"
|
|
357
357
|
}, n("update:modelValue", a);
|
|
358
358
|
}
|
|
359
|
-
}), { enabledCountries: Y, currentCountry: X } =
|
|
359
|
+
}), { enabledCountries: Y, currentCountry: X } = Ne(), te = E({
|
|
360
360
|
get() {
|
|
361
|
-
var
|
|
362
|
-
return ((
|
|
361
|
+
var $;
|
|
362
|
+
return (($ = r.modelValue) == null ? void 0 : $.email) ?? "";
|
|
363
363
|
},
|
|
364
|
-
set(
|
|
364
|
+
set($) {
|
|
365
365
|
const a = r.modelValue ?? {};
|
|
366
|
-
a.email =
|
|
366
|
+
a.email = $, n("update:modelValue", a);
|
|
367
367
|
}
|
|
368
368
|
}), _ = E({
|
|
369
369
|
get() {
|
|
370
370
|
var a;
|
|
371
|
-
return (((a = r.modelValue) == null ? void 0 : a.supplyItems) ?? []).filter((
|
|
371
|
+
return (((a = r.modelValue) == null ? void 0 : a.supplyItems) ?? []).filter((H) => l.value[H.skuId]);
|
|
372
372
|
},
|
|
373
|
-
set(
|
|
373
|
+
set($) {
|
|
374
374
|
const a = r.modelValue ?? {};
|
|
375
|
-
a.supplyItems =
|
|
375
|
+
a.supplyItems = $, n("update:modelValue", a);
|
|
376
376
|
}
|
|
377
377
|
}), x = k();
|
|
378
378
|
return d({
|
|
379
379
|
validateInputs: () => {
|
|
380
|
-
var
|
|
381
|
-
(a = (
|
|
380
|
+
var $, a;
|
|
381
|
+
(a = ($ = x.value) == null ? void 0 : $.validateInputs) == null || a.call($);
|
|
382
382
|
},
|
|
383
383
|
resetInputsValidation: () => {
|
|
384
|
-
var
|
|
385
|
-
(a = (
|
|
384
|
+
var $, a;
|
|
385
|
+
(a = ($ = x.value) == null ? void 0 : $.resetInputsValidation) == null || a.call($);
|
|
386
386
|
},
|
|
387
387
|
resetInputs: () => {
|
|
388
|
-
var
|
|
389
|
-
(a = (
|
|
388
|
+
var $, a;
|
|
389
|
+
(a = ($ = x.value) == null ? void 0 : $.resetInputs) == null || a.call($);
|
|
390
390
|
}
|
|
391
|
-
}), (
|
|
392
|
-
const
|
|
393
|
-
return S(),
|
|
391
|
+
}), ($, a) => {
|
|
392
|
+
const H = D("FmChip"), I = D("FmTextField"), R = D("FmPhoneNumber"), de = D("FmPill"), M = D("FmForm");
|
|
393
|
+
return S(), z(M, {
|
|
394
394
|
ref_key: "formRef",
|
|
395
395
|
ref: x,
|
|
396
|
-
onValidationSuccess: a[13] || (a[13] = (
|
|
396
|
+
onValidationSuccess: a[13] || (a[13] = (P) => n("validation-success"))
|
|
397
397
|
}, {
|
|
398
|
-
default:
|
|
398
|
+
default: B(() => [
|
|
399
399
|
h("div", Et, [
|
|
400
400
|
h("div", It, [
|
|
401
401
|
v.value ? (S(), w("div", Ot, [
|
|
402
|
-
|
|
402
|
+
C(H, {
|
|
403
403
|
label: "Business supplier",
|
|
404
404
|
compact: ""
|
|
405
405
|
})
|
|
406
406
|
])) : W("", !0),
|
|
407
|
-
|
|
408
|
-
disabled:
|
|
409
|
-
rules: [p(
|
|
407
|
+
C(I, {
|
|
408
|
+
disabled: $.disabled,
|
|
409
|
+
rules: [p(Z)()],
|
|
410
410
|
"label-mark": "required",
|
|
411
411
|
label: p(s)("inventory.supplier.companyName"),
|
|
412
412
|
modelValue: m.value,
|
|
413
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
413
|
+
"onUpdate:modelValue": a[0] || (a[0] = (P) => m.value = P)
|
|
414
414
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
415
|
-
|
|
416
|
-
disabled:
|
|
417
|
-
rules: [p(
|
|
415
|
+
C(I, {
|
|
416
|
+
disabled: $.disabled,
|
|
417
|
+
rules: [p(Z)()],
|
|
418
418
|
"label-mark": "required",
|
|
419
419
|
label: p(s)("inventory.supplier.registrationNo"),
|
|
420
420
|
modelValue: c.value,
|
|
421
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
421
|
+
"onUpdate:modelValue": a[1] || (a[1] = (P) => c.value = P)
|
|
422
422
|
}, null, 8, ["disabled", "rules", "label", "modelValue"])
|
|
423
423
|
]),
|
|
424
424
|
h("div", Ft, [
|
|
425
|
-
h("div", wt,
|
|
426
|
-
h("div",
|
|
427
|
-
|
|
428
|
-
disabled:
|
|
429
|
-
rules: [p(
|
|
425
|
+
h("div", wt, A(p(s)("inventory.supplier.address.title")), 1),
|
|
426
|
+
h("div", Tt, [
|
|
427
|
+
C(I, {
|
|
428
|
+
disabled: $.disabled,
|
|
429
|
+
rules: [p(Z)()],
|
|
430
430
|
"label-mark": "required",
|
|
431
431
|
label: p(s)("inventory.supplier.address.line1"),
|
|
432
432
|
modelValue: y.value,
|
|
433
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
433
|
+
"onUpdate:modelValue": a[2] || (a[2] = (P) => y.value = P)
|
|
434
434
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
435
|
-
|
|
436
|
-
disabled:
|
|
435
|
+
C(I, {
|
|
436
|
+
disabled: $.disabled,
|
|
437
437
|
"label-mark": "optional",
|
|
438
438
|
label: p(s)("inventory.supplier.address.line2"),
|
|
439
439
|
modelValue: g.value,
|
|
440
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
440
|
+
"onUpdate:modelValue": a[3] || (a[3] = (P) => g.value = P)
|
|
441
441
|
}, null, 8, ["disabled", "label", "modelValue"]),
|
|
442
|
-
|
|
443
|
-
disabled:
|
|
444
|
-
rules: [p(
|
|
442
|
+
C(I, {
|
|
443
|
+
disabled: $.disabled,
|
|
444
|
+
rules: [p(Z)()],
|
|
445
445
|
"label-mark": "required",
|
|
446
446
|
label: p(s)("inventory.supplier.address.city"),
|
|
447
|
-
modelValue:
|
|
448
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
447
|
+
modelValue: N.value,
|
|
448
|
+
"onUpdate:modelValue": a[4] || (a[4] = (P) => N.value = P)
|
|
449
449
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
450
|
-
|
|
451
|
-
disabled:
|
|
452
|
-
rules: [p(
|
|
450
|
+
C(I, {
|
|
451
|
+
disabled: $.disabled,
|
|
452
|
+
rules: [p(Z)()],
|
|
453
453
|
"label-mark": "required",
|
|
454
454
|
label: p(s)("inventory.supplier.address.postcode"),
|
|
455
455
|
modelValue: f.value,
|
|
456
|
-
"onUpdate:modelValue": a[5] || (a[5] = (
|
|
456
|
+
"onUpdate:modelValue": a[5] || (a[5] = (P) => f.value = P)
|
|
457
457
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
458
|
-
|
|
459
|
-
disabled:
|
|
460
|
-
rules: [p(
|
|
458
|
+
C(I, {
|
|
459
|
+
disabled: $.disabled,
|
|
460
|
+
rules: [p(Z)()],
|
|
461
461
|
"label-mark": "required",
|
|
462
462
|
label: p(s)("inventory.supplier.address.state"),
|
|
463
463
|
modelValue: O.value,
|
|
464
|
-
"onUpdate:modelValue": a[6] || (a[6] = (
|
|
464
|
+
"onUpdate:modelValue": a[6] || (a[6] = (P) => O.value = P)
|
|
465
465
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
466
|
-
|
|
467
|
-
disabled:
|
|
468
|
-
rules: [p(
|
|
466
|
+
C(I, {
|
|
467
|
+
disabled: $.disabled,
|
|
468
|
+
rules: [p(Z)()],
|
|
469
469
|
"label-mark": "required",
|
|
470
470
|
label: p(s)("inventory.supplier.address.country"),
|
|
471
471
|
modelValue: b.value,
|
|
472
|
-
"onUpdate:modelValue": a[7] || (a[7] = (
|
|
472
|
+
"onUpdate:modelValue": a[7] || (a[7] = (P) => b.value = P)
|
|
473
473
|
}, null, 8, ["disabled", "rules", "label", "modelValue"])
|
|
474
474
|
])
|
|
475
475
|
]),
|
|
476
|
-
h("div",
|
|
477
|
-
h("div", Rt,
|
|
476
|
+
h("div", At, [
|
|
477
|
+
h("div", Rt, A(p(s)("inventory.supplier.contact.title")), 1),
|
|
478
478
|
h("div", Mt, [
|
|
479
|
-
|
|
480
|
-
disabled:
|
|
481
|
-
rules: [p(
|
|
479
|
+
C(I, {
|
|
480
|
+
disabled: $.disabled,
|
|
481
|
+
rules: [p(Z)()],
|
|
482
482
|
"label-mark": "required",
|
|
483
483
|
label: p(s)("inventory.supplier.contact.pic"),
|
|
484
484
|
modelValue: F.value,
|
|
485
|
-
"onUpdate:modelValue": a[8] || (a[8] = (
|
|
485
|
+
"onUpdate:modelValue": a[8] || (a[8] = (P) => F.value = P)
|
|
486
486
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
487
|
-
|
|
488
|
-
disabled:
|
|
489
|
-
rules: [p(
|
|
487
|
+
C(R, {
|
|
488
|
+
disabled: $.disabled,
|
|
489
|
+
rules: [p(Z)()],
|
|
490
490
|
"label-mark": "required",
|
|
491
491
|
label: p(s)("inventory.supplier.contact.phoneNumber"),
|
|
492
|
-
modelValue:
|
|
493
|
-
"onUpdate:modelValue": a[9] || (a[9] = (
|
|
492
|
+
modelValue: T.value,
|
|
493
|
+
"onUpdate:modelValue": a[9] || (a[9] = (P) => T.value = P),
|
|
494
494
|
"extra-country-codes": p(Y),
|
|
495
495
|
"default-country": p(X)
|
|
496
496
|
}, null, 8, ["disabled", "rules", "label", "modelValue", "extra-country-codes", "default-country"]),
|
|
497
|
-
|
|
498
|
-
disabled:
|
|
497
|
+
C(I, {
|
|
498
|
+
disabled: $.disabled,
|
|
499
499
|
"label-mark": "optional",
|
|
500
500
|
label: p(s)("inventory.supplier.contact.email"),
|
|
501
|
-
modelValue:
|
|
502
|
-
"onUpdate:modelValue": a[10] || (a[10] = (
|
|
501
|
+
modelValue: te.value,
|
|
502
|
+
"onUpdate:modelValue": a[10] || (a[10] = (P) => te.value = P)
|
|
503
503
|
}, null, 8, ["disabled", "label", "modelValue"])
|
|
504
504
|
])
|
|
505
505
|
]),
|
|
506
|
-
p(
|
|
506
|
+
p(i).enableSupplierPreparationTime ? (S(), w("div", Dt, [
|
|
507
507
|
h("div", Lt, [
|
|
508
|
-
wd(
|
|
509
|
-
|
|
508
|
+
wd(A(p(s)("inventory.supplier.delivery.title")) + " ", 1),
|
|
509
|
+
C(de, { variant: "beta" })
|
|
510
510
|
]),
|
|
511
511
|
h("div", kt, [
|
|
512
|
-
|
|
513
|
-
disabled:
|
|
512
|
+
C(I, {
|
|
513
|
+
disabled: $.disabled,
|
|
514
514
|
label: p(s)("inventory.supplier.delivery.preparationTime"),
|
|
515
515
|
modelValue: V.value,
|
|
516
|
-
"onUpdate:modelValue": a[11] || (a[11] = (
|
|
516
|
+
"onUpdate:modelValue": a[11] || (a[11] = (P) => V.value = P),
|
|
517
517
|
type: "number"
|
|
518
518
|
}, null, 8, ["disabled", "label", "modelValue"])
|
|
519
519
|
])
|
|
520
520
|
])) : W("", !0),
|
|
521
|
-
p(
|
|
522
|
-
|
|
521
|
+
p(i).enableTotalCost ? (S(), w("div", Vt, [
|
|
522
|
+
C(xt, {
|
|
523
523
|
modelValue: _.value,
|
|
524
|
-
"onUpdate:modelValue": a[12] || (a[12] = (
|
|
524
|
+
"onUpdate:modelValue": a[12] || (a[12] = (P) => _.value = P)
|
|
525
525
|
}, null, 8, ["modelValue"])
|
|
526
526
|
])) : W("", !0)
|
|
527
527
|
])
|
|
@@ -533,7 +533,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
533
533
|
}), Ut = {
|
|
534
534
|
key: 0,
|
|
535
535
|
class: "mt-5 flex flex-col gap-4"
|
|
536
|
-
}, Gt = { class: "line-clamp-1" }, Ht = { class: "flex gap-4" }, jt = /* @__PURE__ */
|
|
536
|
+
}, Gt = { class: "line-clamp-1" }, Ht = { class: "flex gap-4" }, jt = /* @__PURE__ */ ie({
|
|
537
537
|
__name: "SupplierDialog",
|
|
538
538
|
props: {
|
|
539
539
|
mode: {},
|
|
@@ -542,23 +542,23 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
542
542
|
},
|
|
543
543
|
emits: ["update:show", "submitted"],
|
|
544
544
|
setup(e, { expose: d, emit: t }) {
|
|
545
|
-
const r =
|
|
545
|
+
const r = ke(), n = e, i = t, o = k(!1), l = xe(), s = Se(), { t: u } = ee(), v = ce(), m = lt(), c = Ve(), y = k(!1), g = E(() => {
|
|
546
546
|
switch (n.mode) {
|
|
547
|
-
case
|
|
547
|
+
case U.READ:
|
|
548
548
|
return "";
|
|
549
|
-
case
|
|
549
|
+
case U.UPDATE:
|
|
550
550
|
return u("inventory.supplier.update.title");
|
|
551
|
-
case
|
|
551
|
+
case U.CREATE:
|
|
552
552
|
return u("inventory.supplier.create.title");
|
|
553
553
|
}
|
|
554
554
|
return "";
|
|
555
|
-
}),
|
|
555
|
+
}), N = E(() => {
|
|
556
556
|
switch (n.mode) {
|
|
557
|
-
case
|
|
557
|
+
case U.READ:
|
|
558
558
|
return "";
|
|
559
|
-
case
|
|
559
|
+
case U.UPDATE:
|
|
560
560
|
return u("common.save");
|
|
561
|
-
case
|
|
561
|
+
case U.CREATE:
|
|
562
562
|
return u("common.add");
|
|
563
563
|
}
|
|
564
564
|
return "";
|
|
@@ -582,7 +582,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
582
582
|
var _, x;
|
|
583
583
|
(x = (_ = f.value) == null ? void 0 : _.validateInputs) == null || x.call(_);
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function T() {
|
|
586
586
|
return new Promise((_) => {
|
|
587
587
|
s.open({
|
|
588
588
|
title: u("inventory.supplier.autoAppendToTemplates.title"),
|
|
@@ -607,11 +607,11 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
607
607
|
async function V() {
|
|
608
608
|
var _;
|
|
609
609
|
switch (n.mode) {
|
|
610
|
-
case
|
|
610
|
+
case U.READ:
|
|
611
611
|
return;
|
|
612
|
-
case
|
|
613
|
-
return ((_ = b.value.supplyItems) == null ? void 0 : _.length) > 0 ? await
|
|
614
|
-
case
|
|
612
|
+
case U.UPDATE:
|
|
613
|
+
return ((_ = b.value.supplyItems) == null ? void 0 : _.length) > 0 ? await T() : y.value = !1, X();
|
|
614
|
+
case U.CREATE:
|
|
615
615
|
return Y();
|
|
616
616
|
}
|
|
617
617
|
}
|
|
@@ -625,7 +625,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
625
625
|
title: u("inventory.common.success"),
|
|
626
626
|
message: u("inventory.supplier.create.success", { name: b.value.name }),
|
|
627
627
|
type: "success"
|
|
628
|
-
}),
|
|
628
|
+
}), i("update:show", !1), i("submitted");
|
|
629
629
|
} catch (_) {
|
|
630
630
|
l.open({
|
|
631
631
|
title: "Something went wrong",
|
|
@@ -652,14 +652,14 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
652
652
|
v.updateSupplier(b.value),
|
|
653
653
|
new Promise((x) => setTimeout(x, 1e3))
|
|
654
654
|
]), y.value && ((_ = b.value.supplyItems) == null ? void 0 : _.length) > 0) {
|
|
655
|
-
const x = b.value.supplyItems.map((
|
|
656
|
-
b.value._id && await
|
|
655
|
+
const x = b.value.supplyItems.map(($) => $.skuId);
|
|
656
|
+
b.value._id && await te(b.value._id, b.value.supplyItems);
|
|
657
657
|
}
|
|
658
658
|
l.open({
|
|
659
659
|
title: u("inventory.common.success"),
|
|
660
660
|
message: u("inventory.supplier.update.success", { name: b.value.name }),
|
|
661
661
|
type: "success"
|
|
662
|
-
}),
|
|
662
|
+
}), i("update:show", !1), i("submitted");
|
|
663
663
|
} catch (x) {
|
|
664
664
|
l.open({
|
|
665
665
|
title: u("inventory.supplier.update.error.title"),
|
|
@@ -670,31 +670,33 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
670
670
|
o.value = !1;
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
async function
|
|
673
|
+
async function te(_, x) {
|
|
674
674
|
try {
|
|
675
675
|
if (!x.length) return;
|
|
676
|
-
const
|
|
677
|
-
|
|
676
|
+
const a = (await m.readTemplates()).filter(
|
|
677
|
+
(M) => M.purchaseOrder.supplier._id === _
|
|
678
|
+
);
|
|
679
|
+
if (a.length === 0) {
|
|
678
680
|
console.error("No purchase order templates found for supplier", _);
|
|
679
681
|
return;
|
|
680
682
|
}
|
|
681
|
-
const
|
|
682
|
-
const
|
|
683
|
-
return
|
|
683
|
+
const H = x.flatMap((M) => {
|
|
684
|
+
const P = c.skuById[M.skuId];
|
|
685
|
+
return P ? [{ supplyItem: M, ingredient: P }] : [];
|
|
684
686
|
});
|
|
685
|
-
if (
|
|
687
|
+
if (H.length === 0) {
|
|
686
688
|
console.warn("No valid ingredients found for the provided supply items");
|
|
687
689
|
return;
|
|
688
690
|
}
|
|
689
|
-
const
|
|
690
|
-
const
|
|
691
|
-
M.purchaseOrder.items.map((
|
|
691
|
+
const I = a.map(async (M) => {
|
|
692
|
+
const P = new Set(
|
|
693
|
+
M.purchaseOrder.items.map((j) => {
|
|
692
694
|
var K;
|
|
693
|
-
return (K =
|
|
695
|
+
return (K = j.sku) == null ? void 0 : K._id;
|
|
694
696
|
}).filter(Boolean)
|
|
695
|
-
),
|
|
696
|
-
var
|
|
697
|
-
const
|
|
697
|
+
), Q = H.filter(({ ingredient: j }) => !P.has(j._id)).map(({ supplyItem: j, ingredient: K }) => {
|
|
698
|
+
var $e;
|
|
699
|
+
const re = {
|
|
698
700
|
amount: 1,
|
|
699
701
|
precision: qd(K.unit)
|
|
700
702
|
};
|
|
@@ -702,31 +704,31 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
702
704
|
sku: K,
|
|
703
705
|
name: K.name,
|
|
704
706
|
code: K.code,
|
|
705
|
-
quantity:
|
|
706
|
-
minimumQuantity:
|
|
707
|
-
quantityStep:
|
|
708
|
-
measurement: ((
|
|
707
|
+
quantity: re,
|
|
708
|
+
minimumQuantity: re,
|
|
709
|
+
quantityStep: re,
|
|
710
|
+
measurement: (($e = j.defaultCost) == null ? void 0 : $e.measurement) || null
|
|
709
711
|
};
|
|
710
712
|
});
|
|
711
|
-
if (
|
|
712
|
-
const
|
|
713
|
+
if (Q.length > 0) {
|
|
714
|
+
const j = {
|
|
713
715
|
...M,
|
|
714
716
|
purchaseOrder: {
|
|
715
717
|
...M.purchaseOrder,
|
|
716
|
-
items: [...M.purchaseOrder.items, ...
|
|
718
|
+
items: [...M.purchaseOrder.items, ...Q]
|
|
717
719
|
}
|
|
718
720
|
};
|
|
719
|
-
return await m.updateTemplate(
|
|
721
|
+
return await m.updateTemplate(j), Q.length;
|
|
720
722
|
}
|
|
721
723
|
return 0;
|
|
722
|
-
}),
|
|
723
|
-
} catch (
|
|
724
|
-
throw console.error("Error appending ingredients to purchase order templates:",
|
|
724
|
+
}), de = (await Promise.all(I)).reduce((M, P) => M + P, 0);
|
|
725
|
+
} catch ($) {
|
|
726
|
+
throw console.error("Error appending ingredients to purchase order templates:", $), $;
|
|
725
727
|
}
|
|
726
728
|
}
|
|
727
729
|
return (_, x) => {
|
|
728
|
-
const
|
|
729
|
-
return S(),
|
|
730
|
+
const $ = D("FmLabel"), a = D("FmField"), H = D("FmButton"), I = D("FmSideSheet");
|
|
731
|
+
return S(), z(I, {
|
|
730
732
|
header: g.value,
|
|
731
733
|
modelValue: p(O),
|
|
732
734
|
"onUpdate:modelValue": x[1] || (x[1] = (R) => dd(O) ? O.value = R : null),
|
|
@@ -734,35 +736,35 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
|
|
|
734
736
|
"close-button": "",
|
|
735
737
|
"max-width": 500
|
|
736
738
|
}, {
|
|
737
|
-
default:
|
|
739
|
+
default: B(() => {
|
|
738
740
|
var R;
|
|
739
741
|
return [
|
|
740
|
-
(S(),
|
|
742
|
+
(S(), z(Bt, {
|
|
741
743
|
class: "w-full",
|
|
742
744
|
ref_key: "formRef",
|
|
743
745
|
ref: f,
|
|
744
746
|
modelValue: p(b),
|
|
745
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
747
|
+
"onUpdate:modelValue": x[0] || (x[0] = (de) => dd(b) ? b.value = de : null),
|
|
746
748
|
onValidationSuccess: V,
|
|
747
749
|
key: ((R = _.supplier) == null ? void 0 : R._id) ?? "",
|
|
748
750
|
disabled: o.value
|
|
749
751
|
}, null, 8, ["modelValue", "disabled"])),
|
|
750
752
|
p(r).isEnabled && p(r).getVendorSubsidiaryName(p(b)._id) ? (S(), w("div", Ut, [
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
default:
|
|
754
|
-
h("span", Gt,
|
|
753
|
+
C($, { label: "NetSuite Subsidiary" }),
|
|
754
|
+
C(a, null, {
|
|
755
|
+
default: B(() => [
|
|
756
|
+
h("span", Gt, A(p(r).getVendorSubsidiaryName(p(b)._id)), 1)
|
|
755
757
|
]),
|
|
756
758
|
_: 1
|
|
757
759
|
})
|
|
758
760
|
])) : W("", !0)
|
|
759
761
|
];
|
|
760
762
|
}),
|
|
761
|
-
"side-sheet-footer":
|
|
763
|
+
"side-sheet-footer": B(() => [
|
|
762
764
|
h("div", Ht, [
|
|
763
|
-
|
|
765
|
+
C(H, {
|
|
764
766
|
loading: o.value,
|
|
765
|
-
label:
|
|
767
|
+
label: N.value,
|
|
766
768
|
onClick: F
|
|
767
769
|
}, null, 8, ["loading", "label"])
|
|
768
770
|
])
|
|
@@ -776,13 +778,13 @@ function Wt(e, d) {
|
|
|
776
778
|
var t = Array.prototype.slice.call(d);
|
|
777
779
|
return t.push(Kt), e.apply(this, t);
|
|
778
780
|
}
|
|
779
|
-
function
|
|
781
|
+
function Te(e) {
|
|
780
782
|
"@babel/helpers - typeof";
|
|
781
|
-
return
|
|
783
|
+
return Te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(d) {
|
|
782
784
|
return typeof d;
|
|
783
785
|
} : function(d) {
|
|
784
786
|
return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
|
|
785
|
-
},
|
|
787
|
+
}, Te(e);
|
|
786
788
|
}
|
|
787
789
|
function Yt(e, d, t) {
|
|
788
790
|
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
@@ -794,22 +796,22 @@ function Xt(e, d) {
|
|
|
794
796
|
function Zt(e, d) {
|
|
795
797
|
if (typeof d != "function" && d !== null)
|
|
796
798
|
throw new TypeError("Super expression must either be null or a function");
|
|
797
|
-
e.prototype = Object.create(d && d.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), d &&
|
|
799
|
+
e.prototype = Object.create(d && d.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), d && se(e, d);
|
|
798
800
|
}
|
|
799
801
|
function qt(e) {
|
|
800
802
|
var d = Ld();
|
|
801
803
|
return function() {
|
|
802
|
-
var r =
|
|
804
|
+
var r = ue(e), n;
|
|
803
805
|
if (d) {
|
|
804
|
-
var
|
|
805
|
-
n = Reflect.construct(r, arguments,
|
|
806
|
+
var i = ue(this).constructor;
|
|
807
|
+
n = Reflect.construct(r, arguments, i);
|
|
806
808
|
} else
|
|
807
809
|
n = r.apply(this, arguments);
|
|
808
810
|
return zt(this, n);
|
|
809
811
|
};
|
|
810
812
|
}
|
|
811
813
|
function zt(e, d) {
|
|
812
|
-
if (d && (
|
|
814
|
+
if (d && (Te(d) === "object" || typeof d == "function"))
|
|
813
815
|
return d;
|
|
814
816
|
if (d !== void 0)
|
|
815
817
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -831,18 +833,18 @@ function Ae(e) {
|
|
|
831
833
|
d.set(r, n);
|
|
832
834
|
}
|
|
833
835
|
function n() {
|
|
834
|
-
return
|
|
836
|
+
return ge(r, arguments, ue(this).constructor);
|
|
835
837
|
}
|
|
836
|
-
return n.prototype = Object.create(r.prototype, { constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 } }),
|
|
838
|
+
return n.prototype = Object.create(r.prototype, { constructor: { value: n, enumerable: !1, writable: !0, configurable: !0 } }), se(n, r);
|
|
837
839
|
}, Ae(e);
|
|
838
840
|
}
|
|
839
|
-
function
|
|
840
|
-
return Ld() ?
|
|
841
|
+
function ge(e, d, t) {
|
|
842
|
+
return Ld() ? ge = Reflect.construct : ge = function(n, i, o) {
|
|
841
843
|
var l = [null];
|
|
842
|
-
l.push.apply(l,
|
|
844
|
+
l.push.apply(l, i);
|
|
843
845
|
var s = Function.bind.apply(n, l), u = new s();
|
|
844
|
-
return o &&
|
|
845
|
-
},
|
|
846
|
+
return o && se(u, o.prototype), u;
|
|
847
|
+
}, ge.apply(null, arguments);
|
|
846
848
|
}
|
|
847
849
|
function Ld() {
|
|
848
850
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
@@ -857,17 +859,17 @@ function Ld() {
|
|
|
857
859
|
function Jt(e) {
|
|
858
860
|
return Function.toString.call(e).indexOf("[native code]") !== -1;
|
|
859
861
|
}
|
|
860
|
-
function
|
|
861
|
-
return
|
|
862
|
+
function se(e, d) {
|
|
863
|
+
return se = Object.setPrototypeOf || function(r, n) {
|
|
862
864
|
return r.__proto__ = n, r;
|
|
863
|
-
},
|
|
865
|
+
}, se(e, d);
|
|
864
866
|
}
|
|
865
|
-
function
|
|
866
|
-
return
|
|
867
|
+
function ue(e) {
|
|
868
|
+
return ue = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
|
|
867
869
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
868
|
-
},
|
|
870
|
+
}, ue(e);
|
|
869
871
|
}
|
|
870
|
-
var
|
|
872
|
+
var q = /* @__PURE__ */ function(e) {
|
|
871
873
|
Zt(t, e);
|
|
872
874
|
var d = qt(t);
|
|
873
875
|
function t(r) {
|
|
@@ -875,31 +877,31 @@ var z = /* @__PURE__ */ function(e) {
|
|
|
875
877
|
return Xt(this, t), n = d.call(this, r), Object.setPrototypeOf(Dd(n), t.prototype), n.name = n.constructor.name, n;
|
|
876
878
|
}
|
|
877
879
|
return Yt(t);
|
|
878
|
-
}(/* @__PURE__ */ Ae(Error)),
|
|
880
|
+
}(/* @__PURE__ */ Ae(Error)), Be = 2, Qt = 17, er = 3, G = "0-90-9٠-٩۰-۹", dr = "-‐-―−ー-", tr = "//", rr = "..", nr = " ", or = "()()[]\\[\\]", ar = "~⁓∼~", be = "".concat(dr).concat(tr).concat(rr).concat(nr).concat(or).concat(ar), Ue = "++";
|
|
879
881
|
function ad(e, d) {
|
|
880
882
|
e = e.split("-"), d = d.split("-");
|
|
881
883
|
for (var t = e[0].split("."), r = d[0].split("."), n = 0; n < 3; n++) {
|
|
882
|
-
var
|
|
883
|
-
if (
|
|
884
|
-
if (o >
|
|
885
|
-
if (!isNaN(
|
|
886
|
-
if (isNaN(
|
|
884
|
+
var i = Number(t[n]), o = Number(r[n]);
|
|
885
|
+
if (i > o) return 1;
|
|
886
|
+
if (o > i) return -1;
|
|
887
|
+
if (!isNaN(i) && isNaN(o)) return 1;
|
|
888
|
+
if (isNaN(i) && !isNaN(o)) return -1;
|
|
887
889
|
}
|
|
888
890
|
return e[1] && d[1] ? e[1] > d[1] ? 1 : e[1] < d[1] ? -1 : 0 : !e[1] && d[1] ? 1 : e[1] && !d[1] ? -1 : 0;
|
|
889
891
|
}
|
|
890
892
|
var ir = {}.constructor;
|
|
891
|
-
function
|
|
893
|
+
function he(e) {
|
|
892
894
|
return e != null && e.constructor === ir;
|
|
893
895
|
}
|
|
894
|
-
function
|
|
896
|
+
function Re(e) {
|
|
895
897
|
"@babel/helpers - typeof";
|
|
896
|
-
return
|
|
898
|
+
return Re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(d) {
|
|
897
899
|
return typeof d;
|
|
898
900
|
} : function(d) {
|
|
899
901
|
return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
|
|
900
|
-
},
|
|
902
|
+
}, Re(e);
|
|
901
903
|
}
|
|
902
|
-
function
|
|
904
|
+
function Ee(e, d) {
|
|
903
905
|
if (!(e instanceof d))
|
|
904
906
|
throw new TypeError("Cannot call a class as a function");
|
|
905
907
|
}
|
|
@@ -909,14 +911,14 @@ function $r(e, d) {
|
|
|
909
911
|
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
910
912
|
}
|
|
911
913
|
}
|
|
912
|
-
function
|
|
914
|
+
function Ie(e, d, t) {
|
|
913
915
|
return d && $r(e.prototype, d), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
914
916
|
}
|
|
915
917
|
var lr = "1.2.0", sr = "1.7.35", id = " ext. ", ur = /^\d+$/, L = /* @__PURE__ */ function() {
|
|
916
918
|
function e(d) {
|
|
917
|
-
|
|
919
|
+
Ee(this, e), mr(d), this.metadata = d, kd.call(this, d);
|
|
918
920
|
}
|
|
919
|
-
return
|
|
921
|
+
return Ie(e, [{
|
|
920
922
|
key: "getCountries",
|
|
921
923
|
value: function() {
|
|
922
924
|
return Object.keys(this.metadata.countries).filter(function(t) {
|
|
@@ -1004,8 +1006,8 @@ var lr = "1.2.0", sr = "1.7.35", id = " ext. ", ur = /^\d+$/, L = /* @__PURE__ *
|
|
|
1004
1006
|
if (n)
|
|
1005
1007
|
return n;
|
|
1006
1008
|
} else {
|
|
1007
|
-
var
|
|
1008
|
-
if (
|
|
1009
|
+
var i = this.countryCallingCodes()[t];
|
|
1010
|
+
if (i && i.length === 1 && i[0] === "001")
|
|
1009
1011
|
return this.metadata.countries["001"];
|
|
1010
1012
|
}
|
|
1011
1013
|
}
|
|
@@ -1100,9 +1102,9 @@ var lr = "1.2.0", sr = "1.7.35", id = " ext. ", ur = /^\d+$/, L = /* @__PURE__ *
|
|
|
1100
1102
|
}]), e;
|
|
1101
1103
|
}(), $d = /* @__PURE__ */ function() {
|
|
1102
1104
|
function e(d, t) {
|
|
1103
|
-
|
|
1105
|
+
Ee(this, e), this.globalMetadataObject = t, this.metadata = d, kd.call(this, t.metadata);
|
|
1104
1106
|
}
|
|
1105
|
-
return
|
|
1107
|
+
return Ie(e, [{
|
|
1106
1108
|
key: "callingCode",
|
|
1107
1109
|
value: function() {
|
|
1108
1110
|
return this.metadata[0];
|
|
@@ -1236,9 +1238,9 @@ var lr = "1.2.0", sr = "1.7.35", id = " ext. ", ur = /^\d+$/, L = /* @__PURE__ *
|
|
|
1236
1238
|
}]), e;
|
|
1237
1239
|
}(), cr = /* @__PURE__ */ function() {
|
|
1238
1240
|
function e(d, t) {
|
|
1239
|
-
|
|
1241
|
+
Ee(this, e), this._format = d, this.metadata = t;
|
|
1240
1242
|
}
|
|
1241
|
-
return
|
|
1243
|
+
return Ie(e, [{
|
|
1242
1244
|
key: "pattern",
|
|
1243
1245
|
value: function() {
|
|
1244
1246
|
return this._format[0];
|
|
@@ -1283,9 +1285,9 @@ var lr = "1.2.0", sr = "1.7.35", id = " ext. ", ur = /^\d+$/, L = /* @__PURE__ *
|
|
|
1283
1285
|
}]), e;
|
|
1284
1286
|
}(), pr = /^\(?\$1\)?$/, fr = /* @__PURE__ */ function() {
|
|
1285
1287
|
function e(d, t) {
|
|
1286
|
-
|
|
1288
|
+
Ee(this, e), this.type = d, this.metadata = t;
|
|
1287
1289
|
}
|
|
1288
|
-
return
|
|
1290
|
+
return Ie(e, [{
|
|
1289
1291
|
key: "pattern",
|
|
1290
1292
|
value: function() {
|
|
1291
1293
|
return this.metadata.v1 ? this.type : this.type[0];
|
|
@@ -1325,13 +1327,13 @@ function ld(e, d) {
|
|
|
1325
1327
|
function mr(e) {
|
|
1326
1328
|
if (!e)
|
|
1327
1329
|
throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
1328
|
-
if (!
|
|
1329
|
-
throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(
|
|
1330
|
+
if (!he(e) || !he(e.countries))
|
|
1331
|
+
throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(he(e) ? "an object of shape: { " + Object.keys(e).join(", ") + " }" : "a " + yr(e) + ": " + e, "."));
|
|
1330
1332
|
}
|
|
1331
1333
|
var yr = function(d) {
|
|
1332
|
-
return
|
|
1334
|
+
return Re(d);
|
|
1333
1335
|
};
|
|
1334
|
-
function
|
|
1336
|
+
function Ge(e, d) {
|
|
1335
1337
|
if (d = new L(d), d.hasCountry(e))
|
|
1336
1338
|
return d.country(e).countryCallingCode();
|
|
1337
1339
|
throw new Error("Unknown country: ".concat(e));
|
|
@@ -1343,21 +1345,21 @@ function kd(e) {
|
|
|
1343
1345
|
var d = e.version;
|
|
1344
1346
|
typeof d == "number" ? (this.v1 = d === 1, this.v2 = d === 2, this.v3 = d === 3, this.v4 = d === 4) : d ? ad(d, lr) === -1 ? this.v2 = !0 : ad(d, sr) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
|
|
1345
1347
|
}
|
|
1346
|
-
var gr = ";ext=",
|
|
1347
|
-
return "([".concat(
|
|
1348
|
+
var gr = ";ext=", ne = function(d) {
|
|
1349
|
+
return "([".concat(G, "]{1,").concat(d, "})");
|
|
1348
1350
|
};
|
|
1349
1351
|
function Vd(e) {
|
|
1350
|
-
var d = "20", t = "15", r = "9", n = "6",
|
|
1351
|
-
return y + "|" + g + "|" +
|
|
1352
|
+
var d = "20", t = "15", r = "9", n = "6", i = "[ \\t,]*", o = "[:\\..]?[ \\t,-]*", l = "#?", s = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", u = "(?:[xx##~~]|int|int)", v = "[- ]+", m = "[ \\t]*", c = "(?:,{2}|;)", y = gr + ne(d), g = i + s + o + ne(d) + l, N = i + u + o + ne(r) + l, f = v + ne(n) + "#", O = m + c + o + ne(t) + l, b = m + "(?:,)+" + o + ne(r) + l;
|
|
1353
|
+
return y + "|" + g + "|" + N + "|" + f + "|" + O + "|" + b;
|
|
1352
1354
|
}
|
|
1353
|
-
var hr = "[" +
|
|
1355
|
+
var hr = "[" + G + "]{" + Be + "}", br = "[" + Ue + "]{0,1}(?:[" + be + "]*[" + G + "]){3,}[" + be + G + "]*", _r = new RegExp("^[" + Ue + "]{0,1}(?:[" + be + "]*[" + G + "]){1,2}$", "i"), Pr = br + // Phone number extensions
|
|
1354
1356
|
"(?:" + Vd() + ")?", Cr = new RegExp(
|
|
1355
1357
|
// Either a short two-digit-only phone number
|
|
1356
1358
|
"^" + hr + "$|^" + Pr + "$",
|
|
1357
1359
|
"i"
|
|
1358
1360
|
);
|
|
1359
1361
|
function Nr(e) {
|
|
1360
|
-
return e.length >=
|
|
1362
|
+
return e.length >= Be && Cr.test(e);
|
|
1361
1363
|
}
|
|
1362
1364
|
function Sr(e) {
|
|
1363
1365
|
return _r.test(e);
|
|
@@ -1488,17 +1490,17 @@ function cd(e) {
|
|
|
1488
1490
|
function wr(e, d, t) {
|
|
1489
1491
|
return e === "+" ? d ? void 0 : "+" : Ir(e);
|
|
1490
1492
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1493
|
+
function He(e, d) {
|
|
1494
|
+
return Tr(e, void 0, d);
|
|
1493
1495
|
}
|
|
1494
|
-
function
|
|
1496
|
+
function Tr(e, d, t) {
|
|
1495
1497
|
var r = t.type(d), n = r && r.possibleLengths() || t.possibleLengths();
|
|
1496
1498
|
if (!n)
|
|
1497
1499
|
return "IS_POSSIBLE";
|
|
1498
|
-
var
|
|
1499
|
-
return o ===
|
|
1500
|
+
var i = e.length, o = n[0];
|
|
1501
|
+
return o === i ? "IS_POSSIBLE" : o > i ? "TOO_SHORT" : n[n.length - 1] < i ? "TOO_LONG" : n.indexOf(i, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
|
|
1500
1502
|
}
|
|
1501
|
-
function
|
|
1503
|
+
function Ar(e, d, t) {
|
|
1502
1504
|
if (d === void 0 && (d = {}), t = new L(t), d.v2) {
|
|
1503
1505
|
if (!e.countryCallingCode)
|
|
1504
1506
|
throw new Error("Invalid phone number object passed");
|
|
@@ -1523,14 +1525,14 @@ function Tr(e, d, t) {
|
|
|
1523
1525
|
throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
|
|
1524
1526
|
}
|
|
1525
1527
|
function Bd(e, d) {
|
|
1526
|
-
switch (
|
|
1528
|
+
switch (He(e, d)) {
|
|
1527
1529
|
case "IS_POSSIBLE":
|
|
1528
1530
|
return !0;
|
|
1529
1531
|
default:
|
|
1530
1532
|
return !1;
|
|
1531
1533
|
}
|
|
1532
1534
|
}
|
|
1533
|
-
function
|
|
1535
|
+
function J(e, d) {
|
|
1534
1536
|
return e = e || "", new RegExp("^(?:" + d + ")$").test(e);
|
|
1535
1537
|
}
|
|
1536
1538
|
function Rr(e, d) {
|
|
@@ -1561,34 +1563,34 @@ function pd(e, d) {
|
|
|
1561
1563
|
return r;
|
|
1562
1564
|
}
|
|
1563
1565
|
var Dr = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
|
|
1564
|
-
function
|
|
1566
|
+
function je(e, d, t) {
|
|
1565
1567
|
if (d = d || {}, !(!e.country && !e.countryCallingCode)) {
|
|
1566
1568
|
t = new L(t), t.selectNumberingPlan(e.country, e.countryCallingCode);
|
|
1567
1569
|
var r = d.v2 ? e.nationalNumber : e.phone;
|
|
1568
|
-
if (
|
|
1569
|
-
if (
|
|
1570
|
-
return t.type("MOBILE") && t.type("MOBILE").pattern() === "" || !t.type("MOBILE") ||
|
|
1571
|
-
for (var n = Rr(Dr),
|
|
1572
|
-
var o =
|
|
1573
|
-
if (
|
|
1570
|
+
if (J(r, t.nationalNumberPattern())) {
|
|
1571
|
+
if (Oe(r, "FIXED_LINE", t))
|
|
1572
|
+
return t.type("MOBILE") && t.type("MOBILE").pattern() === "" || !t.type("MOBILE") || Oe(r, "MOBILE", t) ? "FIXED_LINE_OR_MOBILE" : "FIXED_LINE";
|
|
1573
|
+
for (var n = Rr(Dr), i; !(i = n()).done; ) {
|
|
1574
|
+
var o = i.value;
|
|
1575
|
+
if (Oe(r, o, t))
|
|
1574
1576
|
return o;
|
|
1575
1577
|
}
|
|
1576
1578
|
}
|
|
1577
1579
|
}
|
|
1578
1580
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return d = t.type(d), !d || !d.pattern() || d.possibleLengths() && d.possibleLengths().indexOf(e.length) < 0 ? !1 :
|
|
1581
|
+
function Oe(e, d, t) {
|
|
1582
|
+
return d = t.type(d), !d || !d.pattern() || d.possibleLengths() && d.possibleLengths().indexOf(e.length) < 0 ? !1 : J(e, d.pattern());
|
|
1581
1583
|
}
|
|
1582
1584
|
function Lr(e, d, t) {
|
|
1583
1585
|
if (d = d || {}, t = new L(t), t.selectNumberingPlan(e.country, e.countryCallingCode), t.hasTypes())
|
|
1584
|
-
return
|
|
1586
|
+
return je(e, d, t.metadata) !== void 0;
|
|
1585
1587
|
var r = d.v2 ? e.nationalNumber : e.phone;
|
|
1586
|
-
return
|
|
1588
|
+
return J(r, t.nationalNumberPattern());
|
|
1587
1589
|
}
|
|
1588
1590
|
function kr(e, d, t) {
|
|
1589
1591
|
var r = new L(t), n = r.getCountryCodesForCallingCode(e);
|
|
1590
|
-
return n ? n.filter(function(
|
|
1591
|
-
return Vr(d,
|
|
1592
|
+
return n ? n.filter(function(i) {
|
|
1593
|
+
return Vr(d, i, t);
|
|
1592
1594
|
}) : [];
|
|
1593
1595
|
}
|
|
1594
1596
|
function Vr(e, d, t) {
|
|
@@ -1596,11 +1598,11 @@ function Vr(e, d, t) {
|
|
|
1596
1598
|
return r.selectNumberingPlan(d), r.numberingPlan.possibleLengths().indexOf(e.length) >= 0;
|
|
1597
1599
|
}
|
|
1598
1600
|
function Br(e) {
|
|
1599
|
-
return e.replace(new RegExp("[".concat(
|
|
1601
|
+
return e.replace(new RegExp("[".concat(be, "]+"), "g"), " ").trim();
|
|
1600
1602
|
}
|
|
1601
1603
|
var Ur = /(\$\d)/;
|
|
1602
1604
|
function Gr(e, d, t) {
|
|
1603
|
-
var r = t.useInternationalFormat, n = t.withNationalPrefix,
|
|
1605
|
+
var r = t.useInternationalFormat, n = t.withNationalPrefix, i = e.replace(new RegExp(d.pattern()), r ? d.internationalFormat() : (
|
|
1604
1606
|
// This library doesn't use `domestic_carrier_code_formatting_rule`,
|
|
1605
1607
|
// because that one is only used when formatting phone numbers
|
|
1606
1608
|
// for dialing from a mobile phone, and this is not a dialing library.
|
|
@@ -1616,7 +1618,7 @@ function Gr(e, d, t) {
|
|
|
1616
1618
|
// )
|
|
1617
1619
|
n && d.nationalPrefixFormattingRule() ? d.format().replace(Ur, d.nationalPrefixFormattingRule()) : d.format()
|
|
1618
1620
|
));
|
|
1619
|
-
return r ? Br(
|
|
1621
|
+
return r ? Br(i) : i;
|
|
1620
1622
|
}
|
|
1621
1623
|
var Hr = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
1622
1624
|
function jr(e, d, t) {
|
|
@@ -1698,33 +1700,33 @@ function Zr(e, d, t, r) {
|
|
|
1698
1700
|
} else if (e.countryCallingCode)
|
|
1699
1701
|
r.selectNumberingPlan(e.countryCallingCode);
|
|
1700
1702
|
else return e.phone || "";
|
|
1701
|
-
var n = r.countryCallingCode(),
|
|
1703
|
+
var n = r.countryCallingCode(), i = t.v2 ? e.nationalNumber : e.phone, o;
|
|
1702
1704
|
switch (d) {
|
|
1703
1705
|
case "NATIONAL":
|
|
1704
|
-
return
|
|
1706
|
+
return i ? (o = _e(i, e.carrierCode, "NATIONAL", r, t), Fe(o, e.ext, r, t.formatExtension)) : "";
|
|
1705
1707
|
case "INTERNATIONAL":
|
|
1706
|
-
return
|
|
1708
|
+
return i ? (o = _e(i, null, "INTERNATIONAL", r, t), o = "+".concat(n, " ").concat(o), Fe(o, e.ext, r, t.formatExtension)) : "+".concat(n);
|
|
1707
1709
|
case "E.164":
|
|
1708
|
-
return "+".concat(n).concat(
|
|
1710
|
+
return "+".concat(n).concat(i);
|
|
1709
1711
|
case "RFC3966":
|
|
1710
1712
|
return Kr({
|
|
1711
|
-
number: "+".concat(n).concat(
|
|
1713
|
+
number: "+".concat(n).concat(i),
|
|
1712
1714
|
ext: e.ext
|
|
1713
1715
|
});
|
|
1714
1716
|
case "IDD":
|
|
1715
1717
|
if (!t.fromCountry)
|
|
1716
1718
|
return;
|
|
1717
|
-
var l = zr(
|
|
1718
|
-
return
|
|
1719
|
+
var l = zr(i, e.carrierCode, n, t.fromCountry, r);
|
|
1720
|
+
return Fe(l, e.ext, r, t.formatExtension);
|
|
1719
1721
|
default:
|
|
1720
1722
|
throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(d, '"'));
|
|
1721
1723
|
}
|
|
1722
1724
|
}
|
|
1723
|
-
function
|
|
1724
|
-
var
|
|
1725
|
-
return
|
|
1725
|
+
function _e(e, d, t, r, n) {
|
|
1726
|
+
var i = qr(r.formats(), e);
|
|
1727
|
+
return i ? Gr(e, i, {
|
|
1726
1728
|
useInternationalFormat: t === "INTERNATIONAL",
|
|
1727
|
-
withNationalPrefix: !(
|
|
1729
|
+
withNationalPrefix: !(i.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && n && n.nationalPrefix === !1),
|
|
1728
1730
|
carrierCode: d,
|
|
1729
1731
|
metadata: r
|
|
1730
1732
|
}) : e;
|
|
@@ -1733,26 +1735,26 @@ function qr(e, d) {
|
|
|
1733
1735
|
for (var t = Wr(e), r; !(r = t()).done; ) {
|
|
1734
1736
|
var n = r.value;
|
|
1735
1737
|
if (n.leadingDigitsPatterns().length > 0) {
|
|
1736
|
-
var
|
|
1737
|
-
if (d.search(
|
|
1738
|
+
var i = n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length - 1];
|
|
1739
|
+
if (d.search(i) !== 0)
|
|
1738
1740
|
continue;
|
|
1739
1741
|
}
|
|
1740
|
-
if (
|
|
1742
|
+
if (J(d, n.pattern()))
|
|
1741
1743
|
return n;
|
|
1742
1744
|
}
|
|
1743
1745
|
}
|
|
1744
|
-
function
|
|
1746
|
+
function Fe(e, d, t, r) {
|
|
1745
1747
|
return d ? r(e, d, t) : e;
|
|
1746
1748
|
}
|
|
1747
1749
|
function zr(e, d, t, r, n) {
|
|
1748
|
-
var
|
|
1749
|
-
if (
|
|
1750
|
-
var o =
|
|
1750
|
+
var i = Ge(r, n.metadata);
|
|
1751
|
+
if (i === t) {
|
|
1752
|
+
var o = _e(e, d, "NATIONAL", n);
|
|
1751
1753
|
return t === "1" ? t + " " + o : o;
|
|
1752
1754
|
}
|
|
1753
1755
|
var l = jr(r, void 0, n.metadata);
|
|
1754
1756
|
if (l)
|
|
1755
|
-
return "".concat(l, " ").concat(t, " ").concat(
|
|
1757
|
+
return "".concat(l, " ").concat(t, " ").concat(_e(e, null, "INTERNATIONAL", n));
|
|
1756
1758
|
}
|
|
1757
1759
|
function gd(e, d) {
|
|
1758
1760
|
var t = Object.keys(e);
|
|
@@ -1799,8 +1801,8 @@ var t0 = /* @__PURE__ */ function() {
|
|
|
1799
1801
|
throw new TypeError("`nationalNumber` not passed");
|
|
1800
1802
|
if (!r)
|
|
1801
1803
|
throw new TypeError("`metadata` not passed");
|
|
1802
|
-
var n = n0(d, r),
|
|
1803
|
-
this.country =
|
|
1804
|
+
var n = n0(d, r), i = n.country, o = n.countryCallingCode;
|
|
1805
|
+
this.country = i, this.countryCallingCode = o, this.nationalNumber = t, this.number = "+" + this.countryCallingCode + this.nationalNumber, this.getMetadata = function() {
|
|
1804
1806
|
return r;
|
|
1805
1807
|
};
|
|
1806
1808
|
}
|
|
@@ -1817,7 +1819,7 @@ var t0 = /* @__PURE__ */ function() {
|
|
|
1817
1819
|
}, {
|
|
1818
1820
|
key: "isPossible",
|
|
1819
1821
|
value: function() {
|
|
1820
|
-
return
|
|
1822
|
+
return Ar(this, {
|
|
1821
1823
|
v2: !0
|
|
1822
1824
|
}, this.getMetadata());
|
|
1823
1825
|
}
|
|
@@ -1856,7 +1858,7 @@ var t0 = /* @__PURE__ */ function() {
|
|
|
1856
1858
|
}, {
|
|
1857
1859
|
key: "getType",
|
|
1858
1860
|
value: function() {
|
|
1859
|
-
return
|
|
1861
|
+
return je(this, {
|
|
1860
1862
|
v2: !0
|
|
1861
1863
|
}, this.getMetadata());
|
|
1862
1864
|
}
|
|
@@ -1895,14 +1897,14 @@ function n0(e, d) {
|
|
|
1895
1897
|
countryCallingCode: r
|
|
1896
1898
|
};
|
|
1897
1899
|
}
|
|
1898
|
-
var o0 = new RegExp("([" +
|
|
1900
|
+
var o0 = new RegExp("([" + G + "])");
|
|
1899
1901
|
function a0(e, d, t, r) {
|
|
1900
1902
|
if (d) {
|
|
1901
1903
|
var n = new L(r);
|
|
1902
1904
|
n.selectNumberingPlan(d, t);
|
|
1903
|
-
var
|
|
1904
|
-
if (e.search(
|
|
1905
|
-
e = e.slice(e.match(
|
|
1905
|
+
var i = new RegExp(n.IDDPrefix());
|
|
1906
|
+
if (e.search(i) === 0) {
|
|
1907
|
+
e = e.slice(e.match(i)[0].length);
|
|
1906
1908
|
var o = e.match(o0);
|
|
1907
1909
|
if (!(o && o[1] != null && o[1].length > 0 && o[1] === "0"))
|
|
1908
1910
|
return e;
|
|
@@ -1913,12 +1915,12 @@ function i0(e, d) {
|
|
|
1913
1915
|
if (e && d.numberingPlan.nationalPrefixForParsing()) {
|
|
1914
1916
|
var t = new RegExp("^(?:" + d.numberingPlan.nationalPrefixForParsing() + ")"), r = t.exec(e);
|
|
1915
1917
|
if (r) {
|
|
1916
|
-
var n,
|
|
1918
|
+
var n, i, o = r.length - 1, l = o > 0 && r[o];
|
|
1917
1919
|
if (d.nationalPrefixTransformRule() && l)
|
|
1918
|
-
n = e.replace(t, d.nationalPrefixTransformRule()), o > 1 && (
|
|
1920
|
+
n = e.replace(t, d.nationalPrefixTransformRule()), o > 1 && (i = r[1]);
|
|
1919
1921
|
else {
|
|
1920
1922
|
var s = r[0];
|
|
1921
|
-
n = e.slice(s.length), l && (
|
|
1923
|
+
n = e.slice(s.length), l && (i = r[1]);
|
|
1922
1924
|
}
|
|
1923
1925
|
var u;
|
|
1924
1926
|
if (l) {
|
|
@@ -1929,7 +1931,7 @@ function i0(e, d) {
|
|
|
1929
1931
|
return {
|
|
1930
1932
|
nationalNumber: n,
|
|
1931
1933
|
nationalPrefix: u,
|
|
1932
|
-
carrierCode:
|
|
1934
|
+
carrierCode: i
|
|
1933
1935
|
};
|
|
1934
1936
|
}
|
|
1935
1937
|
}
|
|
@@ -1937,7 +1939,7 @@ function i0(e, d) {
|
|
|
1937
1939
|
nationalNumber: e
|
|
1938
1940
|
};
|
|
1939
1941
|
}
|
|
1940
|
-
function
|
|
1942
|
+
function Me(e, d) {
|
|
1941
1943
|
var t = i0(e, d), r = t.carrierCode, n = t.nationalNumber;
|
|
1942
1944
|
if (n !== e) {
|
|
1943
1945
|
if (!$0(e, n, d))
|
|
@@ -1955,10 +1957,10 @@ function Re(e, d) {
|
|
|
1955
1957
|
};
|
|
1956
1958
|
}
|
|
1957
1959
|
function $0(e, d, t) {
|
|
1958
|
-
return !(
|
|
1960
|
+
return !(J(e, t.nationalNumberPattern()) && !J(d, t.nationalNumberPattern()));
|
|
1959
1961
|
}
|
|
1960
1962
|
function l0(e, d) {
|
|
1961
|
-
switch (
|
|
1963
|
+
switch (He(e, d)) {
|
|
1962
1964
|
case "TOO_SHORT":
|
|
1963
1965
|
case "INVALID_LENGTH":
|
|
1964
1966
|
return !1;
|
|
@@ -1967,14 +1969,14 @@ function l0(e, d) {
|
|
|
1967
1969
|
}
|
|
1968
1970
|
}
|
|
1969
1971
|
function s0(e, d, t, r) {
|
|
1970
|
-
var n = d ?
|
|
1972
|
+
var n = d ? Ge(d, r) : t;
|
|
1971
1973
|
if (e.indexOf(n) === 0) {
|
|
1972
1974
|
r = new L(r), r.selectNumberingPlan(d, t);
|
|
1973
|
-
var
|
|
1974
|
-
if (!
|
|
1975
|
+
var i = e.slice(n.length), o = Me(i, r), l = o.nationalNumber, s = Me(e, r), u = s.nationalNumber;
|
|
1976
|
+
if (!J(u, r.nationalNumberPattern()) && J(l, r.nationalNumberPattern()) || He(u, r) === "TOO_LONG")
|
|
1975
1977
|
return {
|
|
1976
1978
|
countryCallingCode: n,
|
|
1977
|
-
number:
|
|
1979
|
+
number: i
|
|
1978
1980
|
};
|
|
1979
1981
|
}
|
|
1980
1982
|
return {
|
|
@@ -1986,9 +1988,9 @@ function u0(e, d, t, r) {
|
|
|
1986
1988
|
return {};
|
|
1987
1989
|
var n;
|
|
1988
1990
|
if (e[0] !== "+") {
|
|
1989
|
-
var
|
|
1990
|
-
if (
|
|
1991
|
-
n = !0, e = "+" +
|
|
1991
|
+
var i = a0(e, d, t, r);
|
|
1992
|
+
if (i && i !== e)
|
|
1993
|
+
n = !0, e = "+" + i;
|
|
1992
1994
|
else {
|
|
1993
1995
|
if (d || t) {
|
|
1994
1996
|
var o = s0(e, d, t, r), l = o.countryCallingCode, s = o.number;
|
|
@@ -2051,12 +2053,12 @@ function bd(e, d) {
|
|
|
2051
2053
|
function f0(e, d) {
|
|
2052
2054
|
var t = d.countries, r = d.metadata;
|
|
2053
2055
|
r = new L(r);
|
|
2054
|
-
for (var n = c0(t),
|
|
2055
|
-
var o =
|
|
2056
|
+
for (var n = c0(t), i; !(i = n()).done; ) {
|
|
2057
|
+
var o = i.value;
|
|
2056
2058
|
if (r.country(o), r.leadingDigits()) {
|
|
2057
2059
|
if (e && e.search(r.leadingDigits()) === 0)
|
|
2058
2060
|
return o;
|
|
2059
|
-
} else if (
|
|
2061
|
+
} else if (je({
|
|
2060
2062
|
phone: e,
|
|
2061
2063
|
country: o
|
|
2062
2064
|
}, void 0, r.metadata))
|
|
@@ -2064,20 +2066,20 @@ function f0(e, d) {
|
|
|
2064
2066
|
}
|
|
2065
2067
|
}
|
|
2066
2068
|
function m0(e, d) {
|
|
2067
|
-
var t = d.nationalNumber, r = d.defaultCountry, n = d.metadata,
|
|
2068
|
-
if (
|
|
2069
|
-
return
|
|
2070
|
-
countries:
|
|
2069
|
+
var t = d.nationalNumber, r = d.defaultCountry, n = d.metadata, i = n.getCountryCodesForCallingCode(e);
|
|
2070
|
+
if (i)
|
|
2071
|
+
return i.length === 1 ? i[0] : f0(t, {
|
|
2072
|
+
countries: i,
|
|
2071
2073
|
defaultCountry: r,
|
|
2072
2074
|
metadata: n.metadata
|
|
2073
2075
|
});
|
|
2074
2076
|
}
|
|
2075
|
-
var Ud = "+", y0 = "[\\-\\.\\(\\)]?", _d = "([" +
|
|
2077
|
+
var Ud = "+", y0 = "[\\-\\.\\(\\)]?", _d = "([" + G + "]|" + y0 + ")", v0 = "^\\" + Ud + _d + "*[" + G + "]" + _d + "*$", g0 = new RegExp(v0, "g"), De = G, h0 = "[" + De + "]+((\\-)*[" + De + "])*", b0 = "a-zA-Z", _0 = "[" + b0 + "]+((\\-)*[" + De + "])*", P0 = "^(" + h0 + "\\.)*" + _0 + "\\.?$", C0 = new RegExp(P0, "g"), Pd = "tel:", Le = ";phone-context=", N0 = ";isub=";
|
|
2076
2078
|
function S0(e) {
|
|
2077
|
-
var d = e.indexOf(
|
|
2079
|
+
var d = e.indexOf(Le);
|
|
2078
2080
|
if (d < 0)
|
|
2079
2081
|
return null;
|
|
2080
|
-
var t = d +
|
|
2082
|
+
var t = d + Le.length;
|
|
2081
2083
|
if (t >= e.length)
|
|
2082
2084
|
return "";
|
|
2083
2085
|
var r = e.indexOf(";", t);
|
|
@@ -2089,52 +2091,52 @@ function x0(e) {
|
|
|
2089
2091
|
function E0(e, d) {
|
|
2090
2092
|
var t = d.extractFormattedPhoneNumber, r = S0(e);
|
|
2091
2093
|
if (!x0(r))
|
|
2092
|
-
throw new
|
|
2094
|
+
throw new q("NOT_A_NUMBER");
|
|
2093
2095
|
var n;
|
|
2094
2096
|
if (r === null)
|
|
2095
2097
|
n = t(e) || "";
|
|
2096
2098
|
else {
|
|
2097
2099
|
n = "", r.charAt(0) === Ud && (n += r);
|
|
2098
|
-
var
|
|
2099
|
-
|
|
2100
|
-
var l = e.indexOf(
|
|
2100
|
+
var i = e.indexOf(Pd), o;
|
|
2101
|
+
i >= 0 ? o = i + Pd.length : o = 0;
|
|
2102
|
+
var l = e.indexOf(Le);
|
|
2101
2103
|
n += e.substring(o, l);
|
|
2102
2104
|
}
|
|
2103
2105
|
var s = n.indexOf(N0);
|
|
2104
2106
|
if (s > 0 && (n = n.substring(0, s)), n !== "")
|
|
2105
2107
|
return n;
|
|
2106
2108
|
}
|
|
2107
|
-
var I0 = 250, O0 = new RegExp("[" +
|
|
2109
|
+
var I0 = 250, O0 = new RegExp("[" + Ue + G + "]"), F0 = new RegExp("[^" + G + "#]+$");
|
|
2108
2110
|
function w0(e, d, t) {
|
|
2109
2111
|
if (d = d || {}, t = new L(t), d.defaultCountry && !t.hasCountry(d.defaultCountry))
|
|
2110
|
-
throw d.v2 ? new
|
|
2111
|
-
var r =
|
|
2112
|
+
throw d.v2 ? new q("INVALID_COUNTRY") : new Error("Unknown country: ".concat(d.defaultCountry));
|
|
2113
|
+
var r = A0(e, d.v2, d.extract), n = r.number, i = r.ext, o = r.error;
|
|
2112
2114
|
if (!n) {
|
|
2113
2115
|
if (d.v2)
|
|
2114
|
-
throw o === "TOO_SHORT" ? new
|
|
2116
|
+
throw o === "TOO_SHORT" ? new q("TOO_SHORT") : new q("NOT_A_NUMBER");
|
|
2115
2117
|
return {};
|
|
2116
2118
|
}
|
|
2117
2119
|
var l = M0(n, d.defaultCountry, d.defaultCallingCode, t), s = l.country, u = l.nationalNumber, v = l.countryCallingCode, m = l.countryCallingCodeSource, c = l.carrierCode;
|
|
2118
2120
|
if (!t.hasSelectedNumberingPlan()) {
|
|
2119
2121
|
if (d.v2)
|
|
2120
|
-
throw new
|
|
2122
|
+
throw new q("INVALID_COUNTRY");
|
|
2121
2123
|
return {};
|
|
2122
2124
|
}
|
|
2123
|
-
if (!u || u.length <
|
|
2125
|
+
if (!u || u.length < Be) {
|
|
2124
2126
|
if (d.v2)
|
|
2125
|
-
throw new
|
|
2127
|
+
throw new q("TOO_SHORT");
|
|
2126
2128
|
return {};
|
|
2127
2129
|
}
|
|
2128
2130
|
if (u.length > Qt) {
|
|
2129
2131
|
if (d.v2)
|
|
2130
|
-
throw new
|
|
2132
|
+
throw new q("TOO_LONG");
|
|
2131
2133
|
return {};
|
|
2132
2134
|
}
|
|
2133
2135
|
if (d.v2) {
|
|
2134
2136
|
var y = new t0(v, u, t.metadata);
|
|
2135
|
-
return s && (y.country = s), c && (y.carrierCode = c),
|
|
2137
|
+
return s && (y.country = s), c && (y.carrierCode = c), i && (y.ext = i), y.__countryCallingCodeSource = m, y;
|
|
2136
2138
|
}
|
|
2137
|
-
var g = (d.extended ? t.hasSelectedNumberingPlan() : s) ?
|
|
2139
|
+
var g = (d.extended ? t.hasSelectedNumberingPlan() : s) ? J(u, t.nationalNumberPattern()) : !1;
|
|
2138
2140
|
return d.extended ? {
|
|
2139
2141
|
country: s,
|
|
2140
2142
|
countryCallingCode: v,
|
|
@@ -2142,14 +2144,14 @@ function w0(e, d, t) {
|
|
|
2142
2144
|
valid: g,
|
|
2143
2145
|
possible: g ? !0 : !!(d.extended === !0 && t.possibleLengths() && Bd(u, t)),
|
|
2144
2146
|
phone: u,
|
|
2145
|
-
ext:
|
|
2146
|
-
} : g ? R0(s, u,
|
|
2147
|
+
ext: i
|
|
2148
|
+
} : g ? R0(s, u, i) : {};
|
|
2147
2149
|
}
|
|
2148
|
-
function
|
|
2150
|
+
function T0(e, d, t) {
|
|
2149
2151
|
if (e) {
|
|
2150
2152
|
if (e.length > I0) {
|
|
2151
2153
|
if (t)
|
|
2152
|
-
throw new
|
|
2154
|
+
throw new q("TOO_LONG");
|
|
2153
2155
|
return;
|
|
2154
2156
|
}
|
|
2155
2157
|
if (d === !1)
|
|
@@ -2159,10 +2161,10 @@ function A0(e, d, t) {
|
|
|
2159
2161
|
return e.slice(r).replace(F0, "");
|
|
2160
2162
|
}
|
|
2161
2163
|
}
|
|
2162
|
-
function
|
|
2164
|
+
function A0(e, d, t) {
|
|
2163
2165
|
var r = E0(e, {
|
|
2164
2166
|
extractFormattedPhoneNumber: function(o) {
|
|
2165
|
-
return
|
|
2167
|
+
return T0(o, t, d);
|
|
2166
2168
|
}
|
|
2167
2169
|
});
|
|
2168
2170
|
if (!r)
|
|
@@ -2184,18 +2186,18 @@ function R0(e, d, t) {
|
|
|
2184
2186
|
return t && (r.ext = t), r;
|
|
2185
2187
|
}
|
|
2186
2188
|
function M0(e, d, t, r) {
|
|
2187
|
-
var n = u0(cd(e), d, t, r.metadata),
|
|
2189
|
+
var n = u0(cd(e), d, t, r.metadata), i = n.countryCallingCodeSource, o = n.countryCallingCode, l = n.number, s;
|
|
2188
2190
|
if (o)
|
|
2189
2191
|
r.selectNumberingPlan(o);
|
|
2190
2192
|
else if (l && (d || t))
|
|
2191
|
-
r.selectNumberingPlan(d, t), d && (s = d), o = t ||
|
|
2193
|
+
r.selectNumberingPlan(d, t), d && (s = d), o = t || Ge(d, r.metadata);
|
|
2192
2194
|
else return {};
|
|
2193
2195
|
if (!l)
|
|
2194
2196
|
return {
|
|
2195
|
-
countryCallingCodeSource:
|
|
2197
|
+
countryCallingCodeSource: i,
|
|
2196
2198
|
countryCallingCode: o
|
|
2197
2199
|
};
|
|
2198
|
-
var u =
|
|
2200
|
+
var u = Me(cd(l), r), v = u.nationalNumber, m = u.carrierCode, c = m0(o, {
|
|
2199
2201
|
nationalNumber: v,
|
|
2200
2202
|
defaultCountry: d,
|
|
2201
2203
|
metadata: r
|
|
@@ -2203,7 +2205,7 @@ function M0(e, d, t, r) {
|
|
|
2203
2205
|
return c && (s = c, c === "001" || r.country(s)), {
|
|
2204
2206
|
country: s,
|
|
2205
2207
|
countryCallingCode: o,
|
|
2206
|
-
countryCallingCodeSource:
|
|
2208
|
+
countryCallingCodeSource: i,
|
|
2207
2209
|
nationalNumber: v,
|
|
2208
2210
|
carrierCode: m
|
|
2209
2211
|
};
|
|
@@ -2285,17 +2287,17 @@ function xd(e, d) {
|
|
|
2285
2287
|
function H0(e, d) {
|
|
2286
2288
|
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2287
2289
|
if (t != null) {
|
|
2288
|
-
var r = [], n = !0,
|
|
2290
|
+
var r = [], n = !0, i = !1, o, l;
|
|
2289
2291
|
try {
|
|
2290
2292
|
for (t = t.call(e); !(n = (o = t.next()).done) && (r.push(o.value), !(d && r.length === d)); n = !0)
|
|
2291
2293
|
;
|
|
2292
2294
|
} catch (s) {
|
|
2293
|
-
|
|
2295
|
+
i = !0, l = s;
|
|
2294
2296
|
} finally {
|
|
2295
2297
|
try {
|
|
2296
2298
|
!n && t.return != null && t.return();
|
|
2297
2299
|
} finally {
|
|
2298
|
-
if (
|
|
2300
|
+
if (i) throw l;
|
|
2299
2301
|
}
|
|
2300
2302
|
}
|
|
2301
2303
|
return r;
|
|
@@ -2305,16 +2307,16 @@ function j0(e) {
|
|
|
2305
2307
|
if (Array.isArray(e)) return e;
|
|
2306
2308
|
}
|
|
2307
2309
|
function K0(e) {
|
|
2308
|
-
var d = Array.prototype.slice.call(e), t = B0(d, 4), r = t[0], n = t[1],
|
|
2310
|
+
var d = Array.prototype.slice.call(e), t = B0(d, 4), r = t[0], n = t[1], i = t[2], o = t[3], l, s, u;
|
|
2309
2311
|
if (typeof r == "string")
|
|
2310
2312
|
l = r;
|
|
2311
2313
|
else throw new TypeError("A text for parsing must be a string.");
|
|
2312
2314
|
if (!n || typeof n == "string")
|
|
2313
|
-
o ? (s =
|
|
2315
|
+
o ? (s = i, u = o) : (s = void 0, u = i), n && (s = k0({
|
|
2314
2316
|
defaultCountry: n
|
|
2315
2317
|
}, s));
|
|
2316
|
-
else if (
|
|
2317
|
-
|
|
2318
|
+
else if (he(n))
|
|
2319
|
+
i ? (s = n, u = i) : u = n;
|
|
2318
2320
|
else throw new Error("Invalid second argument: ".concat(n));
|
|
2319
2321
|
return {
|
|
2320
2322
|
text: l,
|
|
@@ -2353,7 +2355,7 @@ function Y0(e, d, t) {
|
|
|
2353
2355
|
try {
|
|
2354
2356
|
return L0(e, d, t);
|
|
2355
2357
|
} catch (r) {
|
|
2356
|
-
if (!(r instanceof
|
|
2358
|
+
if (!(r instanceof q)) throw r;
|
|
2357
2359
|
}
|
|
2358
2360
|
}
|
|
2359
2361
|
function X0() {
|
|
@@ -2472,7 +2474,7 @@ function z0() {
|
|
|
2472
2474
|
];
|
|
2473
2475
|
}
|
|
2474
2476
|
function J0() {
|
|
2475
|
-
const e =
|
|
2477
|
+
const e = Pe(), d = ce(), t = Ce(), n = (e.businessLevel || t.businessSupplierOnly ? d.businessSuppliers : d.locationSuppliers).map(q0), o = Ne().currentBusiness.value, l = Gd(), s = [
|
|
2476
2478
|
["Business name:", o == null ? void 0 : o.name],
|
|
2477
2479
|
["Business ID:", o == null ? void 0 : o._id],
|
|
2478
2480
|
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
@@ -2483,14 +2485,14 @@ function J0() {
|
|
|
2483
2485
|
return Md(v, m), m;
|
|
2484
2486
|
}
|
|
2485
2487
|
function Q0() {
|
|
2486
|
-
const d =
|
|
2488
|
+
const d = Ne().currentBusiness.value, t = Gd(), r = [
|
|
2487
2489
|
["Business name:", d == null ? void 0 : d.name],
|
|
2488
2490
|
["Business ID:", d == null ? void 0 : d._id],
|
|
2489
2491
|
["Menu version", d == null ? void 0 : d.menuVersion],
|
|
2490
2492
|
[],
|
|
2491
2493
|
t.map((l) => l.name)
|
|
2492
|
-
], n = t.map((l) => `system:${l.id}`),
|
|
2493
|
-
return Md(
|
|
2494
|
+
], n = t.map((l) => `system:${l.id}`), i = Rd(r, n), o = "FeedMe supplier template.xlsx";
|
|
2495
|
+
return Md(i, o), o;
|
|
2494
2496
|
}
|
|
2495
2497
|
function e1(e) {
|
|
2496
2498
|
const [
|
|
@@ -2498,7 +2500,7 @@ function e1(e) {
|
|
|
2498
2500
|
t,
|
|
2499
2501
|
r,
|
|
2500
2502
|
n,
|
|
2501
|
-
|
|
2503
|
+
i,
|
|
2502
2504
|
o,
|
|
2503
2505
|
...l
|
|
2504
2506
|
] = Jd(e);
|
|
@@ -2522,9 +2524,9 @@ function e1(e) {
|
|
|
2522
2524
|
);
|
|
2523
2525
|
return l.map((c, y) => {
|
|
2524
2526
|
const g = {};
|
|
2525
|
-
for (const
|
|
2526
|
-
const f = s[
|
|
2527
|
-
Object.assign(g, { [f]: c[
|
|
2527
|
+
for (const N in s) {
|
|
2528
|
+
const f = s[N];
|
|
2529
|
+
Object.assign(g, { [f]: c[N] });
|
|
2528
2530
|
}
|
|
2529
2531
|
return {
|
|
2530
2532
|
index: y,
|
|
@@ -2559,7 +2561,7 @@ function Od(e, d) {
|
|
|
2559
2561
|
}
|
|
2560
2562
|
function d1(e) {
|
|
2561
2563
|
try {
|
|
2562
|
-
const d = e1(e).filter((m) => m.data.name), t =
|
|
2564
|
+
const d = e1(e).filter((m) => m.data.name), t = Pe(), r = ce(), n = Ce(), i = t.businessLevel || n.businessSupplierOnly ? r.businessSuppliers : r.locationSuppliers, o = Ad(i, "_id"), l = d.filter((m) => !m.data.id), s = d.filter((m) => m.data.id), u = l.map((m) => Od(m.data, m.index)), v = s.map((m) => {
|
|
2563
2565
|
const c = Od(m.data, m.index), y = o[m.data.id];
|
|
2564
2566
|
if (!y)
|
|
2565
2567
|
return {
|
|
@@ -2613,7 +2615,7 @@ function d1(e) {
|
|
|
2613
2615
|
const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-col" }, n1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, o1 = {
|
|
2614
2616
|
key: 0,
|
|
2615
2617
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
2616
|
-
}, a1 = { key: 0 }, Fd = /* @__PURE__ */
|
|
2618
|
+
}, a1 = { key: 0 }, Fd = /* @__PURE__ */ ie({
|
|
2617
2619
|
__name: "SupplierImportItem",
|
|
2618
2620
|
props: {
|
|
2619
2621
|
type: {},
|
|
@@ -2624,28 +2626,28 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2624
2626
|
setup(e) {
|
|
2625
2627
|
const { t: d } = ee();
|
|
2626
2628
|
return (t, r) => {
|
|
2627
|
-
const n = D("FmIcon"),
|
|
2629
|
+
const n = D("FmIcon"), i = D("FmTooltip");
|
|
2628
2630
|
return S(), w("div", t1, [
|
|
2629
2631
|
r[0] || (r[0] = h("div", null, "•", -1)),
|
|
2630
2632
|
h("div", r1, [
|
|
2631
2633
|
h("div", n1, [
|
|
2632
2634
|
h("div", {
|
|
2633
|
-
class:
|
|
2635
|
+
class: ae({
|
|
2634
2636
|
"text-fm-color-system-error-300": t.errors.length
|
|
2635
2637
|
})
|
|
2636
2638
|
}, [
|
|
2637
|
-
wd(
|
|
2638
|
-
t.type === "create" ? (S(), w("span", o1, "(" +
|
|
2639
|
+
wd(A(t.name) + " ", 1),
|
|
2640
|
+
t.type === "create" ? (S(), w("span", o1, "(" + A(p(d)("inventory.closing.template.import.new")) + ")", 1)) : W("", !0)
|
|
2639
2641
|
], 2),
|
|
2640
2642
|
t.errors.length ? (S(), w("div", a1, [
|
|
2641
|
-
|
|
2642
|
-
content:
|
|
2643
|
+
C(i, { "z-index": 50 }, {
|
|
2644
|
+
content: B(() => [
|
|
2643
2645
|
h("ol", null, [
|
|
2644
|
-
(S(!0), w(
|
|
2646
|
+
(S(!0), w(oe, null, le(t.errors, (o, l) => (S(), w("li", { key: l }, A(o), 1))), 128))
|
|
2645
2647
|
])
|
|
2646
2648
|
]),
|
|
2647
|
-
default:
|
|
2648
|
-
|
|
2649
|
+
default: B(() => [
|
|
2650
|
+
C(n, {
|
|
2649
2651
|
name: "error",
|
|
2650
2652
|
size: "sm",
|
|
2651
2653
|
color: "system-error-300"
|
|
@@ -2656,14 +2658,14 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2656
2658
|
])) : W("", !0)
|
|
2657
2659
|
]),
|
|
2658
2660
|
h("div", {
|
|
2659
|
-
class:
|
|
2661
|
+
class: ae([
|
|
2660
2662
|
"fm-typo-en-body-sm-400",
|
|
2661
2663
|
{
|
|
2662
2664
|
"text-fm-color-system-error-200": t.errors.length,
|
|
2663
2665
|
"text-fm-color-typo-secondary": !t.errors.length
|
|
2664
2666
|
}
|
|
2665
2667
|
])
|
|
2666
|
-
},
|
|
2668
|
+
}, A(t.pic), 3)
|
|
2667
2669
|
])
|
|
2668
2670
|
]);
|
|
2669
2671
|
};
|
|
@@ -2680,10 +2682,10 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2680
2682
|
}, m1 = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, y1 = {
|
|
2681
2683
|
key: 0,
|
|
2682
2684
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
2683
|
-
}, v1 = { class: "fm-typo-en-body-lg-600" }, g1 = /* @__PURE__ */
|
|
2685
|
+
}, v1 = { class: "fm-typo-en-body-lg-600" }, g1 = /* @__PURE__ */ ie({
|
|
2684
2686
|
__name: "SupplierImport",
|
|
2685
2687
|
setup(e) {
|
|
2686
|
-
const d = k(null), t = ot(), r =
|
|
2688
|
+
const d = k(null), t = ot(), r = xe(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
|
|
2687
2689
|
() => !!o.value.length || l.value.some((y) => y.errors.length) || s.value.some((y) => y.errors.length)
|
|
2688
2690
|
), v = E(
|
|
2689
2691
|
() => !!l.value.length || !!s.value.length
|
|
@@ -2696,12 +2698,12 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2696
2698
|
et(y),
|
|
2697
2699
|
// fake buffer
|
|
2698
2700
|
new Promise((O) => setTimeout(O, 1e3))
|
|
2699
|
-
]),
|
|
2700
|
-
if (!
|
|
2701
|
+
]), N = g.SheetNames.find((O) => O);
|
|
2702
|
+
if (!N) {
|
|
2701
2703
|
o.value.push(m("inventory.ingredient.import.fileError.noSheet"));
|
|
2702
2704
|
return;
|
|
2703
2705
|
}
|
|
2704
|
-
const f = d1(g.Sheets[
|
|
2706
|
+
const f = d1(g.Sheets[N]);
|
|
2705
2707
|
if (f.invalidExcel) {
|
|
2706
2708
|
o.value.push(
|
|
2707
2709
|
f.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
|
|
@@ -2726,23 +2728,23 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2726
2728
|
}), n.value = !1;
|
|
2727
2729
|
}
|
|
2728
2730
|
}
|
|
2729
|
-
return
|
|
2731
|
+
return Td(d, (y) => {
|
|
2730
2732
|
y && c(y);
|
|
2731
2733
|
}), (y, g) => {
|
|
2732
|
-
const
|
|
2734
|
+
const N = D("FmCircularProgress"), f = D("FmIcon"), O = D("FmButton");
|
|
2733
2735
|
return S(), w("div", i1, [
|
|
2734
|
-
h("div", $1,
|
|
2735
|
-
|
|
2736
|
+
h("div", $1, A(p(m)("inventory.supplier.import.message")), 1),
|
|
2737
|
+
i.value ? (S(), w("div", l1, [
|
|
2736
2738
|
h("div", null, [
|
|
2737
|
-
|
|
2739
|
+
C(N, {
|
|
2738
2740
|
size: "md",
|
|
2739
2741
|
color: "neutral-gray-200"
|
|
2740
2742
|
})
|
|
2741
2743
|
]),
|
|
2742
|
-
h("div", s1,
|
|
2743
|
-
])) : (S(), w(
|
|
2744
|
-
|
|
2745
|
-
class:
|
|
2744
|
+
h("div", s1, A(p(m)("inventory.formField.loading")), 1)
|
|
2745
|
+
])) : (S(), w(oe, { key: 1 }, [
|
|
2746
|
+
C(Qd, {
|
|
2747
|
+
class: ae({
|
|
2746
2748
|
"w-full": !0,
|
|
2747
2749
|
"h-[200px]": !d.value
|
|
2748
2750
|
}),
|
|
@@ -2753,10 +2755,10 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2753
2755
|
}, jd({ _: 2 }, [
|
|
2754
2756
|
d.value ? {
|
|
2755
2757
|
name: "default",
|
|
2756
|
-
fn:
|
|
2758
|
+
fn: B(({ openFileDialog: b }) => [
|
|
2757
2759
|
h("div", u1, [
|
|
2758
2760
|
h("div", {
|
|
2759
|
-
class:
|
|
2761
|
+
class: ae([
|
|
2760
2762
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
2761
2763
|
{
|
|
2762
2764
|
"border border-fm-color-neutral-gray-100": n.value,
|
|
@@ -2765,18 +2767,18 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2765
2767
|
}
|
|
2766
2768
|
])
|
|
2767
2769
|
}, [
|
|
2768
|
-
n.value ? (S(),
|
|
2770
|
+
n.value ? (S(), z(N, {
|
|
2769
2771
|
key: 0,
|
|
2770
2772
|
size: "md",
|
|
2771
2773
|
color: "neutral-gray-200"
|
|
2772
|
-
})) : (S(),
|
|
2774
|
+
})) : (S(), z(f, {
|
|
2773
2775
|
key: 1,
|
|
2774
2776
|
name: u.value ? "error" : "attach_file",
|
|
2775
2777
|
outline: "",
|
|
2776
2778
|
color: u.value ? "system-error-300" : void 0
|
|
2777
2779
|
}, null, 8, ["name", "color"])),
|
|
2778
2780
|
h("div", {
|
|
2779
|
-
class:
|
|
2781
|
+
class: ae([
|
|
2780
2782
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
2781
2783
|
{
|
|
2782
2784
|
"text-fm-color-typo-disabled": n.value,
|
|
@@ -2784,10 +2786,10 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2784
2786
|
}
|
|
2785
2787
|
])
|
|
2786
2788
|
}, [
|
|
2787
|
-
h("div", c1,
|
|
2789
|
+
h("div", c1, A(d.value.name), 1)
|
|
2788
2790
|
], 2),
|
|
2789
2791
|
n.value ? W("", !0) : (S(), w("div", p1, [
|
|
2790
|
-
|
|
2792
|
+
C(O, {
|
|
2791
2793
|
label: p(m)("inventory.ingredient.import.replaceFile"),
|
|
2792
2794
|
variant: u.value ? "destructive" : "secondary",
|
|
2793
2795
|
"prepend-icon": u.value ? void 0 : "autorenew",
|
|
@@ -2796,16 +2798,16 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2796
2798
|
]))
|
|
2797
2799
|
], 2),
|
|
2798
2800
|
o.value.length ? (S(), w("div", f1, [
|
|
2799
|
-
(S(!0), w(
|
|
2800
|
-
key:
|
|
2801
|
+
(S(!0), w(oe, null, le(o.value, (F, T) => (S(), w("div", {
|
|
2802
|
+
key: T,
|
|
2801
2803
|
class: "flex gap-8 items-center"
|
|
2802
2804
|
}, [
|
|
2803
|
-
|
|
2805
|
+
C(f, {
|
|
2804
2806
|
name: "error",
|
|
2805
2807
|
size: "sm",
|
|
2806
2808
|
color: "system-error-300"
|
|
2807
2809
|
}),
|
|
2808
|
-
h("div", m1,
|
|
2810
|
+
h("div", m1, A(F), 1)
|
|
2809
2811
|
]))), 128))
|
|
2810
2812
|
])) : W("", !0)
|
|
2811
2813
|
])
|
|
@@ -2814,15 +2816,15 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2814
2816
|
} : void 0
|
|
2815
2817
|
]), 1032, ["class", "label", "button-label"]),
|
|
2816
2818
|
v.value ? (S(), w("div", y1, [
|
|
2817
|
-
h("div", v1,
|
|
2818
|
-
(S(!0), w(
|
|
2819
|
+
h("div", v1, A(p(m)("inventory.ingredient.import.summary")), 1),
|
|
2820
|
+
(S(!0), w(oe, null, le(l.value, (b, F) => (S(), z(Fd, {
|
|
2819
2821
|
key: F,
|
|
2820
2822
|
name: b.supplier.name,
|
|
2821
2823
|
pic: b.supplier.contactName ?? "",
|
|
2822
2824
|
errors: b.errors,
|
|
2823
2825
|
type: "create"
|
|
2824
2826
|
}, null, 8, ["name", "pic", "errors"]))), 128)),
|
|
2825
|
-
(S(!0), w(
|
|
2827
|
+
(S(!0), w(oe, null, le(s.value, (b) => (S(), z(Fd, {
|
|
2826
2828
|
key: b.supplier._id,
|
|
2827
2829
|
name: b.supplier.name,
|
|
2828
2830
|
pic: b.supplier.contactName ?? "",
|
|
@@ -2835,7 +2837,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2835
2837
|
};
|
|
2836
2838
|
}
|
|
2837
2839
|
}), h1 = st("supplierActions", function() {
|
|
2838
|
-
const e =
|
|
2840
|
+
const e = ce(), d = Se(), { t } = ee(), r = xe();
|
|
2839
2841
|
function n() {
|
|
2840
2842
|
d.open({
|
|
2841
2843
|
title: t("inventory.supplier.import.title"),
|
|
@@ -2882,7 +2884,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2882
2884
|
d.close(), o(l);
|
|
2883
2885
|
}).onTertiary(Q0);
|
|
2884
2886
|
}
|
|
2885
|
-
function
|
|
2887
|
+
function i() {
|
|
2886
2888
|
const l = J0();
|
|
2887
2889
|
r.open({
|
|
2888
2890
|
title: t("inventory.supplier.export.success"),
|
|
@@ -2923,18 +2925,18 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2923
2925
|
}
|
|
2924
2926
|
return {
|
|
2925
2927
|
importSuppliers: n,
|
|
2926
|
-
exportSuppliers:
|
|
2928
|
+
exportSuppliers: i
|
|
2927
2929
|
};
|
|
2928
2930
|
}), b1 = { class: "flex flex-col py-8" }, _1 = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, P1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, C1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, N1 = {
|
|
2929
2931
|
key: 0,
|
|
2930
2932
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
2931
|
-
}, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", M1 = /* @__PURE__ */
|
|
2933
|
+
}, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", M1 = /* @__PURE__ */ ie({
|
|
2932
2934
|
__name: "SupplierView",
|
|
2933
2935
|
setup(e) {
|
|
2934
|
-
const { importSuppliers: d, exportSuppliers: t } = h1(), r =
|
|
2936
|
+
const { importSuppliers: d, exportSuppliers: t } = h1(), r = ce(), n = Pe(), i = Ce(), o = ke(), l = k(!1), s = Se(), u = xe(), { t: v } = ee();
|
|
2935
2937
|
n.watchLocation(c);
|
|
2936
2938
|
const m = E(() => n.businessLevel);
|
|
2937
|
-
|
|
2939
|
+
Td(m, c);
|
|
2938
2940
|
async function c() {
|
|
2939
2941
|
if (n._currentLocation) {
|
|
2940
2942
|
l.value = !0;
|
|
@@ -2954,18 +2956,18 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2954
2956
|
}
|
|
2955
2957
|
}
|
|
2956
2958
|
const y = E(
|
|
2957
|
-
() => n.businessLevel ||
|
|
2959
|
+
() => n.businessLevel || i.businessSupplierOnly ? r.businessSuppliers : r.locationSuppliers
|
|
2958
2960
|
), g = k({});
|
|
2959
|
-
function
|
|
2960
|
-
g.value.mode =
|
|
2961
|
+
function N() {
|
|
2962
|
+
g.value.mode = U.CREATE, g.value.supplier = {}, g.value.show = !0;
|
|
2961
2963
|
}
|
|
2962
|
-
function f(
|
|
2963
|
-
g.value.mode =
|
|
2964
|
+
function f($) {
|
|
2965
|
+
g.value.mode = U.UPDATE, g.value.supplier = we($), g.value.show = !0;
|
|
2964
2966
|
}
|
|
2965
|
-
async function O(
|
|
2967
|
+
async function O($) {
|
|
2966
2968
|
s.open({
|
|
2967
2969
|
title: v("inventory.supplier.delete.confirm"),
|
|
2968
|
-
message: v("inventory.supplier.delete.confirmMessage", { name:
|
|
2970
|
+
message: v("inventory.supplier.delete.confirmMessage", { name: $.name }),
|
|
2969
2971
|
primaryActions: {
|
|
2970
2972
|
text: v("common.delete"),
|
|
2971
2973
|
close: !0,
|
|
@@ -2975,23 +2977,23 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2975
2977
|
text: v("common.cancel"),
|
|
2976
2978
|
close: !0
|
|
2977
2979
|
}
|
|
2978
|
-
}).onPrimary(() => b(
|
|
2980
|
+
}).onPrimary(() => b($));
|
|
2979
2981
|
}
|
|
2980
|
-
async function b(
|
|
2982
|
+
async function b($) {
|
|
2981
2983
|
s.open({
|
|
2982
2984
|
title: v("inventory.supplier.deletingSupplier"),
|
|
2983
2985
|
closeButton: !1
|
|
2984
2986
|
});
|
|
2985
2987
|
try {
|
|
2986
|
-
await r.deleteSupplier(
|
|
2988
|
+
await r.deleteSupplier($), u.open({
|
|
2987
2989
|
title: v("inventory.supplier.delete.success"),
|
|
2988
|
-
message: v("inventory.supplier.delete.successMessage", { name:
|
|
2990
|
+
message: v("inventory.supplier.delete.successMessage", { name: $ == null ? void 0 : $.name }),
|
|
2989
2991
|
type: "success"
|
|
2990
2992
|
}), c();
|
|
2991
2993
|
} catch (a) {
|
|
2992
2994
|
u.open({
|
|
2993
2995
|
title: v("inventory.supplier.delete.error"),
|
|
2994
|
-
message: v("inventory.supplier.delete.errorMessage", { name:
|
|
2996
|
+
message: v("inventory.supplier.delete.errorMessage", { name: $ == null ? void 0 : $.name }),
|
|
2995
2997
|
type: "error"
|
|
2996
2998
|
}), console.error("failed to delete supplier", a);
|
|
2997
2999
|
} finally {
|
|
@@ -2999,10 +3001,10 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
2999
3001
|
}
|
|
3000
3002
|
}
|
|
3001
3003
|
const { columnDefs: F } = ut(f, O);
|
|
3002
|
-
function
|
|
3003
|
-
if (
|
|
3004
|
-
return
|
|
3005
|
-
if (
|
|
3004
|
+
function T($) {
|
|
3005
|
+
if ($ === "create")
|
|
3006
|
+
return N();
|
|
3007
|
+
if ($ === "import") {
|
|
3006
3008
|
if (l.value) {
|
|
3007
3009
|
u.open({
|
|
3008
3010
|
title: "Loading data...",
|
|
@@ -3013,12 +3015,12 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3013
3015
|
}
|
|
3014
3016
|
return d();
|
|
3015
3017
|
}
|
|
3016
|
-
if (
|
|
3018
|
+
if ($ === "export")
|
|
3017
3019
|
return t();
|
|
3018
|
-
if (
|
|
3020
|
+
if ($ === "refresh")
|
|
3019
3021
|
return c();
|
|
3020
3022
|
}
|
|
3021
|
-
const V = k(""), { breakpoints: Y } = at(), X = E(() => Y.value.xs || Y.value.sm),
|
|
3023
|
+
const V = k(""), { breakpoints: Y } = at(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = dt(), x = E(() => [
|
|
3022
3024
|
{
|
|
3023
3025
|
label: v("inventory.supplier.create.title"),
|
|
3024
3026
|
value: "create",
|
|
@@ -3041,17 +3043,17 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3041
3043
|
isPrimary: !1
|
|
3042
3044
|
}
|
|
3043
3045
|
]);
|
|
3044
|
-
return (
|
|
3045
|
-
const
|
|
3046
|
-
return S(),
|
|
3046
|
+
return ($, a) => {
|
|
3047
|
+
const H = D("FmTable");
|
|
3048
|
+
return S(), z(tt, {
|
|
3047
3049
|
title: p(v)("inventory.supplier.title"),
|
|
3048
3050
|
actions: x.value,
|
|
3049
|
-
"onClick:action":
|
|
3050
|
-
"helper-text": p(n).businessLevel || p(
|
|
3051
|
+
"onClick:action": T,
|
|
3052
|
+
"helper-text": p(n).businessLevel || p(i).businessSupplierOnly ? S1 : void 0
|
|
3051
3053
|
}, {
|
|
3052
|
-
default:
|
|
3054
|
+
default: B(() => [
|
|
3053
3055
|
h("div", {
|
|
3054
|
-
class:
|
|
3056
|
+
class: ae([
|
|
3055
3057
|
"flex flex-col gap-8 max-h-full",
|
|
3056
3058
|
{
|
|
3057
3059
|
"p-0": X.value,
|
|
@@ -3059,13 +3061,13 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3059
3061
|
}
|
|
3060
3062
|
])
|
|
3061
3063
|
}, [
|
|
3062
|
-
|
|
3064
|
+
C(rt, {
|
|
3063
3065
|
searchable: "",
|
|
3064
|
-
"change-location": !(p(n).businessLevel || p(
|
|
3066
|
+
"change-location": !(p(n).businessLevel || p(i).businessSupplierOnly),
|
|
3065
3067
|
search: V.value,
|
|
3066
3068
|
"onUpdate:search": a[0] || (a[0] = (I) => V.value = I)
|
|
3067
3069
|
}, null, 8, ["change-location", "search"]),
|
|
3068
|
-
|
|
3070
|
+
C(H, {
|
|
3069
3071
|
style: Kd(p(_).tableHeight),
|
|
3070
3072
|
"column-defs": p(F),
|
|
3071
3073
|
columnVisibility: {
|
|
@@ -3075,39 +3077,39 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3075
3077
|
"search-value": V.value,
|
|
3076
3078
|
loading: (!p(n)._currentLocation || l.value) && p(o).isReady,
|
|
3077
3079
|
onRowClick: a[1] || (a[1] = (I) => f(I.original)),
|
|
3078
|
-
"page-size":
|
|
3080
|
+
"page-size": te.value
|
|
3079
3081
|
}, {
|
|
3080
|
-
"list-row":
|
|
3081
|
-
|
|
3082
|
+
"list-row": B((I) => [
|
|
3083
|
+
C(nt, {
|
|
3082
3084
|
row: I,
|
|
3083
3085
|
onRowClick: f
|
|
3084
3086
|
}, {
|
|
3085
|
-
default:
|
|
3086
|
-
var M,
|
|
3087
|
+
default: B((R) => {
|
|
3088
|
+
var de, M, P, Q, j, K, re, $e, pe, Ke, We, Ye, Xe, fe, Ze, qe, ze, Je, me, Qe;
|
|
3087
3089
|
return [
|
|
3088
3090
|
h("div", b1, [
|
|
3089
3091
|
h("div", _1, [
|
|
3090
|
-
|
|
3091
|
-
render: (
|
|
3092
|
-
props: (
|
|
3092
|
+
C(p(ve), {
|
|
3093
|
+
render: (P = (M = (de = R.name) == null ? void 0 : de.column) == null ? void 0 : M.columnDef) == null ? void 0 : P.cell,
|
|
3094
|
+
props: (j = (Q = R.name) == null ? void 0 : Q.getContext) == null ? void 0 : j.call(Q)
|
|
3093
3095
|
}, null, 8, ["render", "props"])
|
|
3094
3096
|
]),
|
|
3095
3097
|
h("div", P1, [
|
|
3096
|
-
|
|
3097
|
-
render: (
|
|
3098
|
-
props: (Ke = (
|
|
3098
|
+
C(p(ve), {
|
|
3099
|
+
render: ($e = (re = (K = R.contactName) == null ? void 0 : K.column) == null ? void 0 : re.columnDef) == null ? void 0 : $e.cell,
|
|
3100
|
+
props: (Ke = (pe = R.contactName) == null ? void 0 : pe.getContext) == null ? void 0 : Ke.call(pe)
|
|
3099
3101
|
}, null, 8, ["render", "props"])
|
|
3100
3102
|
]),
|
|
3101
3103
|
h("div", C1, [
|
|
3102
|
-
|
|
3104
|
+
C(p(ve), {
|
|
3103
3105
|
render: (Xe = (Ye = (We = R.phoneNumber) == null ? void 0 : We.column) == null ? void 0 : Ye.columnDef) == null ? void 0 : Xe.cell,
|
|
3104
|
-
props: (Ze = (
|
|
3106
|
+
props: (Ze = (fe = R.phoneNumber) == null ? void 0 : fe.getContext) == null ? void 0 : Ze.call(fe)
|
|
3105
3107
|
}, null, 8, ["render", "props"])
|
|
3106
3108
|
]),
|
|
3107
3109
|
I.original.email ? (S(), w("div", N1, [
|
|
3108
|
-
|
|
3110
|
+
C(p(ve), {
|
|
3109
3111
|
render: (Je = (ze = (qe = R.email) == null ? void 0 : qe.column) == null ? void 0 : ze.columnDef) == null ? void 0 : Je.cell,
|
|
3110
|
-
props: (Qe = (
|
|
3112
|
+
props: (Qe = (me = R.email) == null ? void 0 : me.getContext) == null ? void 0 : Qe.call(me)
|
|
3111
3113
|
}, null, 8, ["render", "props"])
|
|
3112
3114
|
])) : W("", !0)
|
|
3113
3115
|
])
|
|
@@ -3119,8 +3121,8 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
|
|
|
3119
3121
|
_: 1
|
|
3120
3122
|
}, 8, ["style", "column-defs", "columnVisibility", "row-data", "search-value", "loading", "page-size"])
|
|
3121
3123
|
], 2),
|
|
3122
|
-
(S(),
|
|
3123
|
-
|
|
3124
|
+
(S(), z(Wd, { to: "body" }, [
|
|
3125
|
+
C(jt, {
|
|
3124
3126
|
show: g.value.show,
|
|
3125
3127
|
"onUpdate:show": a[2] || (a[2] = (I) => g.value.show = I),
|
|
3126
3128
|
supplier: g.value.supplier,
|