@feedmepos/mf-menu 0.20.1 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CYQnhiBN.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Ds2qfY_X.js} +2 -2
- package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-DKlRd-kN.js → ApplyProducts.vue_vue_type_script_setup_true_lang-BRepaPR3.js} +2 -2
- package/dist/{Catalog-C_MjlkAH.js → Catalog-S5KDEWzG.js} +3 -3
- package/dist/{Category-hDpbuKdl.js → Category-DLaNEtA5.js} +6 -6
- package/dist/{CookingGuide-DoTQcfZo.js → CookingGuide-DSGZapxz.js} +4 -4
- package/dist/{Group-CnbKRGYg.js → Group-B0VQ-64x.js} +4 -4
- package/dist/{Group-CIwshUNs.js → Group-CBMSkmwQ.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BmqRBXoX.js → Group.vue_vue_type_script_setup_true_lang-DKzrhXtM.js} +43 -43
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BKuXmC_M.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BV-FC8tM.js} +2 -2
- package/dist/{Ingredient-E4dxFuRx.js → Ingredient-CnPQ0kiR.js} +5 -5
- package/dist/{LinkProductSideSheet-CN4VpQoC.js → LinkProductSideSheet-A26Otbdm.js} +9 -9
- package/dist/{PrintRoute-Cp9qAt37.js → PrintRoute-BlJMdPP0.js} +3 -3
- package/dist/{Product-CukHHpY7.js → Product-BvD813LL.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-Bwlojikf.js → Product.vue_vue_type_script_setup_true_lang-D_oKtXbh.js} +251 -247
- package/dist/{Products----2Vzee.js → Products-B8Ok-bkN.js} +8 -8
- package/dist/{Publish-CTL7_VDW.js → Publish-qBiJUQ4X.js} +33 -33
- package/dist/{Recipe-C71_p_4o.js → Recipe-CJxJJAUV.js} +34 -34
- package/dist/{Scheduler-CMY10OCN.js → Scheduler-DfAMwXCu.js} +2 -2
- package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-DIyqCShi.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-CArE_Hua.js} +1 -1
- package/dist/ServingSequence-DxDMeto7.js +4 -0
- package/dist/{Setting-N_IomrUQ.js → Setting-BbgJcWsN.js} +1 -1
- package/dist/{Setting.vue_vue_type_script_setup_true_lang-BTiZlc2E.js → Setting.vue_vue_type_script_setup_true_lang-BbVEzNve.js} +3 -3
- package/dist/{Takeaway-C6wwnu5v.js → Takeaway-CMDFYeUw.js} +1 -1
- package/dist/{Takeaway-DThy6R7w.js → Takeaway-wAXsZQN2.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CrIDoLuT.js → Takeaway.vue_vue_type_script_setup_true_lang-DSphRs_i.js} +4 -4
- package/dist/{TaxSetting-f09g9uzO.js → TaxSetting-C1XOTv-9.js} +4 -4
- package/dist/{Unit-DpN-cIoI.js → Unit-BW3iqgp8.js} +2 -2
- package/dist/{Variant-DVj3Rl1M.js → Variant-BJIxp9PJ.js} +2 -2
- package/dist/{_id_-D_LlvKj8.js → _id_-B25OxuPV.js} +6 -6
- package/dist/{app-Cn8ejMq2.js → app-BFJlAowN.js} +63563 -80078
- package/dist/app.js +2 -2
- package/dist/assets/linked-status-4i88AmvK.js +24 -0
- package/dist/assets/validate-menu-CTKwgXfw.js +24 -0
- package/dist/{catalog-DYe86x7O.js → catalog-B-Z6lEFK.js} +1 -1
- package/dist/{catalog-B4hTLUkg.js → catalog-Do7RfIKm.js} +22510 -22511
- package/dist/{category-Cn9bav8Y.js → category-DEWEor3m.js} +14 -14
- package/dist/{currency-ak89ne8W.js → currency-33gUke3q.js} +1 -1
- package/dist/{index-B-PHXxgb.js → index-BEdHzZvu.js} +44 -44
- package/dist/index-BXl09ebx.js +21908 -0
- package/dist/{item-CtPBj2_Y.js → item-BooojPpg.js} +930 -930
- package/dist/{lodash-QRXx-M3X.js → lodash-247YxYiQ.js} +439 -439
- package/dist/{menu-DyHXKzGq.js → menu-DCnWrgH7.js} +1 -1
- package/dist/{object-DrR2KRA7.js → object-B2cP_UeG.js} +19 -19
- package/dist/{scheduler-C8HLf4JH.js → scheduler-0cChIv2I.js} +4 -4
- package/dist/{takeaway-D1YMjOoE.js → takeaway-mwqVQ1ij.js} +4 -4
- package/dist/{toExcel-CeOvEnsu.js → toExcel-Dha8Vf3u.js} +237 -237
- package/dist/{unit-DJPAcXZf.js → unit-BgfdgXAu.js} +3 -3
- package/dist/{vuedraggable-WU01qJgi.js → vuedraggable-BEszc36M.js} +110 -110
- package/package.json +3 -3
- package/dist/ServingSequence-C6L1_ijp.js +0 -4
- package/dist/assets/linked-status-CcasRdDR.js +0 -24
- package/dist/assets/validate-menu-Dsx_6ljN.js +0 -24
- package/dist/index-D1sxBB7B.js +0 -7392
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { b as L, h as be, G as
|
|
3
|
-
import { useDialog as Ue, useSnackbar as Le, components as ke, useDialogChild as
|
|
4
|
-
import { C as Pe } from "./catalog-
|
|
5
|
-
import { openBlock as F, createElementBlock as Z, createElementVNode as D, defineComponent as le, computed as T, resolveComponent as B, createVNode as C, unref as p, createBlock as G, renderSlot as he, withCtx as N, Fragment as Re, renderList as Ke, resolveDynamicComponent as yt, withDirectives as Xe, vShow as wt, mergeProps as
|
|
1
|
+
import { defineStore as Fn } from "pinia";
|
|
2
|
+
import { b as L, h as be, G as di, H as mi, I as hi, d as ae, m as ye, c as _e, J as En, u as me, K as fn, L as pi, M as Te, N as lt, a as Ye, i as He, O as Ht, P as Ot, g as ut, n as fi, x as gi, Q as vi, y as bi, F as yi, l as _i, S as gn, T as wi } from "./app-BFJlAowN.js";
|
|
3
|
+
import { useDialog as Ue, useSnackbar as Le, components as ke, useDialogChild as In, FmButtonVariant as Be, FmButtonColorThemeVariant as $e, useBreakpoints as Pn } from "@feedmepos/ui-library";
|
|
4
|
+
import { C as Pe } from "./catalog-B-Z6lEFK.js";
|
|
5
|
+
import { openBlock as F, createElementBlock as Z, createElementVNode as D, defineComponent as le, computed as T, resolveComponent as B, createVNode as C, unref as p, createBlock as G, renderSlot as he, withCtx as N, Fragment as Re, renderList as Ke, resolveDynamicComponent as yt, withDirectives as Xe, vShow as wt, mergeProps as Dn, withModifiers as St, createCommentVNode as ee, ref as q, createTextVNode as _t, toDisplayString as se, normalizeClass as Ee, onMounted as Qe, resolveDirective as Ut, h as ue, watch as Ce, Transition as Si, onBeforeUnmount as Ci, normalizeProps as Ri, guardReactiveProps as Ai, normalizeStyle as xi, nextTick as ki, getCurrentInstance as Mi, render as Oi } from "vue";
|
|
6
6
|
import { useI18n as ce, useCoreStore as Xt } from "@feedmepos/mf-common";
|
|
7
|
-
import { u as
|
|
8
|
-
import { a as
|
|
9
|
-
import { _ as Ge, a as
|
|
7
|
+
import { u as zi } from "./category-DEWEor3m.js";
|
|
8
|
+
import { a as Tn, _ as vn } from "./InfoBasic.vue_vue_type_script_setup_true_lang-DxQBDu16.js";
|
|
9
|
+
import { _ as Ge, a as Fi } from "./FormSection.vue_vue_type_script_setup_true_lang-BWJUD8NZ.js";
|
|
10
10
|
import { _ as et } from "./FormItem.vue_vue_type_script_setup_true_lang-DKsxEK-8.js";
|
|
11
|
-
import { f as rt } from "./currency-
|
|
12
|
-
import { _ as Je, T as
|
|
13
|
-
import {
|
|
14
|
-
import { l as Ne, u as
|
|
11
|
+
import { f as rt } from "./currency-33gUke3q.js";
|
|
12
|
+
import { _ as Je, T as Ei, l as $t } from "./takeaway-mwqVQ1ij.js";
|
|
13
|
+
import { d as Un } from "./vuedraggable-BEszc36M.js";
|
|
14
|
+
import { l as Ne, u as Ii } from "./lodash-247YxYiQ.js";
|
|
15
15
|
import "vue-router";
|
|
16
|
-
import { V as
|
|
17
|
-
import { s as Vt, F as
|
|
18
|
-
import { L as
|
|
19
|
-
import { useInventoryStore as
|
|
20
|
-
import { c as $
|
|
21
|
-
import { _ as
|
|
22
|
-
const
|
|
16
|
+
import { V as bn } from "./index-BEdHzZvu.js";
|
|
17
|
+
import { s as Vt, F as Pi } from "./object-B2cP_UeG.js";
|
|
18
|
+
import { L as Di } from "./LinkProductSideSheet-A26Otbdm.js";
|
|
19
|
+
import { useInventoryStore as $n, InventoryBindingForm as Ti, InventoryBindingSummary as Ui } from "@feedmepos/mf-inventory-portal";
|
|
20
|
+
import { c as $i } from "./string-DpfFixWH.js";
|
|
21
|
+
import { _ as Vi } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-Ds2qfY_X.js";
|
|
22
|
+
const Ni = {
|
|
23
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
24
|
width: "24",
|
|
25
25
|
height: "24",
|
|
26
26
|
fill: "none"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return F(), Z("svg",
|
|
28
|
+
function Li(e, n) {
|
|
29
|
+
return F(), Z("svg", Ni, n[0] || (n[0] = [
|
|
30
30
|
D("g", {
|
|
31
31
|
stroke: "#1C1C1E",
|
|
32
32
|
"stroke-linecap": "round",
|
|
@@ -37,14 +37,14 @@ function Ln(e, i) {
|
|
|
37
37
|
], -1)
|
|
38
38
|
]));
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Bi = { render: Li }, Ki = {
|
|
41
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
42
42
|
width: "24",
|
|
43
43
|
height: "24",
|
|
44
44
|
fill: "none"
|
|
45
45
|
};
|
|
46
|
-
function
|
|
47
|
-
return F(), Z("svg",
|
|
46
|
+
function Gi(e, n) {
|
|
47
|
+
return F(), Z("svg", Ki, n[0] || (n[0] = [
|
|
48
48
|
D("path", {
|
|
49
49
|
fill: "#1C1C1E",
|
|
50
50
|
d: "M7.6 7.6c.57-.658.9-2.1.9-2.1s.314 1.374.857 2c.572.66 2.143 1 2.143 1s-1.57.198-2.143.857C8.814 9.984 8.5 11.5 8.5 11.5s-.18-1.311-.75-1.91C7.149 8.962 5.5 8.5 5.5 8.5s1.5-.207 2.1-.9M12.2 12.2C13.342 10.885 14 8 14 8s.627 2.747 1.714 4C16.86 13.32 20 14 20 14s-3.141.395-4.286 1.714C14.627 16.967 14 20 14 20s-.358-2.622-1.5-3.818C11.298 14.922 8 14 8 14s2.998-.415 4.2-1.8"
|
|
@@ -58,20 +58,20 @@ function Gn(e, i) {
|
|
|
58
58
|
}, null, -1)
|
|
59
59
|
]));
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const Wi = { render: Gi };
|
|
62
62
|
class vt {
|
|
63
|
-
constructor(
|
|
64
|
-
this.scheduler =
|
|
63
|
+
constructor(n, t, i, a) {
|
|
64
|
+
this.scheduler = n, this.menuStore = t, this.updateMenu = i, this.dialog = a;
|
|
65
65
|
}
|
|
66
66
|
async create() {
|
|
67
|
-
this.promptDialog().onPrimary(async (
|
|
67
|
+
this.promptDialog().onPrimary(async (n) => {
|
|
68
68
|
await this.updateMenu(
|
|
69
69
|
{
|
|
70
70
|
module: L.F_MENU_MODULE_V4_KEY.enum.scheduler,
|
|
71
71
|
operation: be.F_OPERATION_TYPE.create,
|
|
72
|
-
data:
|
|
72
|
+
data: n
|
|
73
73
|
},
|
|
74
|
-
|
|
74
|
+
n.name
|
|
75
75
|
);
|
|
76
76
|
});
|
|
77
77
|
}
|
|
@@ -89,10 +89,10 @@ class vt {
|
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
delete() {
|
|
92
|
-
const
|
|
93
|
-
|
|
92
|
+
const n = this.scheduler;
|
|
93
|
+
n && this.dialog.open({
|
|
94
94
|
title: "Remove scheduler",
|
|
95
|
-
message: `Are you sure to remove ${
|
|
95
|
+
message: `Are you sure to remove ${n.name}?`,
|
|
96
96
|
primaryActions: {
|
|
97
97
|
text: "Remove",
|
|
98
98
|
close: !0
|
|
@@ -106,24 +106,24 @@ class vt {
|
|
|
106
106
|
{
|
|
107
107
|
module: L.F_MENU_MODULE_V4_KEY.enum.scheduler,
|
|
108
108
|
operation: be.F_OPERATION_TYPE.delete,
|
|
109
|
-
data:
|
|
109
|
+
data: n._id
|
|
110
110
|
},
|
|
111
|
-
|
|
111
|
+
n.name,
|
|
112
112
|
!0
|
|
113
113
|
);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
getSchedulerGroup(
|
|
117
|
-
return this.scheduler ? this.scheduler.groups.find((t) => t._id ===
|
|
118
|
-
_id:
|
|
116
|
+
getSchedulerGroup(n) {
|
|
117
|
+
return this.scheduler ? this.scheduler.groups.find((t) => t._id === n) ?? {
|
|
118
|
+
_id: n,
|
|
119
119
|
groupKey: ""
|
|
120
120
|
} : null;
|
|
121
121
|
}
|
|
122
|
-
overrideSchedulerGroups(
|
|
122
|
+
overrideSchedulerGroups(n) {
|
|
123
123
|
if (!this.scheduler) return null;
|
|
124
|
-
const t = this.scheduler.groups,
|
|
125
|
-
...t.filter((o) => !
|
|
126
|
-
...
|
|
124
|
+
const t = this.scheduler.groups, i = n.map((o) => o._id), a = [
|
|
125
|
+
...t.filter((o) => !i.includes(o._id)),
|
|
126
|
+
...n.map((o) => ({
|
|
127
127
|
_id: o._id,
|
|
128
128
|
groupKey: "",
|
|
129
129
|
items: o.items
|
|
@@ -132,14 +132,14 @@ class vt {
|
|
|
132
132
|
this.scheduler = { ...this.scheduler, groups: a };
|
|
133
133
|
}
|
|
134
134
|
injectSchedulerToMenu() {
|
|
135
|
-
const
|
|
136
|
-
if (!
|
|
137
|
-
const t = this.menuStore.state.menu,
|
|
135
|
+
const n = this.scheduler;
|
|
136
|
+
if (!n) return null;
|
|
137
|
+
const t = this.menuStore.state.menu, i = t.modules.scheduler.map((a) => a._id === n._id ? n : a);
|
|
138
138
|
return {
|
|
139
139
|
...t,
|
|
140
140
|
modules: {
|
|
141
141
|
...t.modules,
|
|
142
|
-
scheduler:
|
|
142
|
+
scheduler: i
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
@@ -161,31 +161,31 @@ class vt {
|
|
|
161
161
|
text: "Cancel",
|
|
162
162
|
close: !0
|
|
163
163
|
}
|
|
164
|
-
}).onPrimary(async (
|
|
165
|
-
this.updateItemAvailable(
|
|
164
|
+
}).onPrimary(async (i) => {
|
|
165
|
+
this.updateItemAvailable(i.map((a) => a._id));
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
async unlinkProduct(
|
|
168
|
+
async unlinkProduct(n) {
|
|
169
169
|
if (!this.scheduler) return;
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
172
|
-
const a =
|
|
170
|
+
const i = this.getItemAvailable();
|
|
171
|
+
if (!i) return;
|
|
172
|
+
const a = i.filter((o) => !n.includes(o));
|
|
173
173
|
this.updateItemAvailable(a);
|
|
174
174
|
}
|
|
175
175
|
async updateScheduler() {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
const
|
|
176
|
+
const n = this.scheduler;
|
|
177
|
+
n && this.promptDialog(n).onPrimary(async (t) => {
|
|
178
|
+
const i = {
|
|
179
179
|
...t,
|
|
180
|
-
items:
|
|
180
|
+
items: n.items
|
|
181
181
|
};
|
|
182
|
-
this.scheduler =
|
|
182
|
+
this.scheduler = i, this.updateItemAvailable(t.items.map((a) => a._id));
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
async overrideScheduler(
|
|
185
|
+
async overrideScheduler(n) {
|
|
186
186
|
const t = this.scheduler;
|
|
187
187
|
if (!t) return;
|
|
188
|
-
const
|
|
188
|
+
const i = this.menuStore.catalogs.find((l) => l._id === n), a = new Pe(i, this.menuStore, this.updateMenu, this.dialog), o = a.getCatalogScheduler(t._id);
|
|
189
189
|
if (!o) return;
|
|
190
190
|
const r = this.menuStore.state.menu.modules.scheduler.find(
|
|
191
191
|
(l) => l._id === t._id
|
|
@@ -193,12 +193,12 @@ class vt {
|
|
|
193
193
|
this.promptDialog(
|
|
194
194
|
o,
|
|
195
195
|
r,
|
|
196
|
-
|
|
196
|
+
i == null ? void 0 : i.name
|
|
197
197
|
).onPrimary(async (l) => {
|
|
198
198
|
a.overrideCatalogScheduler(l), await a.update();
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
promptDialog(
|
|
201
|
+
promptDialog(n, t, i) {
|
|
202
202
|
return this.menuStore.rules.item.multiScheduler, this.dialog.open({
|
|
203
203
|
// component: SchedulerDialog,
|
|
204
204
|
// componentProps: {
|
|
@@ -220,30 +220,30 @@ class vt {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
getItemAvailable() {
|
|
223
|
-
var
|
|
223
|
+
var i;
|
|
224
224
|
if (!this.scheduler) return null;
|
|
225
|
-
const
|
|
225
|
+
const n = this.menuStore.currentCatalog, t = n ? ((i = n.override.scheduler[this.scheduler._id]) == null ? void 0 : i.items) ?? [] : this.scheduler.items;
|
|
226
226
|
return [
|
|
227
227
|
...new Set(t.filter((a) => a.orderFrom != L.F_ORDER_FROM.enum.NONE).map((a) => a._id))
|
|
228
228
|
];
|
|
229
229
|
}
|
|
230
|
-
async updateItemAvailable(
|
|
230
|
+
async updateItemAvailable(n) {
|
|
231
231
|
const t = this.scheduler;
|
|
232
232
|
if (!t) return;
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
233
|
+
const i = this.menuStore.currentCatalog;
|
|
234
|
+
if (i && this.menuStore.rules.scheduler.override) {
|
|
235
235
|
const a = new Pe(
|
|
236
|
-
|
|
236
|
+
i,
|
|
237
237
|
this.menuStore,
|
|
238
238
|
this.updateMenu,
|
|
239
239
|
this.dialog
|
|
240
240
|
);
|
|
241
|
-
a.overrideCatalogSchedulerItems(
|
|
241
|
+
a.overrideCatalogSchedulerItems(n, t._id), await a.update();
|
|
242
242
|
} else {
|
|
243
|
-
const a =
|
|
243
|
+
const a = n.reduce((r, l) => {
|
|
244
244
|
const s = t.items.filter((u) => u._id == l) ?? [];
|
|
245
245
|
return r = r.concat(
|
|
246
|
-
|
|
246
|
+
di(l, s, (u) => ({
|
|
247
247
|
...u,
|
|
248
248
|
orderFrom: null
|
|
249
249
|
}))
|
|
@@ -256,30 +256,30 @@ class vt {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
getAvailableItemForLink() {
|
|
259
|
-
const
|
|
259
|
+
const n = mi(
|
|
260
260
|
this.menuStore.variants,
|
|
261
261
|
this.menuStore.categories,
|
|
262
|
-
|
|
262
|
+
hi(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
|
|
263
263
|
), t = new Set(
|
|
264
264
|
this.menuStore.currentCatalog ? Pe.getItemAvailable(this.menuStore.currentCatalog) : this.menuStore.state.menu.modules.item.map((a) => a._id)
|
|
265
265
|
);
|
|
266
|
-
return
|
|
266
|
+
return n.map((a) => ({
|
|
267
267
|
...a,
|
|
268
268
|
items: a.items.filter((o) => t.has(o._id))
|
|
269
269
|
})).filter((a) => a.items.length > 0);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function Ct(e,
|
|
273
|
-
for (const t of
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
if (
|
|
272
|
+
function Ct(e, n) {
|
|
273
|
+
for (const t of n) {
|
|
274
|
+
const i = e.find((a) => a._id === t._id);
|
|
275
|
+
if (i != null && i.isDynamicAddon || t.isDynamicAddon) return L.F_ADDON_GROUP_TYPE.enum.DYNAMIC;
|
|
276
|
+
if (i != null && i.category) return L.F_ADDON_GROUP_TYPE.enum.PRODUCT;
|
|
277
277
|
}
|
|
278
278
|
return L.F_ADDON_GROUP_TYPE.enum.NORMAL;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return [...new Set(e.map((t) => t._id))].reduce((t,
|
|
282
|
-
const a = e.filter((l) => l._id ===
|
|
280
|
+
function ji(e) {
|
|
281
|
+
return [...new Set(e.map((t) => t._id))].reduce((t, i) => {
|
|
282
|
+
const a = e.filter((l) => l._id === i), { base: o, variants: r } = a.reduce(
|
|
283
283
|
(l, s) => {
|
|
284
284
|
if (!s.combinationKey)
|
|
285
285
|
l.base = s;
|
|
@@ -294,8 +294,8 @@ function jn(e) {
|
|
|
294
294
|
variants: []
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return t[
|
|
298
|
-
_id:
|
|
297
|
+
return t[i] = {
|
|
298
|
+
_id: i,
|
|
299
299
|
code: o.code,
|
|
300
300
|
name: o.name,
|
|
301
301
|
price: o.price,
|
|
@@ -311,22 +311,22 @@ function jn(e) {
|
|
|
311
311
|
}, {});
|
|
312
312
|
}
|
|
313
313
|
function qt(e) {
|
|
314
|
-
const
|
|
315
|
-
_id:
|
|
316
|
-
name:
|
|
317
|
-
price:
|
|
318
|
-
orderFrom:
|
|
319
|
-
selection:
|
|
320
|
-
inventoryBindings:
|
|
321
|
-
isDynamicAddon:
|
|
322
|
-
}), t = t.concat((
|
|
314
|
+
const n = Object.values(e.items).reduce((t, i) => (t.push({
|
|
315
|
+
_id: i._id,
|
|
316
|
+
name: i.name,
|
|
317
|
+
price: i.price,
|
|
318
|
+
orderFrom: i.orderFrom,
|
|
319
|
+
selection: i.selection,
|
|
320
|
+
inventoryBindings: i.inventoryBindings,
|
|
321
|
+
isDynamicAddon: i.isDynamicAddon
|
|
322
|
+
}), t = t.concat((i == null ? void 0 : i.items) || []), t), []);
|
|
323
323
|
return {
|
|
324
324
|
...e,
|
|
325
|
-
items:
|
|
325
|
+
items: n
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
const
|
|
328
|
+
function Vn(e) {
|
|
329
|
+
const n = qt(e), t = (o) => ["product", "item", "addonGroup", "group"].some((r) => o._id.startsWith(r)), i = n.items.filter((o) => t(o)), a = n.items.filter((o) => !t(o)).map((o) => ({
|
|
330
330
|
...ye.generator.initMenuV4Item(),
|
|
331
331
|
...o,
|
|
332
332
|
code: o.code ?? "",
|
|
@@ -338,35 +338,35 @@ function $i(e) {
|
|
|
338
338
|
}));
|
|
339
339
|
return {
|
|
340
340
|
group: {
|
|
341
|
-
...
|
|
342
|
-
items:
|
|
341
|
+
...n,
|
|
342
|
+
items: i
|
|
343
343
|
},
|
|
344
344
|
linkItems: a
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
class
|
|
348
|
-
constructor(
|
|
349
|
-
this.menuStore =
|
|
347
|
+
class Nn {
|
|
348
|
+
constructor(n, t, i) {
|
|
349
|
+
this.menuStore = n, this.updateMenu = t, this.dialog = i;
|
|
350
350
|
}
|
|
351
|
-
getFallbackPrices(
|
|
352
|
-
const t = this.menuStore.currentCatalog,
|
|
353
|
-
|
|
351
|
+
getFallbackPrices(n) {
|
|
352
|
+
const t = this.menuStore.currentCatalog, i = this.menuStore.currentScheduler, a = new Pe(t, this.menuStore, this.updateMenu, this.dialog), o = new vt(
|
|
353
|
+
i,
|
|
354
354
|
this.menuStore,
|
|
355
355
|
this.updateMenu,
|
|
356
356
|
this.dialog
|
|
357
357
|
);
|
|
358
358
|
let r = ae(this.menuStore.state.menu);
|
|
359
359
|
if (t)
|
|
360
|
-
|
|
361
|
-
else if (
|
|
362
|
-
o.overrideSchedulerGroups(
|
|
360
|
+
i ? a.overrideCatalogSchedulerGroups(n, i._id) : a.overrideCatalogGroups(n), r = a.injectCatalogToMenu();
|
|
361
|
+
else if (i)
|
|
362
|
+
o.overrideSchedulerGroups(n), r = o.injectSchedulerToMenu();
|
|
363
363
|
else {
|
|
364
364
|
r = {
|
|
365
365
|
...r,
|
|
366
366
|
modules: {
|
|
367
367
|
...r.modules,
|
|
368
368
|
group: r == null ? void 0 : r.modules.group.reduce((s, u) => {
|
|
369
|
-
const d =
|
|
369
|
+
const d = n.find((m) => m._id === u._id);
|
|
370
370
|
if (!d)
|
|
371
371
|
return s = [...s, u], s;
|
|
372
372
|
const h = d.items.filter(
|
|
@@ -384,8 +384,8 @@ class Vi {
|
|
|
384
384
|
}, [])
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
for (let s = 0; s <
|
|
388
|
-
const u =
|
|
387
|
+
for (let s = 0; s < n.length; s++) {
|
|
388
|
+
const u = n[s];
|
|
389
389
|
!(r == null ? void 0 : r.modules.group.find((h) => {
|
|
390
390
|
h._id, u._id;
|
|
391
391
|
})) && !u._id && r.modules.group.push(u);
|
|
@@ -393,13 +393,13 @@ class Vi {
|
|
|
393
393
|
}
|
|
394
394
|
return r ? ye.getFallbackPrices({
|
|
395
395
|
catalogId: t == null ? void 0 : t._id,
|
|
396
|
-
schedulerId:
|
|
396
|
+
schedulerId: i == null ? void 0 : i._id,
|
|
397
397
|
rawMenu: r,
|
|
398
|
-
groups:
|
|
398
|
+
groups: n.reduce((s, u) => (s[u._id] = { ...u, groupKey: "" }, s), {})
|
|
399
399
|
}).groups : {};
|
|
400
400
|
}
|
|
401
|
-
mapGroups(
|
|
402
|
-
const
|
|
401
|
+
mapGroups(n, t) {
|
|
402
|
+
const i = this.getFallbackPrices(n), a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
|
|
403
403
|
function l(s, u) {
|
|
404
404
|
const d = s.items.reduce((m, c) => {
|
|
405
405
|
var E, P, A, _;
|
|
@@ -409,7 +409,7 @@ class Vi {
|
|
|
409
409
|
...(E = y == null ? void 0 : y.variant) == null ? void 0 : E.variantCombinations.find(
|
|
410
410
|
(R) => R.combinationKey === c.combinationKey
|
|
411
411
|
),
|
|
412
|
-
name:
|
|
412
|
+
name: En(me().variants, ((P = y == null ? void 0 : y.variant) == null ? void 0 : P.variantGroupIds) || [])[c.combinationKey]
|
|
413
413
|
} : y, g = (A = o.find((R) => R._id === s._id)) == null ? void 0 : A.items.find((R) => R._id === c._id && R.combinationKey === c.combinationKey), w = !t && !c.combinationKey, z = (_ = u.find(
|
|
414
414
|
(R) => R._id == c._id && R.combinationKey == c.combinationKey
|
|
415
415
|
)) == null ? void 0 : _.price, O = c.name ?? (g == null ? void 0 : g.name) ?? (v == null ? void 0 : v.name) ?? "", I = {
|
|
@@ -427,35 +427,35 @@ class Vi {
|
|
|
427
427
|
return {
|
|
428
428
|
...s,
|
|
429
429
|
type: h,
|
|
430
|
-
items:
|
|
430
|
+
items: ji(d),
|
|
431
431
|
itemsLinked: r.filter((m) => m.groups.some(({ _id: c }) => c === s._id)).map((m) => m._id)
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
return
|
|
434
|
+
return n.map((s) => {
|
|
435
435
|
var u;
|
|
436
|
-
return l(s, ((u =
|
|
436
|
+
return l(s, ((u = i[s._id]) == null ? void 0 : u.items) ?? []);
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
async sortGroups(
|
|
439
|
+
async sortGroups(n) {
|
|
440
440
|
const t = {
|
|
441
441
|
module: L.F_MENU_MODULE_V4_KEY.enum.group,
|
|
442
442
|
operation: be.F_OPERATION_TYPE.rearrange,
|
|
443
|
-
data:
|
|
443
|
+
data: n.map((i) => i._id)
|
|
444
444
|
};
|
|
445
445
|
await this.updateMenu(t, "Groups");
|
|
446
446
|
}
|
|
447
|
-
async duplicateGroup(
|
|
448
|
-
const t = ae(
|
|
449
|
-
|
|
447
|
+
async duplicateGroup(n) {
|
|
448
|
+
const t = ae(n);
|
|
449
|
+
n.type === L.F_ADDON_GROUP_TYPE.enum.PRODUCT || (t.items = Object.entries(t.items).reduce((r, [l, s]) => (r[l] = {
|
|
450
450
|
...s,
|
|
451
451
|
items: (s.items ?? []).map((u) => ({ ...u, _id: "" }))
|
|
452
452
|
}, r), {}));
|
|
453
|
-
const a =
|
|
453
|
+
const a = Vn(t), o = {
|
|
454
454
|
module: L.F_MENU_MODULE_V4_KEY.enum.group,
|
|
455
455
|
operation: be.F_OPERATION_TYPE.create,
|
|
456
456
|
data: {
|
|
457
457
|
...a.group,
|
|
458
|
-
name: `${
|
|
458
|
+
name: `${n.name} clone`
|
|
459
459
|
},
|
|
460
460
|
link: [
|
|
461
461
|
{
|
|
@@ -467,26 +467,26 @@ class Vi {
|
|
|
467
467
|
};
|
|
468
468
|
await this.updateMenu(o, a.group.name);
|
|
469
469
|
}
|
|
470
|
-
async deleteGroup(
|
|
470
|
+
async deleteGroup(n) {
|
|
471
471
|
const t = {
|
|
472
472
|
module: L.F_MENU_MODULE_V4_KEY.enum.group,
|
|
473
473
|
operation: be.F_OPERATION_TYPE.delete,
|
|
474
|
-
data:
|
|
474
|
+
data: n._id
|
|
475
475
|
};
|
|
476
|
-
await this.updateMenu(t,
|
|
476
|
+
await this.updateMenu(t, n.name);
|
|
477
477
|
}
|
|
478
|
-
async applyItems(
|
|
479
|
-
function
|
|
480
|
-
const d = s.filter((m) => m._id ===
|
|
481
|
-
return u ? h : [...h, ...d.length ? d : [{ _id:
|
|
478
|
+
async applyItems(n, t) {
|
|
479
|
+
function i(s, u) {
|
|
480
|
+
const d = s.filter((m) => m._id === n._id), h = s.filter((m) => m._id !== n._id);
|
|
481
|
+
return u ? h : [...h, ...d.length ? d : [{ _id: n._id, groupKey: "" }]];
|
|
482
482
|
}
|
|
483
483
|
function a(s, u, d) {
|
|
484
484
|
var c;
|
|
485
|
-
const h =
|
|
486
|
-
const v =
|
|
485
|
+
const h = i(u.groups, d), m = (((c = u.variant) == null ? void 0 : c.variantCombinations) ?? []).map((y) => {
|
|
486
|
+
const v = i(y.groups ?? [], d);
|
|
487
487
|
return { ...y, groups: v };
|
|
488
488
|
});
|
|
489
|
-
return
|
|
489
|
+
return ui(s, {
|
|
490
490
|
...u,
|
|
491
491
|
groups: h,
|
|
492
492
|
variant: u.variant ? {
|
|
@@ -495,7 +495,7 @@ class Vi {
|
|
|
495
495
|
} : null
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
|
-
const o =
|
|
498
|
+
const o = n.itemsLinked, l = [.../* @__PURE__ */ new Set([...t, ...o])].map((s) => {
|
|
499
499
|
const u = this.menuStore.state.menu.modules.item.find(
|
|
500
500
|
(d) => d._id === s
|
|
501
501
|
);
|
|
@@ -506,20 +506,20 @@ class Vi {
|
|
|
506
506
|
data: a(this.menuStore, u, !t.includes(s))
|
|
507
507
|
};
|
|
508
508
|
});
|
|
509
|
-
await this.updateMenu(l,
|
|
509
|
+
await this.updateMenu(l, n.name);
|
|
510
510
|
}
|
|
511
511
|
isOverride() {
|
|
512
512
|
return !!this.menuStore.state.currentCatalogId || !!this.menuStore.state.currentSchedulerId;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
const
|
|
516
|
-
function
|
|
517
|
-
var
|
|
518
|
-
const
|
|
519
|
-
return delete
|
|
515
|
+
const Yi = "/assets/linked-status-4i88AmvK.js";
|
|
516
|
+
function Hi(e) {
|
|
517
|
+
var i;
|
|
518
|
+
const n = ae(e), t = (i = n.variant) == null ? void 0 : i.variantCombinations;
|
|
519
|
+
return delete n.variant, delete n.thumbnail, [n, ...t || []];
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
const a = ae(
|
|
521
|
+
function Xi(e, n, t, i) {
|
|
522
|
+
const a = ae(n), o = t ? a.modules.catalog.find((m) => m._id === t) : null, r = i ? a.modules.scheduler.find((m) => m._id === i) : null, l = o ? ae(o) : void 0, s = t ? a.modules.catalog.filter((m) => m._id !== t) : [], u = r ? ae(r) : void 0, d = e.reduce((m, c) => (m[c._id] = Hi(c), m), {});
|
|
523
523
|
function h(m = []) {
|
|
524
524
|
const c = e.map((y) => y._id);
|
|
525
525
|
return [
|
|
@@ -527,11 +527,11 @@ function Xn(e, i, t, n) {
|
|
|
527
527
|
...Object.values(d).flatMap((y) => y)
|
|
528
528
|
];
|
|
529
529
|
}
|
|
530
|
-
return l &&
|
|
530
|
+
return l && i ? (l.override.scheduler = {
|
|
531
531
|
...l.override.scheduler,
|
|
532
|
-
[
|
|
533
|
-
...l.override.scheduler[
|
|
534
|
-
_id:
|
|
532
|
+
[i]: {
|
|
533
|
+
...l.override.scheduler[i],
|
|
534
|
+
_id: i,
|
|
535
535
|
items: h(u == null ? void 0 : u.items).map((m) => ({
|
|
536
536
|
...m,
|
|
537
537
|
orderFrom: L.F_ORDER_FROM.enum.ALL
|
|
@@ -541,12 +541,12 @@ function Xn(e, i, t, n) {
|
|
|
541
541
|
...l.override.items,
|
|
542
542
|
...d
|
|
543
543
|
}, a.modules.catalog = [...s, l], a) : u ? (u.items = h(u.items), a.modules.scheduler = [
|
|
544
|
-
...a.modules.scheduler.filter((m) => m._id !==
|
|
544
|
+
...a.modules.scheduler.filter((m) => m._id !== i),
|
|
545
545
|
u
|
|
546
546
|
], a) : {
|
|
547
|
-
...
|
|
547
|
+
...fn(),
|
|
548
548
|
modules: {
|
|
549
|
-
...
|
|
549
|
+
...fn().modules,
|
|
550
550
|
catalog: a.modules.catalog,
|
|
551
551
|
item: a.modules.item,
|
|
552
552
|
group: a.modules.group,
|
|
@@ -555,13 +555,13 @@ function Xn(e, i, t, n) {
|
|
|
555
555
|
_id: a._id
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function ot(e,
|
|
558
|
+
function ot(e, n, t) {
|
|
559
559
|
var o;
|
|
560
560
|
if (t >= 3) return e;
|
|
561
|
-
const
|
|
562
|
-
if (!
|
|
561
|
+
const i = n.modules.item.find((r) => r._id === e._id);
|
|
562
|
+
if (!i)
|
|
563
563
|
throw new Error(`_insertItemOverriders - Item not found - ${e._id}`);
|
|
564
|
-
const a = (o =
|
|
564
|
+
const a = (o = i.groups) == null ? void 0 : o.map((r) => {
|
|
565
565
|
var u, d, h;
|
|
566
566
|
const l = (u = e == null ? void 0 : e.groups) == null ? void 0 : u.find((m) => m._id === r._id);
|
|
567
567
|
let s;
|
|
@@ -570,54 +570,54 @@ function ot(e, i, t) {
|
|
|
570
570
|
const c = (y = l.items) == null ? void 0 : y.find(
|
|
571
571
|
(v) => v._id === m._id && v.combinationKey === m.combinationKey
|
|
572
572
|
);
|
|
573
|
-
return ot(c || m,
|
|
574
|
-
})) ?? [] : s = ((h = r.items) == null ? void 0 : h.map((m) => ot(m,
|
|
573
|
+
return ot(c || m, n, t + 1);
|
|
574
|
+
})) ?? [] : s = ((h = r.items) == null ? void 0 : h.map((m) => ot(m, n, t + 1))) ?? [], {
|
|
575
575
|
...r,
|
|
576
576
|
items: s
|
|
577
577
|
};
|
|
578
578
|
});
|
|
579
579
|
return {
|
|
580
|
-
_id:
|
|
581
|
-
name: e.name ||
|
|
582
|
-
code: e.code ||
|
|
580
|
+
_id: i._id,
|
|
581
|
+
name: e.name || i.name,
|
|
582
|
+
code: e.code || i.code,
|
|
583
583
|
combinationKey: e.combinationKey,
|
|
584
584
|
groups: a
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function qi(e, n) {
|
|
588
588
|
const t = e.groups.map((o) => {
|
|
589
|
-
const r =
|
|
589
|
+
const r = n.modules.group.find((s) => s._id === o._id), l = ((r == null ? void 0 : r.items) || []).map((s) => {
|
|
590
590
|
var h;
|
|
591
591
|
const u = (h = o.items) == null ? void 0 : h.find(
|
|
592
592
|
(m) => m._id === s._id && m.combinationKey === s.combinationKey
|
|
593
593
|
);
|
|
594
594
|
if (u)
|
|
595
|
-
return ot(u,
|
|
595
|
+
return ot(u, n, 1);
|
|
596
596
|
const d = {
|
|
597
597
|
...ye.generator.initMenuV4ItemOverrider(),
|
|
598
598
|
_id: s._id,
|
|
599
599
|
combinationKey: s.combinationKey
|
|
600
600
|
};
|
|
601
|
-
return ot(d,
|
|
601
|
+
return ot(d, n, 1);
|
|
602
602
|
});
|
|
603
603
|
return { ...o, items: l };
|
|
604
|
-
}),
|
|
604
|
+
}), i = e.variant ? e.variant.variantCombinations.map((o) => ot(o, n, 1)) : [], a = {
|
|
605
605
|
...ye.generator.initMenuV4ItemOverrider(),
|
|
606
606
|
_id: e._id,
|
|
607
607
|
name: e.name,
|
|
608
608
|
code: e.code,
|
|
609
609
|
groups: t
|
|
610
610
|
};
|
|
611
|
-
return [...
|
|
611
|
+
return [...i, a];
|
|
612
612
|
}
|
|
613
|
-
function Nt(e,
|
|
614
|
-
var
|
|
615
|
-
if (!
|
|
613
|
+
function Nt(e, n) {
|
|
614
|
+
var i;
|
|
615
|
+
if (!n)
|
|
616
616
|
return e;
|
|
617
|
-
const t = { ...e, code:
|
|
618
|
-
return t.groups = (
|
|
617
|
+
const t = { ...e, code: n.code };
|
|
618
|
+
return t.groups = (i = t.groups) == null ? void 0 : i.map((a) => {
|
|
619
619
|
var r, l;
|
|
620
|
-
const o = (r =
|
|
620
|
+
const o = (r = n.groups) == null ? void 0 : r.find((s) => s._id === a._id);
|
|
621
621
|
return a.items = (l = a.items) == null ? void 0 : l.map((s) => {
|
|
622
622
|
var d;
|
|
623
623
|
const u = (d = o == null ? void 0 : o.items) == null ? void 0 : d.find(
|
|
@@ -627,11 +627,11 @@ function Nt(e, i) {
|
|
|
627
627
|
}), a;
|
|
628
628
|
}), t;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
const t = e.items[
|
|
632
|
-
|
|
633
|
-
...
|
|
634
|
-
variantCombinations:
|
|
630
|
+
function Zi(e, n) {
|
|
631
|
+
const t = e.items[n._id];
|
|
632
|
+
n.variant && (n.variant = {
|
|
633
|
+
...n.variant,
|
|
634
|
+
variantCombinations: n.variant.variantCombinations.map((a) => {
|
|
635
635
|
const o = t.find(
|
|
636
636
|
(r) => r._id === a._id && r.combinationKey === a.combinationKey
|
|
637
637
|
);
|
|
@@ -640,12 +640,12 @@ function Zn(e, i) {
|
|
|
640
640
|
return Nt(o, a);
|
|
641
641
|
})
|
|
642
642
|
});
|
|
643
|
-
const
|
|
644
|
-
if (!
|
|
645
|
-
throw new Error(`Base item overrider not found - ${
|
|
646
|
-
return
|
|
643
|
+
const i = t.find((a) => !a.combinationKey);
|
|
644
|
+
if (!i)
|
|
645
|
+
throw new Error(`Base item overrider not found - ${n._id}`);
|
|
646
|
+
return n.groups = (i.groups || []).map((a) => {
|
|
647
647
|
var r;
|
|
648
|
-
const o =
|
|
648
|
+
const o = n.groups.find((l) => l._id === a._id);
|
|
649
649
|
return a.items = (r = a.items) == null ? void 0 : r.map((l) => {
|
|
650
650
|
var u;
|
|
651
651
|
const s = (u = o == null ? void 0 : o.items) == null ? void 0 : u.find(
|
|
@@ -654,34 +654,34 @@ function Zn(e, i) {
|
|
|
654
654
|
return Nt(l, s);
|
|
655
655
|
}), a;
|
|
656
656
|
}), {
|
|
657
|
-
...
|
|
658
|
-
price: (
|
|
657
|
+
...n,
|
|
658
|
+
price: (i == null ? void 0 : i.price) || n.price
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
async function
|
|
662
|
-
const r = ae(t), l = o ?
|
|
661
|
+
async function Qi(e, n, t, i, a, o = !0) {
|
|
662
|
+
const r = ae(t), l = o ? Xi(n, r, i, a) : r, s = n.reduce((h, m) => (h[m._id] = l.modules.item.find((c) => c._id === m._id), h), {}), u = n.reduce((h, m) => {
|
|
663
663
|
const c = m._id;
|
|
664
|
-
return h[c] =
|
|
664
|
+
return h[c] = qi(s[c], e), h;
|
|
665
665
|
}, {}), d = ye.getFallbackPrices({
|
|
666
666
|
rawMenu: l,
|
|
667
667
|
items: u,
|
|
668
|
-
catalogId:
|
|
668
|
+
catalogId: i || void 0,
|
|
669
669
|
schedulerId: a
|
|
670
670
|
});
|
|
671
|
-
return
|
|
671
|
+
return n.map((h) => {
|
|
672
672
|
const m = h._id, c = s[m];
|
|
673
673
|
return {
|
|
674
|
-
...
|
|
675
|
-
category:
|
|
674
|
+
...Zi(d, c),
|
|
675
|
+
category: i || a ? c == null ? void 0 : c.category : null
|
|
676
676
|
};
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Ln(e, n) {
|
|
680
680
|
if (e.length === 0) return "";
|
|
681
681
|
const t = e == null ? void 0 : e.split("variant");
|
|
682
682
|
return ((t == null ? void 0 : t.reduce((a, o) => {
|
|
683
683
|
if (o && o.length > 0) {
|
|
684
|
-
const r = `variant${o.split("/")[0]}`, l = o.split("/")[1], u =
|
|
684
|
+
const r = `variant${o.split("/")[0]}`, l = o.split("/")[1], u = n.find(
|
|
685
685
|
({ _id: d }) => d === r
|
|
686
686
|
).options.find(({ _id: d }) => d === l);
|
|
687
687
|
a.push(((u == null ? void 0 : u.name) || "").trim());
|
|
@@ -690,18 +690,18 @@ function Ni(e, i) {
|
|
|
690
690
|
}, [])) || []).join(" / ");
|
|
691
691
|
}
|
|
692
692
|
const zt = /* @__PURE__ */ new Map();
|
|
693
|
-
async function
|
|
694
|
-
const t = `${e._id}-${e.updatedAt}-${
|
|
693
|
+
async function Ji(e, n) {
|
|
694
|
+
const t = `${e._id}-${e.updatedAt}-${n}`;
|
|
695
695
|
if (zt.has(t))
|
|
696
696
|
return zt.get(t);
|
|
697
|
-
const
|
|
698
|
-
|
|
697
|
+
const i = await pi(
|
|
698
|
+
Yi,
|
|
699
699
|
JSON.stringify({
|
|
700
700
|
menu: e,
|
|
701
|
-
itemId:
|
|
701
|
+
itemId: n
|
|
702
702
|
})
|
|
703
703
|
);
|
|
704
|
-
return zt.set(t,
|
|
704
|
+
return zt.set(t, i), i;
|
|
705
705
|
}
|
|
706
706
|
const Zt = /* @__PURE__ */ le({
|
|
707
707
|
__name: "OrderFrom",
|
|
@@ -744,18 +744,18 @@ const Zt = /* @__PURE__ */ le({
|
|
|
744
744
|
}
|
|
745
745
|
},
|
|
746
746
|
emits: ["update:model-value"],
|
|
747
|
-
setup(e, { emit:
|
|
748
|
-
const t = e, { t:
|
|
747
|
+
setup(e, { emit: n }) {
|
|
748
|
+
const t = e, { t: i } = ce(), a = n, o = T(() => ({
|
|
749
749
|
ALL: {
|
|
750
|
-
label:
|
|
750
|
+
label: i("menu.order.from.options.all"),
|
|
751
751
|
value: L.F_ORDER_FROM.enum.ALL
|
|
752
752
|
},
|
|
753
753
|
POS_ONLY: {
|
|
754
|
-
label:
|
|
754
|
+
label: i("menu.order.from.options.pos_only"),
|
|
755
755
|
value: L.F_ORDER_FROM.enum.POS_ONLY
|
|
756
756
|
},
|
|
757
757
|
NONE: {
|
|
758
|
-
label:
|
|
758
|
+
label: i("menu.order.from.options.none"),
|
|
759
759
|
value: L.F_ORDER_FROM.enum.NONE
|
|
760
760
|
}
|
|
761
761
|
})), r = T(() => {
|
|
@@ -785,10 +785,10 @@ const Zt = /* @__PURE__ */ le({
|
|
|
785
785
|
C(h, {
|
|
786
786
|
disabled: e.disable,
|
|
787
787
|
items: r.value,
|
|
788
|
-
label: e.label ?? p(
|
|
788
|
+
label: e.label ?? p(i)("menu.common.labels.order_from"),
|
|
789
789
|
"menu-z-index": e.menuZIndex,
|
|
790
790
|
"model-value": s.value,
|
|
791
|
-
rules: e.required ? [(m) => !!m || p(
|
|
791
|
+
rules: e.required ? [(m) => !!m || p(i)("menu.common.validation.required_field")] : [],
|
|
792
792
|
"shift-menu": "",
|
|
793
793
|
"onUpdate:modelValue": d[0] || (d[0] = (m) => a("update:model-value", m ?? null))
|
|
794
794
|
}, null, 8, ["disabled", "items", "label", "menu-z-index", "model-value", "rules"])
|
|
@@ -796,134 +796,134 @@ const Zt = /* @__PURE__ */ le({
|
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
798
|
});
|
|
799
|
-
var eo = function(e,
|
|
800
|
-
return Object.assign(document.createElement("canvas"), { width: e, height:
|
|
799
|
+
var eo = function(e, n) {
|
|
800
|
+
return Object.assign(document.createElement("canvas"), { width: e, height: n });
|
|
801
801
|
};
|
|
802
|
-
function
|
|
802
|
+
function yn(e, n) {
|
|
803
803
|
var t = Object.keys(e);
|
|
804
804
|
if (Object.getOwnPropertySymbols) {
|
|
805
|
-
var
|
|
806
|
-
|
|
805
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
806
|
+
n && (i = i.filter(function(a) {
|
|
807
807
|
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
808
|
-
})), t.push.apply(t,
|
|
808
|
+
})), t.push.apply(t, i);
|
|
809
809
|
}
|
|
810
810
|
return t;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
for (var
|
|
814
|
-
var t = arguments[
|
|
815
|
-
|
|
816
|
-
Ae(e,
|
|
817
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
818
|
-
Object.defineProperty(e,
|
|
812
|
+
function ie(e) {
|
|
813
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
814
|
+
var t = arguments[n] != null ? arguments[n] : {};
|
|
815
|
+
n % 2 ? yn(Object(t), !0).forEach(function(i) {
|
|
816
|
+
Ae(e, i, t[i]);
|
|
817
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : yn(Object(t)).forEach(function(i) {
|
|
818
|
+
Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(t, i));
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
821
|
return e;
|
|
822
822
|
}
|
|
823
|
-
function Ae(e,
|
|
824
|
-
return
|
|
823
|
+
function Ae(e, n, t) {
|
|
824
|
+
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
825
825
|
}
|
|
826
|
-
function to(e,
|
|
826
|
+
function to(e, n) {
|
|
827
827
|
if (e == null) return {};
|
|
828
|
-
var t,
|
|
828
|
+
var t, i, a = function(r, l) {
|
|
829
829
|
if (r == null) return {};
|
|
830
830
|
var s, u, d = {}, h = Object.keys(r);
|
|
831
831
|
for (u = 0; u < h.length; u++) s = h[u], l.indexOf(s) >= 0 || (d[s] = r[s]);
|
|
832
832
|
return d;
|
|
833
|
-
}(e,
|
|
833
|
+
}(e, n);
|
|
834
834
|
if (Object.getOwnPropertySymbols) {
|
|
835
835
|
var o = Object.getOwnPropertySymbols(e);
|
|
836
|
-
for (
|
|
836
|
+
for (i = 0; i < o.length; i++) t = o[i], n.indexOf(t) >= 0 || Object.prototype.propertyIsEnumerable.call(e, t) && (a[t] = e[t]);
|
|
837
837
|
}
|
|
838
838
|
return a;
|
|
839
839
|
}
|
|
840
840
|
function qe(e) {
|
|
841
|
-
return function(
|
|
842
|
-
if (Array.isArray(
|
|
843
|
-
}(e) || function(
|
|
844
|
-
if (typeof Symbol < "u" &&
|
|
845
|
-
}(e) || function(
|
|
846
|
-
if (
|
|
847
|
-
if (typeof
|
|
848
|
-
var
|
|
849
|
-
if (
|
|
850
|
-
if (
|
|
841
|
+
return function(n) {
|
|
842
|
+
if (Array.isArray(n)) return Ft(n);
|
|
843
|
+
}(e) || function(n) {
|
|
844
|
+
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n);
|
|
845
|
+
}(e) || function(n, t) {
|
|
846
|
+
if (n) {
|
|
847
|
+
if (typeof n == "string") return Ft(n, t);
|
|
848
|
+
var i = Object.prototype.toString.call(n).slice(8, -1);
|
|
849
|
+
if (i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set") return Array.from(n);
|
|
850
|
+
if (i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return Ft(n, t);
|
|
851
851
|
}
|
|
852
852
|
}(e) || function() {
|
|
853
853
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
854
854
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
855
855
|
}();
|
|
856
856
|
}
|
|
857
|
-
function Ft(e,
|
|
858
|
-
(
|
|
859
|
-
for (var t = 0,
|
|
860
|
-
return
|
|
857
|
+
function Ft(e, n) {
|
|
858
|
+
(n == null || n > e.length) && (n = e.length);
|
|
859
|
+
for (var t = 0, i = new Array(n); t < n; t++) i[t] = e[t];
|
|
860
|
+
return i;
|
|
861
861
|
}
|
|
862
|
-
var
|
|
862
|
+
var _n, no, mt, de = (_n = function(e) {
|
|
863
863
|
/*!
|
|
864
864
|
Copyright (c) 2018 Jed Watson.
|
|
865
865
|
Licensed under the MIT License (MIT), see
|
|
866
866
|
http://jedwatson.github.io/classnames
|
|
867
867
|
*/
|
|
868
868
|
(function() {
|
|
869
|
-
var
|
|
869
|
+
var n = {}.hasOwnProperty;
|
|
870
870
|
function t() {
|
|
871
|
-
for (var
|
|
871
|
+
for (var i = [], a = 0; a < arguments.length; a++) {
|
|
872
872
|
var o = arguments[a];
|
|
873
873
|
if (o) {
|
|
874
874
|
var r = typeof o;
|
|
875
|
-
if (r === "string" || r === "number")
|
|
875
|
+
if (r === "string" || r === "number") i.push(o);
|
|
876
876
|
else if (Array.isArray(o)) {
|
|
877
877
|
if (o.length) {
|
|
878
878
|
var l = t.apply(null, o);
|
|
879
|
-
l &&
|
|
879
|
+
l && i.push(l);
|
|
880
880
|
}
|
|
881
|
-
} else if (r === "object") if (o.toString === Object.prototype.toString) for (var s in o)
|
|
882
|
-
else
|
|
881
|
+
} else if (r === "object") if (o.toString === Object.prototype.toString) for (var s in o) n.call(o, s) && o[s] && i.push(s);
|
|
882
|
+
else i.push(o.toString());
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
return
|
|
885
|
+
return i.join(" ");
|
|
886
886
|
}
|
|
887
887
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
888
888
|
})();
|
|
889
|
-
},
|
|
889
|
+
}, _n(mt = { path: no, exports: {}, require: function(e, n) {
|
|
890
890
|
return function() {
|
|
891
891
|
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
892
|
-
}(
|
|
892
|
+
}(n == null && mt.path);
|
|
893
893
|
} }, mt.exports), mt.exports), Me = function(e) {
|
|
894
|
-
return function(
|
|
895
|
-
if (!
|
|
896
|
-
var
|
|
897
|
-
typeof
|
|
894
|
+
return function(n, t) {
|
|
895
|
+
if (!n) return e;
|
|
896
|
+
var i;
|
|
897
|
+
typeof n == "string" ? i = n : t = n;
|
|
898
898
|
var a = e;
|
|
899
|
-
return
|
|
899
|
+
return i && (a += "__" + i), a + (t ? Object.keys(t).reduce(function(o, r) {
|
|
900
900
|
var l = t[r];
|
|
901
901
|
return l && (o += " " + (typeof l == "boolean" ? a + "--" + r : a + "--" + r + "_" + l)), o;
|
|
902
902
|
}, "") : "");
|
|
903
903
|
};
|
|
904
904
|
};
|
|
905
|
-
function Lt(e,
|
|
906
|
-
var
|
|
905
|
+
function Lt(e, n, t) {
|
|
906
|
+
var i, a, o, r, l;
|
|
907
907
|
function s() {
|
|
908
908
|
var d = Date.now() - r;
|
|
909
|
-
d <
|
|
909
|
+
d < n && d >= 0 ? i = setTimeout(s, n - d) : (i = null, t || (l = e.apply(o, a), o = a = null));
|
|
910
910
|
}
|
|
911
|
-
|
|
911
|
+
n == null && (n = 100);
|
|
912
912
|
var u = function() {
|
|
913
913
|
o = this, a = arguments, r = Date.now();
|
|
914
|
-
var d = t && !
|
|
915
|
-
return
|
|
914
|
+
var d = t && !i;
|
|
915
|
+
return i || (i = setTimeout(s, n)), d && (l = e.apply(o, a), o = a = null), l;
|
|
916
916
|
};
|
|
917
917
|
return u.clear = function() {
|
|
918
|
-
|
|
918
|
+
i && (clearTimeout(i), i = null);
|
|
919
919
|
}, u.flush = function() {
|
|
920
|
-
|
|
920
|
+
i && (l = e.apply(o, a), o = a = null, clearTimeout(i), i = null);
|
|
921
921
|
}, u;
|
|
922
922
|
}
|
|
923
923
|
Lt.debounce = Lt;
|
|
924
924
|
var Bt = Lt, H = function() {
|
|
925
925
|
return H = Object.assign || function(e) {
|
|
926
|
-
for (var
|
|
926
|
+
for (var n, t = 1, i = arguments.length; t < i; t++) for (var a in n = arguments[t]) Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
927
927
|
return e;
|
|
928
928
|
}, H.apply(this, arguments);
|
|
929
929
|
};
|
|
@@ -941,16 +941,16 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
941
941
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
942
942
|
PERFORMANCE OF THIS SOFTWARE.
|
|
943
943
|
***************************************************************************** */
|
|
944
|
-
function
|
|
945
|
-
var t,
|
|
946
|
-
return e &&
|
|
944
|
+
function Bn(e, n) {
|
|
945
|
+
var t, i;
|
|
946
|
+
return e && n ? (t = "" + e + n[0].toUpperCase() + n.slice(1), i = e + "-" + n) : (t = e || n, i = e || n), { name: t, classname: i };
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function Kn(e) {
|
|
949
949
|
return /^blob:/.test(e);
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
return
|
|
953
|
-
return /^data:/.test(
|
|
951
|
+
function wn(e) {
|
|
952
|
+
return Kn(e) || function(n) {
|
|
953
|
+
return /^data:/.test(n);
|
|
954
954
|
}(e);
|
|
955
955
|
}
|
|
956
956
|
function Ze(e) {
|
|
@@ -962,42 +962,42 @@ function fe(e) {
|
|
|
962
962
|
function bt(e) {
|
|
963
963
|
return typeof e == "object" && e !== null;
|
|
964
964
|
}
|
|
965
|
-
function Kt(e,
|
|
966
|
-
var
|
|
967
|
-
return bt(e) ? (Object.keys(
|
|
968
|
-
fe(e[a]) ?
|
|
969
|
-
}),
|
|
965
|
+
function Kt(e, n, t) {
|
|
966
|
+
var i = {};
|
|
967
|
+
return bt(e) ? (Object.keys(n).forEach(function(a) {
|
|
968
|
+
fe(e[a]) ? i[a] = n[a] : bt(n[a]) ? bt(e[a]) ? i[a] = Kt(e[a], n[a], t[a]) : i[a] = e[a] ? n[a] : t[a] : n[a] === !0 || n[a] === !1 ? i[a] = !!e[a] : i[a] = e[a];
|
|
969
|
+
}), i) : e ? n : t;
|
|
970
970
|
}
|
|
971
971
|
function ht(e) {
|
|
972
|
-
var
|
|
973
|
-
return Number.isNaN(
|
|
972
|
+
var n = Number(e);
|
|
973
|
+
return Number.isNaN(n) ? e : n;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return typeof (e == "number" || /* @__PURE__ */ function(
|
|
977
|
-
return typeof
|
|
978
|
-
}(e) && toString.call(e) == "[object Number]") && !
|
|
975
|
+
function Sn(e) {
|
|
976
|
+
return typeof (e == "number" || /* @__PURE__ */ function(n) {
|
|
977
|
+
return typeof n == "object" && n !== null;
|
|
978
|
+
}(e) && toString.call(e) == "[object Number]") && !Gn(e);
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Gn(e) {
|
|
981
981
|
return e != e;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
return Math.sqrt(Math.pow(e.x -
|
|
983
|
+
function Wn(e, n) {
|
|
984
|
+
return Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2));
|
|
985
985
|
}
|
|
986
|
-
var at = function(e,
|
|
987
|
-
e === void 0 && (e = {}),
|
|
988
|
-
},
|
|
989
|
-
|
|
986
|
+
var at = function(e, n) {
|
|
987
|
+
e === void 0 && (e = {}), n === void 0 && (n = {}), this.type = "manipulateImage", this.move = e, this.scale = n;
|
|
988
|
+
}, io = function(e, n) {
|
|
989
|
+
n === void 0 && (n = {}), this.type = "resize", this.directions = e, this.params = n;
|
|
990
990
|
}, Qt = function(e) {
|
|
991
991
|
this.type = "move", this.directions = e;
|
|
992
992
|
}, oo = function() {
|
|
993
|
-
function e(
|
|
994
|
-
this.type = "drag", this.nativeEvent =
|
|
993
|
+
function e(n, t, i, a, o) {
|
|
994
|
+
this.type = "drag", this.nativeEvent = n, this.position = i, this.previousPosition = a, this.element = t, this.anchor = o;
|
|
995
995
|
}
|
|
996
996
|
return e.prototype.shift = function() {
|
|
997
|
-
var
|
|
997
|
+
var n = this, t = n.element, i = n.anchor, a = n.position;
|
|
998
998
|
if (t) {
|
|
999
999
|
var o = t.getBoundingClientRect(), r = o.left, l = o.top;
|
|
1000
|
-
return { left: a.left - r -
|
|
1000
|
+
return { left: a.left - r - i.left, top: a.top - l - i.top };
|
|
1001
1001
|
}
|
|
1002
1002
|
return { left: 0, top: 0 };
|
|
1003
1003
|
}, e;
|
|
@@ -1013,8 +1013,8 @@ var at = function(e, i) {
|
|
|
1013
1013
|
}, onMouseLeave: function() {
|
|
1014
1014
|
this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
|
|
1015
1015
|
}, onTouchStart: function(e) {
|
|
1016
|
-
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = qe(e.touches), this.hovered || (this.$emit("enter"), this.hovered = !0), e.touches.length && this.initAnchor(this.touches.reduce(function(
|
|
1017
|
-
return { clientX:
|
|
1016
|
+
e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = qe(e.touches), this.hovered || (this.$emit("enter"), this.hovered = !0), e.touches.length && this.initAnchor(this.touches.reduce(function(n, t) {
|
|
1017
|
+
return { clientX: n.clientX + t.clientX / e.touches.length, clientY: n.clientY + t.clientY / e.touches.length };
|
|
1018
1018
|
}, { clientX: 0, clientY: 0 })), e.preventDefault && e.preventDefault(), e.stopPropagation());
|
|
1019
1019
|
}, onTouchEnd: function() {
|
|
1020
1020
|
this.processEnd();
|
|
@@ -1022,204 +1022,204 @@ var at = function(e, i) {
|
|
|
1022
1022
|
this.touches.length && (this.processMove(e, e.touches), e.preventDefault && e.preventDefault(), e.stopPropagation && e.stopPropagation());
|
|
1023
1023
|
}, onMouseDown: function(e) {
|
|
1024
1024
|
if (!this.disabled) {
|
|
1025
|
-
var
|
|
1026
|
-
this.touches = [
|
|
1025
|
+
var n = { fake: !0, clientX: e.clientX, clientY: e.clientY };
|
|
1026
|
+
this.touches = [n], this.initAnchor(n), e.stopPropagation();
|
|
1027
1027
|
}
|
|
1028
1028
|
}, onMouseMove: function(e) {
|
|
1029
1029
|
this.touches.length && (this.processMove(e, [{ fake: !0, clientX: e.clientX, clientY: e.clientY }]), e.preventDefault && e.preventDefault());
|
|
1030
1030
|
}, onMouseUp: function() {
|
|
1031
1031
|
this.processEnd();
|
|
1032
1032
|
}, initAnchor: function(e) {
|
|
1033
|
-
var
|
|
1034
|
-
this.anchor = { left: e.clientX - t, top: e.clientY - o, bottom: a - e.clientY, right:
|
|
1035
|
-
}, processMove: function(e,
|
|
1036
|
-
var t = qe(
|
|
1033
|
+
var n = this.$refs.draggable.getBoundingClientRect(), t = n.left, i = n.right, a = n.bottom, o = n.top;
|
|
1034
|
+
this.anchor = { left: e.clientX - t, top: e.clientY - o, bottom: a - e.clientY, right: i - e.clientX };
|
|
1035
|
+
}, processMove: function(e, n) {
|
|
1036
|
+
var t = qe(n);
|
|
1037
1037
|
if (this.touches.length) {
|
|
1038
1038
|
if (this.touches.length === 1 && t.length === 1) {
|
|
1039
|
-
var
|
|
1040
|
-
this.$emit("drag", new oo(e,
|
|
1039
|
+
var i = this.$refs.draggable;
|
|
1040
|
+
this.$emit("drag", new oo(e, i, { left: t[0].clientX, top: t[0].clientY }, { left: this.touches[0].clientX, top: this.touches[0].clientY }, this.anchor));
|
|
1041
1041
|
}
|
|
1042
1042
|
this.touches = t;
|
|
1043
1043
|
}
|
|
1044
1044
|
}, processEnd: function() {
|
|
1045
1045
|
this.touches.length && this.$emit("drag-end"), this.hovered && (this.$emit("leave"), this.hovered = !1), this.touches = [];
|
|
1046
1046
|
} }, emits: ["drag", "drag-end", "leave", "enter"] };
|
|
1047
|
-
Jt.render = function(e,
|
|
1048
|
-
return F(), G("div", { ref: "draggable", class: t.classname, onTouchstart:
|
|
1047
|
+
Jt.render = function(e, n, t, i, a, o) {
|
|
1048
|
+
return F(), G("div", { ref: "draggable", class: t.classname, onTouchstart: n[1] || (n[1] = function() {
|
|
1049
1049
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1050
|
-
}), onMousedown:
|
|
1050
|
+
}), onMousedown: n[2] || (n[2] = function() {
|
|
1051
1051
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
1052
|
-
}), onMouseover:
|
|
1052
|
+
}), onMouseover: n[3] || (n[3] = function() {
|
|
1053
1053
|
return o.onMouseOver && o.onMouseOver.apply(o, arguments);
|
|
1054
|
-
}), onMouseleave:
|
|
1054
|
+
}), onMouseleave: n[4] || (n[4] = function() {
|
|
1055
1055
|
return o.onMouseLeave && o.onMouseLeave.apply(o, arguments);
|
|
1056
1056
|
}) }, [he(e.$slots, "default")], 34);
|
|
1057
1057
|
};
|
|
1058
|
-
var Et = Me("vue-handler-wrapper"),
|
|
1058
|
+
var Et = Me("vue-handler-wrapper"), jn = { name: "HandlerWrapper", components: { DraggableElement: Jt }, props: { horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, computed: { classes: function() {
|
|
1059
1059
|
var e;
|
|
1060
1060
|
if (this.horizontalPosition || this.verticalPosition) {
|
|
1061
|
-
var
|
|
1062
|
-
e = Et((Ae(
|
|
1061
|
+
var n, t = Bn(this.horizontalPosition, this.verticalPosition);
|
|
1062
|
+
e = Et((Ae(n = {}, t.classname, !0), Ae(n, "disabled", this.disabled), n));
|
|
1063
1063
|
} else e = Et({ disabled: this.disabled });
|
|
1064
1064
|
return { root: e, draggable: Et("draggable") };
|
|
1065
1065
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1066
|
-
|
|
1066
|
+
jn.render = function(e, n, t, i, a, o) {
|
|
1067
1067
|
var r = B("DraggableElement");
|
|
1068
|
-
return F(), G("div", { class: o.classes.root }, [C(r, { class: o.classes.draggable, onDrag:
|
|
1068
|
+
return F(), G("div", { class: o.classes.root }, [C(r, { class: o.classes.draggable, onDrag: n[1] || (n[1] = function(l) {
|
|
1069
1069
|
return e.$emit("drag", l);
|
|
1070
|
-
}), onDragEnd:
|
|
1070
|
+
}), onDragEnd: n[2] || (n[2] = function(l) {
|
|
1071
1071
|
return e.$emit("drag-end");
|
|
1072
|
-
}), onLeave:
|
|
1072
|
+
}), onLeave: n[3] || (n[3] = function(l) {
|
|
1073
1073
|
return e.$emit("leave");
|
|
1074
|
-
}), onEnter:
|
|
1074
|
+
}), onEnter: n[4] || (n[4] = function(l) {
|
|
1075
1075
|
return e.$emit("enter");
|
|
1076
1076
|
}) }, { default: N(function() {
|
|
1077
1077
|
return [he(e.$slots, "default")];
|
|
1078
1078
|
}), _: 3 }, 8, ["class"])], 2);
|
|
1079
1079
|
};
|
|
1080
|
-
var ao = Me("vue-line-wrapper"),
|
|
1080
|
+
var ao = Me("vue-line-wrapper"), Yn = { name: "LineWrapper", components: { DraggableElement: Jt }, props: { position: { type: String, required: !0 }, disabled: { type: Boolean, default: !1 } }, computed: { classname: function() {
|
|
1081
1081
|
var e;
|
|
1082
1082
|
return ao((Ae(e = {}, this.position, !0), Ae(e, "disabled", this.disabled), e));
|
|
1083
1083
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1084
|
-
|
|
1084
|
+
Yn.render = function(e, n, t, i, a, o) {
|
|
1085
1085
|
var r = B("DraggableElement");
|
|
1086
|
-
return F(), G(r, { class: o.classname, onDrag:
|
|
1086
|
+
return F(), G(r, { class: o.classname, onDrag: n[1] || (n[1] = function(l) {
|
|
1087
1087
|
return e.$emit("drag", l);
|
|
1088
|
-
}), onDragEnd:
|
|
1088
|
+
}), onDragEnd: n[2] || (n[2] = function(l) {
|
|
1089
1089
|
return e.$emit("drag-end");
|
|
1090
|
-
}), onLeave:
|
|
1090
|
+
}), onLeave: n[3] || (n[3] = function(l) {
|
|
1091
1091
|
return e.$emit("leave");
|
|
1092
|
-
}), onEnter:
|
|
1092
|
+
}), onEnter: n[4] || (n[4] = function(l) {
|
|
1093
1093
|
return e.$emit("enter");
|
|
1094
1094
|
}) }, { default: N(function() {
|
|
1095
1095
|
return [he(e.$slots, "default")];
|
|
1096
1096
|
}), _: 3 }, 8, ["class"]);
|
|
1097
1097
|
};
|
|
1098
|
-
var ze = ["left", "right", "top", "bottom"], ro = ["left", "right"], so = ["top", "bottom"], lo = ["left", "top"], uo = ["fill-area", "fit-area", "stencil", "none"],
|
|
1099
|
-
function
|
|
1100
|
-
return !(t = t || ["width", "height", "left", "top"]).some(function(
|
|
1101
|
-
return e[
|
|
1098
|
+
var ze = ["left", "right", "top", "bottom"], ro = ["left", "right"], so = ["top", "bottom"], lo = ["left", "top"], uo = ["fill-area", "fit-area", "stencil", "none"], Cn = { left: 0, top: 0, width: 0, height: 0 };
|
|
1099
|
+
function Rn(e, n, t) {
|
|
1100
|
+
return !(t = t || ["width", "height", "left", "top"]).some(function(i) {
|
|
1101
|
+
return e[i] !== n[i];
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
1104
|
function Fe(e) {
|
|
1105
1105
|
return { left: e.left, top: e.top, right: e.left + e.width, bottom: e.top + e.height };
|
|
1106
1106
|
}
|
|
1107
|
-
function tt(e,
|
|
1108
|
-
return { left: e.left -
|
|
1107
|
+
function tt(e, n) {
|
|
1108
|
+
return { left: e.left - n.left, top: e.top - n.top };
|
|
1109
1109
|
}
|
|
1110
1110
|
function ge(e) {
|
|
1111
1111
|
return { left: e.left + e.width / 2, top: e.top + e.height / 2 };
|
|
1112
1112
|
}
|
|
1113
|
-
function st(e,
|
|
1113
|
+
function st(e, n) {
|
|
1114
1114
|
var t = { left: 0, top: 0, right: 0, bottom: 0 };
|
|
1115
|
-
return ze.forEach(function(
|
|
1116
|
-
var a = i
|
|
1117
|
-
t[
|
|
1115
|
+
return ze.forEach(function(i) {
|
|
1116
|
+
var a = n[i], o = Fe(e)[i];
|
|
1117
|
+
t[i] = a !== void 0 && o !== void 0 ? i === "left" || i === "top" ? Math.max(0, a - o) : Math.max(0, o - a) : 0;
|
|
1118
1118
|
}), t;
|
|
1119
1119
|
}
|
|
1120
|
-
function Oe(e,
|
|
1121
|
-
return { left: e.left -
|
|
1120
|
+
function Oe(e, n) {
|
|
1121
|
+
return { left: e.left - n.left, top: e.top - n.top, width: e.width + n.left + n.right, height: e.height + n.top + n.bottom };
|
|
1122
1122
|
}
|
|
1123
1123
|
function Rt(e) {
|
|
1124
1124
|
return { left: -e.left, top: -e.top };
|
|
1125
1125
|
}
|
|
1126
|
-
function Se(e,
|
|
1127
|
-
return H(H({}, e), { left: e.left +
|
|
1126
|
+
function Se(e, n) {
|
|
1127
|
+
return H(H({}, e), { left: e.left + n.left, top: e.top + n.top });
|
|
1128
1128
|
}
|
|
1129
|
-
function xe(e,
|
|
1130
|
-
if (
|
|
1129
|
+
function xe(e, n, t, i) {
|
|
1130
|
+
if (n !== 1) {
|
|
1131
1131
|
if (t) {
|
|
1132
1132
|
var a = ge(e);
|
|
1133
|
-
return { width: e.width *
|
|
1133
|
+
return { width: e.width * n, height: e.height * n, left: e.left + e.width * (1 - n) / 2 + (t.left - a.left) * (1 - n), top: e.top + e.height * (1 - n) / 2 + (t.top - a.top) * (1 - n) };
|
|
1134
1134
|
}
|
|
1135
|
-
return { width: e.width *
|
|
1135
|
+
return { width: e.width * n, height: e.height * n, left: e.left + e.width * (1 - n) / 2, top: e.top + e.height * (1 - n) / 2 };
|
|
1136
1136
|
}
|
|
1137
1137
|
return e;
|
|
1138
1138
|
}
|
|
1139
1139
|
function oe(e) {
|
|
1140
1140
|
return e.width / e.height;
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
return Math.min(
|
|
1142
|
+
function nt(e, n) {
|
|
1143
|
+
return Math.min(n.right !== void 0 && n.left !== void 0 ? (n.right - n.left) / e.width : 1 / 0, n.bottom !== void 0 && n.top !== void 0 ? (n.bottom - n.top) / e.height : 1 / 0);
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1146
|
-
var t = { left: 0, top: 0 },
|
|
1147
|
-
return
|
|
1145
|
+
function it(e, n) {
|
|
1146
|
+
var t = { left: 0, top: 0 }, i = st(e, n);
|
|
1147
|
+
return i.left && i.left > 0 ? t.left = i.left : i.right && i.right > 0 && (t.left = -i.right), i.top && i.top > 0 ? t.top = i.top : i.bottom && i.bottom > 0 && (t.top = -i.bottom), t;
|
|
1148
1148
|
}
|
|
1149
|
-
function It(e,
|
|
1149
|
+
function It(e, n) {
|
|
1150
1150
|
var t;
|
|
1151
|
-
return
|
|
1151
|
+
return n.minimum && e < n.minimum ? t = n.minimum : n.maximum && e > n.maximum && (t = n.maximum), t;
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1154
|
-
var t = oe(e),
|
|
1155
|
-
return
|
|
1153
|
+
function Hn(e, n) {
|
|
1154
|
+
var t = oe(e), i = oe(n);
|
|
1155
|
+
return n.width < 1 / 0 && n.height < 1 / 0 ? t > i ? { width: n.width, height: n.width / t } : { width: n.height * t, height: n.height } : n.width < 1 / 0 ? { width: n.width, height: n.width / t } : n.height < 1 / 0 ? { width: n.height * t, height: n.height } : e;
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1158
|
-
var t =
|
|
1157
|
+
function Xn(e, n) {
|
|
1158
|
+
var t = n * Math.PI / 180;
|
|
1159
1159
|
return { width: Math.abs(e.width * Math.cos(t)) + Math.abs(e.height * Math.sin(t)), height: Math.abs(e.width * Math.sin(t)) + Math.abs(e.height * Math.cos(t)) };
|
|
1160
1160
|
}
|
|
1161
|
-
function Ve(e,
|
|
1162
|
-
var t =
|
|
1161
|
+
function Ve(e, n) {
|
|
1162
|
+
var t = n * Math.PI / 180;
|
|
1163
1163
|
return { left: e.left * Math.cos(t) - e.top * Math.sin(t), top: e.left * Math.sin(t) + e.top * Math.cos(t) };
|
|
1164
1164
|
}
|
|
1165
|
-
function At(e,
|
|
1166
|
-
var t = st(ve(e,
|
|
1167
|
-
return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width,
|
|
1165
|
+
function At(e, n) {
|
|
1166
|
+
var t = st(ve(e, n), n);
|
|
1167
|
+
return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width, nt(e, n)) : Math.min((e.height + t.top + t.bottom) / e.height, nt(e, n)) : 1;
|
|
1168
1168
|
}
|
|
1169
|
-
function ve(e,
|
|
1169
|
+
function ve(e, n, t) {
|
|
1170
1170
|
t === void 0 && (t = !1);
|
|
1171
|
-
var
|
|
1172
|
-
return Se(e, t ? Rt(
|
|
1171
|
+
var i = it(e, n);
|
|
1172
|
+
return Se(e, t ? Rt(i) : i);
|
|
1173
1173
|
}
|
|
1174
1174
|
function Gt(e) {
|
|
1175
1175
|
return { width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0, height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0 };
|
|
1176
1176
|
}
|
|
1177
|
-
function co(e,
|
|
1178
|
-
return H(H({}, e), { minWidth: Math.min(
|
|
1177
|
+
function co(e, n) {
|
|
1178
|
+
return H(H({}, e), { minWidth: Math.min(n.width, e.minWidth), minHeight: Math.min(n.height, e.minHeight), maxWidth: Math.min(n.width, e.maxWidth), maxHeight: Math.min(n.height, e.maxHeight) });
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function qn(e, n, t) {
|
|
1181
1181
|
t === void 0 && (t = !0);
|
|
1182
|
-
var
|
|
1182
|
+
var i = {};
|
|
1183
1183
|
return ze.forEach(function(a) {
|
|
1184
|
-
var o = e[a], r =
|
|
1185
|
-
o !== void 0 && r !== void 0 ?
|
|
1186
|
-
}),
|
|
1184
|
+
var o = e[a], r = n[a];
|
|
1185
|
+
o !== void 0 && r !== void 0 ? i[a] = a === "left" || a === "top" ? t ? Math.max(o, r) : Math.min(o, r) : t ? Math.min(o, r) : Math.max(o, r) : r !== void 0 ? i[a] = r : o !== void 0 && (i[a] = o);
|
|
1186
|
+
}), i;
|
|
1187
1187
|
}
|
|
1188
|
-
function xt(e,
|
|
1189
|
-
return
|
|
1188
|
+
function xt(e, n) {
|
|
1189
|
+
return qn(e, n, !0);
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1192
|
-
var
|
|
1193
|
-
return !!((
|
|
1191
|
+
function An(e) {
|
|
1192
|
+
var n = e.size, t = e.aspectRatio, i = e.ignoreMinimum, a = e.sizeRestrictions;
|
|
1193
|
+
return !!((n.correctRatio || oe(n) >= t.minimum && oe(n) <= t.maximum) && n.height <= a.maxHeight && n.width <= a.maxWidth && n.width && n.height && (i || n.height >= a.minHeight && n.width >= a.minWidth));
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return Math.pow(e.width -
|
|
1195
|
+
function xn(e, n) {
|
|
1196
|
+
return Math.pow(e.width - n.width, 2) + Math.pow(e.height - n.height, 2);
|
|
1197
1197
|
}
|
|
1198
1198
|
function De(e) {
|
|
1199
|
-
var
|
|
1199
|
+
var n = e.width, t = e.height, i = e.sizeRestrictions, a = { minimum: e.aspectRatio && e.aspectRatio.minimum || 0, maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0 }, o = { width: Math.max(i.minWidth, Math.min(i.maxWidth, n)), height: Math.max(i.minHeight, Math.min(i.maxHeight, t)) };
|
|
1200
1200
|
function r(u, d) {
|
|
1201
1201
|
return d === void 0 && (d = !1), u.reduce(function(h, m) {
|
|
1202
|
-
return
|
|
1202
|
+
return An({ size: m, aspectRatio: a, sizeRestrictions: i, ignoreMinimum: d }) && (!h || xn(m, { width: n, height: t }) < xn(h, { width: n, height: t })) ? m : h;
|
|
1203
1203
|
}, null);
|
|
1204
1204
|
}
|
|
1205
1205
|
var l = [];
|
|
1206
|
-
|
|
1206
|
+
[a.minimum, a.maximum].forEach(function(u) {
|
|
1207
1207
|
u && l.push({ width: o.width, height: o.width / u, correctRatio: !0 }, { width: o.height * u, height: o.height, correctRatio: !0 });
|
|
1208
|
-
}),
|
|
1208
|
+
}), An({ size: o, aspectRatio: a, sizeRestrictions: i }) && l.push(o);
|
|
1209
1209
|
var s = r(l) || r(l, !0);
|
|
1210
1210
|
return s && { width: s.width, height: s.height };
|
|
1211
1211
|
}
|
|
1212
1212
|
function Wt(e) {
|
|
1213
|
-
var
|
|
1214
|
-
return Se(o,
|
|
1213
|
+
var n = e.event, t = e.coordinates, i = e.positionRestrictions, a = i === void 0 ? {} : i, o = Se(t, n.directions);
|
|
1214
|
+
return Se(o, it(o, a));
|
|
1215
1215
|
}
|
|
1216
1216
|
function mo(e) {
|
|
1217
|
-
var
|
|
1217
|
+
var n = e.coordinates, t = e.transform, i = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(d, h) {
|
|
1218
1218
|
return Wt({ coordinates: d, positionRestrictions: o, event: new Qt({ left: h.left - d.left, top: h.top - d.top }) });
|
|
1219
|
-
}, u = H({},
|
|
1219
|
+
}, u = H({}, n);
|
|
1220
1220
|
return (Array.isArray(t) ? t : [t]).forEach(function(d) {
|
|
1221
1221
|
var h = {};
|
|
1222
|
-
fe((h = typeof d == "function" ? d({ coordinates: u, imageSize:
|
|
1222
|
+
fe((h = typeof d == "function" ? d({ coordinates: u, imageSize: i, visibleArea: l }) : d).width) && fe(h.height) || (u = function(m, c) {
|
|
1223
1223
|
var y = H(H(H({}, m), De({ width: c.width, height: c.height, sizeRestrictions: a, aspectRatio: r })), { left: 0, top: 0 });
|
|
1224
1224
|
return s(y, { left: m.left, top: m.top });
|
|
1225
1225
|
}(u, H(H({}, u), h))), fe(h.left) && fe(h.top) || (u = s(u, H(H({}, u), h)));
|
|
@@ -1227,83 +1227,83 @@ function mo(e) {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
function ho(e) {
|
|
1229
1229
|
e.event;
|
|
1230
|
-
var
|
|
1230
|
+
var n = e.getAreaRestrictions, t = e.boundaries, i = e.coordinates, a = e.visibleArea;
|
|
1231
1231
|
e.aspectRatio;
|
|
1232
1232
|
var o = e.stencilSize, r = e.sizeRestrictions, l = e.positionRestrictions;
|
|
1233
1233
|
e.stencilReference;
|
|
1234
|
-
var s, u, d, h = H({},
|
|
1234
|
+
var s, u, d, h = H({}, i), m = H({}, a), c = H({}, o);
|
|
1235
1235
|
s = oe(c), u = oe(h), d === void 0 && (d = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < d : Math.abs(u / s) < 1 + d && Math.abs(u / s) > 1 - d) || (h = H(H({}, h), De({ sizeRestrictions: r, width: h.width, height: h.height, aspectRatio: { minimum: oe(c), maximum: oe(c) } })));
|
|
1236
|
-
var y = At(m = xe(m, h.width * t.width / (m.width * c.width)),
|
|
1237
|
-
return y !== 1 && (m = xe(m, y), h = xe(h, y)), m = ve(m = Se(m, tt(ge(h), ge(m))),
|
|
1236
|
+
var y = At(m = xe(m, h.width * t.width / (m.width * c.width)), n({ visibleArea: m, type: "resize" }));
|
|
1237
|
+
return y !== 1 && (m = xe(m, y), h = xe(h, y)), m = ve(m = Se(m, tt(ge(h), ge(m))), n({ visibleArea: m, type: "move" })), { coordinates: h = ve(h, xt(Fe(m), l)), visibleArea: m };
|
|
1238
1238
|
}
|
|
1239
1239
|
function po(e) {
|
|
1240
|
-
var
|
|
1240
|
+
var n = e.event, t = e.getAreaRestrictions, i = e.boundaries, a = e.coordinates, o = e.visibleArea;
|
|
1241
1241
|
e.aspectRatio, e.stencilSize, e.sizeRestrictions;
|
|
1242
1242
|
var r = e.positionRestrictions;
|
|
1243
1243
|
e.stencilReference;
|
|
1244
1244
|
var l = H({}, a), s = H({}, o);
|
|
1245
|
-
if (a && o &&
|
|
1245
|
+
if (a && o && n.type !== "manipulateImage") {
|
|
1246
1246
|
var u = { width: 0, height: 0 };
|
|
1247
|
-
s.width,
|
|
1248
|
-
var d = At(s = xe(s, l.width *
|
|
1247
|
+
s.width, i.width, oe(i) > oe(l) ? (u.height = 0.8 * i.height, u.width = u.height * oe(l)) : (u.width = 0.8 * i.width, u.height = u.width * oe(l));
|
|
1248
|
+
var d = At(s = xe(s, l.width * i.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
|
|
1249
1249
|
s = xe(s, d), d !== 1 && (u.height /= d, u.width /= d), s = ve(s = Se(s, tt(ge(l), ge(s))), t({ visibleArea: s, type: "move" })), l = ve(l, xt(Fe(s), r));
|
|
1250
1250
|
}
|
|
1251
1251
|
return { coordinates: l, visibleArea: s };
|
|
1252
1252
|
}
|
|
1253
1253
|
function fo(e) {
|
|
1254
|
-
var
|
|
1255
|
-
if (
|
|
1254
|
+
var n = e.event, t = e.coordinates, i = e.visibleArea, a = e.getAreaRestrictions, o = H({}, i), r = H({}, t);
|
|
1255
|
+
if (n.type === "setCoordinates") {
|
|
1256
1256
|
var l = Math.max(0, r.width - o.width), s = Math.max(0, r.height - o.height);
|
|
1257
|
-
l > s ? o = xe(o, Math.min(r.width / o.width,
|
|
1257
|
+
l > s ? o = xe(o, Math.min(r.width / o.width, nt(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = xe(o, Math.min(r.height / o.height, nt(o, a({ visibleArea: o, type: "resize" }))))), o = ve(o = Se(o, Rt(it(r, Fe(o)))), a({ visibleArea: o, type: "move" }));
|
|
1258
1258
|
}
|
|
1259
1259
|
return { visibleArea: o, coordinates: r };
|
|
1260
1260
|
}
|
|
1261
1261
|
function go(e) {
|
|
1262
|
-
var
|
|
1263
|
-
return { left: (t ? t.left : 0) + a.width / 2 -
|
|
1262
|
+
var n = e.imageSize, t = e.visibleArea, i = e.coordinates, a = t || n;
|
|
1263
|
+
return { left: (t ? t.left : 0) + a.width / 2 - i.width / 2, top: (t ? t.top : 0) + a.height / 2 - i.height / 2 };
|
|
1264
1264
|
}
|
|
1265
1265
|
function vo(e) {
|
|
1266
|
-
var
|
|
1267
|
-
return De(H(H({}, l), { aspectRatio:
|
|
1266
|
+
var n = e.imageSize, t = e.visibleArea, i = e.aspectRatio, a = e.sizeRestrictions, o = t || n, r = Math.min(i.maximum || 1 / 0, Math.max(i.minimum || 0, oe(o))), l = o.width < o.height ? { width: 0.8 * o.width, height: 0.8 * o.width / r } : { height: 0.8 * o.height, width: 0.8 * o.height * r };
|
|
1267
|
+
return De(H(H({}, l), { aspectRatio: i, sizeRestrictions: a }));
|
|
1268
1268
|
}
|
|
1269
1269
|
function bo(e) {
|
|
1270
|
-
var
|
|
1271
|
-
return oe(u) > oe(o) ? t = (
|
|
1270
|
+
var n, t, i = e.imageSize, a = e.visibleArea, o = e.boundaries, r = e.aspectRatio, l = e.sizeRestrictions, s = e.stencilSize, u = a || i;
|
|
1271
|
+
return oe(u) > oe(o) ? t = (n = s.height * u.height / o.height) * oe(s) : n = (t = s.width * u.width / o.width) / oe(s), De({ width: t, height: n, aspectRatio: r, sizeRestrictions: l });
|
|
1272
1272
|
}
|
|
1273
1273
|
function yo(e) {
|
|
1274
|
-
var
|
|
1274
|
+
var n = e.getAreaRestrictions, t = e.coordinates, i = e.imageSize, a = oe(e.boundaries);
|
|
1275
1275
|
if (t) {
|
|
1276
|
-
var o = { height: Math.max(t.height,
|
|
1277
|
-
return !s.left && !s.right && l.width <=
|
|
1276
|
+
var o = { height: Math.max(t.height, i.height), width: Math.max(t.width, i.width) }, r = Hn({ width: oe(o) > a ? o.width : o.height * a, height: oe(o) > a ? o.width / a : o.height }, Gt(n())), l = { left: t.left + t.width / 2 - r.width / 2, top: t.top + t.height / 2 - r.height / 2, width: r.width, height: r.height }, s = st(t, Fe(H({ left: 0, top: 0 }, i))), u = {};
|
|
1277
|
+
return !s.left && !s.right && l.width <= i.width && (u.left = 0, u.right = i.width), !s.top && !s.bottom && l.height <= i.height && (u.top = 0, u.bottom = i.height), ve(l, u);
|
|
1278
1278
|
}
|
|
1279
|
-
var d = oe(
|
|
1280
|
-
return r = { height: d > a ?
|
|
1279
|
+
var d = oe(i);
|
|
1280
|
+
return r = { height: d > a ? i.height : i.width / a, width: d > a ? i.height * a : i.width }, { left: i.width / 2 - r.width / 2, top: i.height / 2 - r.height / 2, width: r.width, height: r.height };
|
|
1281
1281
|
}
|
|
1282
|
-
function pt(e,
|
|
1283
|
-
return
|
|
1282
|
+
function pt(e, n) {
|
|
1283
|
+
return qn(e, Fe(n));
|
|
1284
1284
|
}
|
|
1285
1285
|
function _o(e) {
|
|
1286
|
-
var
|
|
1286
|
+
var n = e.event, t = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = n.scale, u = n.move, d = H({}, i), h = H({}, t), m = 1, c = 1, y = s.factor && Math.abs(s.factor - 1) > 1e-3;
|
|
1287
1287
|
d = Se(d, { left: u.left || 0, top: u.top || 0 });
|
|
1288
|
-
var v = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / h.width : 0, a.minHeight ? a.minHeight / h.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / h.width : 1 / 0, a.maxHeight ? a.maxHeight / h.height : 1 / 0,
|
|
1288
|
+
var v = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / h.width : 0, a.minHeight ? a.minHeight / h.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / h.width : 1 / 0, a.maxHeight ? a.maxHeight / h.height : 1 / 0, nt(h, r)) }, area: { maximum: nt(d, o({ visibleArea: d, type: "resize" })) } };
|
|
1289
1289
|
s.factor && y && (s.factor < 1 ? (c = Math.max(s.factor, v.stencil.minimum)) > 1 && (c = 1) : s.factor > 1 && (c = Math.min(s.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (c = 1)), c && (d = xe(d, c, s.center));
|
|
1290
|
-
var g = t.left -
|
|
1291
|
-
return d = ve(d = Se(d,
|
|
1290
|
+
var g = t.left - i.left, w = i.width + i.left - (t.width + t.left), z = t.top - i.top, O = i.height + i.top - (t.height + t.top);
|
|
1291
|
+
return d = ve(d = Se(d, it(d, { left: r.left !== void 0 ? r.left - g * c : void 0, top: r.top !== void 0 ? r.top - z * c : void 0, bottom: r.bottom !== void 0 ? r.bottom + O * c : void 0, right: r.right !== void 0 ? r.right + w * c : void 0 })), o({ visibleArea: d, type: "move" })), h.width = h.width * c, h.height = h.height * c, h.left = d.left + g * c, h.top = d.top + z * c, h = ve(h, xt(Fe(d), r)), s.factor && y && l && (s.factor > 1 ? m = Math.min(v.area.maximum, s.factor) / c : s.factor < 1 && (m = Math.max(h.height / d.height, h.width / d.width, s.factor / c)), m !== 1 && (d = Se(d = ve(d = xe(d, m, s.factor > 1 ? s.center : ge(h)), o({ visibleArea: d, type: "move" })), Rt(it(h, Fe(d)))))), { coordinates: h, visibleArea: d };
|
|
1292
1292
|
}
|
|
1293
1293
|
function wo(e) {
|
|
1294
|
-
var
|
|
1295
|
-
return (d = H(H({}, De({ sizeRestrictions: o, aspectRatio:
|
|
1294
|
+
var n = e.aspectRatio, t = e.getAreaRestrictions, i = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, d = H({}, i), h = H({}, a), m = Ve(ge(H({ left: 0, top: 0 }, s)), u);
|
|
1295
|
+
return (d = H(H({}, De({ sizeRestrictions: o, aspectRatio: n, width: d.width, height: d.height })), Ve(ge(d), u))).left -= m.left - l.width / 2 + d.width / 2, d.top -= m.top - l.height / 2 + d.height / 2, h = xe(h, At(h, t({ visibleArea: h, type: "resize" }))), { coordinates: d = ve(d, r), visibleArea: h = ve(h = Se(h, tt(ge(d), ge(i))), t({ visibleArea: h, type: "move" })) };
|
|
1296
1296
|
}
|
|
1297
1297
|
function So(e) {
|
|
1298
|
-
var
|
|
1298
|
+
var n = e.flip, t = e.previousFlip, i = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = H({}, o), u = H({}, r), d = t.horizontal !== n.horizontal, h = t.vertical !== n.vertical;
|
|
1299
1299
|
if (d || h) {
|
|
1300
|
-
var m = Ve({ left: l.width / 2, top: l.height / 2 }, -
|
|
1301
|
-
s = Se(s, tt(y, ge(s))), c = Ve(ge(u), -
|
|
1300
|
+
var m = Ve({ left: l.width / 2, top: l.height / 2 }, -i), c = Ve(ge(s), -i), y = Ve({ left: d ? m.left - (c.left - m.left) : c.left, top: h ? m.top - (c.top - m.top) : c.top }, i);
|
|
1301
|
+
s = Se(s, tt(y, ge(s))), c = Ve(ge(u), -i), u = ve(u = Se(u, tt(y = Ve({ left: d ? m.left - (c.left - m.left) : c.left, top: h ? m.top - (c.top - m.top) : c.top }, i), ge(u))), a({ visibleArea: u, type: "move" }));
|
|
1302
1302
|
}
|
|
1303
1303
|
return { coordinates: s, visibleArea: u };
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1306
|
-
var
|
|
1305
|
+
function kn(e) {
|
|
1306
|
+
var n = e.directions, t = e.coordinates, i = e.positionRestrictions, a = i === void 0 ? {} : i, o = e.sizeRestrictions, r = e.preserveRatio, l = e.compensate, s = H({}, n), u = Oe(t, s).width, d = Oe(t, s).height;
|
|
1307
1307
|
u < 0 && (s.left < 0 && s.right < 0 ? (s.left = -(t.width - o.minWidth) / (s.left / s.right), s.right = -(t.width - o.minWidth) / (s.right / s.left)) : s.left < 0 ? s.left = -(t.width - o.minWidth) : s.right < 0 && (s.right = -(t.width - o.minWidth))), d < 0 && (s.top < 0 && s.bottom < 0 ? (s.top = -(t.height - o.minHeight) / (s.top / s.bottom), s.bottom = -(t.height - o.minHeight) / (s.bottom / s.top)) : s.top < 0 ? s.top = -(t.height - o.minHeight) : s.bottom < 0 && (s.bottom = -(t.height - o.minHeight)));
|
|
1308
1308
|
var h = st(Oe(t, s), a);
|
|
1309
1309
|
l && (h.left && h.left > 0 && h.right === 0 ? (s.right += h.left, s.left -= h.left) : h.right && h.right > 0 && h.left === 0 && (s.left += h.right, s.right -= h.right), h.top && h.top > 0 && h.bottom === 0 ? (s.bottom += h.top, s.top -= h.top) : h.bottom && h.bottom > 0 && h.top === 0 && (s.top += h.bottom, s.bottom -= h.bottom), h = st(Oe(t, s), a));
|
|
@@ -1333,14 +1333,14 @@ function xi(e) {
|
|
|
1333
1333
|
});
|
|
1334
1334
|
return s;
|
|
1335
1335
|
}
|
|
1336
|
-
function ft(e,
|
|
1337
|
-
return
|
|
1336
|
+
function ft(e, n, t) {
|
|
1337
|
+
return n == 0 && t == 0 ? e / 2 : n == 0 ? 0 : t == 0 ? e : e * Math.abs(n / (n + t));
|
|
1338
1338
|
}
|
|
1339
|
-
var Co = Me("vue-simple-handler"), Ro = Me("vue-simple-handler-wrapper"),
|
|
1339
|
+
var Co = Me("vue-simple-handler"), Ro = Me("vue-simple-handler-wrapper"), en = { name: "SimpleHandler", components: { HandlerWrapper: jn }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, horizontalPosition: { type: String }, verticalPosition: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
1340
1340
|
return { hover: !1 };
|
|
1341
1341
|
}, computed: { classes: function() {
|
|
1342
|
-
var e,
|
|
1343
|
-
return { default: de(Co(
|
|
1342
|
+
var e, n = (Ae(e = {}, this.horizontalPosition, !!this.horizontalPosition), Ae(e, this.verticalPosition, !!this.verticalPosition), Ae(e, "".concat(this.horizontalPosition, "-").concat(this.verticalPosition), !!(this.verticalPosition && this.horizontalPosition)), Ae(e, "hover", this.hover), e);
|
|
1343
|
+
return { default: de(Co(n), this.defaultClass, this.hover && this.hoverClass), wrapper: de(Ro(n), this.wrapperClass) };
|
|
1344
1344
|
} }, methods: { onDrag: function(e) {
|
|
1345
1345
|
this.$emit("drag", e);
|
|
1346
1346
|
}, onEnter: function() {
|
|
@@ -1350,13 +1350,13 @@ var Co = Me("vue-simple-handler"), Ro = Me("vue-simple-handler-wrapper"), ei = {
|
|
|
1350
1350
|
}, onDragEnd: function() {
|
|
1351
1351
|
this.$emit("drag-end");
|
|
1352
1352
|
} }, emits: ["drag", "drag-end"] };
|
|
1353
|
-
|
|
1353
|
+
en.render = function(e, n, t, i, a, o) {
|
|
1354
1354
|
var r = B("HandlerWrapper");
|
|
1355
1355
|
return F(), G(r, { class: o.classes.wrapper, "vertical-position": t.verticalPosition, "horizontal-position": t.horizontalPosition, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: N(function() {
|
|
1356
1356
|
return [C("div", { class: o.classes.default }, null, 2)];
|
|
1357
1357
|
}), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1358
1358
|
};
|
|
1359
|
-
var Ao = Me("vue-simple-line"), xo = Me("vue-simple-line-wrapper"),
|
|
1359
|
+
var Ao = Me("vue-simple-line"), xo = Me("vue-simple-line-wrapper"), tn = { name: "SimpleLine", components: { LineWrapper: Yn }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
|
|
1360
1360
|
return { hover: !1 };
|
|
1361
1361
|
}, computed: { classes: function() {
|
|
1362
1362
|
return { root: de(Ao(Ae({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass), wrapper: de(xo(Ae({}, this.position, !0)), this.wrapperClass) };
|
|
@@ -1369,16 +1369,16 @@ var Ao = Me("vue-simple-line"), xo = Me("vue-simple-line-wrapper"), ti = { name:
|
|
|
1369
1369
|
}, onDragEnd: function() {
|
|
1370
1370
|
this.$emit("drag-end");
|
|
1371
1371
|
} }, emits: ["drag", "drag-end"] };
|
|
1372
|
-
|
|
1372
|
+
tn.render = function(e, n, t, i, a, o) {
|
|
1373
1373
|
var r = B("LineWrapper");
|
|
1374
1374
|
return F(), G(r, { class: o.classes.wrapper, position: t.position, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: N(function() {
|
|
1375
1375
|
return [C("div", { class: o.classes.root }, null, 2)];
|
|
1376
1376
|
}), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1377
1377
|
};
|
|
1378
|
-
var Pt = Me("vue-bounding-box"), ko = ["east", "west", null], Mo = ["south", "north", null],
|
|
1378
|
+
var Pt = Me("vue-bounding-box"), ko = ["east", "west", null], Mo = ["south", "north", null], Zn = { name: "BoundingBox", props: { width: { type: Number }, height: { type: Number }, transitions: { type: Object }, handlers: { type: Object, default: function() {
|
|
1379
1379
|
return { eastNorth: !0, north: !0, westNorth: !0, west: !0, westSouth: !0, south: !0, eastSouth: !0, east: !0 };
|
|
1380
1380
|
} }, handlersComponent: { type: [Object, String], default: function() {
|
|
1381
|
-
return
|
|
1381
|
+
return en;
|
|
1382
1382
|
} }, handlersClasses: { type: Object, default: function() {
|
|
1383
1383
|
return {};
|
|
1384
1384
|
} }, handlersWrappersClasses: { type: Object, default: function() {
|
|
@@ -1386,18 +1386,18 @@ var Pt = Me("vue-bounding-box"), ko = ["east", "west", null], Mo = ["south", "no
|
|
|
1386
1386
|
} }, lines: { type: Object, default: function() {
|
|
1387
1387
|
return { west: !0, north: !0, east: !0, south: !0 };
|
|
1388
1388
|
} }, linesComponent: { type: [Object, String], default: function() {
|
|
1389
|
-
return
|
|
1389
|
+
return tn;
|
|
1390
1390
|
} }, linesClasses: { type: Object, default: function() {
|
|
1391
1391
|
return {};
|
|
1392
1392
|
} }, linesWrappersClasses: { type: Object, default: function() {
|
|
1393
1393
|
return {};
|
|
1394
1394
|
} }, resizable: { type: Boolean, default: !0 } }, data: function() {
|
|
1395
1395
|
var e = [];
|
|
1396
|
-
return ko.forEach(function(
|
|
1396
|
+
return ko.forEach(function(n) {
|
|
1397
1397
|
Mo.forEach(function(t) {
|
|
1398
|
-
if (
|
|
1399
|
-
var
|
|
1400
|
-
e.push({ name: a, classname: o, verticalDirection: t, horizontalDirection:
|
|
1398
|
+
if (n !== t) {
|
|
1399
|
+
var i = Bn(n, t), a = i.name, o = i.classname;
|
|
1400
|
+
e.push({ name: a, classname: o, verticalDirection: t, horizontalDirection: n });
|
|
1401
1401
|
}
|
|
1402
1402
|
});
|
|
1403
1403
|
}), { points: e };
|
|
@@ -1405,25 +1405,25 @@ var Pt = Me("vue-bounding-box"), ko = ["east", "west", null], Mo = ["south", "no
|
|
|
1405
1405
|
var e = {};
|
|
1406
1406
|
return this.width && this.height && (e.width = "".concat(this.width, "px"), e.height = "".concat(this.height, "px"), this.transitions && this.transitions.enabled && (e.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction))), e;
|
|
1407
1407
|
}, classes: function() {
|
|
1408
|
-
var e = this.handlersClasses,
|
|
1409
|
-
return { root: Pt(), handlers: e, handlersWrappers:
|
|
1408
|
+
var e = this.handlersClasses, n = this.handlersWrappersClasses, t = this.linesClasses, i = this.linesWrappersClasses;
|
|
1409
|
+
return { root: Pt(), handlers: e, handlersWrappers: n, lines: t, linesWrappers: i };
|
|
1410
1410
|
}, lineNodes: function() {
|
|
1411
|
-
var e = this,
|
|
1411
|
+
var e = this, n = [];
|
|
1412
1412
|
return this.points.forEach(function(t) {
|
|
1413
|
-
t.horizontalDirection && t.verticalDirection || !e.lines[t.name] ||
|
|
1414
|
-
}),
|
|
1413
|
+
t.horizontalDirection && t.verticalDirection || !e.lines[t.name] || n.push({ name: t.name, component: e.linesComponent, class: de(e.classes.lines.default, e.classes.lines[t.name], !e.resizable && e.classes.lines.disabled), wrapperClass: de(e.classes.linesWrappers.default, e.classes.linesWrappers[t.name], !e.resizable && e.classes.linesWrappers.disabled), hoverClass: e.classes.lines.hover, verticalDirection: t.verticalDirection, horizontalDirection: t.horizontalDirection, disabled: !e.resizable });
|
|
1414
|
+
}), n;
|
|
1415
1415
|
}, handlerNodes: function() {
|
|
1416
|
-
var e = this,
|
|
1416
|
+
var e = this, n = [], t = this.width, i = this.height;
|
|
1417
1417
|
return this.points.forEach(function(a) {
|
|
1418
1418
|
if (e.handlers[a.name]) {
|
|
1419
1419
|
var o = { name: a.name, component: e.handlersComponent, class: de(e.classes.handlers.default, e.classes.handlers[a.name]), wrapperClass: de(e.classes.handlersWrappers.default, e.classes.handlersWrappers[a.name]), hoverClass: e.classes.handlers.hover, verticalDirection: a.verticalDirection, horizontalDirection: a.horizontalDirection, disabled: !e.resizable };
|
|
1420
|
-
if (t &&
|
|
1421
|
-
var r = a.horizontalDirection, l = a.verticalDirection, s = r === "east" ? t : r === "west" ? 0 : t / 2, u = l === "south" ?
|
|
1420
|
+
if (t && i) {
|
|
1421
|
+
var r = a.horizontalDirection, l = a.verticalDirection, s = r === "east" ? t : r === "west" ? 0 : t / 2, u = l === "south" ? i : l === "north" ? 0 : i / 2;
|
|
1422
1422
|
o.wrapperClass = Pt("handler"), o.wrapperStyle = { transform: "translate(".concat(s, "px, ").concat(u, "px)") }, e.transitions && e.transitions.enabled && (o.wrapperStyle.transition = "".concat(e.transitions.time, "ms ").concat(e.transitions.timingFunction));
|
|
1423
1423
|
} else o.wrapperClass = Pt("handler", Ae({}, a.classname, !0));
|
|
1424
|
-
|
|
1424
|
+
n.push(o);
|
|
1425
1425
|
}
|
|
1426
|
-
}),
|
|
1426
|
+
}), n;
|
|
1427
1427
|
} }, beforeMount: function() {
|
|
1428
1428
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
1429
1429
|
}, beforeUnmount: function() {
|
|
@@ -1432,26 +1432,26 @@ var Pt = Me("vue-bounding-box"), ko = ["east", "west", null], Mo = ["south", "no
|
|
|
1432
1432
|
this.touches = [];
|
|
1433
1433
|
}, methods: { onEnd: function() {
|
|
1434
1434
|
this.$emit("resize-end");
|
|
1435
|
-
}, onHandlerDrag: function(e,
|
|
1436
|
-
var
|
|
1437
|
-
|
|
1435
|
+
}, onHandlerDrag: function(e, n, t) {
|
|
1436
|
+
var i, a = e.shift(), o = a.left, r = a.top, l = { left: 0, right: 0, top: 0, bottom: 0 };
|
|
1437
|
+
n === "west" ? l.left -= o : n === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && n ? i = "width" : t && !n && (i = "height"), this.resizable && this.$emit("resize", new io(l, { allowedDirections: { left: n === "west" || !n, right: n === "east" || !n, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: i }));
|
|
1438
1438
|
} }, emits: ["resize", "resize-end"] };
|
|
1439
|
-
|
|
1439
|
+
Zn.render = function(e, n, t, i, a, o) {
|
|
1440
1440
|
return F(), G("div", { ref: "box", class: o.classes.root, style: o.style }, [he(e.$slots, "default"), C("div", null, [(F(!0), G(Re, null, Ke(o.lineNodes, function(r) {
|
|
1441
1441
|
return F(), G(yt(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
|
|
1442
1442
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1443
|
-
}, onDragEnd:
|
|
1443
|
+
}, onDragEnd: n[1] || (n[1] = function(l) {
|
|
1444
1444
|
return o.onEnd();
|
|
1445
1445
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1446
1446
|
}), 128))]), (F(!0), G(Re, null, Ke(o.handlerNodes, function(r) {
|
|
1447
1447
|
return F(), G("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(F(), G(yt(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
|
|
1448
1448
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1449
|
-
}, onDragEnd:
|
|
1449
|
+
}, onDragEnd: n[2] || (n[2] = function(l) {
|
|
1450
1450
|
return o.onEnd();
|
|
1451
1451
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "horizontal-position", "vertical-position", "disabled", "onDrag"]))], 6);
|
|
1452
1452
|
}), 128))], 6);
|
|
1453
1453
|
};
|
|
1454
|
-
var Oo = Me("vue-draggable-area"),
|
|
1454
|
+
var Oo = Me("vue-draggable-area"), Qn = { name: "DraggableArea", props: { movable: { type: Boolean, default: !0 }, activationDistance: { type: Number, default: 20 } }, computed: { classnames: function() {
|
|
1455
1455
|
return { default: Oo() };
|
|
1456
1456
|
} }, beforeMount: function() {
|
|
1457
1457
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
@@ -1461,66 +1461,66 @@ var Oo = Me("vue-draggable-area"), Zi = { name: "DraggableArea", props: { movabl
|
|
|
1461
1461
|
this.touches = [], this.touchStarted = !1;
|
|
1462
1462
|
}, methods: { onTouchStart: function(e) {
|
|
1463
1463
|
if (e.cancelable) {
|
|
1464
|
-
var
|
|
1465
|
-
|
|
1464
|
+
var n = this.movable && e.touches.length === 1;
|
|
1465
|
+
n && (this.touches = qe(e.touches)), (this.touchStarted || n) && (e.preventDefault(), e.stopPropagation());
|
|
1466
1466
|
}
|
|
1467
1467
|
}, onTouchEnd: function() {
|
|
1468
1468
|
this.touchStarted = !1, this.processEnd();
|
|
1469
1469
|
}, onTouchMove: function(e) {
|
|
1470
|
-
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) :
|
|
1470
|
+
this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : Wn({ x: this.touches[0].clientX, y: this.touches[0].clientY }, { x: e.touches[0].clientX, y: e.touches[0].clientY }) > this.activationDistance && (this.initAnchor({ clientX: e.touches[0].clientX, clientY: e.touches[0].clientY }), this.touchStarted = !0));
|
|
1471
1471
|
}, onMouseDown: function(e) {
|
|
1472
1472
|
if (this.movable && e.button === 0) {
|
|
1473
|
-
var
|
|
1474
|
-
this.touches = [
|
|
1473
|
+
var n = { fake: !0, clientX: e.clientX, clientY: e.clientY };
|
|
1474
|
+
this.touches = [n], this.initAnchor(n), e.stopPropagation();
|
|
1475
1475
|
}
|
|
1476
1476
|
}, onMouseMove: function(e) {
|
|
1477
1477
|
this.touches.length && (this.processMove(e, [{ fake: !0, clientX: e.clientX, clientY: e.clientY }]), e.preventDefault && e.cancelable && e.preventDefault(), e.stopPropagation());
|
|
1478
1478
|
}, onMouseUp: function() {
|
|
1479
1479
|
this.processEnd();
|
|
1480
1480
|
}, initAnchor: function(e) {
|
|
1481
|
-
var
|
|
1482
|
-
this.anchor = { x: e.clientX - t, y: e.clientY -
|
|
1483
|
-
}, processMove: function(e,
|
|
1484
|
-
var t = qe(
|
|
1481
|
+
var n = this.$refs.container.getBoundingClientRect(), t = n.left, i = n.top;
|
|
1482
|
+
this.anchor = { x: e.clientX - t, y: e.clientY - i };
|
|
1483
|
+
}, processMove: function(e, n) {
|
|
1484
|
+
var t = qe(n);
|
|
1485
1485
|
if (this.touches.length) {
|
|
1486
|
-
var
|
|
1486
|
+
var i = this.$refs.container.getBoundingClientRect(), a = i.left, o = i.top;
|
|
1487
1487
|
this.touches.length === 1 && t.length === 1 && this.$emit("move", new Qt({ left: t[0].clientX - (a + this.anchor.x), top: t[0].clientY - (o + this.anchor.y) }));
|
|
1488
1488
|
}
|
|
1489
1489
|
}, processEnd: function() {
|
|
1490
1490
|
this.touches.length && this.$emit("move-end"), this.touches = [];
|
|
1491
1491
|
} }, emits: ["move", "move-end"] };
|
|
1492
|
-
|
|
1493
|
-
return F(), G("div", { ref: "container", onTouchstart:
|
|
1492
|
+
Qn.render = function(e, n, t, i, a, o) {
|
|
1493
|
+
return F(), G("div", { ref: "container", onTouchstart: n[1] || (n[1] = function() {
|
|
1494
1494
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1495
|
-
}), onMousedown:
|
|
1495
|
+
}), onMousedown: n[2] || (n[2] = function() {
|
|
1496
1496
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
1497
1497
|
}) }, [he(e.$slots, "default")], 544);
|
|
1498
1498
|
};
|
|
1499
1499
|
function Dt(e) {
|
|
1500
|
-
var
|
|
1501
|
-
return { rotate: e.rotate || 0, flip: { horizontal: ((
|
|
1500
|
+
var n, t;
|
|
1501
|
+
return { rotate: e.rotate || 0, flip: { horizontal: ((n = e == null ? void 0 : e.flip) === null || n === void 0 ? void 0 : n.horizontal) || !1, vertical: ((t = e == null ? void 0 : e.flip) === null || t === void 0 ? void 0 : t.vertical) || !1 } };
|
|
1502
1502
|
}
|
|
1503
1503
|
function zo(e) {
|
|
1504
|
-
return new Promise(function(
|
|
1504
|
+
return new Promise(function(n, t) {
|
|
1505
1505
|
try {
|
|
1506
|
-
if (e) if (/^data:/i.test(e))
|
|
1506
|
+
if (e) if (/^data:/i.test(e)) n(function(s) {
|
|
1507
1507
|
s = s.replace(/^data:([^;]+);base64,/gim, "");
|
|
1508
1508
|
for (var u = atob(s), d = u.length, h = new ArrayBuffer(d), m = new Uint8Array(h), c = 0; c < d; c++) m[c] = u.charCodeAt(c);
|
|
1509
1509
|
return h;
|
|
1510
1510
|
}(e));
|
|
1511
1511
|
else if (/^blob:/i.test(e)) {
|
|
1512
|
-
var
|
|
1513
|
-
|
|
1514
|
-
|
|
1512
|
+
var i = new FileReader();
|
|
1513
|
+
i.onload = function(s) {
|
|
1514
|
+
n(s.target.result);
|
|
1515
1515
|
}, o = e, r = function(s) {
|
|
1516
|
-
|
|
1516
|
+
i.readAsArrayBuffer(s);
|
|
1517
1517
|
}, (l = new XMLHttpRequest()).open("GET", o, !0), l.responseType = "blob", l.onload = function() {
|
|
1518
1518
|
this.status != 200 && this.status !== 0 || r(this.response);
|
|
1519
1519
|
}, l.send();
|
|
1520
1520
|
} else {
|
|
1521
1521
|
var a = new XMLHttpRequest();
|
|
1522
1522
|
a.onreadystatechange = function() {
|
|
1523
|
-
a.readyState === 4 && (a.status === 200 || a.status === 0 ?
|
|
1523
|
+
a.readyState === 4 && (a.status === 200 || a.status === 0 ? n(a.response) : t("Warning: could not load an image to parse its orientation"), a = null);
|
|
1524
1524
|
}, a.onprogress = function() {
|
|
1525
1525
|
a.getResponseHeader("content-type") !== "image/jpeg" && a.abort();
|
|
1526
1526
|
}, a.withCredentials = !1, a.open("GET", e, !0), a.responseType = "arraybuffer", a.send(null);
|
|
@@ -1532,13 +1532,13 @@ function zo(e) {
|
|
|
1532
1532
|
var o, r, l;
|
|
1533
1533
|
});
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1536
|
-
var
|
|
1537
|
-
return o += " rotate(" +
|
|
1535
|
+
function Jn(e) {
|
|
1536
|
+
var n = e.rotate, t = e.flip, i = e.scaleX, a = e.scaleY, o = "";
|
|
1537
|
+
return o += " rotate(" + n + "deg) ", o += " scaleX(" + i * (t.horizontal ? -1 : 1) + ") ", o += " scaleY(" + a * (t.vertical ? -1 : 1) + ") ";
|
|
1538
1538
|
}
|
|
1539
1539
|
function Fo(e) {
|
|
1540
1540
|
try {
|
|
1541
|
-
var
|
|
1541
|
+
var n, t = new DataView(e), i = void 0, a = void 0, o = void 0, r = void 0;
|
|
1542
1542
|
if (t.getUint8(0) === 255 && t.getUint8(1) === 216) for (var l = t.byteLength, s = 2; s + 1 < l; ) {
|
|
1543
1543
|
if (t.getUint8(s) === 255 && t.getUint8(s + 1) === 225) {
|
|
1544
1544
|
o = s;
|
|
@@ -1546,51 +1546,51 @@ function Fo(e) {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
s++;
|
|
1548
1548
|
}
|
|
1549
|
-
if (o && (
|
|
1549
|
+
if (o && (i = o + 10, function(c, y, v) {
|
|
1550
1550
|
var g, w = "";
|
|
1551
1551
|
for (g = y, v += y; g < v; g++) w += String.fromCharCode(c.getUint8(g));
|
|
1552
1552
|
return w;
|
|
1553
1553
|
}(t, o + 4, 4) === "Exif")) {
|
|
1554
|
-
var u = t.getUint16(
|
|
1555
|
-
if (((a = u === 18761) || u === 19789) && t.getUint16(
|
|
1556
|
-
var d = t.getUint32(
|
|
1557
|
-
d >= 8 && (r =
|
|
1554
|
+
var u = t.getUint16(i);
|
|
1555
|
+
if (((a = u === 18761) || u === 19789) && t.getUint16(i + 2, a) === 42) {
|
|
1556
|
+
var d = t.getUint32(i + 4, a);
|
|
1557
|
+
d >= 8 && (r = i + d);
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
1560
|
if (r) {
|
|
1561
1561
|
for (var h = t.getUint16(r, a), m = 0; m < h; m++)
|
|
1562
1562
|
if (s = r + 12 * m + 2, t.getUint16(s, a) === 274) {
|
|
1563
|
-
s += 8,
|
|
1563
|
+
s += 8, n = t.getUint16(s, a), t.setUint16(s, 1, a);
|
|
1564
1564
|
break;
|
|
1565
1565
|
}
|
|
1566
1566
|
}
|
|
1567
|
-
return
|
|
1567
|
+
return n;
|
|
1568
1568
|
} catch {
|
|
1569
1569
|
return null;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1573
|
-
var t =
|
|
1572
|
+
function Mn(e, n) {
|
|
1573
|
+
var t = n.getBoundingClientRect(), i = t.left, a = t.top, o = { left: 0, top: 0 }, r = 0;
|
|
1574
1574
|
return e.forEach(function(l) {
|
|
1575
|
-
o.left += (l.clientX -
|
|
1575
|
+
o.left += (l.clientX - i) / e.length, o.top += (l.clientY - a) / e.length;
|
|
1576
1576
|
}), e.forEach(function(l) {
|
|
1577
|
-
r +=
|
|
1577
|
+
r += Wn({ x: o.left, y: o.top }, { x: l.clientX - i, y: l.clientY - a });
|
|
1578
1578
|
}), { centerMass: o, spread: r, count: e.length };
|
|
1579
1579
|
}
|
|
1580
|
-
var
|
|
1580
|
+
var ei = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 }, eventsFilter: { type: Function, required: !1 } }, beforeMount: function() {
|
|
1581
1581
|
window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
|
|
1582
1582
|
}, beforeUnmount: function() {
|
|
1583
1583
|
window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
|
|
1584
1584
|
}, created: function() {
|
|
1585
1585
|
this.transforming = !1, this.debouncedProcessEnd = Bt(this.processEnd), this.touches = [];
|
|
1586
|
-
}, methods: { processMove: function(e,
|
|
1586
|
+
}, methods: { processMove: function(e, n) {
|
|
1587
1587
|
if (this.touches.length) {
|
|
1588
|
-
if (this.touches.length === 1 &&
|
|
1588
|
+
if (this.touches.length === 1 && n.length === 1) this.$emit("move", new at({ left: this.touches[0].clientX - n[0].clientX, top: this.touches[0].clientY - n[0].clientY }));
|
|
1589
1589
|
else if (this.touches.length > 1 && this.touchResize) {
|
|
1590
|
-
var t =
|
|
1591
|
-
|
|
1590
|
+
var t = Mn(n, this.$refs.container), i = this.oldGeometricProperties;
|
|
1591
|
+
i.count === t.count && i.count > 1 && this.$emit("resize", new at({ left: i.centerMass.left - t.centerMass.left, top: i.centerMass.top - t.centerMass.top }, { factor: i.spread / t.spread, center: t.centerMass })), this.oldGeometricProperties = t;
|
|
1592
1592
|
}
|
|
1593
|
-
this.touches =
|
|
1593
|
+
this.touches = n;
|
|
1594
1594
|
}
|
|
1595
1595
|
}, processEnd: function() {
|
|
1596
1596
|
this.transforming && (this.transforming = !1, this.$emit("transform-end"));
|
|
@@ -1600,27 +1600,27 @@ var Ji = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1600
1600
|
return this.eventsFilter ? this.eventsFilter(e, this.transforming) !== !1 : (e.preventDefault(), e.stopPropagation(), !0);
|
|
1601
1601
|
}, onTouchStart: function(e) {
|
|
1602
1602
|
if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
|
|
1603
|
-
var
|
|
1603
|
+
var n = this.$refs.container, t = n.getBoundingClientRect(), i = t.left, a = t.top, o = t.bottom, r = t.right;
|
|
1604
1604
|
this.touches = qe(e.touches).filter(function(l) {
|
|
1605
|
-
return l.clientX >
|
|
1606
|
-
}), this.oldGeometricProperties =
|
|
1605
|
+
return l.clientX > i && l.clientX < r && l.clientY > a && l.clientY < o;
|
|
1606
|
+
}), this.oldGeometricProperties = Mn(this.touches, n);
|
|
1607
1607
|
}
|
|
1608
1608
|
}, onTouchEnd: function(e) {
|
|
1609
1609
|
e.touches.length === 0 && (this.touches = [], this.processEnd());
|
|
1610
1610
|
}, onTouchMove: function(e) {
|
|
1611
|
-
var
|
|
1611
|
+
var n = this;
|
|
1612
1612
|
if (this.touches.length) {
|
|
1613
|
-
var t = qe(e.touches).filter(function(
|
|
1614
|
-
return !
|
|
1615
|
-
return a.identifier ===
|
|
1613
|
+
var t = qe(e.touches).filter(function(i) {
|
|
1614
|
+
return !i.identifier || n.touches.find(function(a) {
|
|
1615
|
+
return a.identifier === i.identifier;
|
|
1616
1616
|
});
|
|
1617
1617
|
});
|
|
1618
1618
|
this.processEvent(e) && (this.processMove(e, t), this.processStart());
|
|
1619
1619
|
}
|
|
1620
1620
|
}, onMouseDown: function(e) {
|
|
1621
1621
|
if (this.mouseMove && "buttons" in e && e.buttons === 1 && this.processEvent(e)) {
|
|
1622
|
-
var
|
|
1623
|
-
this.touches = [
|
|
1622
|
+
var n = { fake: !0, clientX: e.clientX, clientY: e.clientY };
|
|
1623
|
+
this.touches = [n], this.processStart();
|
|
1624
1624
|
}
|
|
1625
1625
|
}, onMouseMove: function(e) {
|
|
1626
1626
|
this.touches.length && this.processEvent(e) && this.processMove(e, [{ clientX: e.clientX, clientY: e.clientY }]);
|
|
@@ -1628,32 +1628,32 @@ var Ji = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1628
1628
|
this.touches = [], this.processEnd();
|
|
1629
1629
|
}, onWheel: function(e) {
|
|
1630
1630
|
if (this.wheelResize && this.processEvent(e)) {
|
|
1631
|
-
var
|
|
1631
|
+
var n = this.$refs.container.getBoundingClientRect(), t = n.left, i = n.top, a = 1 + this.wheelResize.ratio * (r = e.deltaY || e.detail || e.wheelDelta, (l = +r) == 0 || Gn(l) ? l : l > 0 ? 1 : -1), o = { left: e.clientX - t, top: e.clientY - i };
|
|
1632
1632
|
this.$emit("resize", new at({}, { factor: a, center: o })), this.touches.length || this.debouncedProcessEnd();
|
|
1633
1633
|
}
|
|
1634
1634
|
var r, l;
|
|
1635
1635
|
} }, emits: ["resize", "move", "transform-end"] };
|
|
1636
|
-
|
|
1637
|
-
return F(), G("div", { ref: "container", onTouchstart:
|
|
1636
|
+
ei.render = function(e, n, t, i, a, o) {
|
|
1637
|
+
return F(), G("div", { ref: "container", onTouchstart: n[1] || (n[1] = function() {
|
|
1638
1638
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1639
|
-
}), onMousedown:
|
|
1639
|
+
}), onMousedown: n[2] || (n[2] = function() {
|
|
1640
1640
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
1641
|
-
}), onWheel:
|
|
1641
|
+
}), onWheel: n[3] || (n[3] = function() {
|
|
1642
1642
|
return o.onWheel && o.onWheel.apply(o, arguments);
|
|
1643
1643
|
}) }, [he(e.$slots, "default")], 544);
|
|
1644
1644
|
};
|
|
1645
|
-
var jt = { components: { TransformableImage:
|
|
1646
|
-
jt.render = function(e,
|
|
1645
|
+
var jt = { components: { TransformableImage: ei }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
|
|
1646
|
+
jt.render = function(e, n, t, i, a, o) {
|
|
1647
1647
|
var r = B("transformable-image");
|
|
1648
|
-
return F(), G(r, { "touch-move": t.touchMove, "touch-resize": t.touchResize, "mouse-move": t.mouseMove, "wheel-resize": t.wheelResize, onMove:
|
|
1648
|
+
return F(), G(r, { "touch-move": t.touchMove, "touch-resize": t.touchResize, "mouse-move": t.mouseMove, "wheel-resize": t.wheelResize, onMove: n[1] || (n[1] = function(l) {
|
|
1649
1649
|
return e.$emit("move", l);
|
|
1650
|
-
}), onResize:
|
|
1650
|
+
}), onResize: n[2] || (n[2] = function(l) {
|
|
1651
1651
|
return e.$emit("resize", l);
|
|
1652
1652
|
}) }, { default: N(function() {
|
|
1653
1653
|
return [he(e.$slots, "default")];
|
|
1654
1654
|
}), _: 3 }, 8, ["touch-move", "touch-resize", "mouse-move", "wheel-resize"]);
|
|
1655
1655
|
};
|
|
1656
|
-
var gt = Me("vue-preview"),
|
|
1656
|
+
var gt = Me("vue-preview"), ti = { props: { coordinates: { type: Object }, transitions: { type: Object }, image: { type: Object, default: function() {
|
|
1657
1657
|
return {};
|
|
1658
1658
|
} }, imageClass: { type: String }, width: { type: Number }, height: { type: Number }, fill: { type: Boolean } }, data: function() {
|
|
1659
1659
|
return { calculatedImageSize: { width: 0, height: 0 }, calculatedSize: { width: 0, height: 0 } };
|
|
@@ -1668,9 +1668,9 @@ var gt = Me("vue-preview"), en = { props: { coordinates: { type: Object }, trans
|
|
|
1668
1668
|
return this.transitions && this.transitions.enabled && (e.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), e;
|
|
1669
1669
|
}, imageStyle: function() {
|
|
1670
1670
|
if (this.coordinates && this.image) {
|
|
1671
|
-
var e = this.coordinates.width / this.size.width,
|
|
1671
|
+
var e = this.coordinates.width / this.size.width, n = ie(ie({ rotate: 0, flip: { horizontal: !1, vertical: !1 } }, this.image.transforms), {}, { scaleX: 1 / e, scaleY: 1 / e }), t = this.imageSize.width, i = this.imageSize.height, a = Xn({ width: t, height: i }, n.rotate), o = { width: "".concat(t, "px"), height: "".concat(i, "px"), left: "0px", top: "0px" }, r = { rotate: { left: (t - a.width) * n.scaleX / 2, top: (i - a.height) * n.scaleY / 2 }, scale: { left: (1 - n.scaleX) * t / 2, top: (1 - n.scaleY) * i / 2 } };
|
|
1672
1672
|
return o.transform = `translate(
|
|
1673
|
-
`.concat(-this.coordinates.left / e - r.rotate.left - r.scale.left, "px,").concat(-this.coordinates.top / e - r.rotate.top - r.scale.top, "px) ") +
|
|
1673
|
+
`.concat(-this.coordinates.left / e - r.rotate.left - r.scale.left, "px,").concat(-this.coordinates.top / e - r.rotate.top - r.scale.top, "px) ") + Jn(n), this.transitions && this.transitions.enabled && (o.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), o;
|
|
1674
1674
|
}
|
|
1675
1675
|
return {};
|
|
1676
1676
|
}, size: function() {
|
|
@@ -1696,18 +1696,18 @@ var gt = Me("vue-preview"), en = { props: { coordinates: { type: Object }, trans
|
|
|
1696
1696
|
var e = this.$refs.image;
|
|
1697
1697
|
e && e.complete && this.refreshImage(), this.refresh();
|
|
1698
1698
|
} } };
|
|
1699
|
-
|
|
1699
|
+
ti.render = function(e, n, t, i, a, o) {
|
|
1700
1700
|
return F(), G("div", { ref: "root", class: o.classes.root, style: o.style }, [C("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [Xe(C("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[wt, t.image && t.image.src]])], 6)], 6);
|
|
1701
1701
|
};
|
|
1702
|
-
var
|
|
1703
|
-
|
|
1702
|
+
var ni = { components: { Preview: ti }, inheritAttrs: !1 };
|
|
1703
|
+
ni.render = function(e, n, t, i, a, o) {
|
|
1704
1704
|
var r = B("preview");
|
|
1705
|
-
return F(), G(r,
|
|
1705
|
+
return F(), G(r, Dn(e.$attrs, { fill: !0 }), null, 16);
|
|
1706
1706
|
};
|
|
1707
|
-
var Tt = Me("vue-rectangle-stencil"),
|
|
1708
|
-
return
|
|
1707
|
+
var Tt = Me("vue-rectangle-stencil"), ii = { name: "RectangleStencil", components: { StencilPreview: ni, BoundingBox: Zn, DraggableArea: Qn }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object }, handlersComponent: { type: [Object, String], default: function() {
|
|
1708
|
+
return en;
|
|
1709
1709
|
} }, lines: { type: Object }, linesComponent: { type: [Object, String], default: function() {
|
|
1710
|
-
return
|
|
1710
|
+
return tn;
|
|
1711
1711
|
} }, aspectRatio: { type: [Number, String] }, minAspectRatio: { type: [Number, String] }, maxAspectRatio: { type: [Number, String] }, movable: { type: Boolean, default: !0 }, resizable: { type: Boolean, default: !0 }, transitions: { type: Object }, movingClass: { type: String }, resizingClass: { type: String }, previewClass: { type: String }, boundingBoxClass: { type: String }, linesClasses: { type: Object, default: function() {
|
|
1712
1712
|
return {};
|
|
1713
1713
|
} }, linesWrappersClasses: { type: Object, default: function() {
|
|
@@ -1721,7 +1721,7 @@ var Tt = Me("vue-rectangle-stencil"), nn = { name: "RectangleStencil", component
|
|
|
1721
1721
|
}, computed: { classes: function() {
|
|
1722
1722
|
return { stencil: de(Tt({ movable: this.movable, moving: this.moving, resizing: this.resizing }), this.moving && this.movingClass, this.resizing && this.resizingClass), preview: de(Tt("preview"), this.previewClass), boundingBox: de(Tt("bounding-box"), this.boundingBoxClass) };
|
|
1723
1723
|
}, style: function() {
|
|
1724
|
-
var e = this.stencilCoordinates,
|
|
1724
|
+
var e = this.stencilCoordinates, n = e.height, t = e.width, i = e.left, a = e.top, o = { width: "".concat(t, "px"), height: "".concat(n, "px"), transform: "translate(".concat(i, "px, ").concat(a, "px)") };
|
|
1725
1725
|
return this.transitions && this.transitions.enabled && (o.transition = "".concat(this.transitions.time, "ms ").concat(this.transitions.timingFunction)), o;
|
|
1726
1726
|
} }, methods: { onMove: function(e) {
|
|
1727
1727
|
this.$emit("move", e), this.moving = !0;
|
|
@@ -1734,7 +1734,7 @@ var Tt = Me("vue-rectangle-stencil"), nn = { name: "RectangleStencil", component
|
|
|
1734
1734
|
}, aspectRatios: function() {
|
|
1735
1735
|
return { minimum: this.aspectRatio || this.minAspectRatio, maximum: this.aspectRatio || this.maxAspectRatio };
|
|
1736
1736
|
} }, emits: ["resize", "resize-end", "move", "move-end"] };
|
|
1737
|
-
|
|
1737
|
+
ii.render = function(e, n, t, i, a, o) {
|
|
1738
1738
|
var r = B("stencil-preview"), l = B("draggable-area"), s = B("bounding-box");
|
|
1739
1739
|
return F(), G("div", { class: o.classes.stencil, style: o.style }, [C(s, { width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, transitions: t.transitions, class: o.classes.boundingBox, handlers: t.handlers, "handlers-component": t.handlersComponent, "handlers-classes": t.handlersClasses, "handlers-wrappers-classes": t.handlersWrappersClasses, lines: t.lines, "lines-component": t.linesComponent, "lines-classes": t.linesClasses, "lines-wrappers-classes": t.linesWrappersClasses, resizable: t.resizable, onResize: o.onResize, onResizeEnd: o.onResizeEnd }, { default: N(function() {
|
|
1740
1740
|
return [C(l, { movable: t.movable, onMove: o.onMove, onMoveEnd: o.onMoveEnd }, { default: N(function() {
|
|
@@ -1742,8 +1742,8 @@ nn.render = function(e, i, t, n, a, o) {
|
|
|
1742
1742
|
}), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
|
|
1743
1743
|
}), _: 1 }, 8, ["width", "height", "transitions", "class", "handlers", "handlers-component", "handlers-classes", "handlers-wrappers-classes", "lines", "lines-component", "lines-classes", "lines-wrappers-classes", "resizable", "onResize", "onResizeEnd"])], 6);
|
|
1744
1744
|
};
|
|
1745
|
-
var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"),
|
|
1746
|
-
return
|
|
1745
|
+
var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), oi = { name: "Cropper", components: { BackgroundWrapper: jt }, props: { src: { type: String, default: null }, stencilComponent: { type: [Object, String], default: function() {
|
|
1746
|
+
return ii;
|
|
1747
1747
|
} }, backgroundWrapperComponent: { type: [Object, String], default: function() {
|
|
1748
1748
|
return jt;
|
|
1749
1749
|
} }, stencilProps: { type: Object, default: function() {
|
|
@@ -1753,11 +1753,11 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1753
1753
|
} }, roundResult: { type: Boolean, default: !0 }, defaultSize: { type: [Function, Object] }, defaultPosition: { type: [Function, Object] }, defaultVisibleArea: { type: [Function, Object] }, defaultTransforms: { type: [Function, Object] }, defaultBoundaries: { type: [Function, String], validator: function(e) {
|
|
1754
1754
|
return !(typeof e == "string" && e !== "fill" && e !== "fit");
|
|
1755
1755
|
} }, priority: { type: String, default: "coordinates" }, stencilSize: { type: [Object, Function] }, resizeImage: { type: [Boolean, Object], default: !0 }, moveImage: { type: [Boolean, Object], default: !0 }, autoZoomAlgorithm: { type: Function }, resizeAlgorithm: { type: Function, default: function(e) {
|
|
1756
|
-
var
|
|
1756
|
+
var n = e.event, t = e.coordinates, i = e.aspectRatio, a = e.positionRestrictions, o = e.sizeRestrictions, r = H(H({}, t), { right: t.left + t.width, bottom: t.top + t.height }), l = n.params || {}, s = H({}, n.directions), u = l.allowedDirections || { left: !0, right: !0, bottom: !0, top: !0 };
|
|
1757
1757
|
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0), ze.forEach(function(I) {
|
|
1758
1758
|
u[I] || (s[I] = 0);
|
|
1759
1759
|
});
|
|
1760
|
-
var d = Oe(r, s =
|
|
1760
|
+
var d = Oe(r, s = kn({ coordinates: r, directions: s, sizeRestrictions: o, positionRestrictions: a })).width, h = Oe(r, s).height, m = l.preserveRatio ? oe(r) : It(d / h, i);
|
|
1761
1761
|
if (m) {
|
|
1762
1762
|
var c = l.respectDirection;
|
|
1763
1763
|
if (c || (c = r.width >= r.height || m === 1 ? "width" : "height"), c === "width") {
|
|
@@ -1773,39 +1773,39 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1773
1773
|
s.left = -ft(w, z, O), s.right = -ft(w, O, z);
|
|
1774
1774
|
} else u.left ? s.left = -w : u.right ? s.right = -w : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
|
|
1775
1775
|
}
|
|
1776
|
-
s =
|
|
1776
|
+
s = kn({ directions: s, coordinates: r, sizeRestrictions: o, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
|
|
1777
1777
|
}
|
|
1778
|
-
return d = Oe(r, s).width, h = Oe(r, s).height, (m = l.preserveRatio ? oe(r) : It(d / h,
|
|
1778
|
+
return d = Oe(r, s).width, h = Oe(r, s).height, (m = l.preserveRatio ? oe(r) : It(d / h, i)) && Math.abs(m - d / h) > 1e-3 && ze.forEach(function(I) {
|
|
1779
1779
|
u[I] || (s[I] = 0);
|
|
1780
1780
|
}), Wt({ event: new Qt({ left: -s.left, top: -s.top }), coordinates: { width: t.width + s.right + s.left, height: t.height + s.top + s.bottom, left: t.left, top: t.top }, positionRestrictions: a });
|
|
1781
1781
|
} }, moveAlgorithm: { type: Function, default: Wt }, initStretcher: { type: Function, default: function(e) {
|
|
1782
|
-
var
|
|
1783
|
-
|
|
1782
|
+
var n = e.stretcher, t = e.imageSize, i = oe(t);
|
|
1783
|
+
n.style.width = t.width + "px", n.style.height = n.clientWidth / i + "px", n.style.width = n.clientWidth + "px";
|
|
1784
1784
|
} }, fitCoordinates: { type: Function, default: function(e) {
|
|
1785
|
-
var
|
|
1786
|
-
return r = ve(r = Se(r, tt(ge(t), ge(r))), xt(Fe(
|
|
1785
|
+
var n = e.visibleArea, t = e.coordinates, i = e.aspectRatio, a = e.sizeRestrictions, o = e.positionRestrictions, r = H(H({}, t), De({ width: t.width, height: t.height, aspectRatio: i, sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minHeight: Math.min(n.height, a.minHeight), minWidth: Math.min(n.width, a.minWidth) } }));
|
|
1786
|
+
return r = ve(r = Se(r, tt(ge(t), ge(r))), xt(Fe(n), o));
|
|
1787
1787
|
} }, fitVisibleArea: { type: Function, default: function(e) {
|
|
1788
|
-
var
|
|
1789
|
-
o.height = o.width / oe(t), o.top += (
|
|
1790
|
-
var r = Rt(
|
|
1791
|
-
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = ve(o = Se(o, r),
|
|
1788
|
+
var n = e.visibleArea, t = e.boundaries, i = e.getAreaRestrictions, a = e.coordinates, o = H({}, n);
|
|
1789
|
+
o.height = o.width / oe(t), o.top += (n.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o = xe(o, Math.max(a.height / o.height, a.width / o.width)));
|
|
1790
|
+
var r = Rt(it(a, Fe(o = xe(o, At(o, i({ visibleArea: o, type: "resize" }))))));
|
|
1791
|
+
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = ve(o = Se(o, r), i({ visibleArea: o, type: "move" }));
|
|
1792
1792
|
} }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1793
|
-
var
|
|
1794
|
-
return a === "fill-area" ? r = { left: 0, top: 0, right:
|
|
1793
|
+
var n = e.visibleArea, t = e.boundaries, i = e.imageSize, a = e.imageRestriction, o = e.type, r = {};
|
|
1794
|
+
return a === "fill-area" ? r = { left: 0, top: 0, right: i.width, bottom: i.height } : a === "fit-area" && (oe(t) > oe(i) ? (r = { top: 0, bottom: i.height }, n && o === "move" && (n.width > i.width ? (r.left = -(n.width - i.width) / 2, r.right = i.width - r.left) : (r.left = 0, r.right = i.width))) : (r = { left: 0, right: i.width }, n && o === "move" && (n.height > i.height ? (r.top = -(n.height - i.height) / 2, r.bottom = i.height - r.top) : (r.top = 0, r.bottom = i.height)))), r;
|
|
1795
1795
|
} }, sizeRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1796
1796
|
return { minWidth: e.minWidth, minHeight: e.minHeight, maxWidth: e.maxWidth, maxHeight: e.maxHeight };
|
|
1797
1797
|
} }, positionRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1798
|
-
var
|
|
1799
|
-
return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right:
|
|
1798
|
+
var n = e.imageSize, t = {};
|
|
1799
|
+
return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right: n.width, bottom: n.height }), t;
|
|
1800
1800
|
} } }, data: function() {
|
|
1801
|
-
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates:
|
|
1801
|
+
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: ie({}, Cn) };
|
|
1802
1802
|
}, computed: { image: function() {
|
|
1803
1803
|
return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
|
|
1804
1804
|
}, imageTransforms: function() {
|
|
1805
1805
|
return { rotate: this.appliedImageTransforms.rotate, flip: { horizontal: this.appliedImageTransforms.flip.horizontal, vertical: this.appliedImageTransforms.flip.vertical }, translateX: this.visibleArea ? this.visibleArea.left / this.coefficient : 0, translateY: this.visibleArea ? this.visibleArea.top / this.coefficient : 0, scaleX: 1 / this.coefficient, scaleY: 1 / this.coefficient };
|
|
1806
1806
|
}, imageSize: function() {
|
|
1807
|
-
var e = function(
|
|
1808
|
-
return
|
|
1807
|
+
var e = function(n) {
|
|
1808
|
+
return n * Math.PI / 180;
|
|
1809
1809
|
}(this.imageTransforms.rotate);
|
|
1810
1810
|
return { width: Math.abs(this.imageAttributes.width * Math.cos(e)) + Math.abs(this.imageAttributes.height * Math.sin(e)), height: Math.abs(this.imageAttributes.width * Math.sin(e)) + Math.abs(this.imageAttributes.height * Math.cos(e)) };
|
|
1811
1811
|
}, initialized: function() {
|
|
@@ -1822,14 +1822,14 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1822
1822
|
}, sizeRestrictions: function() {
|
|
1823
1823
|
if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
|
|
1824
1824
|
var e = this.sizeRestrictionsAlgorithm({ imageSize: this.imageSize, minWidth: fe(this.minWidth) ? 0 : ht(this.minWidth), minHeight: fe(this.minHeight) ? 0 : ht(this.minHeight), maxWidth: fe(this.maxWidth) ? 1 / 0 : ht(this.maxWidth), maxHeight: fe(this.maxHeight) ? 1 / 0 : ht(this.maxHeight) });
|
|
1825
|
-
if (e = function(
|
|
1826
|
-
var a =
|
|
1825
|
+
if (e = function(i) {
|
|
1826
|
+
var a = i.areaRestrictions, o = i.sizeRestrictions, r = i.boundaries, l = i.positionRestrictions, s = H(H({}, o), { minWidth: o.minWidth !== void 0 ? o.minWidth : 0, minHeight: o.minHeight !== void 0 ? o.minHeight : 0, maxWidth: o.maxWidth !== void 0 ? o.maxWidth : 1 / 0, maxHeight: o.maxHeight !== void 0 ? o.maxHeight : 1 / 0 });
|
|
1827
1827
|
l.left !== void 0 && l.right !== void 0 && (s.maxWidth = Math.min(s.maxWidth, l.right - l.left)), l.bottom !== void 0 && l.top !== void 0 && (s.maxHeight = Math.min(s.maxHeight, l.bottom - l.top));
|
|
1828
|
-
var u = Gt(a), d =
|
|
1828
|
+
var u = Gt(a), d = Hn(r, u);
|
|
1829
1829
|
return u.width < 1 / 0 && (!s.maxWidth || s.maxWidth > d.width) && (s.maxWidth = Math.min(s.maxWidth, d.width)), u.height < 1 / 0 && (!s.maxHeight || s.maxHeight > d.height) && (s.maxHeight = Math.min(s.maxHeight, d.height)), s.minWidth > s.maxWidth && (s.minWidth = s.maxWidth, s.widthFrozen = !0), s.minHeight > s.maxHeight && (s.minHeight = s.maxHeight, s.heightFrozen = !0), s;
|
|
1830
1830
|
}({ sizeRestrictions: e, areaRestrictions: this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }), imageSize: this.imageSize, boundaries: this.boundaries, positionRestrictions: this.positionRestrictions, imageRestriction: this.imageRestriction, visibleArea: this.visibleArea, stencilSize: this.getStencilSize() }), this.visibleArea && this.stencilSize) {
|
|
1831
|
-
var
|
|
1832
|
-
e.maxWidth = Math.min(e.maxWidth, t.width *
|
|
1831
|
+
var n = this.getStencilSize(), t = Gt(this.getAreaRestrictions({ visibleArea: this.visibleArea, type: "resize" }));
|
|
1832
|
+
e.maxWidth = Math.min(e.maxWidth, t.width * n.width / this.boundaries.width), e.maxHeight = Math.min(e.maxHeight, t.height * n.height / this.boundaries.height), e.maxWidth < e.minWidth && (e.minWidth = e.maxWidth), e.maxHeight < e.minHeight && (e.minHeight = e.maxHeight);
|
|
1833
1833
|
}
|
|
1834
1834
|
return e;
|
|
1835
1835
|
}
|
|
@@ -1840,15 +1840,15 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1840
1840
|
return { cropper: Ie(), image: de(Ie("image"), this.imageClass), stencil: Ie("stencil"), boundaries: de(Ie("boundaries"), this.boundariesClass), stretcher: de(Ie("stretcher")), background: de(Ie("background"), this.backgroundClass), foreground: de(Ie("foreground"), this.foregroundClass), imageWrapper: de(Ie("image-wrapper")), cropperWrapper: de(Ie("cropper-wrapper")) };
|
|
1841
1841
|
}, stencilCoordinates: function() {
|
|
1842
1842
|
if (this.initialized) {
|
|
1843
|
-
var e = this.coordinates,
|
|
1844
|
-
return { width:
|
|
1843
|
+
var e = this.coordinates, n = e.width, t = e.height, i = e.left, a = e.top;
|
|
1844
|
+
return { width: n / this.coefficient, height: t / this.coefficient, left: (i - this.visibleArea.left) / this.coefficient, top: (a - this.visibleArea.top) / this.coefficient };
|
|
1845
1845
|
}
|
|
1846
1846
|
return this.defaultCoordinates();
|
|
1847
1847
|
}, boundariesStyle: function() {
|
|
1848
1848
|
var e = { width: this.boundaries.width ? "".concat(Math.round(this.boundaries.width), "px") : "auto", height: this.boundaries.height ? "".concat(Math.round(this.boundaries.height), "px") : "auto", transition: "opacity ".concat(this.transitionTime, "ms"), pointerEvents: this.imageLoaded ? "all" : "none" };
|
|
1849
1849
|
return this.imageLoaded || (e.opacity = "0"), e;
|
|
1850
1850
|
}, imageStyle: function() {
|
|
1851
|
-
var e = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) },
|
|
1851
|
+
var e = this.imageAttributes.width > this.imageAttributes.height ? { width: Math.min(1024, this.imageAttributes.width), height: Math.min(1024, this.imageAttributes.width) / (this.imageAttributes.width / this.imageAttributes.height) } : { height: Math.min(1024, this.imageAttributes.height), width: Math.min(1024, this.imageAttributes.height) * (this.imageAttributes.width / this.imageAttributes.height) }, n = { left: (e.width - this.imageSize.width) / (2 * this.coefficient), top: (e.height - this.imageSize.height) / (2 * this.coefficient) }, t = { left: (1 - 1 / this.coefficient) * e.width / 2, top: (1 - 1 / this.coefficient) * e.height / 2 }, i = ie(ie({}, this.imageTransforms), {}, { scaleX: this.imageTransforms.scaleX * (this.imageAttributes.width / e.width), scaleY: this.imageTransforms.scaleY * (this.imageAttributes.height / e.height) }), a = { width: "".concat(e.width, "px"), height: "".concat(e.height, "px"), left: "0px", top: "0px", transform: "translate(".concat(-n.left - t.left - this.imageTransforms.translateX, "px, ").concat(-n.top - t.top - this.imageTransforms.translateY, "px)") + Jn(i) };
|
|
1852
1852
|
return this.transitionsOptions.enabled && (a.transition = "".concat(this.transitionsOptions.time, "ms ").concat(this.transitionsOptions.timingFunction)), a;
|
|
1853
1853
|
} }, watch: { src: function() {
|
|
1854
1854
|
this.onChangeImage();
|
|
@@ -1867,9 +1867,9 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1867
1867
|
this.onPropsChange();
|
|
1868
1868
|
}, imageRestriction: function() {
|
|
1869
1869
|
this.reset();
|
|
1870
|
-
}, stencilProps: function(e,
|
|
1870
|
+
}, stencilProps: function(e, n) {
|
|
1871
1871
|
["aspectRatio", "minAspectRatio", "maxAspectRatio"].find(function(t) {
|
|
1872
|
-
return e[t] !==
|
|
1872
|
+
return e[t] !== n[t];
|
|
1873
1873
|
}) && this.$nextTick(this.onPropsChange);
|
|
1874
1874
|
} }, created: function() {
|
|
1875
1875
|
this.debouncedUpdate = Bt(this.update, this.debounce), this.debouncedDisableTransitions = Bt(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
|
|
@@ -1878,28 +1878,28 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1878
1878
|
}, unmounted: function() {
|
|
1879
1879
|
window.removeEventListener("resize", this.refresh), window.removeEventListener("orientationchange", this.refresh), this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.debouncedUpdate.clear(), this.debouncedDisableTransitions.clear();
|
|
1880
1880
|
}, methods: { getResult: function() {
|
|
1881
|
-
var e = this.initialized ? this.prepareResult(
|
|
1881
|
+
var e = this.initialized ? this.prepareResult(ie({}, this.coordinates)) : this.defaultCoordinates(), n = { rotate: this.imageTransforms.rotate % 360, flip: ie({}, this.imageTransforms.flip) };
|
|
1882
1882
|
if (this.src && this.imageLoaded) {
|
|
1883
1883
|
var t = this;
|
|
1884
|
-
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ?
|
|
1884
|
+
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ? ie({}, this.visibleArea) : null, imageTransforms: n, get canvas() {
|
|
1885
1885
|
return t.canvas ? t.getCanvas() : void 0;
|
|
1886
1886
|
} };
|
|
1887
1887
|
}
|
|
1888
|
-
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ?
|
|
1889
|
-
}, zoom: function(e,
|
|
1890
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
1891
|
-
this.onManipulateImage(new at({}, { factor: 1 / e, center:
|
|
1892
|
-
}, move: function(e,
|
|
1893
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
1894
|
-
this.onManipulateImage(new at({ left: e || 0, top:
|
|
1888
|
+
return { image: this.image, coordinates: e, visibleArea: this.visibleArea ? ie({}, this.visibleArea) : null, canvas: void 0, imageTransforms: n };
|
|
1889
|
+
}, zoom: function(e, n) {
|
|
1890
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = t.transitions, a = i === void 0 || i;
|
|
1891
|
+
this.onManipulateImage(new at({}, { factor: 1 / e, center: n }), { normalize: !1, transitions: a });
|
|
1892
|
+
}, move: function(e, n) {
|
|
1893
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = t.transitions, a = i === void 0 || i;
|
|
1894
|
+
this.onManipulateImage(new at({ left: e || 0, top: n || 0 }), { normalize: !1, transitions: a });
|
|
1895
1895
|
}, setCoordinates: function(e) {
|
|
1896
|
-
var
|
|
1896
|
+
var n = this, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = t.autoZoom, a = i === void 0 || i, o = t.transitions, r = o === void 0 || o;
|
|
1897
1897
|
this.$nextTick(function() {
|
|
1898
|
-
|
|
1898
|
+
n.imageLoaded ? (n.transitionsActive || (r && n.enableTransitions(), n.coordinates = n.applyTransform(e), a && n.runAutoZoom("setCoordinates"), r && n.debouncedDisableTransitions()), n.onChange()) : n.delayedTransforms = e;
|
|
1899
1899
|
});
|
|
1900
1900
|
}, refresh: function() {
|
|
1901
|
-
var e = this,
|
|
1902
|
-
if (this.src &&
|
|
1901
|
+
var e = this, n = this.$refs.image;
|
|
1902
|
+
if (this.src && n) return this.initialized ? this.updateVisibleArea().then(function() {
|
|
1903
1903
|
e.onChange();
|
|
1904
1904
|
}) : this.resetVisibleArea().then(function() {
|
|
1905
1905
|
e.onChange();
|
|
@@ -1910,27 +1910,27 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1910
1910
|
e.onChange(!1);
|
|
1911
1911
|
});
|
|
1912
1912
|
}, awaitRender: function(e) {
|
|
1913
|
-
var
|
|
1913
|
+
var n = this;
|
|
1914
1914
|
this.awaiting || (this.awaiting = !0, this.$nextTick(function() {
|
|
1915
|
-
e(),
|
|
1915
|
+
e(), n.awaiting = !1;
|
|
1916
1916
|
}));
|
|
1917
1917
|
}, prepareResult: function(e) {
|
|
1918
|
-
return this.roundResult ? function(
|
|
1919
|
-
var t =
|
|
1920
|
-
return o.width >
|
|
1921
|
-
}(
|
|
1922
|
-
}, processAutoZoom: function(e,
|
|
1918
|
+
return this.roundResult ? function(n) {
|
|
1919
|
+
var t = n.coordinates, i = n.sizeRestrictions, a = n.positionRestrictions, o = { width: Math.round(t.width), height: Math.round(t.height), left: Math.round(t.left), top: Math.round(t.top) };
|
|
1920
|
+
return o.width > i.maxWidth ? o.width = Math.floor(t.width) : o.width < i.minWidth && (o.width = Math.ceil(t.width)), o.height > i.maxHeight ? o.height = Math.floor(t.height) : o.height < i.minHeight && (o.height = Math.ceil(t.height)), ve(o, a);
|
|
1921
|
+
}(ie(ie({}, this.getPublicProperties()), {}, { positionRestrictions: pt(this.positionRestrictions, this.visibleArea), coordinates: e })) : e;
|
|
1922
|
+
}, processAutoZoom: function(e, n, t, i) {
|
|
1923
1923
|
var a = this.autoZoomAlgorithm;
|
|
1924
1924
|
a || (a = this.stencilSize ? ho : this.autoZoom ? po : fo);
|
|
1925
|
-
var o = a({ event: { type: e, params:
|
|
1926
|
-
return
|
|
1925
|
+
var o = a({ event: { type: e, params: i }, visibleArea: n, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
1926
|
+
return ie(ie({}, o), {}, { changed: !Rn(o.visibleArea, n) || !Rn(o.coordinates, t) });
|
|
1927
1927
|
}, runAutoZoom: function(e) {
|
|
1928
|
-
var
|
|
1929
|
-
|
|
1928
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.transitions, i = t !== void 0 && t, a = to(n, Eo), o = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = o.visibleArea, l = o.coordinates, s = o.changed;
|
|
1929
|
+
i && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, i && s && this.debouncedDisableTransitions();
|
|
1930
1930
|
}, normalizeEvent: function(e) {
|
|
1931
|
-
return function(
|
|
1932
|
-
var t =
|
|
1933
|
-
if (t.type === "manipulateImage") return H(H({}, t), { move: { left: t.move && t.move.left ? a * t.move.left : 0, top: t.move && t.move.top ? a * t.move.top : 0 }, scale: { factor: t.scale && t.scale.factor ? t.scale.factor : 1, center: t.scale && t.scale.center ? { left: t.scale.center.left * a +
|
|
1931
|
+
return function(n) {
|
|
1932
|
+
var t = n.event, i = n.visibleArea, a = n.coefficient;
|
|
1933
|
+
if (t.type === "manipulateImage") return H(H({}, t), { move: { left: t.move && t.move.left ? a * t.move.left : 0, top: t.move && t.move.top ? a * t.move.top : 0 }, scale: { factor: t.scale && t.scale.factor ? t.scale.factor : 1, center: t.scale && t.scale.center ? { left: t.scale.center.left * a + i.left, top: t.scale.center.top * a + i.top } : null } });
|
|
1934
1934
|
if (t.type === "resize") {
|
|
1935
1935
|
var o = H(H({}, t), { directions: H({}, t.directions) });
|
|
1936
1936
|
return ze.forEach(function(l) {
|
|
@@ -1944,22 +1944,22 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1944
1944
|
}), r;
|
|
1945
1945
|
}
|
|
1946
1946
|
return t;
|
|
1947
|
-
}(
|
|
1947
|
+
}(ie(ie({}, this.getPublicProperties()), {}, { event: e }));
|
|
1948
1948
|
}, getCanvas: function() {
|
|
1949
1949
|
if (this.$refs.canvas) {
|
|
1950
|
-
var e = this.$refs.canvas,
|
|
1951
|
-
var d = u.rotate, h = u.flip, m = { width: s.naturalWidth, height: s.naturalHeight }, c =
|
|
1950
|
+
var e = this.$refs.canvas, n = this.$refs.image, t = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? function(l, s, u) {
|
|
1951
|
+
var d = u.rotate, h = u.flip, m = { width: s.naturalWidth, height: s.naturalHeight }, c = Xn(m, d), y = l.getContext("2d");
|
|
1952
1952
|
l.height = c.height, l.width = c.width, y.save();
|
|
1953
1953
|
var v = Ve(ge(H({ left: 0, top: 0 }, m)), d);
|
|
1954
1954
|
return y.translate(-(v.left - c.width / 2), -(v.top - c.height / 2)), y.rotate(d * Math.PI / 180), y.translate(h.horizontal ? m.width : 0, h.vertical ? m.height : 0), y.scale(h.horizontal ? -1 : 1, h.vertical ? -1 : 1), y.drawImage(s, 0, 0, m.width, m.height), y.restore(), l;
|
|
1955
|
-
}(this.$refs.sourceCanvas,
|
|
1955
|
+
}(this.$refs.sourceCanvas, n, this.imageTransforms) : n, i = ie({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), a = function(l) {
|
|
1956
1956
|
return l.find(function(s) {
|
|
1957
1957
|
return u = s, !Number.isNaN(parseFloat(u)) && isFinite(u);
|
|
1958
1958
|
var u;
|
|
1959
1959
|
});
|
|
1960
|
-
}, o = De({ sizeRestrictions: { minWidth: a([
|
|
1961
|
-
if (
|
|
1962
|
-
var r = Math.sqrt(
|
|
1960
|
+
}, o = De({ sizeRestrictions: { minWidth: a([i.width, i.minWidth]) || 0, minHeight: a([i.height, i.minHeight]) || 0, maxWidth: a([i.width, i.maxWidth]) || 1 / 0, maxHeight: a([i.height, i.maxHeight]) || 1 / 0 }, width: this.coordinates.width, height: this.coordinates.height, aspectRatio: { minimum: this.coordinates.width / this.coordinates.height, maximum: this.coordinates.width / this.coordinates.height } });
|
|
1961
|
+
if (i.maxArea && o.width * o.height > i.maxArea) {
|
|
1962
|
+
var r = Math.sqrt(i.maxArea / (o.width * o.height));
|
|
1963
1963
|
o = { width: Math.round(r * o.width), height: Math.round(r * o.height) };
|
|
1964
1964
|
}
|
|
1965
1965
|
return function(l, s, u, d, h) {
|
|
@@ -1968,55 +1968,55 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
1968
1968
|
m.clearRect(0, 0, l.width, l.height), h && (h.imageSmoothingEnabled && (m.imageSmoothingEnabled = h.imageSmoothingEnabled), h.imageSmoothingQuality && (m.imageSmoothingQuality = h.imageSmoothingQuality), h.fillColor && (m.fillStyle = h.fillColor, m.fillRect(0, 0, l.width, l.height), m.save()));
|
|
1969
1969
|
var c = u.left < 0 ? -u.left : 0, y = u.top < 0 ? -u.top : 0;
|
|
1970
1970
|
m.drawImage(s, u.left + c, u.top + y, u.width, u.height, c * (l.width / u.width), y * (l.height / u.height), l.width, l.height);
|
|
1971
|
-
}(e, t, this.coordinates, o,
|
|
1971
|
+
}(e, t, this.coordinates, o, i), e;
|
|
1972
1972
|
}
|
|
1973
1973
|
}, update: function() {
|
|
1974
1974
|
this.$emit("change", this.getResult());
|
|
1975
1975
|
}, applyTransform: function(e) {
|
|
1976
|
-
var
|
|
1977
|
-
return mo({ transform: e, coordinates: this.coordinates, imageSize: this.imageSize, sizeRestrictions: t, positionRestrictions:
|
|
1976
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], t = this.visibleArea && n ? co(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, i = this.visibleArea && n ? pt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
|
|
1977
|
+
return mo({ transform: e, coordinates: this.coordinates, imageSize: this.imageSize, sizeRestrictions: t, positionRestrictions: i, aspectRatio: this.getAspectRatio(), visibleArea: this.visibleArea });
|
|
1978
1978
|
}, resetCoordinates: function() {
|
|
1979
1979
|
var e = this;
|
|
1980
1980
|
if (this.$refs.image) {
|
|
1981
1981
|
this.$refs.cropper, this.$refs.image;
|
|
1982
|
-
var
|
|
1983
|
-
|
|
1982
|
+
var n = this.defaultSize;
|
|
1983
|
+
n || (n = this.stencilSize ? bo : vo);
|
|
1984
1984
|
var t = this.sizeRestrictions;
|
|
1985
1985
|
t.minWidth, t.minHeight, t.maxWidth, t.maxHeight;
|
|
1986
|
-
var
|
|
1986
|
+
var i = Ze(n) ? n({ boundaries: this.boundaries, imageSize: this.imageSize, aspectRatio: this.getAspectRatio(), sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize(), visibleArea: this.visibleArea }) : n, a = this.defaultPosition || go, o = [i, function(r) {
|
|
1987
1987
|
var l = r.coordinates;
|
|
1988
|
-
return
|
|
1988
|
+
return ie({}, Ze(a) ? a({ coordinates: l, imageSize: e.imageSize, visibleArea: e.visibleArea }) : e.defaultPosition);
|
|
1989
1989
|
}];
|
|
1990
1990
|
this.delayedTransforms && o.push.apply(o, qe(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(o, !0), this.delayedTransforms = null;
|
|
1991
1991
|
}
|
|
1992
1992
|
}, clearImage: function() {
|
|
1993
1993
|
var e = this;
|
|
1994
1994
|
this.imageLoaded = !1, setTimeout(function() {
|
|
1995
|
-
var
|
|
1996
|
-
|
|
1995
|
+
var n = e.$refs.stretcher;
|
|
1996
|
+
n && (n.style.height = "auto", n.style.width = "auto"), e.coordinates = e.defaultCoordinates(), e.boundaries = { width: 0, height: 0 };
|
|
1997
1997
|
}, this.transitionTime);
|
|
1998
1998
|
}, enableTransitions: function() {
|
|
1999
1999
|
this.transitions && (this.transitionsActive = !0);
|
|
2000
2000
|
}, disableTransitions: function() {
|
|
2001
2001
|
this.transitionsActive = !1;
|
|
2002
2002
|
}, updateBoundaries: function() {
|
|
2003
|
-
var e = this,
|
|
2004
|
-
return this.initStretcher({ cropper: t, stretcher:
|
|
2005
|
-
var
|
|
2006
|
-
if (Ze(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(
|
|
2003
|
+
var e = this, n = this.$refs.stretcher, t = this.$refs.cropper;
|
|
2004
|
+
return this.initStretcher({ cropper: t, stretcher: n, imageSize: this.imageSize }), this.$nextTick().then(function() {
|
|
2005
|
+
var i = { cropper: t, imageSize: e.imageSize };
|
|
2006
|
+
if (Ze(e.defaultBoundaries) ? e.boundaries = e.defaultBoundaries(i) : e.defaultBoundaries === "fit" ? e.boundaries = function(a) {
|
|
2007
2007
|
var o = a.cropper, r = a.imageSize, l = o.clientHeight, s = o.clientWidth, u = l, d = r.width * l / r.height;
|
|
2008
2008
|
return d > s && (d = s, u = r.height * s / r.width), { width: d, height: u };
|
|
2009
|
-
}(
|
|
2009
|
+
}(i) : e.boundaries = function(a) {
|
|
2010
2010
|
var o = a.cropper;
|
|
2011
2011
|
return { width: o.clientWidth, height: o.clientHeight };
|
|
2012
|
-
}(
|
|
2012
|
+
}(i), !e.boundaries.width || !e.boundaries.height) throw new Error("It's impossible to fit the cropper in the current container");
|
|
2013
2013
|
});
|
|
2014
2014
|
}, resetVisibleArea: function() {
|
|
2015
2015
|
var e = this;
|
|
2016
|
-
return this.appliedImageTransforms =
|
|
2016
|
+
return this.appliedImageTransforms = ie(ie({}, this.defaultImageTransforms), {}, { flip: ie({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then(function() {
|
|
2017
2017
|
e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
|
|
2018
|
-
var
|
|
2019
|
-
e.visibleArea = Ze(l) ? l({ imageSize: e.imageSize, boundaries: e.boundaries, coordinates: e.priority !== "visible-area" ? e.coordinates : null, getAreaRestrictions: e.getAreaRestrictions, stencilSize: e.getStencilSize() }) : e.defaultVisibleArea, e.visibleArea = (
|
|
2018
|
+
var n, t, i, a, o, r, l = e.defaultVisibleArea || yo;
|
|
2019
|
+
e.visibleArea = Ze(l) ? l({ imageSize: e.imageSize, boundaries: e.boundaries, coordinates: e.priority !== "visible-area" ? e.coordinates : null, getAreaRestrictions: e.getAreaRestrictions, stencilSize: e.getStencilSize() }) : e.defaultVisibleArea, e.visibleArea = (n = { visibleArea: e.visibleArea, boundaries: e.boundaries, getAreaRestrictions: e.getAreaRestrictions }, t = n.visibleArea, i = n.boundaries, a = n.getAreaRestrictions, o = H({}, t), r = oe(i), o.width / o.height !== r && (o.height = o.width / r), ve(o, a({ visibleArea: o, type: "move" }))), e.priority === "visible-area" ? e.resetCoordinates() : e.coordinates = e.fitCoordinates({ visibleArea: e.visibleArea, coordinates: e.coordinates, aspectRatio: e.getAspectRatio(), positionRestrictions: e.positionRestrictions, sizeRestrictions: e.sizeRestrictions }), e.runAutoZoom("resetVisibleArea");
|
|
2020
2020
|
}).catch(function() {
|
|
2021
2021
|
e.visibleArea = null;
|
|
2022
2022
|
});
|
|
@@ -2031,10 +2031,10 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
2031
2031
|
var e = !(arguments.length > 0 && arguments[0] !== void 0) || arguments[0];
|
|
2032
2032
|
e && this.debounce ? this.debouncedUpdate() : this.update();
|
|
2033
2033
|
}, onChangeImage: function() {
|
|
2034
|
-
var e,
|
|
2034
|
+
var e, n = this;
|
|
2035
2035
|
if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
|
|
2036
2036
|
if (function(a) {
|
|
2037
|
-
if (
|
|
2037
|
+
if (wn(a)) return !1;
|
|
2038
2038
|
var o = window.location, r = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(a) || [], l = { protocol: r[1] || "", host: r[2] || "", port: r[3] || "" }, s = function(u) {
|
|
2039
2039
|
return u.port || ((u.protocol || o.protocol) === "http" ? 80 : 433);
|
|
2040
2040
|
};
|
|
@@ -2044,7 +2044,7 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
2044
2044
|
t === !0 && (t = "anonymous"), this.imageAttributes.crossOrigin = t || null;
|
|
2045
2045
|
}
|
|
2046
2046
|
if (this.checkOrientation) {
|
|
2047
|
-
var
|
|
2047
|
+
var i = (e = this.src, new Promise(function(a) {
|
|
2048
2048
|
zo(e).then(function(o) {
|
|
2049
2049
|
var r = Fo(o);
|
|
2050
2050
|
a(o ? { source: e, arrayBuffer: o, orientation: r } : { source: e, arrayBuffer: null, orientation: null });
|
|
@@ -2053,28 +2053,28 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
2053
2053
|
});
|
|
2054
2054
|
}));
|
|
2055
2055
|
setTimeout(function() {
|
|
2056
|
-
|
|
2056
|
+
i.then(n.onParseImage);
|
|
2057
2057
|
}, this.transitionTime);
|
|
2058
2058
|
} else setTimeout(function() {
|
|
2059
|
-
|
|
2059
|
+
n.onParseImage({ source: n.src });
|
|
2060
2060
|
}, this.transitionTime);
|
|
2061
2061
|
} else this.clearImage();
|
|
2062
2062
|
}, onFailLoadImage: function() {
|
|
2063
2063
|
this.imageAttributes.src && (this.clearImage(), this.$emit("error"));
|
|
2064
2064
|
}, onSuccessLoadImage: function() {
|
|
2065
|
-
var e = this,
|
|
2066
|
-
|
|
2065
|
+
var e = this, n = this.$refs.image;
|
|
2066
|
+
n && !this.imageLoaded && (this.imageAttributes.height = n.naturalHeight, this.imageAttributes.width = n.naturalWidth, this.imageLoaded = !0, this.resetVisibleArea().then(function() {
|
|
2067
2067
|
e.$emit("ready"), e.onChange(!1);
|
|
2068
2068
|
}));
|
|
2069
2069
|
}, onParseImage: function(e) {
|
|
2070
|
-
var
|
|
2071
|
-
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1,
|
|
2070
|
+
var n = this, t = e.source, i = e.arrayBuffer, a = e.orientation;
|
|
2071
|
+
this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, i && a && a > 1 ? Kn(t) || !wn(t) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([i])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(o) {
|
|
2072
2072
|
for (var r = [], l = new Uint8Array(o); l.length > 0; ) {
|
|
2073
2073
|
var s = l.subarray(0, 8192);
|
|
2074
2074
|
r.push(String.fromCharCode.apply(null, Array.from ? Array.from(s) : s.slice())), l = l.subarray(8192);
|
|
2075
2075
|
}
|
|
2076
2076
|
return "data:image/jpeg;base64," + btoa(r.join(""));
|
|
2077
|
-
}(
|
|
2077
|
+
}(i) : this.imageAttributes.src = t, Ze(this.defaultTransforms) ? this.appliedImageTransforms = Dt(this.defaultTransforms()) : bt(this.defaultTransforms) ? this.appliedImageTransforms = Dt(this.defaultTransforms) : this.appliedImageTransforms = function(o) {
|
|
2078
2078
|
var r = Dt({});
|
|
2079
2079
|
if (o) switch (o) {
|
|
2080
2080
|
case 2:
|
|
@@ -2099,79 +2099,79 @@ var Eo = ["transitions"], Ie = Me("vue-advanced-cropper"), on = { name: "Cropper
|
|
|
2099
2099
|
r.rotate = -90;
|
|
2100
2100
|
}
|
|
2101
2101
|
return r;
|
|
2102
|
-
}(a), this.defaultImageTransforms =
|
|
2103
|
-
var o =
|
|
2102
|
+
}(a), this.defaultImageTransforms = ie(ie({}, this.appliedImageTransforms), {}, { flip: ie({}, this.appliedImageTransforms.flip) }), this.$nextTick(function() {
|
|
2103
|
+
var o = n.$refs.image;
|
|
2104
2104
|
o && o.complete && (function(r) {
|
|
2105
2105
|
return !!r.naturalWidth;
|
|
2106
|
-
}(o) ?
|
|
2106
|
+
}(o) ? n.onSuccessLoadImage() : n.onFailLoadImage());
|
|
2107
2107
|
});
|
|
2108
2108
|
}, onResizeEnd: function() {
|
|
2109
2109
|
this.runAutoZoom("resize", { transitions: !0 });
|
|
2110
2110
|
}, onMoveEnd: function() {
|
|
2111
2111
|
this.runAutoZoom("move", { transitions: !0 });
|
|
2112
2112
|
}, onMove: function(e) {
|
|
2113
|
-
var
|
|
2113
|
+
var n = this;
|
|
2114
2114
|
this.transitionsOptions.enabled || this.awaitRender(function() {
|
|
2115
|
-
|
|
2115
|
+
n.coordinates = n.moveAlgorithm(ie(ie({}, n.getPublicProperties()), {}, { positionRestrictions: pt(n.positionRestrictions, n.visibleArea), coordinates: n.coordinates, event: n.normalizeEvent(e) })), n.onChange();
|
|
2116
2116
|
});
|
|
2117
2117
|
}, onResize: function(e) {
|
|
2118
|
-
var
|
|
2118
|
+
var n = this;
|
|
2119
2119
|
this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender(function() {
|
|
2120
|
-
var t =
|
|
2121
|
-
|
|
2120
|
+
var t = n.sizeRestrictions, i = Math.min(n.coordinates.width, n.coordinates.height, 20 * n.coefficient);
|
|
2121
|
+
n.coordinates = n.resizeAlgorithm(ie(ie({}, n.getPublicProperties()), {}, { positionRestrictions: pt(n.positionRestrictions, n.visibleArea), sizeRestrictions: { maxWidth: Math.min(t.maxWidth, n.visibleArea.width), maxHeight: Math.min(t.maxHeight, n.visibleArea.height), minWidth: Math.max(t.minWidth, i), minHeight: Math.max(t.minHeight, i) }, event: n.normalizeEvent(e) })), n.onChange(), n.ticking = !1;
|
|
2122
2122
|
});
|
|
2123
2123
|
}, onManipulateImage: function(e) {
|
|
2124
|
-
var
|
|
2124
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2125
2125
|
if (!this.transitionsOptions.enabled) {
|
|
2126
|
-
var t =
|
|
2127
|
-
|
|
2128
|
-
var r = _o(
|
|
2129
|
-
this.visibleArea = l, this.coordinates = s, this.runAutoZoom("manipulateImage"), this.onChange(),
|
|
2126
|
+
var t = n.transitions, i = t !== void 0 && t, a = n.normalize, o = a === void 0 || a;
|
|
2127
|
+
i && this.enableTransitions();
|
|
2128
|
+
var r = _o(ie(ie({}, this.getPublicProperties()), {}, { event: o ? this.normalizeEvent(e) : e, getAreaRestrictions: this.getAreaRestrictions, imageRestriction: this.imageRestriction, adjustStencil: !this.stencilSize && this.settings.resizeImage.adjustStencil })), l = r.visibleArea, s = r.coordinates;
|
|
2129
|
+
this.visibleArea = l, this.coordinates = s, this.runAutoZoom("manipulateImage"), this.onChange(), i && this.debouncedDisableTransitions();
|
|
2130
2130
|
}
|
|
2131
2131
|
}, onPropsChange: function() {
|
|
2132
2132
|
this.coordinates = this.applyTransform(this.coordinates, !0), this.onChange(!1);
|
|
2133
2133
|
}, getAreaRestrictions: function() {
|
|
2134
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
2135
|
-
return this.areaRestrictionsAlgorithm({ boundaries: this.boundaries, imageSize: this.imageSize, imageRestriction: this.imageRestriction, visibleArea:
|
|
2134
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.visibleArea, t = e.type, i = t === void 0 ? "move" : t;
|
|
2135
|
+
return this.areaRestrictionsAlgorithm({ boundaries: this.boundaries, imageSize: this.imageSize, imageRestriction: this.imageRestriction, visibleArea: n, type: i });
|
|
2136
2136
|
}, getAspectRatio: function(e) {
|
|
2137
|
-
var
|
|
2137
|
+
var n, t, i = this.stencilProps, a = i.aspectRatio, o = i.minAspectRatio, r = i.maxAspectRatio;
|
|
2138
2138
|
if (this.$refs.stencil && this.$refs.stencil.aspectRatios) {
|
|
2139
2139
|
var l = this.$refs.stencil.aspectRatios();
|
|
2140
|
-
|
|
2140
|
+
n = l.minimum, t = l.maximum;
|
|
2141
2141
|
}
|
|
2142
|
-
if (fe(
|
|
2142
|
+
if (fe(n) && (n = fe(a) ? o : a), fe(t) && (t = fe(a) ? r : a), !e && (fe(n) || fe(t))) {
|
|
2143
2143
|
var s = this.getStencilSize(), u = s ? oe(s) : null;
|
|
2144
|
-
fe(
|
|
2144
|
+
fe(n) && (n = Sn(u) ? u : void 0), fe(t) && (t = Sn(u) ? u : void 0);
|
|
2145
2145
|
}
|
|
2146
|
-
return { minimum:
|
|
2146
|
+
return { minimum: n, maximum: t };
|
|
2147
2147
|
}, getStencilSize: function() {
|
|
2148
|
-
if (this.stencilSize) return e = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) },
|
|
2149
|
-
var e,
|
|
2148
|
+
if (this.stencilSize) return e = { currentStencilSize: { width: this.stencilCoordinates.width, height: this.stencilCoordinates.height }, stencilSize: this.stencilSize, boundaries: this.boundaries, coefficient: this.coefficient, coordinates: this.coordinates, aspectRatio: this.getAspectRatio(!0) }, n = e.boundaries, t = e.stencilSize, i = e.aspectRatio, It(oe(a = Ze(t) ? t({ boundaries: n, aspectRatio: i }) : t), i) && (a = De({ sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: i.minimum, maximum: i.maximum } })), (a.width > n.width || a.height > n.height) && (a = De({ sizeRestrictions: { maxWidth: n.width, maxHeight: n.height, minWidth: 0, minHeight: 0 }, width: a.width, height: a.height, aspectRatio: { minimum: oe(a), maximum: oe(a) } })), a;
|
|
2149
|
+
var e, n, t, i, a;
|
|
2150
2150
|
}, getPublicProperties: function() {
|
|
2151
2151
|
return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
|
|
2152
2152
|
}, defaultCoordinates: function() {
|
|
2153
|
-
return
|
|
2154
|
-
}, flip: function(e,
|
|
2155
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
2153
|
+
return ie({}, Cn);
|
|
2154
|
+
}, flip: function(e, n) {
|
|
2155
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = t.transitions, a = i === void 0 || i;
|
|
2156
2156
|
if (!this.transitionsActive) {
|
|
2157
2157
|
a && this.enableTransitions();
|
|
2158
|
-
var o =
|
|
2159
|
-
e && (this.appliedImageTransforms.flip.horizontal = !this.appliedImageTransforms.flip.horizontal),
|
|
2158
|
+
var o = ie({}, this.imageTransforms.flip), r = So({ flip: { horizontal: e ? !o.horizontal : o.horizontal, vertical: n ? !o.vertical : o.vertical }, previousFlip: o, rotate: this.imageTransforms.rotate, visibleArea: this.visibleArea, coordinates: this.coordinates, imageSize: this.imageSize, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), l = r.visibleArea, s = r.coordinates;
|
|
2159
|
+
e && (this.appliedImageTransforms.flip.horizontal = !this.appliedImageTransforms.flip.horizontal), n && (this.appliedImageTransforms.flip.vertical = !this.appliedImageTransforms.flip.vertical), this.visibleArea = l, this.coordinates = s, this.onChange(), a && this.debouncedDisableTransitions();
|
|
2160
2160
|
}
|
|
2161
2161
|
}, rotate: function(e) {
|
|
2162
|
-
var
|
|
2162
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.transitions, i = t === void 0 || t;
|
|
2163
2163
|
if (!this.transitionsActive) {
|
|
2164
|
-
|
|
2165
|
-
var a =
|
|
2164
|
+
i && this.enableTransitions();
|
|
2165
|
+
var a = ie({}, this.imageSize);
|
|
2166
2166
|
this.appliedImageTransforms.rotate += e;
|
|
2167
2167
|
var o = wo({ visibleArea: this.visibleArea, coordinates: this.coordinates, previousImageSize: a, imageSize: this.imageSize, angle: e, positionRestrictions: this.positionRestrictions, sizeRestrictions: this.sizeRestrictions, getAreaRestrictions: this.getAreaRestrictions, aspectRatio: this.getAspectRatio() }), r = o.visibleArea, l = o.coordinates, s = this.processAutoZoom("rotateImage", r, l);
|
|
2168
|
-
r = s.visibleArea, l = s.coordinates, this.visibleArea = r, this.coordinates = l, this.onChange(),
|
|
2168
|
+
r = s.visibleArea, l = s.coordinates, this.visibleArea = r, this.coordinates = l, this.onChange(), i && this.debouncedDisableTransitions();
|
|
2169
2169
|
}
|
|
2170
2170
|
} }, emits: ["change", "error", "ready"] }, Io = { key: 0, ref: "canvas", style: { display: "none" } }, Po = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
|
|
2171
|
-
|
|
2171
|
+
oi.render = function(e, n, t, i, a, o) {
|
|
2172
2172
|
return F(), G("div", { ref: "cropper", class: o.classes.cropper }, [C("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), C("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(F(), G(yt(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: N(function() {
|
|
2173
|
-
return [C("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), C("div", { class: o.classes.imageWrapper }, [C("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown:
|
|
2174
|
-
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), C("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), Xe((F(), G(yt(t.stencilComponent),
|
|
2173
|
+
return [C("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), C("div", { class: o.classes.imageWrapper }, [C("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: n[1] || (n[1] = St(function() {
|
|
2174
|
+
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), C("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), Xe((F(), G(yt(t.stencilComponent), Dn({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[wt, a.imageLoaded]]), t.canvas ? (F(), G("canvas", Io, null, 512)) : ee("", !0), t.canvas ? (F(), G("canvas", Po, null, 512)) : ee("", !0)];
|
|
2175
2175
|
}), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
|
|
2176
2176
|
};
|
|
2177
2177
|
const Do = {
|
|
@@ -2193,8 +2193,8 @@ const Do = {
|
|
|
2193
2193
|
modelValue: {}
|
|
2194
2194
|
},
|
|
2195
2195
|
emits: ["update:model-value", "reset:model-value"],
|
|
2196
|
-
setup(e, { emit:
|
|
2197
|
-
const t = e, { t:
|
|
2196
|
+
setup(e, { emit: n }) {
|
|
2197
|
+
const t = e, { t: i } = ce(), a = n, o = T(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = q();
|
|
2198
2198
|
function l(y, v) {
|
|
2199
2199
|
const w = 2e3 / y;
|
|
2200
2200
|
return {
|
|
@@ -2240,13 +2240,13 @@ const Do = {
|
|
|
2240
2240
|
const g = B("fm-icon"), w = B("fm-drop-field");
|
|
2241
2241
|
return r.value || o.value ? (F(), Z("div", Do, [
|
|
2242
2242
|
D("p", To, [
|
|
2243
|
-
_t(se(p(
|
|
2244
|
-
D("span", Uo, se(p(
|
|
2243
|
+
_t(se(p(i)("menu.common.labels.product_image")) + " ", 1),
|
|
2244
|
+
D("span", Uo, se(p(i)("menu.common.labels.optional")), 1)
|
|
2245
2245
|
]),
|
|
2246
2246
|
D("div", $o, [
|
|
2247
2247
|
D("div", Vo, [
|
|
2248
2248
|
D("div", No, [
|
|
2249
|
-
C(p(
|
|
2249
|
+
C(p(oi), {
|
|
2250
2250
|
class: "cropper h-[150px] w-[200px]",
|
|
2251
2251
|
src: r.value || o.value,
|
|
2252
2252
|
"stencil-props": {
|
|
@@ -2283,45 +2283,45 @@ const Do = {
|
|
|
2283
2283
|
}, {
|
|
2284
2284
|
label: N(() => [
|
|
2285
2285
|
D("p", Lo, [
|
|
2286
|
-
_t(se(p(
|
|
2287
|
-
D("span", Bo, se(p(
|
|
2286
|
+
_t(se(p(i)("menu.common.labels.product_image")) + " ", 1),
|
|
2287
|
+
D("span", Bo, se(p(i)("menu.common.labels.optional")), 1)
|
|
2288
2288
|
])
|
|
2289
2289
|
]),
|
|
2290
2290
|
"accept-text": N(() => [
|
|
2291
|
-
D("p", Ko, se(p(
|
|
2291
|
+
D("p", Ko, se(p(i)("menu.common.file.accepts")), 1)
|
|
2292
2292
|
]),
|
|
2293
2293
|
_: 1
|
|
2294
2294
|
}));
|
|
2295
2295
|
};
|
|
2296
2296
|
}
|
|
2297
|
-
}),
|
|
2297
|
+
}), ai = /* @__PURE__ */ le({
|
|
2298
2298
|
__name: "RemyButton",
|
|
2299
2299
|
props: {
|
|
2300
2300
|
onClick: { type: Function },
|
|
2301
2301
|
pureStyling: { type: Boolean }
|
|
2302
2302
|
},
|
|
2303
2303
|
setup(e) {
|
|
2304
|
-
return (
|
|
2305
|
-
var
|
|
2306
|
-
return (
|
|
2304
|
+
return (n, t) => {
|
|
2305
|
+
var i;
|
|
2306
|
+
return (i = p(Te)) != null && i.enable.value ? (F(), Z("button", {
|
|
2307
2307
|
key: 0,
|
|
2308
|
-
class: Ee([!
|
|
2308
|
+
class: Ee([!n.pureStyling && "bg-fm-color-neutral-gray-100 rounded-lg p-[6px]"]),
|
|
2309
2309
|
type: "button",
|
|
2310
2310
|
onClick: t[0] || (t[0] = //@ts-ignore
|
|
2311
|
-
(...a) =>
|
|
2311
|
+
(...a) => n.onClick && n.onClick(...a))
|
|
2312
2312
|
}, [
|
|
2313
|
-
p(Te).isDialogOpened.value ? (F(), G(p(
|
|
2313
|
+
p(Te).isDialogOpened.value ? (F(), G(p(Wi), { key: 1 })) : (F(), G(p(Bi), { key: 0 }))
|
|
2314
2314
|
], 2)) : ee("", !0);
|
|
2315
2315
|
};
|
|
2316
2316
|
}
|
|
2317
2317
|
}), Wo = {}, jo = { class: "pl-32" };
|
|
2318
|
-
function Yo(e,
|
|
2318
|
+
function Yo(e, n) {
|
|
2319
2319
|
return F(), Z("div", jo, [
|
|
2320
2320
|
he(e.$slots, "default")
|
|
2321
2321
|
]);
|
|
2322
2322
|
}
|
|
2323
2323
|
const Ho = /* @__PURE__ */ lt(Wo, [["render", Yo]]);
|
|
2324
|
-
function
|
|
2324
|
+
function ri(e) {
|
|
2325
2325
|
return e || null;
|
|
2326
2326
|
}
|
|
2327
2327
|
const Xo = {
|
|
@@ -2338,9 +2338,9 @@ const Xo = {
|
|
|
2338
2338
|
class: "relative"
|
|
2339
2339
|
}, ta = {
|
|
2340
2340
|
class: "fm-typo-en-body-lg-600"
|
|
2341
|
-
}, ia = {
|
|
2342
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
2343
2341
|
}, na = {
|
|
2342
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
2343
|
+
}, ia = {
|
|
2344
2344
|
class: "flex flex-col gap-16"
|
|
2345
2345
|
}, oa = {
|
|
2346
2346
|
class: "space-y-8"
|
|
@@ -2369,14 +2369,14 @@ const ra = /* @__PURE__ */ le({
|
|
|
2369
2369
|
},
|
|
2370
2370
|
emits: ["update:form", "update:thumbnail", "reset:thumbnail"],
|
|
2371
2371
|
setup(e, {
|
|
2372
|
-
emit:
|
|
2372
|
+
emit: n
|
|
2373
2373
|
}) {
|
|
2374
|
-
const t = e,
|
|
2374
|
+
const t = e, i = me(), a = Ue(), o = Le(), r = Ye(o), l = He(r), s = zi({
|
|
2375
2375
|
dialog: a,
|
|
2376
2376
|
menuLoader: l
|
|
2377
2377
|
}), {
|
|
2378
2378
|
checkMenuIsLoading: u
|
|
2379
|
-
} = He(Ye(Le())), d =
|
|
2379
|
+
} = He(Ye(Le())), d = n, h = T(() => i.rules.item), m = T(() => i.categorizedItems), c = T(() => {
|
|
2380
2380
|
const P = m.value.map((A) => ({
|
|
2381
2381
|
label: A.name,
|
|
2382
2382
|
value: A.id
|
|
@@ -2410,7 +2410,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2410
2410
|
const w = T(() => {
|
|
2411
2411
|
var A;
|
|
2412
2412
|
const P = t.form.name || ((A = t.fallback) == null ? void 0 : A.name);
|
|
2413
|
-
return P ?
|
|
2413
|
+
return P ? i.items.filter((_) => !!_.category && _._id !== t.form._id && _.name === P).length : 0;
|
|
2414
2414
|
});
|
|
2415
2415
|
function z(P) {
|
|
2416
2416
|
var _, R, f;
|
|
@@ -2455,7 +2455,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2455
2455
|
"model-value": P.form.code,
|
|
2456
2456
|
placeholder: ((Y = P.fallback) == null ? void 0 : Y.code) || p(E)("menu.product.form.detail.fields.code.placeholder"),
|
|
2457
2457
|
label: p(E)("menu.product.form.detail.fields.code.label"),
|
|
2458
|
-
"onUpdate:modelValue": A[0] || (A[0] = (M) => d("update:form", "code", p(
|
|
2458
|
+
"onUpdate:modelValue": A[0] || (A[0] = (M) => d("update:form", "code", p(ri)(M)))
|
|
2459
2459
|
}, null, 8, ["model-value", "placeholder", "label"])]), D("div", Jo, [C(_, {
|
|
2460
2460
|
id: "product-name",
|
|
2461
2461
|
disabled: !h.value.name,
|
|
@@ -2475,12 +2475,12 @@ const ra = /* @__PURE__ */ le({
|
|
|
2475
2475
|
placeholder: p(E)("menu.product.form.detail.fields.description.placeholder"),
|
|
2476
2476
|
"onUpdate:modelValue": A[2] || (A[2] = (M) => d("update:form", "description", M.trim()))
|
|
2477
2477
|
}, {
|
|
2478
|
-
label: N(() => [D("p", ta, [_t(se(p(E)("menu.product.form.detail.fields.description.label")) + " ", 1), D("span",
|
|
2478
|
+
label: N(() => [D("p", ta, [_t(se(p(E)("menu.product.form.detail.fields.description.label")) + " ", 1), D("span", na, se(p(E)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
2479
2479
|
_: 1
|
|
2480
|
-
}, 8, ["disabled", "model-value", "placeholder"]), Xe(C(
|
|
2480
|
+
}, 8, ["disabled", "model-value", "placeholder"]), Xe(C(ai, {
|
|
2481
2481
|
class: Ee(["absolute top-[100px] left-8"]),
|
|
2482
2482
|
onClick: I
|
|
2483
|
-
}, null, 512), [[K, p(
|
|
2483
|
+
}, null, 512), [[K, p(Tn)("Suggest description")]])])]), C(Go, {
|
|
2484
2484
|
disabled: !h.value.thumbnail,
|
|
2485
2485
|
"model-value": P.thumbnail,
|
|
2486
2486
|
"onUpdate:modelValue": A[3] || (A[3] = (M) => d("update:thumbnail", M)),
|
|
@@ -2494,13 +2494,13 @@ const ra = /* @__PURE__ */ le({
|
|
|
2494
2494
|
"model-value": P.isAddon ? je.ADD_ON : je.PRODUCT,
|
|
2495
2495
|
"onUpdate:modelValue": A[5] || (A[5] = (M) => z(M))
|
|
2496
2496
|
}, {
|
|
2497
|
-
default: N(() => [D("div",
|
|
2497
|
+
default: N(() => [D("div", ia, [D("div", oa, [C(f, {
|
|
2498
2498
|
disabled: v.value,
|
|
2499
2499
|
value: je.PRODUCT,
|
|
2500
2500
|
label: p(E)("menu.product.form.detail.category.options.product.label"),
|
|
2501
2501
|
sublabel: p(E)("menu.product.form.detail.category.options.product.sublabel")
|
|
2502
2502
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), C(Ho, null, {
|
|
2503
|
-
default: N(() => [p(
|
|
2503
|
+
default: N(() => [p(i).isV4 ? (F(), G(g, {
|
|
2504
2504
|
key: 0
|
|
2505
2505
|
})) : ee("", !0)]),
|
|
2506
2506
|
_: 1
|
|
@@ -2518,7 +2518,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2518
2518
|
sublabel: p(E)("menu.product.form.detail.category.options.addon.sublabel")
|
|
2519
2519
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
2520
2520
|
_: 1
|
|
2521
|
-
}, 8, ["disabled", "model-value"])) : ee("", !0), p(
|
|
2521
|
+
}, 8, ["disabled", "model-value"])) : ee("", !0), p(i).isV4 ? ee("", !0) : (F(), G(S, {
|
|
2522
2522
|
key: 1,
|
|
2523
2523
|
modelValue: P.form.category,
|
|
2524
2524
|
"onUpdate:modelValue": A[6] || (A[6] = (M) => P.form.category = M),
|
|
@@ -2565,14 +2565,14 @@ const ra = /* @__PURE__ */ le({
|
|
|
2565
2565
|
fallback: {}
|
|
2566
2566
|
},
|
|
2567
2567
|
emits: ["update:form"],
|
|
2568
|
-
setup(e, { emit:
|
|
2569
|
-
const t = e,
|
|
2568
|
+
setup(e, { emit: n }) {
|
|
2569
|
+
const t = e, i = Xt(), a = me(), { t: o } = ce(), r = n, l = T(() => a.rules.item), s = T(() => {
|
|
2570
2570
|
var z, O;
|
|
2571
2571
|
const g = t.isOverride ? ((z = t.fallback) == null ? void 0 : z.unit) ?? ((O = t.fallback) == null ? void 0 : O.perXUnit) : void 0, w = t.form.unit ?? t.form.perXUnit ?? g;
|
|
2572
2572
|
return w != null;
|
|
2573
2573
|
}), u = (g) => {
|
|
2574
2574
|
r("update:form", "unit", g ? "" : void 0), r("update:form", "perXUnit", g ? 0 : void 0);
|
|
2575
|
-
}, d = T(() => Ot.setCoreStore(
|
|
2575
|
+
}, d = T(() => Ot.setCoreStore(i).taxSetting()), h = T(() => {
|
|
2576
2576
|
var g;
|
|
2577
2577
|
return Ot.getSelectedTax(
|
|
2578
2578
|
t.form.taxes,
|
|
@@ -2619,8 +2619,8 @@ const ra = /* @__PURE__ */ le({
|
|
|
2619
2619
|
A,
|
|
2620
2620
|
{
|
|
2621
2621
|
name: t.form.name || "",
|
|
2622
|
-
lat: (O = (z = (w =
|
|
2623
|
-
lon: (P = (E = (I =
|
|
2622
|
+
lat: (O = (z = (w = i.currentRestaurant) == null ? void 0 : w.value) == null ? void 0 : z.profile.address.coordinates) == null ? void 0 : O[1],
|
|
2623
|
+
lon: (P = (E = (I = i.currentRestaurant) == null ? void 0 : I.value) == null ? void 0 : E.profile.address.coordinates) == null ? void 0 : P[0]
|
|
2624
2624
|
},
|
|
2625
2625
|
!0
|
|
2626
2626
|
));
|
|
@@ -2650,11 +2650,11 @@ const ra = /* @__PURE__ */ le({
|
|
|
2650
2650
|
"onUpdate:modelValue": w[0] || (w[0] = (A) => A && r("update:form", "price", A))
|
|
2651
2651
|
}, {
|
|
2652
2652
|
append: N(() => [
|
|
2653
|
-
Xe(C(
|
|
2653
|
+
Xe(C(ai, {
|
|
2654
2654
|
"pure-styling": "",
|
|
2655
2655
|
onClick: v
|
|
2656
2656
|
}, null, 512), [
|
|
2657
|
-
[E, p(
|
|
2657
|
+
[E, p(Tn)("Suggest pricing")]
|
|
2658
2658
|
])
|
|
2659
2659
|
]),
|
|
2660
2660
|
_: 1
|
|
@@ -2790,12 +2790,12 @@ const ra = /* @__PURE__ */ le({
|
|
|
2790
2790
|
selectedVariants: {}
|
|
2791
2791
|
},
|
|
2792
2792
|
setup(e) {
|
|
2793
|
-
const
|
|
2793
|
+
const n = Ue(), { emitData: t, emitAction: i } = In(), a = me(), { t: o } = ce(), r = e, l = T(() => a.variants.map((h) => ({
|
|
2794
2794
|
label: h.name,
|
|
2795
2795
|
value: h._id,
|
|
2796
2796
|
disabled: !1
|
|
2797
2797
|
}))), s = q(ae(r.selectedVariants)), u = q(""), d = () => {
|
|
2798
|
-
t(s.value),
|
|
2798
|
+
t(s.value), i("primary"), n.close();
|
|
2799
2799
|
};
|
|
2800
2800
|
return (h, m) => {
|
|
2801
2801
|
const c = B("FmSearch"), y = B("FmCheckbox"), v = B("FmButton");
|
|
@@ -2828,7 +2828,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2828
2828
|
])
|
|
2829
2829
|
]),
|
|
2830
2830
|
D("div", Ca, [
|
|
2831
|
-
C(p(
|
|
2831
|
+
C(p(bn), null, {
|
|
2832
2832
|
default: N(({ trigger: g }) => [
|
|
2833
2833
|
p(a).rules.item.variant ? (F(), G(v, {
|
|
2834
2834
|
key: 0,
|
|
@@ -2844,7 +2844,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2844
2844
|
C(v, {
|
|
2845
2845
|
label: p(o)("menu.common.actions.cancel"),
|
|
2846
2846
|
variant: "tertiary",
|
|
2847
|
-
onClick: m[3] || (m[3] = (g) => p(
|
|
2847
|
+
onClick: m[3] || (m[3] = (g) => p(n).close())
|
|
2848
2848
|
}, null, 8, ["label"]),
|
|
2849
2849
|
C(v, {
|
|
2850
2850
|
label: p(o)("menu.common.actions.confirm"),
|
|
@@ -2857,7 +2857,7 @@ const ra = /* @__PURE__ */ le({
|
|
|
2857
2857
|
D("p", ka, se(p(o)("menu.common.empty.no_variant.title")), 1),
|
|
2858
2858
|
D("p", Ma, se(p(o)("menu.common.empty.no_variant.subtitle")), 1)
|
|
2859
2859
|
]),
|
|
2860
|
-
C(p(
|
|
2860
|
+
C(p(bn), null, {
|
|
2861
2861
|
default: N(({ trigger: g }) => [
|
|
2862
2862
|
C(v, {
|
|
2863
2863
|
label: p(o)("menu.variant.add"),
|
|
@@ -2871,14 +2871,14 @@ const ra = /* @__PURE__ */ le({
|
|
|
2871
2871
|
};
|
|
2872
2872
|
}
|
|
2873
2873
|
}), za = {}, Fa = { class: "overflow-x-auto" }, Ea = { class: "xs:w-[600px]" };
|
|
2874
|
-
function Ia(e,
|
|
2874
|
+
function Ia(e, n) {
|
|
2875
2875
|
return F(), Z("div", Fa, [
|
|
2876
2876
|
D("div", Ea, [
|
|
2877
2877
|
he(e.$slots, "default")
|
|
2878
2878
|
])
|
|
2879
2879
|
]);
|
|
2880
2880
|
}
|
|
2881
|
-
const
|
|
2881
|
+
const si = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
2882
2882
|
class: "space-y-16"
|
|
2883
2883
|
}, Da = {
|
|
2884
2884
|
class: "flex items-center space-x-8"
|
|
@@ -2901,13 +2901,13 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
2901
2901
|
},
|
|
2902
2902
|
emits: ["update:form", "replace:form"],
|
|
2903
2903
|
setup(e, {
|
|
2904
|
-
emit:
|
|
2904
|
+
emit: n
|
|
2905
2905
|
}) {
|
|
2906
|
-
const t = e,
|
|
2906
|
+
const t = e, i = me(), a = nn(), o = Le(), r = Ue(), {
|
|
2907
2907
|
t: l
|
|
2908
|
-
} = ce(), s = T(() =>
|
|
2908
|
+
} = ce(), s = T(() => i.rules.item), u = T(() => s.value.minPrice && !!t.form.minPrice), d = T(() => !i.state.currentCatalogId), h = T(() => i.variants.reduce((_, R) => (_[R._id] = R, _), {}));
|
|
2909
2909
|
q(!1);
|
|
2910
|
-
const m =
|
|
2910
|
+
const m = n;
|
|
2911
2911
|
function c(_) {
|
|
2912
2912
|
const R = Ne.clone(t.form);
|
|
2913
2913
|
for (const {
|
|
@@ -2917,7 +2917,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
2917
2917
|
R[f] = b;
|
|
2918
2918
|
m("replace:form", R);
|
|
2919
2919
|
}
|
|
2920
|
-
T(() =>
|
|
2920
|
+
T(() => i.variants.map((_) => ({
|
|
2921
2921
|
label: _.name,
|
|
2922
2922
|
value: _._id,
|
|
2923
2923
|
disabled: !1
|
|
@@ -2979,7 +2979,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
2979
2979
|
const f = _.filter((k) => !!k);
|
|
2980
2980
|
let b;
|
|
2981
2981
|
if (f.length) {
|
|
2982
|
-
const k = f.map((K) =>
|
|
2982
|
+
const k = f.map((K) => i.variants.find((Y) => Y._id === K)), S = ye.fullVariantCombination(k).map(({
|
|
2983
2983
|
combinationKey: K
|
|
2984
2984
|
}) => {
|
|
2985
2985
|
var J;
|
|
@@ -3044,7 +3044,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3044
3044
|
modelValue: R,
|
|
3045
3045
|
placeholder: x || l("menu.product.form.variant.placeholders.no_code"),
|
|
3046
3046
|
"onUpdate:modelValue": (K) => {
|
|
3047
|
-
I(_.row.index, "code",
|
|
3047
|
+
I(_.row.index, "code", ri(K));
|
|
3048
3048
|
}
|
|
3049
3049
|
});
|
|
3050
3050
|
}
|
|
@@ -3108,8 +3108,8 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3108
3108
|
minPrice: u.value
|
|
3109
3109
|
}));
|
|
3110
3110
|
function A(_) {
|
|
3111
|
-
return _ != null && _.length && _.length >
|
|
3112
|
-
max:
|
|
3111
|
+
return _ != null && _.length && _.length > i.rules.item.maxVariant ? l("menu.product.form.variant.validation.max_variants", {
|
|
3112
|
+
max: i.rules.item.maxVariant
|
|
3113
3113
|
}) : !0;
|
|
3114
3114
|
}
|
|
3115
3115
|
return (_, R) => {
|
|
@@ -3118,7 +3118,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3118
3118
|
title: p(l)("menu.product.form.variant.title"),
|
|
3119
3119
|
"sub-title": p(l)("menu.product.form.variant.subtitle")
|
|
3120
3120
|
}, {
|
|
3121
|
-
"append-title": N(() => [p(
|
|
3121
|
+
"append-title": N(() => [p(i).rules.item.variant ? (F(), G(f, {
|
|
3122
3122
|
key: 0,
|
|
3123
3123
|
label: p(l)("menu.product.form.variant.add"),
|
|
3124
3124
|
variant: "secondary",
|
|
@@ -3133,7 +3133,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3133
3133
|
}, {
|
|
3134
3134
|
default: N(() => {
|
|
3135
3135
|
var K;
|
|
3136
|
-
return [C(p(
|
|
3136
|
+
return [C(p(Un), {
|
|
3137
3137
|
"model-value": ((K = _.form.variant) == null ? void 0 : K.variantGroupIds) ?? [],
|
|
3138
3138
|
class: "space-y-16",
|
|
3139
3139
|
group: "variants",
|
|
@@ -3162,7 +3162,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3162
3162
|
}, 8, ["model-value"])];
|
|
3163
3163
|
}),
|
|
3164
3164
|
_: 1
|
|
3165
|
-
}, 8, ["model-value", "rules"]), C(
|
|
3165
|
+
}, 8, ["model-value", "rules"]), C(si, null, {
|
|
3166
3166
|
default: N(() => [z.value.length ? (F(), G(k, {
|
|
3167
3167
|
key: 0,
|
|
3168
3168
|
class: "w-full",
|
|
@@ -3183,34 +3183,34 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3183
3183
|
}), Va = /* @__PURE__ */ le({
|
|
3184
3184
|
__name: "AddForm",
|
|
3185
3185
|
setup(e) {
|
|
3186
|
-
const
|
|
3187
|
-
const s = !
|
|
3186
|
+
const n = me(), t = T(() => n.rules.group), i = T(() => !!n.state.currentCatalogId || !!n.state.currentSchedulerId), a = T(() => {
|
|
3187
|
+
const s = !n.state.currentSchedulerId, u = n.rules.group.type, d = n.version === L.F_MENU_VERSION.enum.v3, h = n.rules.item.orderFromActiveOnly, m = n.rules.item.bindToVariant;
|
|
3188
3188
|
return function(y) {
|
|
3189
3189
|
return {
|
|
3190
|
-
link: (v) => !
|
|
3191
|
-
name: (v) => !
|
|
3192
|
-
type: u && !y._id && !
|
|
3190
|
+
link: (v) => !i.value && (!v || m),
|
|
3191
|
+
name: (v) => !i.value && !v,
|
|
3192
|
+
type: u && !y._id && !i.value,
|
|
3193
3193
|
price: y.type !== L.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
3194
|
-
inventory: s ? d ? !
|
|
3195
|
-
orderFrom: (v) => s ? d ? y.type === L.F_ADDON_GROUP_TYPE.enum.DYNAMIC ?
|
|
3194
|
+
inventory: s ? d ? !i.value && y.type === L.F_ADDON_GROUP_TYPE.enum.NORMAL : !i.value : !1,
|
|
3195
|
+
orderFrom: (v) => s ? d ? y.type === L.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? i.value : !!i.value == !v : i.value : !1,
|
|
3196
3196
|
orderFromActiveOnly: h,
|
|
3197
|
-
showOrderFrom: s ? d ?
|
|
3197
|
+
showOrderFrom: s ? d ? i.value ? !0 : y.type === L.F_ADDON_GROUP_TYPE.enum.PRODUCT : i.value : !1,
|
|
3198
3198
|
bindToVariant: m,
|
|
3199
|
-
isOverride:
|
|
3199
|
+
isOverride: i.value,
|
|
3200
3200
|
isItemGroup: !1,
|
|
3201
3201
|
isV4: !d
|
|
3202
3202
|
};
|
|
3203
3203
|
};
|
|
3204
3204
|
}), o = () => ({
|
|
3205
3205
|
...ye.generator.initMenuV4Group(),
|
|
3206
|
-
type:
|
|
3206
|
+
type: n.version === L.F_MENU_VERSION.enum.v4 ? L.F_ADDON_GROUP_TYPE.enum.PRODUCT : L.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
3207
3207
|
items: {},
|
|
3208
|
-
position:
|
|
3208
|
+
position: n.groups.length - 1,
|
|
3209
3209
|
itemsLinked: []
|
|
3210
3210
|
}), r = q(o()), { t: l } = ce();
|
|
3211
3211
|
return (s, u) => t.value.create ? (F(), G(p(rr), {
|
|
3212
3212
|
key: 0,
|
|
3213
|
-
"categorized-items": p(
|
|
3213
|
+
"categorized-items": p(n).categorizedItems,
|
|
3214
3214
|
config: a.value,
|
|
3215
3215
|
group: r.value,
|
|
3216
3216
|
"onUpdate:group": u[0] || (u[0] = (d) => r.value = d),
|
|
@@ -3236,8 +3236,8 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3236
3236
|
allowRefund: { type: Boolean }
|
|
3237
3237
|
},
|
|
3238
3238
|
emits: ["update:inventory"],
|
|
3239
|
-
setup(e, { expose:
|
|
3240
|
-
const
|
|
3239
|
+
setup(e, { expose: n, emit: t }) {
|
|
3240
|
+
const i = e, a = q(!1), o = (m) => {
|
|
3241
3241
|
ut.isBoolean(m) ? a.value = m : a.value = !a.value;
|
|
3242
3242
|
}, r = q([]), l = t;
|
|
3243
3243
|
function s() {
|
|
@@ -3249,10 +3249,10 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3249
3249
|
Ce(
|
|
3250
3250
|
() => a.value,
|
|
3251
3251
|
(m) => {
|
|
3252
|
-
m && (r.value = ae(
|
|
3252
|
+
m && (r.value = ae(i.initialValue));
|
|
3253
3253
|
}
|
|
3254
|
-
),
|
|
3255
|
-
const { t: d } = ce(), h =
|
|
3254
|
+
), n({ getKey: () => i.bindingKey, trigger: o });
|
|
3255
|
+
const { t: d } = ce(), h = $n();
|
|
3256
3256
|
return Qe(() => {
|
|
3257
3257
|
h.readInventory();
|
|
3258
3258
|
}), (m, c) => {
|
|
@@ -3302,7 +3302,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3302
3302
|
variant: "outlined"
|
|
3303
3303
|
}, {
|
|
3304
3304
|
default: N(() => [
|
|
3305
|
-
C(p(
|
|
3305
|
+
C(p(Ti), {
|
|
3306
3306
|
modelValue: r.value,
|
|
3307
3307
|
"onUpdate:modelValue": c[0] || (c[0] = (z) => r.value = z)
|
|
3308
3308
|
}, null, 8, ["modelValue"])
|
|
@@ -3336,9 +3336,9 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3336
3336
|
},
|
|
3337
3337
|
emits: ["update:group", "update:unmap-group"],
|
|
3338
3338
|
setup(e, {
|
|
3339
|
-
emit:
|
|
3339
|
+
emit: n
|
|
3340
3340
|
}) {
|
|
3341
|
-
const t = e,
|
|
3341
|
+
const t = e, i = n, a = Xt(), o = me(), r = T(() => _e.Country.getCountry(a.currentCountry.value)), l = q(!1), s = T(() => t.config.isV4 || t.group.type === L.F_ADDON_GROUP_TYPE.enum.PRODUCT), u = T(() => Object.values(t.group.items).flatMap((M) => [{
|
|
3342
3342
|
_id: M._id,
|
|
3343
3343
|
combinationKey: void 0
|
|
3344
3344
|
}, ...(M.items ?? []).map((U) => ({
|
|
@@ -3347,7 +3347,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3347
3347
|
}))])), {
|
|
3348
3348
|
searchKey: d,
|
|
3349
3349
|
filter: h
|
|
3350
|
-
} =
|
|
3350
|
+
} = fi(), m = T(() => {
|
|
3351
3351
|
const M = Object.entries(t.group.items).filter(([, U]) => h([U.code || "", U.name || U.fallbackName, v(U.price ?? U.fallbackPrice), g(U.orderFrom || U.fallbackOrder), ...(U.items || []).map(($) => [$.code || "", $.name || $.fallbackName, v($.price ?? $.fallbackPrice), g($.orderFrom || $.fallbackOrder)].join(""))]));
|
|
3352
3352
|
return Object.fromEntries(M);
|
|
3353
3353
|
}), c = (M) => ({
|
|
@@ -3357,7 +3357,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3357
3357
|
orderFrom: t.config.orderFrom(M)
|
|
3358
3358
|
}), y = T(() => t.config.isItemGroup), v = (M) => M ? rt(M, !1) : "", g = (M) => {
|
|
3359
3359
|
var U;
|
|
3360
|
-
return M == null ? "" : (U =
|
|
3360
|
+
return M == null ? "" : (U = gi()[M]) == null ? void 0 : U.label;
|
|
3361
3361
|
}, w = T(() => Object.values(m.value)), z = q({}), {
|
|
3362
3362
|
t: O
|
|
3363
3363
|
} = ce(), I = q([{
|
|
@@ -3365,26 +3365,26 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3365
3365
|
header: () => O("menu.group.option.product_title"),
|
|
3366
3366
|
enableSorting: !1,
|
|
3367
3367
|
cell: (M) => {
|
|
3368
|
-
const U = M.getValue(), $ = M.row.original, Q = M.row.depth > 0, j = $.combinationKey ?
|
|
3368
|
+
const U = M.getValue(), $ = M.row.original, Q = M.row.depth > 0, j = $.combinationKey ? Ln($.combinationKey, me().variants) : null;
|
|
3369
3369
|
return ue("div", ue(ke.FmTextField, {
|
|
3370
3370
|
modelValue: U,
|
|
3371
3371
|
placeholder: j ?? "",
|
|
3372
3372
|
disabled: !c($.combinationKey).name,
|
|
3373
|
-
rules: j ? void 0 : [(
|
|
3374
|
-
"onUpdate:modelValue": (
|
|
3373
|
+
rules: j ? void 0 : [(ne) => ne.length > 0 || O("menu.group.option.product_title_required")],
|
|
3374
|
+
"onUpdate:modelValue": (ne) => {
|
|
3375
3375
|
var te;
|
|
3376
3376
|
if (Q) {
|
|
3377
3377
|
const we = (te = M.row.getParentRow()) == null ? void 0 : te.original;
|
|
3378
3378
|
if (!we) return;
|
|
3379
|
-
_(we._id, $.combinationKey ?? "", "name",
|
|
3379
|
+
_(we._id, $.combinationKey ?? "", "name", ne);
|
|
3380
3380
|
} else
|
|
3381
|
-
A($._id, "name",
|
|
3381
|
+
A($._id, "name", ne);
|
|
3382
3382
|
},
|
|
3383
3383
|
class: "min-w-[300px]"
|
|
3384
3384
|
}, {
|
|
3385
3385
|
append: () => {
|
|
3386
|
-
var
|
|
3387
|
-
return (te = (
|
|
3386
|
+
var ne, te;
|
|
3387
|
+
return (te = (ne = M.row.original) == null ? void 0 : ne.items) != null && te.length ? ue(ke.FmIcon, {
|
|
3388
3388
|
name: "keyboard_arrow_up",
|
|
3389
3389
|
onClick: M.row.getToggleExpandedHandler(),
|
|
3390
3390
|
class: ["cursor-pointer", "transition-transform", M.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
@@ -3410,7 +3410,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3410
3410
|
required: !Q,
|
|
3411
3411
|
nullable: !!Q,
|
|
3412
3412
|
min: y ? void 0 : 0,
|
|
3413
|
-
"onUpdate:modelValue": (
|
|
3413
|
+
"onUpdate:modelValue": (ne) => {
|
|
3414
3414
|
var te;
|
|
3415
3415
|
if (j) {
|
|
3416
3416
|
const we = (te = M.row.getParentRow()) == null ? void 0 : te.original;
|
|
@@ -3420,10 +3420,10 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3420
3420
|
$.combinationKey ?? "",
|
|
3421
3421
|
// @ts-ignore
|
|
3422
3422
|
"price",
|
|
3423
|
-
|
|
3423
|
+
ne
|
|
3424
3424
|
);
|
|
3425
3425
|
} else
|
|
3426
|
-
A($._id, "price",
|
|
3426
|
+
A($._id, "price", ne);
|
|
3427
3427
|
},
|
|
3428
3428
|
showCurrency: !1,
|
|
3429
3429
|
class: "min-w-[88px]"
|
|
@@ -3441,7 +3441,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3441
3441
|
disable: !c($.combinationKey).orderFrom,
|
|
3442
3442
|
required: !0,
|
|
3443
3443
|
editActiveOnly: c($.combinationKey).orderFromActiveOnly,
|
|
3444
|
-
"onUpdate:modelValue": (
|
|
3444
|
+
"onUpdate:modelValue": (ne) => {
|
|
3445
3445
|
var te;
|
|
3446
3446
|
if (j) {
|
|
3447
3447
|
const we = (te = M.row.getParentRow()) == null ? void 0 : te.original;
|
|
@@ -3451,10 +3451,10 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3451
3451
|
$.combinationKey ?? "",
|
|
3452
3452
|
// @ts-ignore
|
|
3453
3453
|
"orderFrom",
|
|
3454
|
-
|
|
3454
|
+
ne
|
|
3455
3455
|
);
|
|
3456
3456
|
} else
|
|
3457
|
-
A($._id, "orderFrom",
|
|
3457
|
+
A($._id, "orderFrom", ne);
|
|
3458
3458
|
},
|
|
3459
3459
|
label: "",
|
|
3460
3460
|
menuZIndex: 101
|
|
@@ -3480,10 +3480,10 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3480
3480
|
"onUpdate:inventory": (Q) => {
|
|
3481
3481
|
var j;
|
|
3482
3482
|
if ($) {
|
|
3483
|
-
const
|
|
3484
|
-
if (!
|
|
3483
|
+
const ne = (j = M.row.getParentRow()) == null ? void 0 : j.original;
|
|
3484
|
+
if (!ne) return;
|
|
3485
3485
|
_(
|
|
3486
|
-
|
|
3486
|
+
ne._id,
|
|
3487
3487
|
U.combinationKey ?? "",
|
|
3488
3488
|
// @ts-ignore
|
|
3489
3489
|
"inventoryBindings",
|
|
@@ -3533,7 +3533,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3533
3533
|
}));
|
|
3534
3534
|
async function P() {
|
|
3535
3535
|
const M = (/* @__PURE__ */ new Date()).toISOString();
|
|
3536
|
-
|
|
3536
|
+
i("update:group", {
|
|
3537
3537
|
...t.group,
|
|
3538
3538
|
items: {
|
|
3539
3539
|
...t.group.items,
|
|
@@ -3555,7 +3555,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3555
3555
|
const j = {
|
|
3556
3556
|
...Q
|
|
3557
3557
|
};
|
|
3558
|
-
U === "price" ? j[U] = !$ && !Q.fallbackPrice ? _e.Dinero.zero().toObject() : $ : j[U] = $,
|
|
3558
|
+
U === "price" ? j[U] = !$ && !Q.fallbackPrice ? _e.Dinero.zero().toObject() : $ : j[U] = $, i("update:group", {
|
|
3559
3559
|
...t.group,
|
|
3560
3560
|
items: {
|
|
3561
3561
|
...t.group.items,
|
|
@@ -3565,33 +3565,33 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3565
3565
|
}
|
|
3566
3566
|
function _(M, U, $, Q) {
|
|
3567
3567
|
var we, ct;
|
|
3568
|
-
const j = ae(t.group),
|
|
3569
|
-
if (!ut.isSet(
|
|
3570
|
-
let te = (ct = j.items[M].items) == null ? void 0 : ct[
|
|
3568
|
+
const j = ae(t.group), ne = (we = j.items[M].items) == null ? void 0 : we.findIndex((dt) => dt.combinationKey === U);
|
|
3569
|
+
if (!ut.isSet(ne)) return;
|
|
3570
|
+
let te = (ct = j.items[M].items) == null ? void 0 : ct[ne];
|
|
3571
3571
|
te && (te = {
|
|
3572
3572
|
...te,
|
|
3573
3573
|
[$]: Q
|
|
3574
|
-
}, j.items[M].items[
|
|
3574
|
+
}, j.items[M].items[ne] = te, i("update:group", j));
|
|
3575
3575
|
}
|
|
3576
3576
|
function R(M) {
|
|
3577
3577
|
const U = ae(t.group);
|
|
3578
|
-
delete U.items[M],
|
|
3578
|
+
delete U.items[M], i("update:group", U);
|
|
3579
3579
|
}
|
|
3580
3580
|
function f(M, U) {
|
|
3581
3581
|
const $ = ae(t.group), Q = $.items[M];
|
|
3582
|
-
Q && (Q.items = (Q.items || []).filter((j) => j.combinationKey !== U), $.items[M] = Q,
|
|
3582
|
+
Q && (Q.items = (Q.items || []).filter((j) => j.combinationKey !== U), $.items[M] = Q, i("update:group", $));
|
|
3583
3583
|
}
|
|
3584
3584
|
const b = T(() => t.categorizedItems.flatMap((M) => M.items).reduce((M, U) => {
|
|
3585
3585
|
var $;
|
|
3586
3586
|
return M[U._id] = {
|
|
3587
3587
|
price: U.price,
|
|
3588
|
-
variants:
|
|
3588
|
+
variants: vi((($ = U.variant) == null ? void 0 : $.variantCombinations) || [], "combinationKey")
|
|
3589
3589
|
}, M;
|
|
3590
3590
|
}, {})), x = (M) => {
|
|
3591
|
-
var j,
|
|
3591
|
+
var j, ne;
|
|
3592
3592
|
const $ = o.state.menu.modules.item.find((te) => te._id === M._id), Q = M.combinationKey ? {
|
|
3593
3593
|
...(j = $ == null ? void 0 : $.variant) == null ? void 0 : j.variantCombinations.find((te) => te.combinationKey === M.combinationKey),
|
|
3594
|
-
name:
|
|
3594
|
+
name: En(me().variants, ((ne = $ == null ? void 0 : $.variant) == null ? void 0 : ne.variantGroupIds) || [])[M.combinationKey]
|
|
3595
3595
|
} : $;
|
|
3596
3596
|
return Q == null ? void 0 : Q.name;
|
|
3597
3597
|
}, k = async (M) => {
|
|
@@ -3599,7 +3599,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3599
3599
|
U = {
|
|
3600
3600
|
...U,
|
|
3601
3601
|
items: M.map(($) => {
|
|
3602
|
-
const Q = U.items.find((
|
|
3602
|
+
const Q = U.items.find((ne) => ne._id == $._id && ne.combinationKey == $.combinationKey), j = b.value[$._id];
|
|
3603
3603
|
return Q || {
|
|
3604
3604
|
...$,
|
|
3605
3605
|
name: x($),
|
|
@@ -3607,16 +3607,16 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3607
3607
|
orderFrom: L.F_ORDER_FROM.enum.ALL
|
|
3608
3608
|
};
|
|
3609
3609
|
})
|
|
3610
|
-
},
|
|
3610
|
+
}, i("update:unmap-group", U);
|
|
3611
3611
|
}, S = (M) => M.items;
|
|
3612
3612
|
function K(M) {
|
|
3613
3613
|
const U = ae(t.group);
|
|
3614
3614
|
U.items = M.reduce(($, Q) => ({
|
|
3615
3615
|
...$,
|
|
3616
3616
|
[Q._id]: Q
|
|
3617
|
-
}), {}),
|
|
3617
|
+
}), {}), i("update:group", U);
|
|
3618
3618
|
}
|
|
3619
|
-
const Y =
|
|
3619
|
+
const Y = Pn(), J = T(() => Y.breakpoints.value.xs);
|
|
3620
3620
|
return (M, U) => {
|
|
3621
3621
|
const $ = B("fm-button"), Q = B("fm-table");
|
|
3622
3622
|
return F(), G(Ge, {
|
|
@@ -3624,7 +3624,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3624
3624
|
}, {
|
|
3625
3625
|
"append-title": N(() => [M.config.link() ? (F(), Z(Re, {
|
|
3626
3626
|
key: 0
|
|
3627
|
-
}, [s.value ? (F(), Z("div", Ga, [C(
|
|
3627
|
+
}, [s.value ? (F(), Z("div", Ga, [C(Di, {
|
|
3628
3628
|
"categorized-items": M.categorizedItems,
|
|
3629
3629
|
"initial-value": u.value,
|
|
3630
3630
|
"show-variant": M.config.bindToVariant,
|
|
@@ -3671,7 +3671,7 @@ const sn = /* @__PURE__ */ lt(za, [["render", Ia]]), Pa = {
|
|
|
3671
3671
|
};
|
|
3672
3672
|
}
|
|
3673
3673
|
}), Xa = {}, qa = { class: "flex gap-16" };
|
|
3674
|
-
function Za(e,
|
|
3674
|
+
function Za(e, n) {
|
|
3675
3675
|
return F(), Z("div", qa, [
|
|
3676
3676
|
he(e.$slots, "default")
|
|
3677
3677
|
]);
|
|
@@ -3679,7 +3679,7 @@ function Za(e, i) {
|
|
|
3679
3679
|
const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-title-md-600" }, er = {
|
|
3680
3680
|
key: 0,
|
|
3681
3681
|
class: "pt-8 space-y-32"
|
|
3682
|
-
}, tr = { class: "flex gap-8 items-center justify-start" },
|
|
3682
|
+
}, tr = { class: "flex gap-8 items-center justify-start" }, li = /* @__PURE__ */ le({
|
|
3683
3683
|
__name: "Form",
|
|
3684
3684
|
props: {
|
|
3685
3685
|
title: {},
|
|
@@ -3690,11 +3690,11 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3690
3690
|
allowRefundInventory: { type: Boolean }
|
|
3691
3691
|
},
|
|
3692
3692
|
emits: ["update:group", "submit:group", "status:show"],
|
|
3693
|
-
setup(e, { expose:
|
|
3694
|
-
let
|
|
3693
|
+
setup(e, { expose: n, emit: t }) {
|
|
3694
|
+
let i = e;
|
|
3695
3695
|
const a = t, o = me(), r = Ue(), l = He(Ye(Le())), s = q(!1), u = q(!1), d = (I) => {
|
|
3696
3696
|
ut.isBoolean(I) ? u.value = I : u.value = !u.value;
|
|
3697
|
-
}, h = T(() =>
|
|
3697
|
+
}, h = T(() => i.config(i.group)), m = T(() => [
|
|
3698
3698
|
{
|
|
3699
3699
|
label: "Normal",
|
|
3700
3700
|
value: L.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -3714,12 +3714,12 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3714
3714
|
function y(I) {
|
|
3715
3715
|
function E() {
|
|
3716
3716
|
c({
|
|
3717
|
-
...
|
|
3717
|
+
...i.group,
|
|
3718
3718
|
items: {},
|
|
3719
3719
|
type: I
|
|
3720
3720
|
});
|
|
3721
3721
|
}
|
|
3722
|
-
Object.keys(
|
|
3722
|
+
Object.keys(i.group.items).length > 0 ? r.open({
|
|
3723
3723
|
title: "Change addon group type",
|
|
3724
3724
|
message: "Change addon group type will clear all products. Are you sure to proceed?",
|
|
3725
3725
|
primaryActions: {
|
|
@@ -3733,20 +3733,20 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3733
3733
|
}).onPrimary(E) : E();
|
|
3734
3734
|
}
|
|
3735
3735
|
function v(I) {
|
|
3736
|
-
return new
|
|
3736
|
+
return new Nn(o, l.updateMenu, r).mapGroups(
|
|
3737
3737
|
[I],
|
|
3738
3738
|
h.value.isOverride
|
|
3739
3739
|
)[0];
|
|
3740
3740
|
}
|
|
3741
|
-
const g = q(Ne.clone(
|
|
3742
|
-
() => !Ne.isEqual(
|
|
3741
|
+
const g = q(Ne.clone(i.group)), w = Ii(
|
|
3742
|
+
() => !Ne.isEqual(i.group, g.value),
|
|
3743
3743
|
() => {
|
|
3744
3744
|
u.value = !1;
|
|
3745
3745
|
}
|
|
3746
3746
|
);
|
|
3747
3747
|
async function z() {
|
|
3748
|
-
if (
|
|
3749
|
-
const { group: I, linkItems: E } =
|
|
3748
|
+
if (i.action === "add") {
|
|
3749
|
+
const { group: I, linkItems: E } = Vn(i.group), P = {
|
|
3750
3750
|
module: L.F_MENU_MODULE_V4_KEY.enum.group,
|
|
3751
3751
|
operation: be.F_OPERATION_TYPE.create,
|
|
3752
3752
|
data: I,
|
|
@@ -3758,16 +3758,16 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3758
3758
|
}
|
|
3759
3759
|
]
|
|
3760
3760
|
};
|
|
3761
|
-
await l.updateMenu(P, I.name), a("submit:group",
|
|
3762
|
-
} else
|
|
3761
|
+
await l.updateMenu(P, I.name), a("submit:group", i.group);
|
|
3762
|
+
} else i.action === "update" && a("submit:group", i.group);
|
|
3763
3763
|
d(!1);
|
|
3764
3764
|
}
|
|
3765
3765
|
Ce(
|
|
3766
3766
|
() => u.value,
|
|
3767
3767
|
(I) => {
|
|
3768
|
-
a("status:show", I), I && (g.value = Ne.clone(
|
|
3768
|
+
a("status:show", I), I && (g.value = Ne.clone(i.group));
|
|
3769
3769
|
}
|
|
3770
|
-
),
|
|
3770
|
+
), n({
|
|
3771
3771
|
trigger: d,
|
|
3772
3772
|
show: u
|
|
3773
3773
|
});
|
|
@@ -3794,7 +3794,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3794
3794
|
"side-sheet-footer": N(() => [
|
|
3795
3795
|
D("div", tr, [
|
|
3796
3796
|
C(x, {
|
|
3797
|
-
label: p($
|
|
3797
|
+
label: p($i)(I.action),
|
|
3798
3798
|
loading: s.value,
|
|
3799
3799
|
size: "lg",
|
|
3800
3800
|
type: "submit",
|
|
@@ -3811,7 +3811,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3811
3811
|
default: N(() => [
|
|
3812
3812
|
I.group ? (F(), Z("div", er, [
|
|
3813
3813
|
he(I.$slots, "variant-section"),
|
|
3814
|
-
C(
|
|
3814
|
+
C(Fi, null, {
|
|
3815
3815
|
default: N(() => [
|
|
3816
3816
|
D("div", null, [
|
|
3817
3817
|
C(P, {
|
|
@@ -3909,7 +3909,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3909
3909
|
], 64);
|
|
3910
3910
|
};
|
|
3911
3911
|
}
|
|
3912
|
-
}),
|
|
3912
|
+
}), nr = { class: "fm-typo-en-title-sm-600" }, ir = { class: "flex items-end space-x-24" }, or = { class: "flex" }, ar = /* @__PURE__ */ le({
|
|
3913
3913
|
__name: "UpdateForm",
|
|
3914
3914
|
props: {
|
|
3915
3915
|
combinations: {},
|
|
@@ -3917,23 +3917,23 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3917
3917
|
fullCombinations: {}
|
|
3918
3918
|
},
|
|
3919
3919
|
emits: ["update:combinations"],
|
|
3920
|
-
setup(e, { expose:
|
|
3920
|
+
setup(e, { expose: n, emit: t }) {
|
|
3921
3921
|
var I, E;
|
|
3922
|
-
const
|
|
3922
|
+
const i = e, a = t, o = me(), r = Ue(), l = He(Ye(Le())), s = q([]), u = q(i.combinations[0].combinationKey || ""), d = T(
|
|
3923
3923
|
() => s.value.findIndex((P) => P.combinationKey == u.value)
|
|
3924
3924
|
), h = T(
|
|
3925
|
-
() =>
|
|
3926
|
-
label:
|
|
3925
|
+
() => i.combinations.map((P) => ({
|
|
3926
|
+
label: i.fullCombinations[P.combinationKey || ""],
|
|
3927
3927
|
value: P.combinationKey || ""
|
|
3928
3928
|
}))
|
|
3929
3929
|
), m = T(() => {
|
|
3930
3930
|
var b, x;
|
|
3931
3931
|
const P = ((x = (b = s.value[d.value]) == null ? void 0 : b.groups) == null ? void 0 : x.find(
|
|
3932
|
-
(k) => k._id ===
|
|
3932
|
+
(k) => k._id === i.groupId
|
|
3933
3933
|
)) || {
|
|
3934
|
-
_id:
|
|
3934
|
+
_id: i.groupId,
|
|
3935
3935
|
groupKey: ""
|
|
3936
|
-
}, _ = o.state.menu.modules.group.find((k) => k._id ===
|
|
3936
|
+
}, _ = o.state.menu.modules.group.find((k) => k._id === i.groupId), R = Object.entries({ ...P, items: void 0 }).filter(([, k]) => !!k), f = {
|
|
3937
3937
|
..._,
|
|
3938
3938
|
...Object.fromEntries(R),
|
|
3939
3939
|
items: _.items.map((k) => {
|
|
@@ -3949,13 +3949,13 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3949
3949
|
};
|
|
3950
3950
|
})
|
|
3951
3951
|
};
|
|
3952
|
-
return new
|
|
3952
|
+
return new Nn(o, l.updateMenu, r).mapGroups([f], !0)[0];
|
|
3953
3953
|
});
|
|
3954
3954
|
function c(P) {
|
|
3955
3955
|
var f, b;
|
|
3956
3956
|
const A = (f = s.value[d.value].groups) == null ? void 0 : f.findIndex(
|
|
3957
|
-
(x) => x._id ===
|
|
3958
|
-
), _ = ae(s.value), R = { ...qt(P), _id:
|
|
3957
|
+
(x) => x._id === i.groupId
|
|
3958
|
+
), _ = ae(s.value), R = { ...qt(P), _id: i.groupId, groupKey: "" };
|
|
3959
3959
|
(A ?? -1) < 0 ? _[d.value] = {
|
|
3960
3960
|
..._[d.value],
|
|
3961
3961
|
groups: [...((b = _[d.value]) == null ? void 0 : b.groups) || [], R]
|
|
@@ -3989,18 +3989,18 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
3989
3989
|
Ce(
|
|
3990
3990
|
() => w.value,
|
|
3991
3991
|
(P) => {
|
|
3992
|
-
P && (s.value = ae(
|
|
3992
|
+
P && (s.value = ae(i.combinations), u.value = i.combinations[0].combinationKey || "");
|
|
3993
3993
|
}
|
|
3994
3994
|
);
|
|
3995
3995
|
const z = q();
|
|
3996
|
-
|
|
3996
|
+
n({
|
|
3997
3997
|
show: (I = z.value) == null ? void 0 : I.show,
|
|
3998
3998
|
trigger: (E = z.value) == null ? void 0 : E.trigger
|
|
3999
3999
|
});
|
|
4000
4000
|
const { t: O } = ce();
|
|
4001
4001
|
return (P, A) => {
|
|
4002
4002
|
const _ = B("fm-select"), R = B("fm-button"), f = B("fm-card");
|
|
4003
|
-
return F(), G(
|
|
4003
|
+
return F(), G(li, {
|
|
4004
4004
|
ref_key: "sheet",
|
|
4005
4005
|
ref: z,
|
|
4006
4006
|
"allow-refund-inventory": !0,
|
|
@@ -4023,8 +4023,8 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4023
4023
|
variant: "outlined"
|
|
4024
4024
|
}, {
|
|
4025
4025
|
default: N(() => [
|
|
4026
|
-
D("p",
|
|
4027
|
-
D("div",
|
|
4026
|
+
D("p", nr, se(p(O)("menu.group.option.variant")), 1),
|
|
4027
|
+
D("div", ir, [
|
|
4028
4028
|
C(_, {
|
|
4029
4029
|
modelValue: u.value,
|
|
4030
4030
|
"onUpdate:modelValue": A[0] || (A[0] = (b) => u.value = b),
|
|
@@ -4055,7 +4055,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4055
4055
|
}, 8, ["categorized-items", "group", "title"]);
|
|
4056
4056
|
};
|
|
4057
4057
|
}
|
|
4058
|
-
}), rr =
|
|
4058
|
+
}), rr = li, On = Va, sr = ar, lr = {
|
|
4059
4059
|
key: 0,
|
|
4060
4060
|
class: "flex flex-col space-y-16 h-[440px]"
|
|
4061
4061
|
}, ur = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, cr = { class: "flex justify-between pb-16" }, dr = { class: "flex gap-8" }, mr = {
|
|
@@ -4067,7 +4067,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4067
4067
|
groupIds: {}
|
|
4068
4068
|
},
|
|
4069
4069
|
setup(e) {
|
|
4070
|
-
const
|
|
4070
|
+
const n = e, t = Ue(), { emitData: i, emitAction: a } = In(), o = me(), r = T(() => o.rules.group), l = T(() => o.groups);
|
|
4071
4071
|
function s(z) {
|
|
4072
4072
|
return ae(z ?? []).sort((I, E) => I.position - E.position);
|
|
4073
4073
|
}
|
|
@@ -4103,8 +4103,8 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4103
4103
|
items: {},
|
|
4104
4104
|
position: o.groups.length - 1,
|
|
4105
4105
|
itemsLinked: []
|
|
4106
|
-
})), y = q(ae(
|
|
4107
|
-
|
|
4106
|
+
})), y = q(ae(n.groupIds || [])), v = q(""), { t: g } = ce(), w = () => {
|
|
4107
|
+
i(y.value), a("primary"), t.close();
|
|
4108
4108
|
};
|
|
4109
4109
|
return (z, O) => {
|
|
4110
4110
|
const I = B("FmSearch"), E = B("FmCheckbox"), P = B("FmButton");
|
|
@@ -4126,7 +4126,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4126
4126
|
modelValue: y.value,
|
|
4127
4127
|
"onUpdate:modelValue": [
|
|
4128
4128
|
O[1] || (O[1] = (_) => y.value = _),
|
|
4129
|
-
O[2] || (O[2] = (_) => p(
|
|
4129
|
+
O[2] || (O[2] = (_) => p(i)(y.value))
|
|
4130
4130
|
],
|
|
4131
4131
|
label: A.label,
|
|
4132
4132
|
value: A.value
|
|
@@ -4137,7 +4137,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4137
4137
|
])
|
|
4138
4138
|
]),
|
|
4139
4139
|
D("div", cr, [
|
|
4140
|
-
C(p(
|
|
4140
|
+
C(p(On), null, {
|
|
4141
4141
|
default: N(({ trigger: A }) => [
|
|
4142
4142
|
C(P, {
|
|
4143
4143
|
label: p(g)("menu.common.actions.add_group"),
|
|
@@ -4165,7 +4165,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4165
4165
|
D("p", pr, se(p(g)("menu.common.empty.no_group.title")), 1),
|
|
4166
4166
|
D("p", fr, se(p(g)("menu.common.empty.no_group.subtitle")), 1)
|
|
4167
4167
|
]),
|
|
4168
|
-
C(p(
|
|
4168
|
+
C(p(On), {
|
|
4169
4169
|
"categorized-items": p(o).categorizedItems,
|
|
4170
4170
|
config: m.value,
|
|
4171
4171
|
group: c.value,
|
|
@@ -4199,14 +4199,14 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4199
4199
|
},
|
|
4200
4200
|
emits: ["update:form", "replace:form"],
|
|
4201
4201
|
setup(e, {
|
|
4202
|
-
emit:
|
|
4202
|
+
emit: n
|
|
4203
4203
|
}) {
|
|
4204
|
-
const t = e,
|
|
4204
|
+
const t = e, i = me(), a = nn(), o = Ue(), {
|
|
4205
4205
|
t: r
|
|
4206
|
-
} = ce(), l =
|
|
4206
|
+
} = ce(), l = n, s = T(() => i.rules.group), u = T(() => i.rules.item), d = T(() => i.groups);
|
|
4207
4207
|
q(!1);
|
|
4208
4208
|
function h(f, b) {
|
|
4209
|
-
return ae(b
|
|
4209
|
+
return ae(b).map((k) => {
|
|
4210
4210
|
const S = f.find((K) => K._id === k._id);
|
|
4211
4211
|
return {
|
|
4212
4212
|
name: (S == null ? void 0 : S.name) ?? "",
|
|
@@ -4224,7 +4224,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4224
4224
|
}
|
|
4225
4225
|
const y = T(() => c(d.value).reduce((f, b) => (f[b._id] = {
|
|
4226
4226
|
name: b.name,
|
|
4227
|
-
type: Ct(
|
|
4227
|
+
type: Ct(i.items, b.items)
|
|
4228
4228
|
}, f), {})), v = T(() => [...Object.entries(y.value).map(([f, {
|
|
4229
4229
|
name: b,
|
|
4230
4230
|
type: x
|
|
@@ -4346,14 +4346,14 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4346
4346
|
}
|
|
4347
4347
|
Ce(() => d.value.length, () => z([...m.value, d.value[d.value.length - 1]._id])), T(() => ({
|
|
4348
4348
|
...ye.generator.initMenuV4Group(),
|
|
4349
|
-
type:
|
|
4349
|
+
type: i.version === L.F_MENU_VERSION.enum.v4 ? L.F_ADDON_GROUP_TYPE.enum.PRODUCT : L.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
4350
4350
|
items: {},
|
|
4351
|
-
position:
|
|
4351
|
+
position: i.groups.length - 1,
|
|
4352
4352
|
itemsLinked: []
|
|
4353
4353
|
}));
|
|
4354
|
-
const A = T(() => !!
|
|
4354
|
+
const A = T(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId);
|
|
4355
4355
|
T(() => {
|
|
4356
|
-
const f = !
|
|
4356
|
+
const f = !i.state.currentSchedulerId, b = i.rules.group.type, x = i.version == L.F_MENU_VERSION.enum.v3, k = i.rules.item.orderFromActiveOnly, S = i.rules.item.bindToVariant;
|
|
4357
4357
|
return function(Y) {
|
|
4358
4358
|
return {
|
|
4359
4359
|
link: (J) => !A.value && (!J || S),
|
|
@@ -4394,7 +4394,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4394
4394
|
variant: "secondary",
|
|
4395
4395
|
onClick: w
|
|
4396
4396
|
}, null, 8, ["label"])]),
|
|
4397
|
-
default: N(() => [C(
|
|
4397
|
+
default: N(() => [C(si, null, {
|
|
4398
4398
|
default: N(() => {
|
|
4399
4399
|
var S;
|
|
4400
4400
|
return [((S = m.value) == null ? void 0 : S.length) > 0 ? (F(), G(k, {
|
|
@@ -4433,32 +4433,32 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4433
4433
|
},
|
|
4434
4434
|
emits: ["update:form", "replace:form"],
|
|
4435
4435
|
setup(e, {
|
|
4436
|
-
emit:
|
|
4436
|
+
emit: n
|
|
4437
4437
|
}) {
|
|
4438
4438
|
const {
|
|
4439
4439
|
t
|
|
4440
|
-
} = ce(),
|
|
4440
|
+
} = ce(), i = e, a = n, o = me(), r = T(() => o.rules.item), l = T(() => r.value.inventory);
|
|
4441
4441
|
function s(v, g, w, z) {
|
|
4442
|
-
return !g || g
|
|
4442
|
+
return !g || g.length === 0 ? [{
|
|
4443
4443
|
_id: "",
|
|
4444
4444
|
name: w,
|
|
4445
4445
|
binding: v || []
|
|
4446
4446
|
}] : g.map((O) => ({
|
|
4447
4447
|
_id: O.combinationKey || "",
|
|
4448
|
-
name:
|
|
4448
|
+
name: Ln(O.combinationKey || "", z),
|
|
4449
4449
|
binding: O.inventoryBindings || []
|
|
4450
4450
|
}));
|
|
4451
4451
|
}
|
|
4452
4452
|
const u = T(() => {
|
|
4453
4453
|
var v;
|
|
4454
|
-
return
|
|
4454
|
+
return i.form.name || ((v = i.fallback) == null ? void 0 : v.name) || "";
|
|
4455
4455
|
}), d = T(() => {
|
|
4456
4456
|
var v;
|
|
4457
|
-
return s(
|
|
4457
|
+
return s(i.form.inventoryBindings || [], ((v = i.form.variant) == null ? void 0 : v.variantCombinations) || [], u.value, o.variants);
|
|
4458
4458
|
});
|
|
4459
4459
|
function h(v, g) {
|
|
4460
4460
|
var I, E;
|
|
4461
|
-
let w = Ne.clone(
|
|
4461
|
+
let w = Ne.clone(i.form);
|
|
4462
4462
|
const z = w.variant;
|
|
4463
4463
|
if ((((I = z == null ? void 0 : z.variantCombinations) == null ? void 0 : I.length) ?? 0) > 0 && z) {
|
|
4464
4464
|
const P = z.variantCombinations.findIndex((_) => _.combinationKey === v);
|
|
@@ -4538,7 +4538,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4538
4538
|
for (const g of m.value)
|
|
4539
4539
|
g.getKey() === v && g.trigger(!0);
|
|
4540
4540
|
}
|
|
4541
|
-
const y =
|
|
4541
|
+
const y = $n();
|
|
4542
4542
|
return Qe(() => {
|
|
4543
4543
|
y.readInventory();
|
|
4544
4544
|
}), (v, g) => (F(), G(Ge, {
|
|
@@ -4558,7 +4558,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4558
4558
|
"onUpdate:inventory": (z) => {
|
|
4559
4559
|
h(w._id, z);
|
|
4560
4560
|
}
|
|
4561
|
-
}, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 256)), C(p(
|
|
4561
|
+
}, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 256)), C(p(Ui), {
|
|
4562
4562
|
"row-data": d.value,
|
|
4563
4563
|
onRowClick: c
|
|
4564
4564
|
}, null, 8, ["row-data"])])])]),
|
|
@@ -4580,11 +4580,11 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4580
4580
|
},
|
|
4581
4581
|
emits: ["update:form", "replace:form"],
|
|
4582
4582
|
setup(e, {
|
|
4583
|
-
emit:
|
|
4583
|
+
emit: n
|
|
4584
4584
|
}) {
|
|
4585
|
-
const t = e,
|
|
4585
|
+
const t = e, i = me(), a = T(() => i.rules.item), o = He(Ye(Le())), {
|
|
4586
4586
|
t: r
|
|
4587
|
-
} = ce(), l =
|
|
4587
|
+
} = ce(), l = n, s = T(() => {
|
|
4588
4588
|
var y, v;
|
|
4589
4589
|
return !!((v = (y = t.form.variant) == null ? void 0 : y.variantCombinations) != null && v.length);
|
|
4590
4590
|
}), u = T(() => {
|
|
@@ -4616,7 +4616,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4616
4616
|
} : {
|
|
4617
4617
|
label: r("menu.product.form.takeaway.options.no_preset"),
|
|
4618
4618
|
value: null
|
|
4619
|
-
}, ...
|
|
4619
|
+
}, ...i.takeaways.map((y) => ({
|
|
4620
4620
|
label: y.name,
|
|
4621
4621
|
value: y._id
|
|
4622
4622
|
}))]), c = q([{
|
|
@@ -4629,10 +4629,10 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4629
4629
|
header: () => r("menu.product.form.takeaway.columns.takeaway"),
|
|
4630
4630
|
cell: (y) => {
|
|
4631
4631
|
const v = y.getValue(), g = y.row.original;
|
|
4632
|
-
return ue(
|
|
4632
|
+
return ue(Ei, {
|
|
4633
4633
|
action: "add",
|
|
4634
4634
|
applyProduct: !1,
|
|
4635
|
-
bindToVariant:
|
|
4635
|
+
bindToVariant: i.rules.item.bindToVariant,
|
|
4636
4636
|
"onUpdate:takeaway": async (w) => {
|
|
4637
4637
|
await o.updateMenu({
|
|
4638
4638
|
module: L.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
@@ -4653,7 +4653,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4653
4653
|
g.onUpdate(z || "");
|
|
4654
4654
|
}
|
|
4655
4655
|
}, {
|
|
4656
|
-
"append-menu": () =>
|
|
4656
|
+
"append-menu": () => i.rules.takeaway.create ? ue("button", {
|
|
4657
4657
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
4658
4658
|
type: "button",
|
|
4659
4659
|
onClick: w
|
|
@@ -4691,10 +4691,10 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4691
4691
|
applyProduct: { type: Boolean }
|
|
4692
4692
|
},
|
|
4693
4693
|
setup(e) {
|
|
4694
|
-
const { t:
|
|
4695
|
-
() => t.initialValue ?
|
|
4694
|
+
const { t: n } = ce(), t = e, i = He(Ye(Le())), a = T(
|
|
4695
|
+
() => t.initialValue ? n("menu.print_dept.update") : n("menu.print_dept.add")
|
|
4696
4696
|
), o = T(
|
|
4697
|
-
() => t.initialValue ?
|
|
4697
|
+
() => t.initialValue ? n("menu.common.actions.update") : n("menu.common.actions.add")
|
|
4698
4698
|
), r = q(
|
|
4699
4699
|
t.initialValue ? ae(t.initialValue) : { ...ye.generator.initMenuV4PrintDepartment(), usedBy: [] }
|
|
4700
4700
|
), l = q(!1), s = q(!1), u = (h) => {
|
|
@@ -4703,7 +4703,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4703
4703
|
async function d() {
|
|
4704
4704
|
var h, m;
|
|
4705
4705
|
try {
|
|
4706
|
-
l.value = !0, t.initialValue ? await
|
|
4706
|
+
l.value = !0, t.initialValue ? await i.updateMenu(
|
|
4707
4707
|
{
|
|
4708
4708
|
module: L.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
4709
4709
|
operation: be.F_OPERATION_TYPE.update,
|
|
@@ -4711,7 +4711,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4711
4711
|
link: $t(((h = r.value) == null ? void 0 : h.usedBy) || [])
|
|
4712
4712
|
},
|
|
4713
4713
|
r.value.name
|
|
4714
|
-
) : await
|
|
4714
|
+
) : await i.updateMenu(
|
|
4715
4715
|
{
|
|
4716
4716
|
module: L.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
4717
4717
|
operation: be.F_OPERATION_TYPE.create,
|
|
@@ -4761,7 +4761,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4761
4761
|
variant: "primary"
|
|
4762
4762
|
}, null, 8, ["label", "loading"]),
|
|
4763
4763
|
C(y, {
|
|
4764
|
-
label: p(
|
|
4764
|
+
label: p(n)("menu.common.actions.cancel"),
|
|
4765
4765
|
size: "lg",
|
|
4766
4766
|
variant: "tertiary",
|
|
4767
4767
|
onClick: m[2] || (m[2] = () => s.value = !1)
|
|
@@ -4774,19 +4774,19 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4774
4774
|
modelValue: r.value.name,
|
|
4775
4775
|
"onUpdate:modelValue": m[0] || (m[0] = (g) => r.value.name = g),
|
|
4776
4776
|
rules: [
|
|
4777
|
-
(g) => g ? !0 : p(
|
|
4778
|
-
field: p(
|
|
4777
|
+
(g) => g ? !0 : p(n)("menu.common.validation.required", {
|
|
4778
|
+
field: p(n)("menu.print_dept.columns.name").toLowerCase()
|
|
4779
4779
|
})
|
|
4780
4780
|
],
|
|
4781
4781
|
autofocus: "",
|
|
4782
|
-
label: p(
|
|
4782
|
+
label: p(n)("menu.print_dept.columns.name")
|
|
4783
4783
|
}, null, 8, ["modelValue", "rules", "label"]),
|
|
4784
|
-
h.applyProduct ? (F(), G(
|
|
4784
|
+
h.applyProduct ? (F(), G(Vi, {
|
|
4785
4785
|
key: 0,
|
|
4786
4786
|
overrides: r.value.usedBy || [],
|
|
4787
4787
|
"select-variant": !1,
|
|
4788
4788
|
editable: "",
|
|
4789
|
-
title: p(
|
|
4789
|
+
title: p(n)("menu.print_dept.columns.products"),
|
|
4790
4790
|
"onUpdate:overrides": m[1] || (m[1] = (g) => r.value.usedBy = g)
|
|
4791
4791
|
}, null, 8, ["overrides", "title"])) : ee("", !0)
|
|
4792
4792
|
])
|
|
@@ -4806,8 +4806,8 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4806
4806
|
fullCombinations: {}
|
|
4807
4807
|
},
|
|
4808
4808
|
emits: ["update:form", "replace:form"],
|
|
4809
|
-
setup(e, { emit:
|
|
4810
|
-
const t = e,
|
|
4809
|
+
setup(e, { emit: n }) {
|
|
4810
|
+
const t = e, i = me(), { t: a } = ce(), o = n;
|
|
4811
4811
|
function r() {
|
|
4812
4812
|
return {
|
|
4813
4813
|
...ye.generator.initMenuV4PrintSetting(),
|
|
@@ -4815,7 +4815,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4815
4815
|
toRoot: !1
|
|
4816
4816
|
};
|
|
4817
4817
|
}
|
|
4818
|
-
const l = T(() =>
|
|
4818
|
+
const l = T(() => i.rules.item), s = T(() => i.printDepartments), u = T(() => {
|
|
4819
4819
|
var w;
|
|
4820
4820
|
return ((w = t.form.print) == null ? void 0 : w.sequential) ?? !1;
|
|
4821
4821
|
}), d = T(() => {
|
|
@@ -4920,7 +4920,7 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4920
4920
|
label: p(a)("menu.product.form.print.routes.label")
|
|
4921
4921
|
}, {
|
|
4922
4922
|
default: N(() => [
|
|
4923
|
-
d.value.length ? (F(), G(p(
|
|
4923
|
+
d.value.length ? (F(), G(p(Un), {
|
|
4924
4924
|
key: 0,
|
|
4925
4925
|
"item-key": (R) => R,
|
|
4926
4926
|
"model-value": d.value,
|
|
@@ -4991,11 +4991,11 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
4991
4991
|
disabled: { type: Boolean }
|
|
4992
4992
|
},
|
|
4993
4993
|
emits: ["update:toggle"],
|
|
4994
|
-
setup(e, { emit:
|
|
4995
|
-
const t =
|
|
4996
|
-
return (
|
|
4994
|
+
setup(e, { emit: n }) {
|
|
4995
|
+
const t = n;
|
|
4996
|
+
return (i, a) => {
|
|
4997
4997
|
const o = B("fm-switch"), r = B("fm-card");
|
|
4998
|
-
return
|
|
4998
|
+
return i.disabled ? he(i.$slots, "default", { key: 0 }, void 0, !0) : (F(), G(r, {
|
|
4999
4999
|
key: 1,
|
|
5000
5000
|
class: "p-16 space-y-24",
|
|
5001
5001
|
variant: "outlined"
|
|
@@ -5003,18 +5003,18 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
5003
5003
|
default: N(() => [
|
|
5004
5004
|
D("div", Er, [
|
|
5005
5005
|
D("div", Ir, [
|
|
5006
|
-
D("p", Pr, se(
|
|
5007
|
-
|
|
5006
|
+
D("p", Pr, se(i.title), 1),
|
|
5007
|
+
i.description ? (F(), Z("p", Dr, se(i.description), 1)) : ee("", !0)
|
|
5008
5008
|
]),
|
|
5009
5009
|
C(o, {
|
|
5010
|
-
"model-value":
|
|
5010
|
+
"model-value": i.toggle,
|
|
5011
5011
|
"onUpdate:modelValue": a[0] || (a[0] = (l) => t("update:toggle", l))
|
|
5012
5012
|
}, null, 8, ["model-value"])
|
|
5013
5013
|
]),
|
|
5014
|
-
C(
|
|
5014
|
+
C(Si, { name: "expand" }, {
|
|
5015
5015
|
default: N(() => [
|
|
5016
|
-
|
|
5017
|
-
he(
|
|
5016
|
+
i.toggle ? (F(), Z("div", Tr, [
|
|
5017
|
+
he(i.$slots, "default", {}, void 0, !0)
|
|
5018
5018
|
])) : ee("", !0)
|
|
5019
5019
|
]),
|
|
5020
5020
|
_: 3
|
|
@@ -5025,15 +5025,15 @@ const Qa = /* @__PURE__ */ lt(Xa, [["render", Za]]), Ja = { class: "fm-typo-en-t
|
|
|
5025
5025
|
};
|
|
5026
5026
|
}
|
|
5027
5027
|
}), We = /* @__PURE__ */ lt(Ur, [["__scopeId", "data-v-e920f110"]]), $r = {};
|
|
5028
|
-
function Vr(e,
|
|
5029
|
-
return F(), Z("div", null,
|
|
5028
|
+
function Vr(e, n) {
|
|
5029
|
+
return F(), Z("div", null, n[0] || (n[0] = [
|
|
5030
5030
|
D("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
|
|
5031
5031
|
]));
|
|
5032
5032
|
}
|
|
5033
5033
|
const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
5034
5034
|
key: 0,
|
|
5035
5035
|
class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
|
|
5036
|
-
}, Br = { class: "fm-typo-en-title-sm-600" },
|
|
5036
|
+
}, Br = { class: "fm-typo-en-title-sm-600" }, zn = /* @__PURE__ */ le({
|
|
5037
5037
|
__name: "Summary",
|
|
5038
5038
|
props: {
|
|
5039
5039
|
title: {},
|
|
@@ -5041,13 +5041,13 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5041
5041
|
items: {}
|
|
5042
5042
|
},
|
|
5043
5043
|
setup(e) {
|
|
5044
|
-
const
|
|
5045
|
-
function
|
|
5044
|
+
const n = e, t = Ue();
|
|
5045
|
+
function i() {
|
|
5046
5046
|
t.open({
|
|
5047
|
-
title:
|
|
5047
|
+
title: n.title,
|
|
5048
5048
|
contentComponent: ue("div", { class: "space-y-4" }, [
|
|
5049
|
-
...
|
|
5050
|
-
(a) => ue(
|
|
5049
|
+
...n.items.map(
|
|
5050
|
+
(a) => ue(vn, {
|
|
5051
5051
|
name: a.name,
|
|
5052
5052
|
value: a.value || "--"
|
|
5053
5053
|
})
|
|
@@ -5057,10 +5057,10 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5057
5057
|
}
|
|
5058
5058
|
return (a, o) => {
|
|
5059
5059
|
const r = B("FmButton");
|
|
5060
|
-
return
|
|
5060
|
+
return n.variant === "full" ? (F(), Z("div", Lr, [
|
|
5061
5061
|
D("div", Br, se(a.title), 1),
|
|
5062
5062
|
C(Nr),
|
|
5063
|
-
(F(!0), Z(Re, null, Ke(a.items, (l) => (F(), G(
|
|
5063
|
+
(F(!0), Z(Re, null, Ke(a.items, (l) => (F(), G(vn, {
|
|
5064
5064
|
key: l.name,
|
|
5065
5065
|
name: l.name,
|
|
5066
5066
|
value: l.value || "--"
|
|
@@ -5069,7 +5069,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5069
5069
|
key: 1,
|
|
5070
5070
|
icon: "info",
|
|
5071
5071
|
variant: "tertiary",
|
|
5072
|
-
onClick:
|
|
5072
|
+
onClick: i
|
|
5073
5073
|
}));
|
|
5074
5074
|
};
|
|
5075
5075
|
}
|
|
@@ -5079,8 +5079,8 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5079
5079
|
linkedStatus: {}
|
|
5080
5080
|
},
|
|
5081
5081
|
emits: ["update:catalogAndScheduler"],
|
|
5082
|
-
setup(e, { emit:
|
|
5083
|
-
const t = e,
|
|
5082
|
+
setup(e, { emit: n }) {
|
|
5083
|
+
const t = e, i = n, { t: a } = ce(), o = me(), r = q(o.state.currentCatalogId || null), l = T(() => {
|
|
5084
5084
|
const m = Object.keys(t.linkedStatus.catalogs).map((c) => {
|
|
5085
5085
|
var y;
|
|
5086
5086
|
return {
|
|
@@ -5115,7 +5115,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5115
5115
|
[null, ...u()].includes(s.value) || (s.value = null);
|
|
5116
5116
|
});
|
|
5117
5117
|
const h = Ne.debounce(() => {
|
|
5118
|
-
|
|
5118
|
+
i("update:catalogAndScheduler", [r.value, s.value]);
|
|
5119
5119
|
}, 100);
|
|
5120
5120
|
return Ce(
|
|
5121
5121
|
() => `${r.value}-${s.value}`,
|
|
@@ -5150,7 +5150,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5150
5150
|
]);
|
|
5151
5151
|
};
|
|
5152
5152
|
}
|
|
5153
|
-
}), Zr =
|
|
5153
|
+
}), Zr = Fn("menu-edit-state", {
|
|
5154
5154
|
state: () => ({
|
|
5155
5155
|
isUpdatingItem: !1,
|
|
5156
5156
|
storedCatalogId: null,
|
|
@@ -5167,10 +5167,10 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5167
5167
|
}, ts = {
|
|
5168
5168
|
key: 4,
|
|
5169
5169
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5170
|
-
},
|
|
5170
|
+
}, ns = {
|
|
5171
5171
|
key: 5,
|
|
5172
5172
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5173
|
-
},
|
|
5173
|
+
}, is = {
|
|
5174
5174
|
key: 7,
|
|
5175
5175
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
5176
5176
|
}, os = {
|
|
@@ -5185,9 +5185,9 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5185
5185
|
action: {}
|
|
5186
5186
|
},
|
|
5187
5187
|
emits: ["update:show", "submit:form"],
|
|
5188
|
-
setup(e, { emit:
|
|
5189
|
-
var
|
|
5190
|
-
const t = e,
|
|
5188
|
+
setup(e, { emit: n }) {
|
|
5189
|
+
var an, rn, sn, ln, un;
|
|
5190
|
+
const t = e, i = n, a = me(), o = Xt(), { t: r } = ce(), l = T(() => t.action === "add" ? r("menu.product.form.title.add") : r("menu.product.form.title.update")), s = T(() => a.rules.item), u = (W) => new Promise((V) => setTimeout(V, W));
|
|
5191
5191
|
Qe(async () => {
|
|
5192
5192
|
t.autoShow && (await u(100), h());
|
|
5193
5193
|
});
|
|
@@ -5195,7 +5195,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5195
5195
|
Ce(
|
|
5196
5196
|
() => d.value,
|
|
5197
5197
|
async (W) => {
|
|
5198
|
-
await u(500),
|
|
5198
|
+
await u(500), i("update:show", W);
|
|
5199
5199
|
}
|
|
5200
5200
|
);
|
|
5201
5201
|
const h = () => {
|
|
@@ -5210,7 +5210,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5210
5210
|
() => t.initialForm,
|
|
5211
5211
|
async () => {
|
|
5212
5212
|
if (t.initialForm)
|
|
5213
|
-
y.value = await
|
|
5213
|
+
y.value = await Ji(
|
|
5214
5214
|
a.state.menu,
|
|
5215
5215
|
t.initialForm._id
|
|
5216
5216
|
);
|
|
@@ -5221,9 +5221,9 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5221
5221
|
immediate: !0
|
|
5222
5222
|
}
|
|
5223
5223
|
);
|
|
5224
|
-
const v =
|
|
5225
|
-
a.selectCatalog(W), a.selectScheduler(V), await
|
|
5226
|
-
|
|
5224
|
+
const v = nn(), g = async ([W, V]) => {
|
|
5225
|
+
a.selectCatalog(W), a.selectScheduler(V), await ki(), v.update(c.value._id), setTimeout(() => {
|
|
5226
|
+
i("update:show", !1);
|
|
5227
5227
|
}, 100);
|
|
5228
5228
|
}, w = T(() => {
|
|
5229
5229
|
var W;
|
|
@@ -5250,7 +5250,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5250
5250
|
};
|
|
5251
5251
|
async function I() {
|
|
5252
5252
|
var W, V;
|
|
5253
|
-
m.value = c.value._id ? (await
|
|
5253
|
+
m.value = c.value._id ? (await Qi(
|
|
5254
5254
|
a.mergedMenu,
|
|
5255
5255
|
[c.value],
|
|
5256
5256
|
a.state.menu,
|
|
@@ -5271,13 +5271,13 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5271
5271
|
(pe = m.value) == null ? void 0 : pe.taxes,
|
|
5272
5272
|
a.taxSetting.countryTaxOptions
|
|
5273
5273
|
), re = a.taxSetting.countryTaxOptions.find((X) => X.value === W);
|
|
5274
|
-
return re ?
|
|
5274
|
+
return re ? yi(re.meta.rate) : "-";
|
|
5275
5275
|
}
|
|
5276
5276
|
function _() {
|
|
5277
5277
|
z.value = null, c.value.thumbnail = null;
|
|
5278
5278
|
}
|
|
5279
5279
|
const R = T(() => {
|
|
5280
|
-
var W, V, re, pe, X,
|
|
5280
|
+
var W, V, re, pe, X, cn, dn, mn, hn;
|
|
5281
5281
|
return {
|
|
5282
5282
|
title: r("menu.product.form.summary.title"),
|
|
5283
5283
|
items: [
|
|
@@ -5307,16 +5307,16 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5307
5307
|
},
|
|
5308
5308
|
{
|
|
5309
5309
|
name: r("menu.product.form.summary.fields.inventory"),
|
|
5310
|
-
value: (
|
|
5310
|
+
value: (cn = c.value.inventoryBindings) != null && cn.length ? String(c.value.inventoryBindings.length) : (mn = (dn = m.value) == null ? void 0 : dn.inventoryBindings) != null && mn.length ? String(m.value.inventoryBindings.length) : "-"
|
|
5311
5311
|
},
|
|
5312
5312
|
{
|
|
5313
5313
|
name: r("menu.product.form.summary.fields.takeaway"),
|
|
5314
|
-
value: ((
|
|
5314
|
+
value: ((hn = a.state.menu.modules.takeaway.find(
|
|
5315
5315
|
(Mt) => {
|
|
5316
|
-
var
|
|
5317
|
-
return Mt._id === (c.value.takeawayUsed || ((
|
|
5316
|
+
var pn;
|
|
5317
|
+
return Mt._id === (c.value.takeawayUsed || ((pn = m.value) == null ? void 0 : pn.takeawayUsed));
|
|
5318
5318
|
}
|
|
5319
|
-
)) == null ? void 0 :
|
|
5319
|
+
)) == null ? void 0 : hn.name) || "-"
|
|
5320
5320
|
}
|
|
5321
5321
|
]
|
|
5322
5322
|
};
|
|
@@ -5341,7 +5341,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5341
5341
|
});
|
|
5342
5342
|
}
|
|
5343
5343
|
const S = q(
|
|
5344
|
-
(((
|
|
5344
|
+
(((an = c.value.variant) == null ? void 0 : an.variantCombinations) || []).some(
|
|
5345
5345
|
(W) => !!W.price || !!W.orderFrom || !!W.code
|
|
5346
5346
|
)
|
|
5347
5347
|
);
|
|
@@ -5361,7 +5361,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5361
5361
|
});
|
|
5362
5362
|
}
|
|
5363
5363
|
const Y = q(
|
|
5364
|
-
!!c.value.inventoryBindings || (((
|
|
5364
|
+
!!c.value.inventoryBindings || (((rn = c.value.variant) == null ? void 0 : rn.variantCombinations) || []).some((W) => !!W.inventoryBindings) || !1
|
|
5365
5365
|
);
|
|
5366
5366
|
function J(W) {
|
|
5367
5367
|
var V, re, pe;
|
|
@@ -5378,7 +5378,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5378
5378
|
});
|
|
5379
5379
|
}
|
|
5380
5380
|
const M = q(
|
|
5381
|
-
c.value.takeawayUsed != null || (((
|
|
5381
|
+
c.value.takeawayUsed != null || (((sn = c.value.variant) == null ? void 0 : sn.variantCombinations) || []).some((W) => W.takeawayUsed != null) || !1
|
|
5382
5382
|
);
|
|
5383
5383
|
function U(W) {
|
|
5384
5384
|
var V, re;
|
|
@@ -5399,12 +5399,12 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5399
5399
|
W || (c.value = { ...c.value, print: void 0 });
|
|
5400
5400
|
}
|
|
5401
5401
|
const j = q(
|
|
5402
|
-
!!((
|
|
5402
|
+
!!((ln = c.value.groups) != null && ln.length) != null || (((un = c.value.variant) == null ? void 0 : un.variantCombinations) || []).some((W) => {
|
|
5403
5403
|
var V;
|
|
5404
5404
|
return !!((V = W.groups) != null && V.length);
|
|
5405
5405
|
}) || !1
|
|
5406
5406
|
);
|
|
5407
|
-
function
|
|
5407
|
+
function ne(W) {
|
|
5408
5408
|
var V, re;
|
|
5409
5409
|
W || (c.value = {
|
|
5410
5410
|
...c.value,
|
|
@@ -5447,7 +5447,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5447
5447
|
} catch (re) {
|
|
5448
5448
|
console.log(re);
|
|
5449
5449
|
}
|
|
5450
|
-
}),
|
|
5450
|
+
}), Ci(() => {
|
|
5451
5451
|
try {
|
|
5452
5452
|
Te.closeSession();
|
|
5453
5453
|
} catch (W) {
|
|
@@ -5462,19 +5462,19 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5462
5462
|
te.isUpdatingItem = !1, a.selectCatalog(te.storedCatalogId), a.selectScheduler(te.storedSchedulerId);
|
|
5463
5463
|
}
|
|
5464
5464
|
function ct() {
|
|
5465
|
-
|
|
5465
|
+
i("submit:form", c.value, z.value), h(), we();
|
|
5466
5466
|
}
|
|
5467
5467
|
function dt() {
|
|
5468
5468
|
h(), we();
|
|
5469
5469
|
}
|
|
5470
|
-
const { isAtMost: kt } =
|
|
5470
|
+
const { isAtMost: kt } = Pn();
|
|
5471
5471
|
T(() => kt("sm"));
|
|
5472
|
-
const
|
|
5472
|
+
const on = q(null), ci = bi(on);
|
|
5473
5473
|
return (W, V) => (F(), Z(Re, null, [
|
|
5474
|
-
he(W.$slots, "trigger",
|
|
5474
|
+
he(W.$slots, "trigger", Ri(Ai({
|
|
5475
5475
|
trigger: h
|
|
5476
5476
|
}))),
|
|
5477
|
-
C(
|
|
5477
|
+
C(Pi, {
|
|
5478
5478
|
title: l.value,
|
|
5479
5479
|
show: d.value,
|
|
5480
5480
|
"primary-action": {
|
|
@@ -5490,7 +5490,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5490
5490
|
onOnCancel: dt
|
|
5491
5491
|
}, {
|
|
5492
5492
|
"append-title": N(() => [
|
|
5493
|
-
p(kt)("sm") ? (F(), G(
|
|
5493
|
+
p(kt)("sm") ? (F(), G(zn, {
|
|
5494
5494
|
key: 0,
|
|
5495
5495
|
variant: "dialog",
|
|
5496
5496
|
title: R.value.title,
|
|
@@ -5500,12 +5500,12 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5500
5500
|
default: N(() => {
|
|
5501
5501
|
var re, pe;
|
|
5502
5502
|
return [
|
|
5503
|
-
p(kt)("sm") ? ee("", !0) : (F(), G(
|
|
5503
|
+
p(kt)("sm") ? ee("", !0) : (F(), G(zn, {
|
|
5504
5504
|
key: 0,
|
|
5505
5505
|
class: "fixed",
|
|
5506
|
-
style:
|
|
5506
|
+
style: xi({
|
|
5507
5507
|
top: "85px",
|
|
5508
|
-
left: p(
|
|
5508
|
+
left: p(ci).right + "px"
|
|
5509
5509
|
}),
|
|
5510
5510
|
variant: "full",
|
|
5511
5511
|
title: R.value.title,
|
|
@@ -5514,7 +5514,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5514
5514
|
D("div", Qr, [
|
|
5515
5515
|
D("div", {
|
|
5516
5516
|
ref_key: "formWrapper",
|
|
5517
|
-
ref:
|
|
5517
|
+
ref: on,
|
|
5518
5518
|
class: Ee(["flex-1 py-24 space-y-24", "xs:w-full"])
|
|
5519
5519
|
}, [
|
|
5520
5520
|
y.value && (Object.keys(y.value.catalogs || {}).length > 0 || y.value.schedulers.length > 0) ? (F(), G(qr, {
|
|
@@ -5618,13 +5618,13 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5618
5618
|
]),
|
|
5619
5619
|
_: 1
|
|
5620
5620
|
}, 8, ["toggle", "disabled"]),
|
|
5621
|
-
s.value.group && !E.value ? (F(), Z("div",
|
|
5621
|
+
s.value.group && !E.value ? (F(), Z("div", ns)) : ee("", !0),
|
|
5622
5622
|
s.value.group ? (F(), G(We, {
|
|
5623
5623
|
key: 6,
|
|
5624
5624
|
toggle: j.value,
|
|
5625
5625
|
"onUpdate:toggle": [
|
|
5626
5626
|
V[12] || (V[12] = (X) => j.value = X),
|
|
5627
|
-
V[13] || (V[13] = (X) =>
|
|
5627
|
+
V[13] || (V[13] = (X) => ne(X))
|
|
5628
5628
|
],
|
|
5629
5629
|
disabled: !E.value,
|
|
5630
5630
|
description: "Use a different group setting",
|
|
@@ -5643,7 +5643,7 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5643
5643
|
]),
|
|
5644
5644
|
_: 1
|
|
5645
5645
|
}, 8, ["toggle", "disabled"])) : ee("", !0),
|
|
5646
|
-
s.value.inventory && !E.value ? (F(), Z("div",
|
|
5646
|
+
s.value.inventory && !E.value ? (F(), Z("div", is)) : ee("", !0),
|
|
5647
5647
|
s.value.inventory ? (F(), G(We, {
|
|
5648
5648
|
key: 8,
|
|
5649
5649
|
toggle: Y.value,
|
|
@@ -5703,14 +5703,14 @@ const Nr = /* @__PURE__ */ lt($r, [["render", Vr]]), Lr = {
|
|
|
5703
5703
|
], 64));
|
|
5704
5704
|
}
|
|
5705
5705
|
}), rs = as;
|
|
5706
|
-
function
|
|
5706
|
+
function ui(e, n) {
|
|
5707
5707
|
var o, r, l, s;
|
|
5708
|
-
const t = (o =
|
|
5708
|
+
const t = (o = n.groups) == null ? void 0 : o.reduce((u, d) => {
|
|
5709
5709
|
const h = e.groups.find((c) => c._id === d._id);
|
|
5710
5710
|
return Ct(e.items, h.items) === L.F_ADDON_GROUP_TYPE.enum.DYNAMIC && u.push(h), u;
|
|
5711
5711
|
}, []);
|
|
5712
|
-
if (!(t != null && t.length)) return
|
|
5713
|
-
const
|
|
5712
|
+
if (!(t != null && t.length)) return n;
|
|
5713
|
+
const i = t.map((u) => u._id);
|
|
5714
5714
|
function a(u) {
|
|
5715
5715
|
const d = t.map((h) => {
|
|
5716
5716
|
var y;
|
|
@@ -5733,28 +5733,28 @@ function un(e, i) {
|
|
|
5733
5733
|
items: c
|
|
5734
5734
|
};
|
|
5735
5735
|
});
|
|
5736
|
-
return [...u.filter((h) => !
|
|
5736
|
+
return [...u.filter((h) => !i.includes(h._id)), ...d];
|
|
5737
5737
|
}
|
|
5738
|
-
if ((r =
|
|
5739
|
-
const u = (l =
|
|
5738
|
+
if ((r = n.variant) != null && r.variantCombinations.length) {
|
|
5739
|
+
const u = (l = n.variant) == null ? void 0 : l.variantCombinations.map((d) => ({ ...d, groups: a(d.groups || []) }));
|
|
5740
5740
|
return {
|
|
5741
|
-
...
|
|
5741
|
+
...n,
|
|
5742
5742
|
variant: {
|
|
5743
|
-
variantGroupIds: ((s =
|
|
5743
|
+
variantGroupIds: ((s = n.variant) == null ? void 0 : s.variantGroupIds) || [],
|
|
5744
5744
|
variantCombinations: u || []
|
|
5745
5745
|
}
|
|
5746
5746
|
};
|
|
5747
5747
|
}
|
|
5748
|
-
return { ...
|
|
5748
|
+
return { ...n, groups: a(n.groups || []) };
|
|
5749
5749
|
}
|
|
5750
|
-
const
|
|
5751
|
-
const e = me(),
|
|
5750
|
+
const nn = Fn("item-manager", () => {
|
|
5751
|
+
const e = me(), n = Le(), t = Ue(), i = Ye(n), a = He(i), o = Mi(), { t: r } = ce(), l = (f) => {
|
|
5752
5752
|
if (!o) throw new Error("No current instance found");
|
|
5753
|
-
const { container: b } =
|
|
5753
|
+
const { container: b } = _i(rs, o, {
|
|
5754
5754
|
...f,
|
|
5755
5755
|
autoShow: !0,
|
|
5756
5756
|
"onUpdate:show": async (x) => {
|
|
5757
|
-
x || (
|
|
5757
|
+
x || (Oi(null, b), b.remove());
|
|
5758
5758
|
}
|
|
5759
5759
|
});
|
|
5760
5760
|
};
|
|
@@ -5764,11 +5764,11 @@ const ii = zi("item-manager", () => {
|
|
|
5764
5764
|
return delete b.variant, delete b.thumbnail, [b, ...x || []];
|
|
5765
5765
|
}
|
|
5766
5766
|
function u(f, b, x, k) {
|
|
5767
|
-
const S = ae(b), K = x ? S.modules.catalog.find((j) => j._id === x) : null, Y = k ? S.modules.scheduler.find((j) => j._id === k) : null, J = K ? ae(K) : void 0, M = x ? S.modules.catalog.filter((j) => j._id !== x) : [], U = Y ? ae(Y) : void 0, $ = f.reduce((j,
|
|
5767
|
+
const S = ae(b), K = x ? S.modules.catalog.find((j) => j._id === x) : null, Y = k ? S.modules.scheduler.find((j) => j._id === k) : null, J = K ? ae(K) : void 0, M = x ? S.modules.catalog.filter((j) => j._id !== x) : [], U = Y ? ae(Y) : void 0, $ = f.reduce((j, ne) => (j[ne._id] = s(ne), j), {});
|
|
5768
5768
|
function Q(j = []) {
|
|
5769
|
-
const
|
|
5769
|
+
const ne = f.map((te) => te._id);
|
|
5770
5770
|
return [
|
|
5771
|
-
...j.filter((te) => !
|
|
5771
|
+
...j.filter((te) => !ne.includes(te._id)),
|
|
5772
5772
|
...Object.values($).flatMap((te) => te)
|
|
5773
5773
|
];
|
|
5774
5774
|
}
|
|
@@ -5807,7 +5807,7 @@ const ii = zi("item-manager", () => {
|
|
|
5807
5807
|
categoryId: f,
|
|
5808
5808
|
"onSubmit:form": async (x, k) => {
|
|
5809
5809
|
x.inventoryBindings ?? (x.inventoryBindings = []), x.inventoryBindings.length === 0 && (x.inventoryBindings = null);
|
|
5810
|
-
const S =
|
|
5810
|
+
const S = gn();
|
|
5811
5811
|
await b(x, be.F_OPERATION_TYPE.create, S, k);
|
|
5812
5812
|
}
|
|
5813
5813
|
});
|
|
@@ -5965,7 +5965,7 @@ const ii = zi("item-manager", () => {
|
|
|
5965
5965
|
initialForm: f,
|
|
5966
5966
|
action: "update",
|
|
5967
5967
|
"onSubmit:form": async (x, k) => {
|
|
5968
|
-
const S =
|
|
5968
|
+
const S = gn(f._id);
|
|
5969
5969
|
x.inventoryBindings ?? (x.inventoryBindings = []), x.inventoryBindings.length === 0 && (x.inventoryBindings = null), await b(x, be.F_OPERATION_TYPE.update, S, k);
|
|
5970
5970
|
}
|
|
5971
5971
|
});
|
|
@@ -6005,8 +6005,8 @@ const ii = zi("item-manager", () => {
|
|
|
6005
6005
|
!0
|
|
6006
6006
|
);
|
|
6007
6007
|
for (const k of f)
|
|
6008
|
-
k.thumbnail && await
|
|
6009
|
-
|
|
6008
|
+
k.thumbnail && await wi.delete(k.thumbnail);
|
|
6009
|
+
n.open({
|
|
6010
6010
|
message: r("menu.common.dialog.remove.product.success"),
|
|
6011
6011
|
type: "success"
|
|
6012
6012
|
});
|
|
@@ -6037,7 +6037,7 @@ const ii = zi("item-manager", () => {
|
|
|
6037
6037
|
);
|
|
6038
6038
|
}
|
|
6039
6039
|
return {
|
|
6040
|
-
initDynamicGroupItem: (f) =>
|
|
6040
|
+
initDynamicGroupItem: (f) => ui(e, f),
|
|
6041
6041
|
create: d,
|
|
6042
6042
|
update: E,
|
|
6043
6043
|
updateMany: P,
|
|
@@ -6046,12 +6046,12 @@ const ii = zi("item-manager", () => {
|
|
|
6046
6046
|
};
|
|
6047
6047
|
});
|
|
6048
6048
|
export {
|
|
6049
|
-
|
|
6050
|
-
|
|
6049
|
+
On as A,
|
|
6050
|
+
Nn as M,
|
|
6051
6051
|
vt as S,
|
|
6052
|
-
|
|
6053
|
-
|
|
6052
|
+
li as _,
|
|
6053
|
+
Vn as a,
|
|
6054
6054
|
qt as e,
|
|
6055
|
-
|
|
6056
|
-
|
|
6055
|
+
Qi as m,
|
|
6056
|
+
nn as u
|
|
6057
6057
|
};
|