@feedmepos/mf-menu 0.32.71 → 0.32.72-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-Bay6p3xd.js → App-DpBAxq_x.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Je_NoQ3y.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BE34SL6B.js} +12 -12
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DBjYkJhB.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-Cg4oaBql.js} +3 -3
- package/dist/{Catalog-DfWHNm4n.js → Catalog-BCKu3av3.js} +20 -20
- package/dist/{Category-51BrJsdv.js → Category-D8fstrW5.js} +4 -4
- package/dist/{Category-m45WrP7O.js → Category-DRyJ8Y9S.js} +4 -4
- package/dist/{CookingGuide-Dk-ibGYd.js → CookingGuide-BKTlBPm-.js} +46 -46
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CzpScELw.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BHqJGqLf.js} +1 -1
- package/dist/{Group-NUWfR17j.js → Group-DMLdJAIA.js} +1 -1
- package/dist/{Group-CZDoqPK7.js → Group-_vEUeyva.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-h8zygLBJ.js → Group.vue_vue_type_script_setup_true_lang-BEONKZuB.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Dq5jMv3_.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B2pS71Xq.js} +24 -24
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-EsQKUSJa.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BHNmNXw0.js} +7 -7
- package/dist/{Ingredient-CcnUyiM5.js → Ingredient-DeGrqMqN.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BwxZEDVT.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DFOcD2mw.js} +2 -2
- package/dist/{LinkProductSideSheet-ClMiajzX.js → LinkProductSideSheet-BZNe2r8t.js} +4 -4
- package/dist/{MenuSetting-Dw3lVHtp.js → MenuSetting-yb8w_Nwc.js} +7 -7
- package/dist/{OrderPacing-Dh8T7OKW.js → OrderPacing-DRApEr9x.js} +5 -5
- package/dist/{PrintRoute-BrSaSZI3.js → PrintRoute-DK3ZMajo.js} +10 -10
- package/dist/{Product-CQ7AuhbY.js → Product-CBhhhicD.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-Bw6l2IEC.js → Product.vue_vue_type_script_setup_true_lang-CPgECJwS.js} +14 -14
- package/dist/ProductInternalTools-D8j9hMuA.js +439 -0
- package/dist/{Products-CoL7S7-1.js → Products-Db0Ihn6p.js} +47 -47
- package/dist/{Publish-C_lOqrSX.js → Publish-BFBUjUWu.js} +4 -4
- package/dist/{Recipe-Ce8qXnG5.js → Recipe-B0r5vJz6.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DMB9bFg9.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-C8Jk7KEh.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-D9i9tMAj.js → RuleView.vue_vue_type_script_setup_true_lang-DPCcNBrm.js} +193 -193
- package/dist/{Scheduler-B2ZtWIPp.js → Scheduler-yOdnbwyV.js} +17 -17
- package/dist/{ServingSequence-BWZ1YpzI.js → ServingSequence-CEcYzZKq.js} +3 -3
- package/dist/{Setting-CdxNVi7G.js → Setting-CEwxLrwm.js} +5 -5
- package/dist/{Subcategory-Bn0O6i5t.js → Subcategory-b1NEH4Rt.js} +6 -6
- package/dist/{Takeaway-yE0GhL5I.js → Takeaway-BwGq2ti3.js} +4 -4
- package/dist/{Takeaway-luRkknPl.js → Takeaway-C4X3hjz2.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CnZTbF3e.js → Takeaway.vue_vue_type_script_setup_true_lang-Da28Vzx1.js} +5 -5
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-B3N7_zfR.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-DIP7cNpd.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-BLzzBcqV.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-CCYzllV_.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BvnoCeCw.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-e_pAe_Ob.js} +15 -15
- package/dist/{Unit-JPFtrbuS.js → Unit-DWGvi3C5.js} +2 -2
- package/dist/{Variant-BGJ-aKF1.js → Variant-2YYwBJmZ.js} +3 -3
- package/dist/{_id_-BUlkRwgU.js → _id_-3pf3YlPS.js} +10 -10
- package/dist/{app-2VeaJE9t.js → app-D1p44Rbf.js} +37 -37
- package/dist/{app-CMjz-bvL.js → app-D6CmNX90.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +65 -16
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-B9caUckb.js → linked-status-B_5fbldk.js} +4 -4
- package/dist/assets/{menu-export-DYfPYpgS.js → menu-export-Dje2CzXB.js} +3 -3
- package/dist/assets/{override-menu-uNjUqcak.js → override-menu-CpJc9-6f.js} +4 -4
- package/dist/assets/{validate-menu-BiXMOXpN.js → validate-menu-CpDDVAwU.js} +3 -3
- package/dist/{catalog--64fgdzd.js → catalog-Ds7c8bSK.js} +1 -1
- package/dist/{catalogSetting-CplTgRmk.js → catalogSetting-qbnlvX9R.js} +1 -1
- package/dist/{currency-CjYkQ4FL.js → currency-BQjK22_U.js} +1 -1
- package/dist/dayjs.min-BjENDBB5.js +7 -0
- package/dist/{discardConfirm-DOc0ieeO.js → discardConfirm-DhbS0wLN.js} +1 -1
- package/dist/{index-BrtZ42qx.js → index-BqB1Vagh.js} +6 -6
- package/dist/{index-CTA48kW2.js → index-C2rMjg4b.js} +1 -1
- package/dist/{index-Dw_Fw5ni.js → index-YU-FPKch.js} +5 -5
- package/dist/{index.vue_vue_type_script_setup_true_lang-BCZZq6zJ.js → index.vue_vue_type_script_setup_true_lang-DILo07iQ.js} +4420 -4414
- package/dist/{item-DL0lbXPC.js → item-CN-mYmn-.js} +1158 -1163
- package/dist/{jszip.min-CTn9qnAT.js → jszip.min-DdiexxWX.js} +3 -3
- package/dist/{linkProducts-DNPyRjOC.js → linkProducts-DSa1bP0Z.js} +4 -4
- package/dist/{memberPricing-ByMD7Sun.js → memberPricing-BLIgqSgU.js} +1 -1
- package/dist/{menu-C77otNXH.js → menu-kYSa55lO.js} +1 -1
- package/dist/{menuV2-Bi_EMfOM.js → menuV2-BJ-6TZDX.js} +24 -24
- package/dist/{order_pacing-29v64nh0.js → order_pacing-CeCi-pP3.js} +5 -5
- package/dist/{priceTier-BscL3YjX.js → priceTier-CsF1g5ie.js} +1 -1
- package/dist/{rules-BYL-otiB.js → rules-C3jtb0rM.js} +3 -3
- package/dist/{scheduler-Cqvnr0u1.js → scheduler-DZpjPLLc.js} +5 -5
- package/dist/{toExcel-421pbm-Z.js → toExcel-DI9BOlMc.js} +2 -2
- package/dist/{unit-DDtyAbV0.js → unit-DeNymCWc.js} +17 -17
- package/package.json +1 -1
- package/dist/ProductInternalTools-2rYX2GR0.js +0 -416
- package/dist/dayjs.min-DCMtwvjf.js +0 -7
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as v, computed as $, resolveComponent as W, createElementBlock as c, openBlock as r, createElementVNode as s, createVNode as I, unref as h, createCommentVNode as T, normalizeClass as E, toDisplayString as U, createStaticVNode as B, Fragment as P, renderList as R, createBlock as oe, withCtx as A } from "vue";
|
|
2
|
-
import { J as O, F as ne } from "./jszip.min-CTn9qnAT.js";
|
|
3
|
-
import { l as D } from "./discardConfirm-DOc0ieeO.js";
|
|
4
|
-
import { useI18n as le } from "@feedmepos/mf-common";
|
|
5
|
-
import { FmButtonVariant as z, useSnackbar as V, useDialog as ie, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
|
|
6
|
-
import { b as re, u as ce, p as de, x as me } from "./index.vue_vue_type_script_setup_true_lang-BCZZq6zJ.js";
|
|
7
|
-
import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
|
|
8
|
-
import { u as ge, a as pe } from "./menu-C77otNXH.js";
|
|
9
|
-
import { a as fe } from "./Product.vue_vue_type_script_setup_true_lang-Bw6l2IEC.js";
|
|
10
|
-
import { af as he, ag as ye, ah as be, ai as ve, aj as _e } from "./item-DL0lbXPC.js";
|
|
11
|
-
const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center justify-between p-16 border-b border-gray-200" }, Ie = { class: "flex gap-8" }, ke = { class: "border-b border-gray-200" }, Ce = { class: "flex" }, Ue = { class: "flex-1 overflow-hidden" }, je = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "h-full flex flex-col"
|
|
14
|
-
}, Fe = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "flex-1 flex items-center justify-center"
|
|
17
|
-
}, Se = {
|
|
18
|
-
key: 1,
|
|
19
|
-
class: "flex-1 overflow-y-auto p-16"
|
|
20
|
-
}, Me = { class: "space-y-12" }, $e = { class: "fm-typo-en-body-sm font-medium" }, ze = { class: "flex" }, Pe = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden flex items-center justify-center" }, Le = ["src", "alt"], Ne = {
|
|
21
|
-
key: 1,
|
|
22
|
-
class: "text-gray-400 text-xs"
|
|
23
|
-
}, Te = { class: "flex" }, Ee = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden" }, Be = ["src", "alt"], Re = {
|
|
24
|
-
key: 1,
|
|
25
|
-
class: "h-full flex flex-col"
|
|
26
|
-
}, Ae = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "flex-1 flex items-center justify-center"
|
|
29
|
-
}, Oe = {
|
|
30
|
-
key: 1,
|
|
31
|
-
class: "flex-1 overflow-y-auto p-16"
|
|
32
|
-
}, De = { class: "space-y-12" }, Ve = { class: "fm-typo-en-body-sm font-medium break-all" }, Ze = { class: "flex" }, We = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden" }, qe = ["src", "alt"], Ge = /* @__PURE__ */ Z({
|
|
33
|
-
__name: "ImageUpdatePreview",
|
|
34
|
-
props: {
|
|
35
|
-
matchedImages: {},
|
|
36
|
-
unmatchedImages: {}
|
|
37
|
-
},
|
|
38
|
-
emits: ["cancel", "update"],
|
|
39
|
-
setup(L, { emit: j }) {
|
|
40
|
-
const u = L, F = j, y = v("matched"), b = $(() => u.matchedImages.length), k = $(() => u.unmatchedImages.length);
|
|
41
|
-
function _() {
|
|
42
|
-
F("cancel");
|
|
43
|
-
}
|
|
44
|
-
function S() {
|
|
45
|
-
F("update", u.matchedImages);
|
|
46
|
-
}
|
|
47
|
-
return (w, l) => {
|
|
48
|
-
const x = W("fm-button");
|
|
49
|
-
return r(), c("div", we, [
|
|
50
|
-
s("div", xe, [
|
|
51
|
-
l[2] || (l[2] = s("h2", { class: "fm-typo-en-headline-sm font-semibold" }, "Update Product Images", -1)),
|
|
52
|
-
s("div", Ie, [
|
|
53
|
-
I(x, {
|
|
54
|
-
variant: h(z).Secondary,
|
|
55
|
-
label: "Cancel",
|
|
56
|
-
onClick: _
|
|
57
|
-
}, null, 8, ["variant"]),
|
|
58
|
-
I(x, {
|
|
59
|
-
variant: h(z).Primary,
|
|
60
|
-
label: "Update",
|
|
61
|
-
disabled: b.value === 0,
|
|
62
|
-
onClick: S
|
|
63
|
-
}, null, 8, ["variant", "disabled"])
|
|
64
|
-
])
|
|
65
|
-
]),
|
|
66
|
-
s("div", ke, [
|
|
67
|
-
s("div", Ce, [
|
|
68
|
-
s("button", {
|
|
69
|
-
class: E([
|
|
70
|
-
"px-16 py-12 font-medium text-sm border-b-2 transition-colors",
|
|
71
|
-
y.value === "matched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
|
|
72
|
-
]),
|
|
73
|
-
onClick: l[0] || (l[0] = (m) => y.value = "matched")
|
|
74
|
-
}, " Matched Images (" + U(b.value) + ") ", 3),
|
|
75
|
-
k.value > 0 ? (r(), c("button", {
|
|
76
|
-
key: 0,
|
|
77
|
-
class: E([
|
|
78
|
-
"px-16 py-12 font-medium text-sm border-b-2 transition-colors",
|
|
79
|
-
y.value === "unmatched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
|
|
80
|
-
]),
|
|
81
|
-
onClick: l[1] || (l[1] = (m) => y.value = "unmatched")
|
|
82
|
-
}, " Unmatched Images (" + U(k.value) + ") ", 3)) : T("", !0)
|
|
83
|
-
])
|
|
84
|
-
]),
|
|
85
|
-
s("div", Ue, [
|
|
86
|
-
y.value === "matched" ? (r(), c("div", je, [
|
|
87
|
-
b.value === 0 ? (r(), c("div", Fe, l[3] || (l[3] = [
|
|
88
|
-
B('<div class="text-center text-gray-500"><svg class="mx-auto h-48 w-48 text-gray-400 mb-16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">No matched images found</p><p class="fm-typo-en-body-sm text-gray-400 mt-4"> Make sure your image filenames match product names </p></div>', 1)
|
|
89
|
-
]))) : (r(), c("div", Se, [
|
|
90
|
-
l[4] || (l[4] = s("div", { class: "grid grid-cols-3 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
|
|
91
|
-
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Product Name"),
|
|
92
|
-
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Current Image"),
|
|
93
|
-
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "New Image")
|
|
94
|
-
], -1)),
|
|
95
|
-
s("div", Me, [
|
|
96
|
-
(r(!0), c(P, null, R(u.matchedImages, (m, C) => (r(), c("div", {
|
|
97
|
-
key: C,
|
|
98
|
-
class: "grid grid-cols-3 gap-16 py-12 border-b border-gray-100 items-center"
|
|
99
|
-
}, [
|
|
100
|
-
s("div", $e, U(m.productName), 1),
|
|
101
|
-
s("div", ze, [
|
|
102
|
-
s("div", Pe, [
|
|
103
|
-
m.originalThumbnail ? (r(), c("img", {
|
|
104
|
-
key: 0,
|
|
105
|
-
src: m.originalThumbnail,
|
|
106
|
-
alt: m.productName,
|
|
107
|
-
class: "w-full h-full object-cover"
|
|
108
|
-
}, null, 8, Le)) : (r(), c("span", Ne, "No image"))
|
|
109
|
-
])
|
|
110
|
-
]),
|
|
111
|
-
s("div", Te, [
|
|
112
|
-
s("div", Ee, [
|
|
113
|
-
s("img", {
|
|
114
|
-
src: m.newImageUrl,
|
|
115
|
-
alt: m.newImage.name,
|
|
116
|
-
class: "w-full h-full object-cover"
|
|
117
|
-
}, null, 8, Be)
|
|
118
|
-
])
|
|
119
|
-
])
|
|
120
|
-
]))), 128))
|
|
121
|
-
])
|
|
122
|
-
]))
|
|
123
|
-
])) : y.value === "unmatched" ? (r(), c("div", Re, [
|
|
124
|
-
k.value === 0 ? (r(), c("div", Ae, l[5] || (l[5] = [
|
|
125
|
-
B('<div class="text-center text-gray-500"><svg class="mx-auto h-48 w-48 text-gray-400 mb-16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">All images matched!</p><p class="fm-typo-en-body-sm text-gray-400 mt-4">No unmatched images found</p></div>', 1)
|
|
126
|
-
]))) : (r(), c("div", Oe, [
|
|
127
|
-
l[6] || (l[6] = s("div", { class: "grid grid-cols-2 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
|
|
128
|
-
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Filename"),
|
|
129
|
-
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Image")
|
|
130
|
-
], -1)),
|
|
131
|
-
s("div", De, [
|
|
132
|
-
(r(!0), c(P, null, R(u.unmatchedImages, (m, C) => (r(), c("div", {
|
|
133
|
-
key: C,
|
|
134
|
-
class: "grid grid-cols-2 gap-16 py-12 border-b border-gray-100 items-center"
|
|
135
|
-
}, [
|
|
136
|
-
s("div", Ve, U(m.filename), 1),
|
|
137
|
-
s("div", Ze, [
|
|
138
|
-
s("div", We, [
|
|
139
|
-
s("img", {
|
|
140
|
-
src: m.imageUrl,
|
|
141
|
-
alt: m.filename,
|
|
142
|
-
class: "w-full h-full object-cover"
|
|
143
|
-
}, null, 8, qe)
|
|
144
|
-
])
|
|
145
|
-
])
|
|
146
|
-
]))), 128))
|
|
147
|
-
])
|
|
148
|
-
]))
|
|
149
|
-
])) : T("", !0)
|
|
150
|
-
])
|
|
151
|
-
]);
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
var Je = { firebase: { storageBucket: "image.feedmedev.cc" } };
|
|
156
|
-
const He = {
|
|
157
|
-
key: 0,
|
|
158
|
-
class: "h-screen"
|
|
159
|
-
}, Xe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ke = { class: "flex items-center" }, Qe = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ye = { class: "fm-typo-en-body-md-600 font-semibold" }, et = { class: "flex gap-8" }, mt = /* @__PURE__ */ Z({
|
|
160
|
-
__name: "ProductInternalTools",
|
|
161
|
-
setup(L) {
|
|
162
|
-
const { t: j } = le(), u = re(V()), F = V(), y = ie(), b = ce(), { selectedCategories: k } = ge(), _ = v(!1), S = v(), w = v([]), l = v([]), x = $(() => {
|
|
163
|
-
const e = D.flatten(k.value.map((a) => a.items));
|
|
164
|
-
return D.uniqBy(e, (a) => a._id);
|
|
165
|
-
}), m = $(() => x.value.length);
|
|
166
|
-
async function C(e, a) {
|
|
167
|
-
return await be(e, {
|
|
168
|
-
withTimestamp: !0,
|
|
169
|
-
filename: a
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
async function q(e, a = "images.zip") {
|
|
173
|
-
const o = new O();
|
|
174
|
-
e.forEach(({ blob: d, filename: n }) => {
|
|
175
|
-
d && o.file(n, d);
|
|
176
|
-
});
|
|
177
|
-
const g = await o.generateAsync({ type: "blob" });
|
|
178
|
-
ne.saveAs(g, a);
|
|
179
|
-
}
|
|
180
|
-
async function G() {
|
|
181
|
-
const e = x.value.filter((a) => a.thumbnail);
|
|
182
|
-
if (e.length === 0) {
|
|
183
|
-
F.open({ type: "error", title: "No downloadable images found" });
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
y.open({
|
|
187
|
-
title: "Download Images",
|
|
188
|
-
message: `Found ${e.length} images, download as ZIP file?`,
|
|
189
|
-
primaryActions: {
|
|
190
|
-
text: "Download",
|
|
191
|
-
close: !0
|
|
192
|
-
},
|
|
193
|
-
secondaryActions: {
|
|
194
|
-
text: j("common.cancel"),
|
|
195
|
-
close: !0
|
|
196
|
-
}
|
|
197
|
-
}).onPrimary(async () => {
|
|
198
|
-
const a = v("Preparing download...");
|
|
199
|
-
await u.minor(
|
|
200
|
-
async () => {
|
|
201
|
-
const o = e.filter((n) => n.thumbnail).map((n, p) => {
|
|
202
|
-
let t = n.name || `image_${Date.now()}_${p}`;
|
|
203
|
-
return t += ".jpg", {
|
|
204
|
-
url: n.thumbnail,
|
|
205
|
-
filename: t,
|
|
206
|
-
index: p + 1
|
|
207
|
-
};
|
|
208
|
-
});
|
|
209
|
-
a.value = `Starting download of ${o.length} images...`;
|
|
210
|
-
const d = (await he(o, C, {
|
|
211
|
-
batchSize: 5,
|
|
212
|
-
// Download 5 images at a time
|
|
213
|
-
batchDelay: 200,
|
|
214
|
-
// 200ms delay between batches
|
|
215
|
-
progressMessage: a
|
|
216
|
-
})).filter((n) => n !== null);
|
|
217
|
-
if (a.value = "Creating ZIP file...", d.length > 0) {
|
|
218
|
-
const n = `images_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`;
|
|
219
|
-
await q(d, n);
|
|
220
|
-
} else
|
|
221
|
-
throw new Error("Failed to fetch any images");
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
message: a,
|
|
225
|
-
successMessage: `Successfully downloaded ${e.length} images`,
|
|
226
|
-
customId: "download-images"
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
async function J(e) {
|
|
232
|
-
const o = await new O().loadAsync(e), g = [];
|
|
233
|
-
for (const [d, n] of Object.entries(o.files)) {
|
|
234
|
-
if (n.dir || d.includes("__MACOSX/") || !N(d))
|
|
235
|
-
continue;
|
|
236
|
-
const p = await n.async("blob"), t = d.split("/").pop() || d, i = new File([p], t, { type: H(t) });
|
|
237
|
-
g.push(i);
|
|
238
|
-
}
|
|
239
|
-
return g;
|
|
240
|
-
}
|
|
241
|
-
function N(e) {
|
|
242
|
-
const a = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"], o = e.toLowerCase().substring(e.lastIndexOf("."));
|
|
243
|
-
return a.includes(o);
|
|
244
|
-
}
|
|
245
|
-
function H(e) {
|
|
246
|
-
const a = e.toLowerCase().substring(e.lastIndexOf("."));
|
|
247
|
-
return {
|
|
248
|
-
".jpg": "image/jpeg",
|
|
249
|
-
".jpeg": "image/jpeg",
|
|
250
|
-
".png": "image/png",
|
|
251
|
-
".gif": "image/gif",
|
|
252
|
-
".webp": "image/webp",
|
|
253
|
-
".bmp": "image/bmp"
|
|
254
|
-
}[a] || "image/jpeg";
|
|
255
|
-
}
|
|
256
|
-
function X(e) {
|
|
257
|
-
return (e.substring(0, e.lastIndexOf(".")) || e).toLowerCase().trim().replace(/[_\-\s]+/g, " ");
|
|
258
|
-
}
|
|
259
|
-
function K(e) {
|
|
260
|
-
return e.toLowerCase().trim().replace(/[_\-\s]+/g, " ");
|
|
261
|
-
}
|
|
262
|
-
async function Q(e) {
|
|
263
|
-
const a = [];
|
|
264
|
-
for (const t of e)
|
|
265
|
-
if (t.type === "application/zip" || t.name.toLowerCase().endsWith(".zip")) {
|
|
266
|
-
const i = await J(t);
|
|
267
|
-
a.push(...i);
|
|
268
|
-
} else N(t.name) && a.push(t);
|
|
269
|
-
const o = /* @__PURE__ */ new Map();
|
|
270
|
-
a.forEach((t) => {
|
|
271
|
-
const i = t.name.toLowerCase();
|
|
272
|
-
o.has(i) || o.set(i, t);
|
|
273
|
-
});
|
|
274
|
-
const g = Array.from(o.values()), d = [], n = [], p = /* @__PURE__ */ new Map();
|
|
275
|
-
x.value.forEach((t) => {
|
|
276
|
-
const i = K(t.name);
|
|
277
|
-
p.set(i, t);
|
|
278
|
-
});
|
|
279
|
-
for (const t of g) {
|
|
280
|
-
const i = X(t.name), f = p.get(i);
|
|
281
|
-
f ? d.push({
|
|
282
|
-
productId: f._id,
|
|
283
|
-
productName: f.name,
|
|
284
|
-
originalThumbnail: f.thumbnail,
|
|
285
|
-
newImage: t,
|
|
286
|
-
newImageUrl: URL.createObjectURL(t)
|
|
287
|
-
}) : n.push({
|
|
288
|
-
filename: t.name,
|
|
289
|
-
file: t,
|
|
290
|
-
imageUrl: URL.createObjectURL(t)
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
return { matched: d, unmatched: n };
|
|
294
|
-
}
|
|
295
|
-
async function Y(e) {
|
|
296
|
-
await u.minor(
|
|
297
|
-
async () => {
|
|
298
|
-
const { matched: a, unmatched: o } = await Q(e);
|
|
299
|
-
w.value = a, l.value = o, _.value = !0;
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
message: "Processing uploaded images...",
|
|
303
|
-
customId: "process-images"
|
|
304
|
-
}
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
async function ee(e) {
|
|
308
|
-
const a = v("Preparing image updates...");
|
|
309
|
-
await u.minor(
|
|
310
|
-
async () => {
|
|
311
|
-
const o = async (t) => {
|
|
312
|
-
const i = ve(t.productId);
|
|
313
|
-
let f = "";
|
|
314
|
-
return t.newImage && (await _e.update(i, t.newImage, Je.firebase.storageBucket), f = me(i)), { productId: t.productId, newImageUrl: f };
|
|
315
|
-
};
|
|
316
|
-
a.value = `Starting upload of ${e.length} product images...`;
|
|
317
|
-
const g = await ye({
|
|
318
|
-
items: e,
|
|
319
|
-
processor: o,
|
|
320
|
-
batchSize: 5,
|
|
321
|
-
// Upload 5 images at a time
|
|
322
|
-
batchDelay: 200,
|
|
323
|
-
// 200ms delay between batches
|
|
324
|
-
onProgress: ({ batchStart: t, batchEnd: i, total: f }) => {
|
|
325
|
-
a.value = `Uploading images ${t}-${i}/${f}...`;
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
a.value = "Updating product data...";
|
|
329
|
-
const d = b.state.menu, n = de(d), p = new Map(g.map((t) => [t == null ? void 0 : t.productId, t]));
|
|
330
|
-
n.modules.item = n.modules.item.map((t) => {
|
|
331
|
-
const i = p.get(t._id);
|
|
332
|
-
return i && i.newImageUrl ? { ...t, thumbnail: i.newImageUrl } : t;
|
|
333
|
-
}), await b.updateMenuSetting(n), await b.importMenu(n);
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
message: a,
|
|
337
|
-
successMessage: `Successfully updated ${e.length} product images`,
|
|
338
|
-
customId: "update-product-images"
|
|
339
|
-
}
|
|
340
|
-
), _.value = !1, w.value = [], l.value = [];
|
|
341
|
-
}
|
|
342
|
-
function te() {
|
|
343
|
-
w.value.forEach((e) => URL.revokeObjectURL(e.newImageUrl)), l.value.forEach((e) => URL.revokeObjectURL(e.imageUrl)), _.value = !1, w.value = [], l.value = [];
|
|
344
|
-
}
|
|
345
|
-
function ae() {
|
|
346
|
-
var e;
|
|
347
|
-
(e = S.value) == null || e.click();
|
|
348
|
-
}
|
|
349
|
-
function se(e) {
|
|
350
|
-
const a = e.target;
|
|
351
|
-
if (a.files && a.files.length > 0) {
|
|
352
|
-
const o = Array.from(a.files);
|
|
353
|
-
Y(o);
|
|
354
|
-
}
|
|
355
|
-
a.value = "";
|
|
356
|
-
}
|
|
357
|
-
return pe().resetOnMount(), (e, a) => {
|
|
358
|
-
const o = W("fm-button");
|
|
359
|
-
return r(), c(P, null, [
|
|
360
|
-
_.value ? (r(), c("div", He, [
|
|
361
|
-
I(Ge, {
|
|
362
|
-
"matched-images": w.value,
|
|
363
|
-
"unmatched-images": l.value,
|
|
364
|
-
onCancel: te,
|
|
365
|
-
onUpdate: ee
|
|
366
|
-
}, null, 8, ["matched-images", "unmatched-images"])
|
|
367
|
-
])) : (r(), oe(ue, {
|
|
368
|
-
key: 1,
|
|
369
|
-
heading: h(j)("menu.productInternalTools.title")
|
|
370
|
-
}, {
|
|
371
|
-
default: A(() => [
|
|
372
|
-
I(fe)
|
|
373
|
-
]),
|
|
374
|
-
"append-heading": A(() => [
|
|
375
|
-
s("div", Xe, [
|
|
376
|
-
s("div", Ke, [
|
|
377
|
-
s("div", Qe, [
|
|
378
|
-
s("p", Ye, U(m.value), 1)
|
|
379
|
-
])
|
|
380
|
-
]),
|
|
381
|
-
s("div", et, [
|
|
382
|
-
I(o, {
|
|
383
|
-
"bg-color": h(M).NeutralGray100,
|
|
384
|
-
"text-color": h(M).TypoSecondary,
|
|
385
|
-
variant: h(z).Primary,
|
|
386
|
-
label: "Download Images",
|
|
387
|
-
onClick: G
|
|
388
|
-
}, null, 8, ["bg-color", "text-color", "variant"]),
|
|
389
|
-
I(o, {
|
|
390
|
-
"bg-color": h(M).NeutralGray100,
|
|
391
|
-
"text-color": h(M).TypoSecondary,
|
|
392
|
-
variant: h(z).Primary,
|
|
393
|
-
label: "Update Images",
|
|
394
|
-
onClick: ae
|
|
395
|
-
}, null, 8, ["bg-color", "text-color", "variant"])
|
|
396
|
-
])
|
|
397
|
-
])
|
|
398
|
-
]),
|
|
399
|
-
_: 1
|
|
400
|
-
}, 8, ["heading"])),
|
|
401
|
-
s("input", {
|
|
402
|
-
ref_key: "fileInput",
|
|
403
|
-
ref: S,
|
|
404
|
-
type: "file",
|
|
405
|
-
multiple: "",
|
|
406
|
-
accept: "image/*,.zip",
|
|
407
|
-
style: { display: "none" },
|
|
408
|
-
onChange: se
|
|
409
|
-
}, null, 544)
|
|
410
|
-
], 64);
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
export {
|
|
415
|
-
mt as default
|
|
416
|
-
};
|