@ozdao/prometheus-framework 0.0.78 → 0.0.80
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-451d2614.mjs +80 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js +1 -0
- package/dist/ButtonFollow-0d83a04a.mjs +130 -0
- package/dist/ButtonFollow-f9c5dc7a.js +1 -0
- package/dist/CardHeader-2d7e5d49.mjs +76 -0
- package/dist/CardHeader-dff9c71a.js +1 -0
- package/dist/Comments-b6e32958.js +1 -0
- package/dist/Comments-d2a8fd0f.mjs +76 -0
- package/dist/EditProductImages-1d4b44a9.mjs +236 -0
- package/dist/EditProductImages-d9228ad0.js +1 -0
- package/dist/EmptyState-34d85f10.mjs +36 -0
- package/dist/EmptyState-7658d7d6.js +1 -0
- package/dist/Feed-932d976d.js +1 -0
- package/dist/Feed-962e009b.js +1 -0
- package/dist/Feed-c93012c7.mjs +346 -0
- package/dist/Feed-d8e33aed.mjs +397 -0
- package/dist/PlaceholderUserpic-1a6cf257.mjs +28 -0
- package/dist/PlaceholderUserpic-3bf126ee.js +1 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-8981c189.mjs +280 -0
- package/dist/Popup.vue_vue_type_style_index_0_lang-931f265a.js +1 -0
- package/dist/Product-3c64a352.mjs +904 -0
- package/dist/Product-67efba5c.js +7 -0
- package/dist/ProductEdit-04760699.js +1 -0
- package/dist/ProductEdit-39adf62f.mjs +113 -0
- package/dist/ProfileBlogposts-00424109.js +1 -0
- package/dist/ProfileBlogposts-65a7a5e0.mjs +56 -0
- package/dist/ProfileComments-5884d09f.mjs +43 -0
- package/dist/ProfileComments-677731b3.js +1 -0
- package/dist/ProfileEvents-85a88674.mjs +55 -0
- package/dist/ProfileEvents-b5431cd6.js +1 -0
- package/dist/ProfileLikes-4a57f637.mjs +43 -0
- package/dist/ProfileLikes-8ccf6815.js +1 -0
- package/dist/ProfileOrganizations-5d681498.mjs +202 -0
- package/dist/ProfileOrganizations-c7688210.js +1 -0
- package/dist/Publics-889c25fc.js +1 -0
- package/dist/Publics-8bea4201.mjs +44 -0
- package/dist/UploadImage-34bc4a3f.mjs +99 -0
- package/dist/UploadImage-75b1a18a.js +1 -0
- package/dist/auth-18f80fef.mjs +1501 -0
- package/dist/auth-78fd9408.js +8 -0
- package/dist/auth.client.cjs +5 -5
- package/dist/auth.client.js +5 -5
- package/dist/auth.validation-6bccabd6.mjs +20 -0
- package/dist/auth.validation-a18510e8.js +1 -0
- package/dist/community.client.cjs +8 -9
- package/dist/community.client.js +568 -552
- package/dist/community.server.js +3 -2
- package/dist/community.server.mjs +3 -2
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +10 -10
- package/dist/files.client.cjs +1 -0
- package/dist/files.client.js +1 -0
- package/dist/files.server.js +5 -2
- package/dist/files.server.mjs +5 -2
- package/dist/main.css +1 -1
- package/dist/organizations-0e9ff7ca.mjs +319 -0
- package/dist/organizations-c77ea9d0.js +1 -0
- package/dist/organizations.client.cjs +2 -2
- package/dist/organizations.client.js +26 -26
- package/dist/prometheus-framework.cjs.js +3 -3
- package/dist/prometheus-framework.es.js +8 -8
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +10 -10
- package/package.json +3 -3
- package/src/modules/community/components/elements/ImageUpload.vue +7 -5
- package/src/modules/community/components/pages/BlogPost.vue +12 -15
- package/src/modules/community/components/pages/CreateBlogPost.vue +14 -1
- package/src/modules/community/controllers/blog.controller.js +2 -1
- package/src/modules/files/controllers/files.controller.js +5 -1
- package/src/modules/files/routes/files.routes.js +3 -1
@@ -0,0 +1,280 @@
|
|
1
|
+
import { computed as z, resolveComponent as $, openBlock as i, createElementBlock as d, Fragment as H, renderList as I, unref as p, normalizeClass as C, createCommentVNode as _, createBlock as R, withCtx as S, createTextVNode as B, toDisplayString as w, createElementVNode as g, reactive as k, watch as L } from "vue";
|
2
|
+
import { useRoute as U } from "vue-router";
|
3
|
+
import { useI18n as A } from "vue-i18n";
|
4
|
+
import { s } from "./globals-f538c0ef.mjs";
|
5
|
+
import "./Breadcrumbs.vue_vue_type_style_index_0_lang-451d2614.mjs";
|
6
|
+
import { _ as E, a as j } from "./auth-18f80fef.mjs";
|
7
|
+
const M = {
|
8
|
+
class: "breadcrumbs flex-row flex-nowrap flex-left flex",
|
9
|
+
"aria-label": "breadcrumbs"
|
10
|
+
}, N = {
|
11
|
+
key: 0,
|
12
|
+
class: "i-small mn-r-thin",
|
13
|
+
viewBox: "0 0 10 9",
|
14
|
+
fill: "none",
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
16
|
+
}, T = /* @__PURE__ */ g("path", {
|
17
|
+
fill: "black",
|
18
|
+
d: "M0.494141 4.26391C0.494141 4.48862 0.659906 4.66912 0.928813 4.66912C1.05037 4.66912 1.16825 4.6065 1.27139 4.52177L1.64344 4.20866V7.56448C1.64344 8.13545 1.98971 8.47803 2.5791 8.47803H7.56678C8.15616 8.47803 8.50243 8.13545 8.50243 7.56448V4.19392L8.8929 4.52177C8.99604 4.6065 9.11392 4.66912 9.23916 4.66912C9.48597 4.66912 9.67015 4.5144 9.67015 4.27128C9.67015 4.1313 9.61121 4.01343 9.5007 3.92133L8.50243 3.08146V1.47538C8.50243 1.30961 8.3956 1.1991 8.22984 1.1991H7.63308C7.46732 1.1991 7.35313 1.30961 7.35313 1.47538V2.11634L5.66969 0.70181C5.31606 0.403433 4.85928 0.403433 4.50197 0.70181L0.663589 3.92133C0.553079 4.01711 0.494141 4.14235 0.494141 4.26391ZM6.13752 5.26219C6.13752 5.08906 6.02701 4.97855 5.85387 4.97855H4.31779C4.14097 4.97855 4.02678 5.08906 4.02678 5.26219V7.63447H2.83327C2.60856 7.63447 2.48332 7.50922 2.48332 7.28084V3.5014L4.90349 1.47538C5.01768 1.37592 5.15029 1.37592 5.26817 1.47538L7.66255 3.48298V7.28084C7.66255 7.50922 7.53731 7.63447 7.3126 7.63447H6.13752V5.26219Z"
|
19
|
+
}, null, -1), Z = [
|
20
|
+
T
|
21
|
+
], q = { key: 2 }, D = {
|
22
|
+
key: 3,
|
23
|
+
class: "i-small chevron",
|
24
|
+
viewBox: "0 0 4 8",
|
25
|
+
fill: "none",
|
26
|
+
xmlns: "http://www.w3.org/2000/svg"
|
27
|
+
}, F = /* @__PURE__ */ g("path", {
|
28
|
+
d: "M4 3.99992C4 3.83673 3.94307 3.70391 3.81025 3.57867L0.899431 0.732369C0.800759 0.629902 0.679317 0.580566 0.531309 0.580566C0.239089 0.580566 0 0.815861 0 1.10808C0 1.25229 0.0607211 1.38512 0.166983 1.49138L2.74763 3.99613L0.166983 6.50846C0.0607211 6.61093 0 6.74375 0 6.89176C0 7.18398 0.239089 7.41928 0.531309 7.41928C0.675522 7.41928 0.800759 7.36994 0.899431 7.26747L3.81025 4.42117C3.94307 4.29594 4 4.15931 4 3.99992Z",
|
29
|
+
fill: "black"
|
30
|
+
}, null, -1), O = [
|
31
|
+
F
|
32
|
+
], ce = {
|
33
|
+
__name: "Breadcrumbs",
|
34
|
+
setup(e) {
|
35
|
+
const t = U(), { t: a, locale: n } = A(), m = z(() => t.matched.map((c) => {
|
36
|
+
var x, y, b;
|
37
|
+
const h = (x = c.meta) == null ? void 0 : x.title, P = n == null ? void 0 : n.value, v = h && P && h[P], u = c.path.replace(/:.+?\//g, (Y) => ""), V = (b = (y = c.meta) == null ? void 0 : y.breadcrumbs) == null ? void 0 : b.hidden;
|
38
|
+
return { name: v, path: u, isHidden: V };
|
39
|
+
}).filter((c) => c.name && !c.isHidden));
|
40
|
+
return (c, h) => {
|
41
|
+
const P = $("router-link");
|
42
|
+
return i(), d("ol", M, [
|
43
|
+
(i(!0), d(H, null, I(p(m), (v, u) => (i(), d("li", {
|
44
|
+
key: u,
|
45
|
+
class: C(["flex-v-center flex-nowrap flex", { "t-main": u === p(m).length - 1 }])
|
46
|
+
}, [
|
47
|
+
u === 0 ? (i(), d("svg", N, Z)) : _("", !0),
|
48
|
+
u !== p(m).length - 1 ? (i(), R(P, {
|
49
|
+
key: 1,
|
50
|
+
to: u === 0 ? "/" : v.path
|
51
|
+
}, {
|
52
|
+
default: S(() => [
|
53
|
+
B(w(v.name), 1)
|
54
|
+
]),
|
55
|
+
_: 2
|
56
|
+
}, 1032, ["to"])) : (i(), d("span", q, w(v.name), 1)),
|
57
|
+
u !== p(m).length - 1 ? (i(), d("svg", D, O)) : _("", !0)
|
58
|
+
], 2))), 128))
|
59
|
+
]);
|
60
|
+
};
|
61
|
+
}
|
62
|
+
};
|
63
|
+
const G = { class: "flex-v-center flex-nowrap flex" }, J = {
|
64
|
+
key: 0,
|
65
|
+
class: "mn-r-auto t-transp mn-r-small"
|
66
|
+
}, K = ["name", "value", "checked"], Q = {
|
67
|
+
__name: "Checkbox",
|
68
|
+
props: {
|
69
|
+
label: String,
|
70
|
+
name: String,
|
71
|
+
value: String,
|
72
|
+
radio: {
|
73
|
+
type: Array,
|
74
|
+
default: []
|
75
|
+
}
|
76
|
+
},
|
77
|
+
emits: ["update:radio"],
|
78
|
+
setup(e, { emit: t }) {
|
79
|
+
const a = e, n = (m) => {
|
80
|
+
let c = a.radio;
|
81
|
+
if (m.target.checked)
|
82
|
+
c.push(a.value);
|
83
|
+
else {
|
84
|
+
const h = c.indexOf(a.value);
|
85
|
+
h !== -1 && c.splice(h, 1);
|
86
|
+
}
|
87
|
+
t("update:radio", c);
|
88
|
+
};
|
89
|
+
return (m, c) => (i(), d("label", G, [
|
90
|
+
e.label ? (i(), d("div", J, [
|
91
|
+
g("span", null, w(e.label), 1)
|
92
|
+
])) : _("", !0),
|
93
|
+
g("input", {
|
94
|
+
onChange: n,
|
95
|
+
class: "round radiobutton",
|
96
|
+
type: "checkbox",
|
97
|
+
name: e.name,
|
98
|
+
value: e.value,
|
99
|
+
checked: e.radio.includes(e.value)
|
100
|
+
}, null, 40, K),
|
101
|
+
g("div", {
|
102
|
+
class: C(["transition-elastic pd-thin h-2r w-4r radius-extra", {
|
103
|
+
"bg-grey": !e.radio.includes(e.value),
|
104
|
+
"bg-main": e.radio.includes(e.value)
|
105
|
+
}])
|
106
|
+
}, [
|
107
|
+
g("div", {
|
108
|
+
class: C(["transition-linear w-1r h-1r radius-extra h-100 bg-white", {
|
109
|
+
"mn-r-auto": !e.radio.includes(e.value),
|
110
|
+
"mn-l-auto": e.radio.includes(e.value)
|
111
|
+
}])
|
112
|
+
}, null, 2)
|
113
|
+
], 2)
|
114
|
+
]));
|
115
|
+
}
|
116
|
+
}, oe = /* @__PURE__ */ E(Q, [["__scopeId", "data-v-2276d48f"]]), o = j.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = k({
|
117
|
+
all: [],
|
118
|
+
current: {
|
119
|
+
recommendation: !1,
|
120
|
+
category: [],
|
121
|
+
status: "unpublished",
|
122
|
+
information: [],
|
123
|
+
coverImage: "",
|
124
|
+
images: [],
|
125
|
+
files: [],
|
126
|
+
image3d: !1,
|
127
|
+
name: "",
|
128
|
+
sale: 0,
|
129
|
+
price: 0,
|
130
|
+
localization: [],
|
131
|
+
modifications: [],
|
132
|
+
description: ""
|
133
|
+
}
|
134
|
+
}), le = {
|
135
|
+
async create(e, t) {
|
136
|
+
const a = {
|
137
|
+
...t,
|
138
|
+
organization: e
|
139
|
+
};
|
140
|
+
return await o.post("/products/create", a).then(
|
141
|
+
(n) => (W(n.data, "current"), Promise.resolve(n.data)),
|
142
|
+
(n) => (s(n), Promise.reject(n))
|
143
|
+
);
|
144
|
+
},
|
145
|
+
async read(e = {}) {
|
146
|
+
e._id && (e.params = { _id: e._id }), e.category && (e.params = e.params || {}, e.params.category = e.category), e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 10, e.organization && (e.params.organization = e.organization), e.params.sort = "createdAt";
|
147
|
+
try {
|
148
|
+
console.log("Request params:" + e.params);
|
149
|
+
const t = await o.get("/products/read", { params: e.params });
|
150
|
+
return e._id ? r.current = t.data[0] : r.all = t.data, Promise.resolve(t.data);
|
151
|
+
} catch (t) {
|
152
|
+
return s(t), Promise.reject(t);
|
153
|
+
}
|
154
|
+
},
|
155
|
+
async update(e, t) {
|
156
|
+
return await o.post("/products/" + e, t).then(
|
157
|
+
(a) => Promise.resolve(a.data),
|
158
|
+
(a) => (s(a), Promise.reject(a))
|
159
|
+
);
|
160
|
+
},
|
161
|
+
async deleteProduct(e) {
|
162
|
+
return await o.delete("/products/" + e).then(
|
163
|
+
(t) => Promise.resolve(t.data),
|
164
|
+
(t) => (s(t), Promise.reject(t))
|
165
|
+
);
|
166
|
+
},
|
167
|
+
async submitMood(e = null) {
|
168
|
+
return console.log(e), o.post("/product/recommended", { mood: e }).then(
|
169
|
+
(t) => (r.current = t.data.product, r.current.recommendation = t.data.recommendationText, Promise.resolve(t.data)),
|
170
|
+
(t) => (console.log(t), s(t), Promise.reject(t))
|
171
|
+
);
|
172
|
+
},
|
173
|
+
async fetchProducts() {
|
174
|
+
return await o.get("/products").then(
|
175
|
+
(e) => (r.all = e.data, r.filtered = e.data.slice(), r.filteredPrice = r.filtered, r.filteredPrice.sort(function(t, a) {
|
176
|
+
return t[r.sort.current] > a[r.sort.current] ? r.sort.ascending ? 1 : -1 : t[r.sort.current] < a[r.sort.current] ? r.sort.ascending ? -1 : 1 : 0;
|
177
|
+
}), Promise.resolve(e.data)),
|
178
|
+
(e) => (s(e), Promise.reject(e))
|
179
|
+
);
|
180
|
+
},
|
181
|
+
async fetchProductsPopular() {
|
182
|
+
return await o.get("/products/popular").then(
|
183
|
+
(e) => (r.popular = e.data, Promise.resolve(e.data)),
|
184
|
+
(e) => (s(e), Promise.reject(e))
|
185
|
+
);
|
186
|
+
},
|
187
|
+
async fetchProductsPublished() {
|
188
|
+
return await o.get("/products").then(
|
189
|
+
(e) => {
|
190
|
+
let t = e.data.filter(function(a, n) {
|
191
|
+
return a.status !== "unpublished";
|
192
|
+
});
|
193
|
+
return r.all = t, r.filtered = t.slice(), r.filteredPrice = r.filtered, r.filteredPrice.sort(function(a, n) {
|
194
|
+
return a[r.sort.current] > n[r.sort.current] ? r.sort.ascending ? 1 : -1 : a[r.sort.current] < n[r.sort.current] ? r.sort.ascending ? -1 : 1 : 0;
|
195
|
+
}), Promise.resolve(e.data);
|
196
|
+
},
|
197
|
+
(e) => (s(e), Promise.reject(e))
|
198
|
+
);
|
199
|
+
},
|
200
|
+
async fetchProduct(e) {
|
201
|
+
return await o.get("/products/" + e).then(
|
202
|
+
(t) => (t.localization || (t.localization = []), r.current = t.data, Promise.resolve(t.data)),
|
203
|
+
(t) => (s(t), Promise.reject(t))
|
204
|
+
);
|
205
|
+
},
|
206
|
+
async fetchProductPopular() {
|
207
|
+
return await o.get("/products").then(
|
208
|
+
(e) => (r.all = e.data.slice(1, 5), Promise.resolve(e.data.slice(1, 5))),
|
209
|
+
(e) => (s(e), Promise.reject(e))
|
210
|
+
);
|
211
|
+
}
|
212
|
+
};
|
213
|
+
function W(e, t) {
|
214
|
+
r[t] = e;
|
215
|
+
}
|
216
|
+
L(r, (e, t) => {
|
217
|
+
});
|
218
|
+
const X = process.env.API_URL, f = j.create({ baseURL: X, withCredentials: !0 }), l = k({
|
219
|
+
all: [],
|
220
|
+
current: {
|
221
|
+
order: "1",
|
222
|
+
name: "",
|
223
|
+
url: "",
|
224
|
+
subcategories: [],
|
225
|
+
filters: [],
|
226
|
+
localization: []
|
227
|
+
}
|
228
|
+
}), ie = {
|
229
|
+
async fetchCategories() {
|
230
|
+
return await f.get("/categories").then(
|
231
|
+
(e) => (l.all = e.data, Promise.resolve(e.data)),
|
232
|
+
(e) => (s(e), Promise.reject(e))
|
233
|
+
);
|
234
|
+
},
|
235
|
+
updateCategories(e) {
|
236
|
+
return f.post("/categories", e).then(
|
237
|
+
(t) => (l.all = e, Promise.resolve(e)),
|
238
|
+
(t) => (s(t), Promise.reject(t))
|
239
|
+
);
|
240
|
+
},
|
241
|
+
fetchCategory(e) {
|
242
|
+
return f.get("/categories/" + e).then(
|
243
|
+
(t) => (l.current = t.data, Promise.resolve(t.data)),
|
244
|
+
(t) => (s(t), Promise.reject(t))
|
245
|
+
);
|
246
|
+
},
|
247
|
+
addCategory() {
|
248
|
+
return f.post("/categories/add", l.current).then(
|
249
|
+
(e) => (l.all.push(e.data), Promise.resolve(e.data)),
|
250
|
+
(e) => (s(e), Promise.reject(e))
|
251
|
+
);
|
252
|
+
},
|
253
|
+
updateCategory(e) {
|
254
|
+
return f.post("/categories/" + e, l.current).then(
|
255
|
+
(t) => (l.current = t.data, Promise.resolve(t.data)),
|
256
|
+
(t) => (s(t), Promise.reject(t))
|
257
|
+
);
|
258
|
+
},
|
259
|
+
deleteCategory(e) {
|
260
|
+
return f.delete("/categories/" + e).then(
|
261
|
+
(t) => {
|
262
|
+
const a = l.all.findIndex((n) => n.url === e);
|
263
|
+
l.all.splice(a, 1);
|
264
|
+
},
|
265
|
+
(t) => {
|
266
|
+
s(t);
|
267
|
+
}
|
268
|
+
);
|
269
|
+
}
|
270
|
+
};
|
271
|
+
L(l, (e) => {
|
272
|
+
});
|
273
|
+
export {
|
274
|
+
oe as C,
|
275
|
+
ce as _,
|
276
|
+
ie as a,
|
277
|
+
le as b,
|
278
|
+
l as c,
|
279
|
+
r as s
|
280
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const r=require("vue"),k=require("vue-router"),w=require("vue-i18n"),c=require("./globals-d7a54bb4.js");require("./Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js");const v=require("./auth-78fd9408.js"),x={class:"breadcrumbs flex-row flex-nowrap flex-left flex","aria-label":"breadcrumbs"},y={key:0,class:"i-small mn-r-thin",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b=r.createElementVNode("path",{fill:"black",d:"M0.494141 4.26391C0.494141 4.48862 0.659906 4.66912 0.928813 4.66912C1.05037 4.66912 1.16825 4.6065 1.27139 4.52177L1.64344 4.20866V7.56448C1.64344 8.13545 1.98971 8.47803 2.5791 8.47803H7.56678C8.15616 8.47803 8.50243 8.13545 8.50243 7.56448V4.19392L8.8929 4.52177C8.99604 4.6065 9.11392 4.66912 9.23916 4.66912C9.48597 4.66912 9.67015 4.5144 9.67015 4.27128C9.67015 4.1313 9.61121 4.01343 9.5007 3.92133L8.50243 3.08146V1.47538C8.50243 1.30961 8.3956 1.1991 8.22984 1.1991H7.63308C7.46732 1.1991 7.35313 1.30961 7.35313 1.47538V2.11634L5.66969 0.70181C5.31606 0.403433 4.85928 0.403433 4.50197 0.70181L0.663589 3.92133C0.553079 4.01711 0.494141 4.14235 0.494141 4.26391ZM6.13752 5.26219C6.13752 5.08906 6.02701 4.97855 5.85387 4.97855H4.31779C4.14097 4.97855 4.02678 5.08906 4.02678 5.26219V7.63447H2.83327C2.60856 7.63447 2.48332 7.50922 2.48332 7.28084V3.5014L4.90349 1.47538C5.01768 1.37592 5.15029 1.37592 5.26817 1.47538L7.66255 3.48298V7.28084C7.66255 7.50922 7.53731 7.63447 7.3126 7.63447H6.13752V5.26219Z"},null,-1),E=[b],B={key:2},V={key:3,class:"i-small chevron",viewBox:"0 0 4 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},L=r.createElementVNode("path",{d:"M4 3.99992C4 3.83673 3.94307 3.70391 3.81025 3.57867L0.899431 0.732369C0.800759 0.629902 0.679317 0.580566 0.531309 0.580566C0.239089 0.580566 0 0.815861 0 1.10808C0 1.25229 0.0607211 1.38512 0.166983 1.49138L2.74763 3.99613L0.166983 6.50846C0.0607211 6.61093 0 6.74375 0 6.89176C0 7.18398 0.239089 7.41928 0.531309 7.41928C0.675522 7.41928 0.800759 7.36994 0.899431 7.26747L3.81025 4.42117C3.94307 4.29594 4 4.15931 4 3.99992Z",fill:"black"},null,-1),j=[L],z={__name:"Breadcrumbs",setup(e){const t=k.useRoute(),{t:n,locale:s}=w.useI18n(),d=r.computed(()=>t.matched.map(o=>{var p,P,C;const m=(p=o.meta)==null?void 0:p.title,g=s==null?void 0:s.value,f=m&&g&&m[g],u=o.path.replace(/:.+?\//g,D=>""),_=(C=(P=o.meta)==null?void 0:P.breadcrumbs)==null?void 0:C.hidden;return{name:f,path:u,isHidden:_}}).filter(o=>o.name&&!o.isHidden));return(o,m)=>{const g=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("ol",x,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(d),(f,u)=>(r.openBlock(),r.createElementBlock("li",{key:u,class:r.normalizeClass(["flex-v-center flex-nowrap flex",{"t-main":u===r.unref(d).length-1}])},[u===0?(r.openBlock(),r.createElementBlock("svg",y,E)):r.createCommentVNode("",!0),u!==r.unref(d).length-1?(r.openBlock(),r.createBlock(g,{key:1,to:u===0?"/":f.path},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(f.name),1)]),_:2},1032,["to"])):(r.openBlock(),r.createElementBlock("span",B,r.toDisplayString(f.name),1)),u!==r.unref(d).length-1?(r.openBlock(),r.createElementBlock("svg",V,j)):r.createCommentVNode("",!0)],2))),128))])}}};const $={class:"flex-v-center flex-nowrap flex"},N={key:0,class:"mn-r-auto t-transp mn-r-small"},S=["name","value","checked"],I={__name:"Checkbox",props:{label:String,name:String,value:String,radio:{type:Array,default:[]}},emits:["update:radio"],setup(e,{emit:t}){const n=e,s=d=>{let o=n.radio;if(d.target.checked)o.push(n.value);else{const m=o.indexOf(n.value);m!==-1&&o.splice(m,1)}t("update:radio",o)};return(d,o)=>(r.openBlock(),r.createElementBlock("label",$,[e.label?(r.openBlock(),r.createElementBlock("div",N,[r.createElementVNode("span",null,r.toDisplayString(e.label),1)])):r.createCommentVNode("",!0),r.createElementVNode("input",{onChange:s,class:"round radiobutton",type:"checkbox",name:e.name,value:e.value,checked:e.radio.includes(e.value)},null,40,S),r.createElementVNode("div",{class:r.normalizeClass(["transition-elastic pd-thin h-2r w-4r radius-extra",{"bg-grey":!e.radio.includes(e.value),"bg-main":e.radio.includes(e.value)}])},[r.createElementVNode("div",{class:r.normalizeClass(["transition-linear w-1r h-1r radius-extra h-100 bg-white",{"mn-r-auto":!e.radio.includes(e.value),"mn-l-auto":e.radio.includes(e.value)}])},null,2)],2)]))}},R=v._export_sfc(I,[["__scopeId","data-v-2276d48f"]]),i=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),a=r.reactive({all:[],current:{recommendation:!1,category:[],status:"unpublished",information:[],coverImage:"",images:[],files:[],image3d:!1,name:"",sale:0,price:0,localization:[],modifications:[],description:""}}),q={async create(e,t){const n={...t,organization:e};return await i.post("/products/create",n).then(s=>(H(s.data,"current"),Promise.resolve(s.data)),s=>(c.setError(s),Promise.reject(s)))},async read(e={}){e._id&&(e.params={_id:e._id}),e.category&&(e.params=e.params||{},e.params.category=e.category),e.params=e.params||{},e.params.skip=e.skip||0,e.params.limit=e.limit||10,e.organization&&(e.params.organization=e.organization),e.params.sort="createdAt";try{console.log("Request params:"+e.params);const t=await i.get("/products/read",{params:e.params});return e._id?a.current=t.data[0]:a.all=t.data,Promise.resolve(t.data)}catch(t){return c.setError(t),Promise.reject(t)}},async update(e,t){return await i.post("/products/"+e,t).then(n=>Promise.resolve(n.data),n=>(c.setError(n),Promise.reject(n)))},async deleteProduct(e){return await i.delete("/products/"+e).then(t=>Promise.resolve(t.data),t=>(c.setError(t),Promise.reject(t)))},async submitMood(e=null){return console.log(e),i.post("/product/recommended",{mood:e}).then(t=>(a.current=t.data.product,a.current.recommendation=t.data.recommendationText,Promise.resolve(t.data)),t=>(console.log(t),c.setError(t),Promise.reject(t)))},async fetchProducts(){return await i.get("/products").then(e=>(a.all=e.data,a.filtered=e.data.slice(),a.filteredPrice=a.filtered,a.filteredPrice.sort(function(t,n){return t[a.sort.current]>n[a.sort.current]?a.sort.ascending?1:-1:t[a.sort.current]<n[a.sort.current]?a.sort.ascending?-1:1:0}),Promise.resolve(e.data)),e=>(c.setError(e),Promise.reject(e)))},async fetchProductsPopular(){return await i.get("/products/popular").then(e=>(a.popular=e.data,Promise.resolve(e.data)),e=>(c.setError(e),Promise.reject(e)))},async fetchProductsPublished(){return await i.get("/products").then(e=>{let t=e.data.filter(function(n,s){return n.status!=="unpublished"});return a.all=t,a.filtered=t.slice(),a.filteredPrice=a.filtered,a.filteredPrice.sort(function(n,s){return n[a.sort.current]>s[a.sort.current]?a.sort.ascending?1:-1:n[a.sort.current]<s[a.sort.current]?a.sort.ascending?-1:1:0}),Promise.resolve(e.data)},e=>(c.setError(e),Promise.reject(e)))},async fetchProduct(e){return await i.get("/products/"+e).then(t=>(t.localization||(t.localization=[]),a.current=t.data,Promise.resolve(t.data)),t=>(c.setError(t),Promise.reject(t)))},async fetchProductPopular(){return await i.get("/products").then(e=>(a.all=e.data.slice(1,5),Promise.resolve(e.data.slice(1,5))),e=>(c.setError(e),Promise.reject(e)))}};function H(e,t){a[t]=e}r.watch(a,(e,t)=>{});const U=process.env.API_URL,h=v.axios.create({baseURL:U,withCredentials:!0}),l=r.reactive({all:[],current:{order:"1",name:"",url:"",subcategories:[],filters:[],localization:[]}}),A={async fetchCategories(){return await h.get("/categories").then(e=>(l.all=e.data,Promise.resolve(e.data)),e=>(c.setError(e),Promise.reject(e)))},updateCategories(e){return h.post("/categories",e).then(t=>(l.all=e,Promise.resolve(e)),t=>(c.setError(t),Promise.reject(t)))},fetchCategory(e){return h.get("/categories/"+e).then(t=>(l.current=t.data,Promise.resolve(t.data)),t=>(c.setError(t),Promise.reject(t)))},addCategory(){return h.post("/categories/add",l.current).then(e=>(l.all.push(e.data),Promise.resolve(e.data)),e=>(c.setError(e),Promise.reject(e)))},updateCategory(e){return h.post("/categories/"+e,l.current).then(t=>(l.current=t.data,Promise.resolve(t.data)),t=>(c.setError(t),Promise.reject(t)))},deleteCategory(e){return h.delete("/categories/"+e).then(t=>{const n=l.all.findIndex(s=>s.url===e);l.all.splice(n,1)},t=>{c.setError(t)})}};r.watch(l,e=>{});exports.Checkbox=R;exports._sfc_main=z;exports.actions=A;exports.actions$1=q;exports.state=a;exports.state$1=l;
|