@ozdao/prometheus-framework 0.0.85 → 0.0.86

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs +138 -0
  2. package/dist/ButtonFollow-728aab73.mjs +130 -0
  3. package/dist/CardHeader-ce5a1a75.mjs +96 -0
  4. package/dist/CardOrganization-58b54995.js +1 -0
  5. package/dist/CardOrganization-91e79698.mjs +320 -0
  6. package/dist/Comments-c092550f.mjs +76 -0
  7. package/dist/EditProductImages-61ff4321.mjs +236 -0
  8. package/dist/Feed-926cf4f3.mjs +355 -0
  9. package/dist/Feed-a31c43c2.mjs +423 -0
  10. package/dist/PlaceholderUserpic-995da0fc.mjs +28 -0
  11. package/dist/Popup-0c791801.mjs +76 -0
  12. package/dist/Product-6c37ef35.js +7 -0
  13. package/dist/Product-7087b358.mjs +837 -0
  14. package/dist/ProductEdit-c5067942.mjs +113 -0
  15. package/dist/ProfileBlogposts-79d5c858.mjs +63 -0
  16. package/dist/ProfileComments-48f3d4bc.mjs +43 -0
  17. package/dist/ProfileEvents-20695376.mjs +55 -0
  18. package/dist/ProfileLikes-503712ec.mjs +43 -0
  19. package/dist/ProfileOrganizations-3f305f4e.mjs +210 -0
  20. package/dist/ProfileOrganizations-50fce34e.js +1 -0
  21. package/dist/Publics-49dbeafc.js +1 -0
  22. package/dist/Publics-b0fad2b0.mjs +1926 -0
  23. package/dist/UploadImage-d1dbc280.mjs +99 -0
  24. package/dist/auth-35ef1791.mjs +1502 -0
  25. package/dist/auth.client.js +3 -3
  26. package/dist/auth.validation-29113f37.mjs +20 -0
  27. package/dist/categories-d669f3af.mjs +225 -0
  28. package/dist/community.client.cjs +1 -1
  29. package/dist/community.client.js +11 -11
  30. package/dist/events.client.js +9 -9
  31. package/dist/modules/icons/entities/IconCommunity.vue.d.ts +2 -0
  32. package/dist/organizations.client.cjs +2 -2
  33. package/dist/organizations.client.js +17 -17
  34. package/dist/organizations.server.js +1 -1
  35. package/dist/organizations.server.mjs +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/users.client.cjs +1 -1
  38. package/dist/users.client.js +244 -207
  39. package/package.json +1 -1
  40. package/src/modules/icons/entities/IconCommunity.vue +8 -0
  41. package/src/modules/organizations/components/blocks/CardOrganization.vue +2 -2
  42. package/src/modules/organizations/components/sections/Publics.vue +1 -0
  43. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  44. package/src/modules/users/components/pages/Profile.vue +15 -4
@@ -0,0 +1,320 @@
1
+ import { a as w, C as g } from "./auth-35ef1791.mjs";
2
+ import { reactive as p, watch as C, openBlock as s, createElementBlock as i, createCommentVNode as c, createElementVNode as t, createTextVNode as h, toDisplayString as n, Fragment as f, renderList as b, createBlock as y, withModifiers as x } from "vue";
3
+ import { s as m } from "./globals-96ba60e4.mjs";
4
+ import { useRouter as v } from "vue-router";
5
+ import { B as z } from "./ButtonFollow-728aab73.mjs";
6
+ const u = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), d = p({
7
+ all: [],
8
+ current: {
9
+ _id: null,
10
+ profile: {
11
+ tags: [],
12
+ photo: "",
13
+ name: "",
14
+ description: ""
15
+ },
16
+ structure: [],
17
+ owner: null,
18
+ types: "",
19
+ contacts: {
20
+ email: "",
21
+ website: "",
22
+ phone: "",
23
+ address: ""
24
+ },
25
+ social: {
26
+ telegram: "",
27
+ line: "",
28
+ facebook: "",
29
+ instagram: ""
30
+ },
31
+ rating: {
32
+ popularity: 0,
33
+ median: 0,
34
+ amount: 0
35
+ }
36
+ }
37
+ }), k = {
38
+ // Create
39
+ async create(e, a) {
40
+ e.owner = a;
41
+ try {
42
+ const r = await u.post("/api/organizations/create", e);
43
+ return console.log("Organization created successfully"), d.current = r.data, r.data;
44
+ } catch (r) {
45
+ throw console.log("Organization creation failed"), m(r), r;
46
+ }
47
+ },
48
+ // Read
49
+ async read(e = {}) {
50
+ console.log(e), e.params = e.params || {}, e.location && (e.params.location = e.location), e.country && (e.params.country = e.country), e.state && (e.params.state = e.state), e.city && (e.params.city = e.city), e.categories && (e.params.categories = e.categories), e.prices && (e.params.prices = e.prices), e.delivery && (e.params.delivery = e.delivery), e._id && (e.params = e.params || {}, e.params._id = e._id), e.types && (e.params = e.params || [], e.params.types = e.types), e.owner && (e.params = e.params || {}, e.params.owner = e.owner), e.user && (e.params = e.params || {}, e.params.user = e.user), e.member && (e.params = e.params || {}, e.params.member = e.member), e.subscriber && (e.params = e.params || {}, e.params.subscriber = e.subscriber), e.postable && (e.params = e.params || {}, e.params.postable = e.postable), e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.sortParam = e.sort;
51
+ try {
52
+ console.log("Request params:" + e.params);
53
+ const a = await u.get("/api/organizations", { params: e.params });
54
+ return e._id ? (console.log(a.data), Object.assign(d.current || {}, a.data[0]), console.log(d.current)) : console.log(a.data), Promise.resolve(a.data);
55
+ } catch (a) {
56
+ return m(a), Promise.reject(a);
57
+ }
58
+ },
59
+ // Update
60
+ async update(e, a) {
61
+ return console.log(e, a), await u.post(`/api/organizations/${e}/update`, a).then(
62
+ (r) => (console.log("Organization updated successfully"), Promise.resolve(r.data)),
63
+ (r) => (console.log("Updating organization failed"), Promise.reject(r))
64
+ );
65
+ },
66
+ // Remove
67
+ async remove(e) {
68
+ await u.delete(`/api/organizations/${e}/delete`).then(
69
+ (a) => {
70
+ d.error = null;
71
+ let r = g.get("user"), l = JSON.parse(r);
72
+ return l.organization = null, g.set("user", JSON.stringify(l), { expires: 7, domain: ".osi.plus", sameSite: "none", secure: !0 }), Promise.resolve(a.data);
73
+ },
74
+ (a) => (m(a), Promise.reject(a))
75
+ ).catch((a) => {
76
+ m(a);
77
+ });
78
+ },
79
+ // Reset
80
+ async reset() {
81
+ d.current = {
82
+ _id: null,
83
+ profile: {
84
+ categories: [],
85
+ photo: "",
86
+ name: "",
87
+ description: ""
88
+ },
89
+ structure: [],
90
+ owner: null,
91
+ types: "",
92
+ contacts: {
93
+ email: "",
94
+ website: "",
95
+ phone: "",
96
+ address: ""
97
+ },
98
+ social: {
99
+ telegram: "",
100
+ line: "",
101
+ facebook: "",
102
+ instagram: ""
103
+ },
104
+ rating: {
105
+ popularity: 0,
106
+ median: 0,
107
+ amount: 0
108
+ }
109
+ };
110
+ }
111
+ };
112
+ C(d, (e, a) => {
113
+ });
114
+ const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
115
+ __proto__: null,
116
+ actions: k,
117
+ state: d
118
+ }, Symbol.toStringTag, { value: "Module" }));
119
+ const _ = { class: "flex-stretch flex-nojustify flex-nowrap flex shop-cart-item" }, $ = ["src"], O = {
120
+ key: 1,
121
+ width: "524",
122
+ height: "345",
123
+ viewBox: "0 0 524 345",
124
+ fill: "none",
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ class: "aspect-1x1",
127
+ style: { "object-fit": "cover" }
128
+ }, M = /* @__PURE__ */ t("rect", {
129
+ width: "524",
130
+ height: "345",
131
+ fill: "white"
132
+ }, null, -1), L = /* @__PURE__ */ t("rect", {
133
+ width: "524",
134
+ height: "345",
135
+ fill: "white"
136
+ }, null, -1), j = /* @__PURE__ */ t("circle", {
137
+ cx: "262",
138
+ cy: "172",
139
+ r: "56",
140
+ fill: "#00ff88",
141
+ "fill-opacity": "0.1"
142
+ }, null, -1), S = /* @__PURE__ */ t("path", {
143
+ fill: "#00ff88",
144
+ d: "M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"
145
+ }, null, -1), P = [
146
+ M,
147
+ L,
148
+ j,
149
+ S
150
+ ], V = { class: "text-left" }, B = { class: "name" }, I = {
151
+ key: 0,
152
+ class: "t-transp"
153
+ }, Z = {
154
+ key: 1,
155
+ class: "t-transp"
156
+ }, q = {
157
+ key: 2,
158
+ class: "t-transp"
159
+ }, F = { class: "t-main t-demi price mn-small" }, H = { key: 0 }, N = {
160
+ key: 0,
161
+ class: "flex-nojustify flex"
162
+ }, R = { class: "flex-nowrap flex" }, U = /* @__PURE__ */ t("svg", {
163
+ fill: "none",
164
+ height: "20",
165
+ viewBox: "0 0 20 20",
166
+ width: "20",
167
+ xmlns: "http://www.w3.org/2000/svg"
168
+ }, [
169
+ /* @__PURE__ */ t("path", {
170
+ "clip-rule": "evenodd",
171
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
172
+ fill: "#8a8a8a",
173
+ "fill-rule": "evenodd"
174
+ })
175
+ ], -1), E = [
176
+ U
177
+ ], J = {
178
+ __name: "CardOrderItem",
179
+ props: {
180
+ product: Object,
181
+ editable: String,
182
+ increase: Function,
183
+ decrease: Function,
184
+ remove: Function
185
+ },
186
+ setup(e) {
187
+ return v(), (a, r) => (s(), i("div", _, [
188
+ e.product.images[0] ? (s(), i("img", {
189
+ key: 0,
190
+ class: "bg-grey aspect-1x1",
191
+ src: e.product.images[0]
192
+ }, null, 8, $)) : c("", !0),
193
+ e.product.images[0] ? c("", !0) : (s(), i("svg", O, P)),
194
+ t("div", V, [
195
+ t("p", B, [
196
+ h(n(e.product.name) + " ", 1),
197
+ e.product.size ? (s(), i("span", I, ", " + n(e.product.size), 1)) : c("", !0),
198
+ typeof e.product.color == "string" && e.product.size ? (s(), i("span", Z, ", ")) : c("", !0),
199
+ typeof e.product.color == "string" ? (s(), i("span", q, n(e.product.color), 1)) : c("", !0)
200
+ ]),
201
+ t("p", F, [
202
+ e.editable ? (s(), i("span", H, n(e.product.quantity) + " x ", 1)) : c("", !0),
203
+ h(n(e.product.price) + " " + n(a.returnCurrency()), 1)
204
+ ]),
205
+ e.editable ? (s(), i("div", N, [
206
+ t("div", R, [
207
+ t("button", {
208
+ onClick: r[0] || (r[0] = (l) => e.decrease(e.product)),
209
+ class: "mn-r-thin bg-grey button-square button"
210
+ }, "-"),
211
+ t("button", {
212
+ onClick: r[1] || (r[1] = (l) => e.increase(e.product)),
213
+ class: "mn-r-thin bg-grey button-square button"
214
+ }, "+")
215
+ ]),
216
+ t("button", {
217
+ onClick: r[2] || (r[2] = (l) => e.remove(e.product)),
218
+ class: "hover_br-transp hover_br-l-dark bg-transp button-square button"
219
+ }, E)
220
+ ])) : c("", !0)
221
+ ])
222
+ ]));
223
+ }
224
+ }, T = { class: "pd-medium flex-v-center flex-nowrap flex" }, A = ["src"], D = {
225
+ key: 1,
226
+ class: "h-4r w-4r radius-extra",
227
+ width: "42",
228
+ height: "42",
229
+ viewBox: "0 0 42 42",
230
+ fill: "none",
231
+ xmlns: "http://www.w3.org/2000/svg"
232
+ }, G = /* @__PURE__ */ t("circle", {
233
+ fill: "rgb(var(--main))",
234
+ cx: "21",
235
+ cy: "21",
236
+ r: "21"
237
+ }, null, -1), K = /* @__PURE__ */ t("path", {
238
+ fill: "#242424",
239
+ "fill-opacity": "0.1",
240
+ "fill-rule": "evenodd",
241
+ "clip-rule": "evenodd",
242
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
243
+ }, null, -1), Q = [
244
+ G,
245
+ K
246
+ ], W = { class: "mn-l-small" }, X = { class: "h3 mn-r-semi mn-thin" }, Y = {
247
+ key: 0,
248
+ class: "w-max star-container flex-v-center flex"
249
+ }, ee = { class: "mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small" }, te = ["src"], ae = { class: "p-small t-semi mn-r-thin" }, re = { class: "p-small" }, se = { class: "mn-thin" }, ie = {
250
+ key: 0,
251
+ class: "pd-medium"
252
+ }, ne = { class: "mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium" }, le = { class: "t-black p-medium t-semi" }, ce = /* @__PURE__ */ t("span", { class: "mn-r-small" }, "30-60min", -1), oe = /* @__PURE__ */ t("span", { class: "mn-r-auto" }, "$50 min", -1), de = { class: "d-block o-scroll flex-nowrap flex" }, me = /* @__PURE__ */ t("button", { class: "flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button" }, "View menu", -1), we = {
253
+ __name: "CardOrganization",
254
+ props: {
255
+ user: String,
256
+ organization: Object
257
+ },
258
+ emits: ["updateMembership"],
259
+ setup(e, { emit: a }) {
260
+ return v(), (r, l) => (s(), i("div", {
261
+ class: "bg-grey radius-big o-hidden",
262
+ onClick: l[1] || (l[1] = (o) => r.$router.push({ name: "Organization", params: { _id: e.organization._id } }))
263
+ }, [
264
+ t("div", T, [
265
+ e.organization.profile.photo && e.organization.profile.photo.length > 0 ? (s(), i("img", {
266
+ key: 0,
267
+ src: e.organization.profile.photo,
268
+ class: "h-4r w-4r radius-extra"
269
+ }, null, 8, A)) : (s(), i("svg", D, Q)),
270
+ t("div", W, [
271
+ t("p", X, n(e.organization.profile.name), 1),
272
+ e.organization.ratingS ? (s(), i("div", Y, [
273
+ t("span", ee, n(e.organization.types[0]), 1),
274
+ (s(), i(f, null, b(5, (o) => t("img", {
275
+ class: "i-small mn-r-thin",
276
+ src: o <= e.organization.rating.median ? "/icons/star.svg" : "/icons/star-stroke.svg"
277
+ }, null, 8, te)), 64)),
278
+ t("span", ae, n(e.organization.rating.median), 1),
279
+ t("span", re, "(" + n(e.organization.rating.amount) + ")", 1)
280
+ ])) : c("", !0),
281
+ t("div", null, [
282
+ t("p", se, n(e.organization.numberOfMemberships) + " followers", 1),
283
+ e.user._id ? (s(), y(z, {
284
+ key: 0,
285
+ type: "organization",
286
+ isMember: e.organization.isMember,
287
+ targetId: e.organization._id,
288
+ userId: e.user,
289
+ class: "radius-big w-100",
290
+ onUpdateMembership: l[0] || (l[0] = (o) => a("updateMembership", o))
291
+ }, null, 8, ["isMember", "targetId", "userId"])) : c("", !0)
292
+ ])
293
+ ])
294
+ ]),
295
+ e.organization.products.length > 0 ? (s(), i("div", ie, [
296
+ t("div", ne, [
297
+ t("p", le, n(e.organization.products.length) + " items: ", 1),
298
+ ce,
299
+ oe
300
+ ]),
301
+ t("div", de, [
302
+ (s(!0), i(f, null, b(e.organization.products, (o) => (s(), y(J, {
303
+ onClick: x((ue) => r.$router.push({ name: "Product Organization", params: { _id: e.organization._id, product: o._id } }), ["stop"]),
304
+ key: o._id,
305
+ editable: !1,
306
+ product: o,
307
+ class: "pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"
308
+ }, null, 8, ["onClick", "product"]))), 128)),
309
+ me
310
+ ])
311
+ ])) : c("", !0)
312
+ ]));
313
+ }
314
+ };
315
+ export {
316
+ we as _,
317
+ k as a,
318
+ ve as o,
319
+ d as s
320
+ };
@@ -0,0 +1,76 @@
1
+ import { ref as u, openBlock as a, createElementBlock as r, createElementVNode as s, toDisplayString as d, createCommentVNode as p, withModifiers as _, withDirectives as b, vModelText as y, Fragment as h, renderList as w, createVNode as f } from "vue";
2
+ import { a as k } from "./auth-35ef1791.mjs";
3
+ import { _ as x } from "./CardHeader-ce5a1a75.mjs";
4
+ const C = { class: "mn-small" }, $ = /* @__PURE__ */ s("p", { class: "t-semi uppercase" }, "Please log in to leave a comment.", -1), S = [
5
+ $
6
+ ], V = {
7
+ key: 1,
8
+ class: "mn-small"
9
+ }, E = ["onSubmit"], L = /* @__PURE__ */ s("button", {
10
+ type: "submit",
11
+ class: "mn-l-auto bg-main button"
12
+ }, "Send", -1), N = { class: "pd-t-zero" }, U = { class: "p-big" }, I = {
13
+ __name: "Comments",
14
+ props: ["target", "owner", "type"],
15
+ setup(m) {
16
+ const o = m, c = k.create({ baseURL: process.env.API_URL }), l = u([]), n = u(""), g = async () => {
17
+ const { data: e } = await c.get(`/comments/read?type=${o.type}&target=${o.target}`);
18
+ l.value = e;
19
+ }, v = async () => {
20
+ if (n.value)
21
+ try {
22
+ const e = await c.post("/comments/create", {
23
+ target: o.target,
24
+ user: o.owner,
25
+ type: o.type,
26
+ content: n.value
27
+ });
28
+ e.data.owner = o.owner, l.value.push(e.data), n.value = "";
29
+ } catch (e) {
30
+ console.error(e);
31
+ }
32
+ };
33
+ return g(), (e, i) => (a(), r("div", null, [
34
+ s("div", null, [
35
+ s("h3", C, d(l.value.length) + " comments", 1),
36
+ m.owner ? p("", !0) : (a(), r("div", {
37
+ key: 0,
38
+ onClick: i[0] || (i[0] = (t) => e.$router.push({ name: "Sign In" })),
39
+ class: "cursor-pointer mn-small section bg-black t-white flex-center flex radius-big"
40
+ }, S)),
41
+ m.owner ? (a(), r("div", V, [
42
+ s("form", {
43
+ onSubmit: _(v, ["prevent"]),
44
+ class: "bg-grey radius-big pd-medium"
45
+ }, [
46
+ b(s("textarea", {
47
+ "onUpdate:modelValue": i[1] || (i[1] = (t) => n.value = t),
48
+ placeholder: "Enter your comment",
49
+ class: "pd-small p-big w-100 radius-small mn-r-small"
50
+ }, null, 512), [
51
+ [y, n.value]
52
+ ]),
53
+ L
54
+ ], 40, E)
55
+ ])) : p("", !0)
56
+ ]),
57
+ (a(!0), r(h, null, w(l.value, (t) => (a(), r("div", {
58
+ key: t._id,
59
+ class: "comment mn-small radius-big pd-medium bg-grey"
60
+ }, [
61
+ f(x, {
62
+ class: "mn-medium",
63
+ owner: { target: t.user },
64
+ creator: { target: t.user },
65
+ date: t.createdAt
66
+ }, null, 8, ["owner", "creator", "date"]),
67
+ s("div", N, [
68
+ s("p", U, d(t.content), 1)
69
+ ])
70
+ ]))), 128))
71
+ ]));
72
+ }
73
+ };
74
+ export {
75
+ I as _
76
+ };
@@ -0,0 +1,236 @@
1
+ import { toRefs as $, openBlock as n, createElementBlock as r, createTextVNode as U, toDisplayString as w, unref as e, createVNode as p, createElementVNode as o, createCommentVNode as y, createBlock as P, withCtx as N, Fragment as D, renderList as S, ref as C, withModifiers as B } from "vue";
2
+ import { F as _, b as E, a as V } from "./auth-35ef1791.mjs";
3
+ import { S as z } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs";
4
+ import { u as A } from "./vuex.esm-bundler-57d8b6ba.mjs";
5
+ import { V as F } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
6
+ import { s as x } from "./categories-d669f3af.mjs";
7
+ const L = { class: "mn-big flex-column flex" }, ne = {
8
+ __name: "EditProductInfo",
9
+ props: {
10
+ product: Object
11
+ },
12
+ setup(i) {
13
+ const c = i, t = A();
14
+ return $(c), (s, a) => (n(), r("div", L, [
15
+ U(w(e(t).products.current) + " ", 1),
16
+ p(z, {
17
+ options: [
18
+ "unpublished",
19
+ "published",
20
+ "archivied"
21
+ ],
22
+ select: e(t).products.state.current.status,
23
+ "onUpdate:select": a[0] || (a[0] = (l) => e(t).products.state.current.status = l),
24
+ placeholder: "Display product",
25
+ class: "w-100 mn-small bg-white radius-small pd-medium"
26
+ }, null, 8, ["select"]),
27
+ p(_, {
28
+ field: e(t).products.state.current.name,
29
+ "onUpdate:field": a[1] || (a[1] = (l) => e(t).products.state.current.name = l),
30
+ placeholder: "Введите название",
31
+ class: "w-100 mn-small bg-white radius-small pd-medium"
32
+ }, null, 8, ["field"]),
33
+ p(_, {
34
+ field: e(t).products.state.current.price,
35
+ "onUpdate:field": a[2] || (a[2] = (l) => e(t).products.state.current.price = l),
36
+ placeholder: "Введите цену",
37
+ class: "w-100 mn-small bg-white radius-small pd-medium",
38
+ type: "number"
39
+ }, null, 8, ["field"]),
40
+ p(_, {
41
+ field: e(t).products.state.current.description,
42
+ "onUpdate:field": a[3] || (a[3] = (l) => e(t).products.state.current.description = l),
43
+ placeholder: "Введите описание",
44
+ class: "w-100 mn-small bg-white radius-small pd-medium",
45
+ type: "textarea"
46
+ }, null, 8, ["field"])
47
+ ]));
48
+ }
49
+ }, j = { class: "mn-big" }, M = { class: "mn-small flex-nowrap flex" }, O = { class: "mn-r-thin" }, R = { class: "flex-column flex" }, T = {
50
+ key: 0,
51
+ class: "w-100 mn-small"
52
+ }, q = ["onClick"], G = /* @__PURE__ */ o("svg", {
53
+ class: "i-small",
54
+ fill: "none",
55
+ height: "20",
56
+ viewBox: "0 0 20 20",
57
+ width: "20",
58
+ xmlns: "http://www.w3.org/2000/svg"
59
+ }, [
60
+ /* @__PURE__ */ o("path", {
61
+ "clip-rule": "evenodd",
62
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
63
+ fill: "#8a8a8a",
64
+ "fill-rule": "evenodd"
65
+ })
66
+ ], -1), H = [
67
+ G
68
+ ], oe = {
69
+ __name: "EditParameters",
70
+ props: {
71
+ items: {
72
+ type: Array,
73
+ default: () => []
74
+ },
75
+ title: String,
76
+ addButtonLabel: String,
77
+ emptyMessage: String,
78
+ keyName: String,
79
+ valueName: String
80
+ },
81
+ emits: ["add-info", "delete-info"],
82
+ setup(i, { emit: c }) {
83
+ const t = i;
84
+ function s() {
85
+ c("add-info", {});
86
+ }
87
+ function a(d) {
88
+ c("delete-info", d);
89
+ }
90
+ const { items: l, title: f, emptyMessage: v, addButtonLabel: m, keyName: u, valueName: g } = $(t);
91
+ return (d, I) => (n(), r("div", j, [
92
+ o("div", M, [
93
+ o("h5", O, w(e(f)), 1),
94
+ o("button", {
95
+ onClick: s,
96
+ class: "i-small pd-thin button-delete button"
97
+ }, "+")
98
+ ]),
99
+ o("div", R, [
100
+ e(l).length == 0 ? (n(), r("p", T, w(e(v)), 1)) : y("", !0),
101
+ e(l).length == 0 ? (n(), P(E, {
102
+ key: 1,
103
+ onClick: s,
104
+ class: "button"
105
+ }, {
106
+ default: N(() => [
107
+ U(w(e(m)), 1)
108
+ ]),
109
+ _: 1
110
+ })) : y("", !0),
111
+ (n(!0), r(D, null, S(e(l), (h, k) => (n(), r("div", {
112
+ class: "mn-medium w-100 flex-nowrap flex",
113
+ key: k
114
+ }, [
115
+ p(_, {
116
+ field: h[e(u)],
117
+ "onUpdate:field": (b) => h[e(u)] = b,
118
+ placeholder: "Название параметра",
119
+ class: "w-100 mn-r-small bg-white radius-small pd-medium"
120
+ }, null, 8, ["field", "onUpdate:field"]),
121
+ p(_, {
122
+ field: h[e(g)],
123
+ "onUpdate:field": (b) => h[e(g)] = b,
124
+ placeholder: "Значение параметра",
125
+ class: "w-100 bg-white radius-small pd-medium"
126
+ }, null, 8, ["field", "onUpdate:field"]),
127
+ o("button", {
128
+ onClick: (b) => a(k),
129
+ class: "mn-l-small button"
130
+ }, H, 8, q)
131
+ ]))), 128))
132
+ ])
133
+ ]));
134
+ }
135
+ }, J = /* @__PURE__ */ o("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), K = {
136
+ __name: "UploadImageMultiple",
137
+ props: [
138
+ "uploadPath"
139
+ ],
140
+ emits: ["update:images"],
141
+ setup(i, { emit: c }) {
142
+ const t = i, s = C([]), a = C(null);
143
+ function l() {
144
+ a.value.click();
145
+ }
146
+ async function f(m) {
147
+ let u = m.target.files, g = new FormData();
148
+ for (let d = 0; d < u.length; d++)
149
+ g.append("file", u[d]);
150
+ try {
151
+ (await V.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(t.uploadPath)}`, g, {
152
+ headers: {
153
+ "Content-Type": "multipart/form-data"
154
+ }
155
+ })).data.forEach((h) => {
156
+ s.value.push(h.filepath);
157
+ }), c("update:images", s.value);
158
+ } catch (d) {
159
+ console.error(d);
160
+ }
161
+ }
162
+ function v(m) {
163
+ m.preventDefault(), f({
164
+ target: {
165
+ files: m.dataTransfer.files
166
+ }
167
+ });
168
+ }
169
+ return (m, u) => (n(), r("div", {
170
+ onClick: l,
171
+ onDrop: v,
172
+ onDragover: u[0] || (u[0] = B(() => {
173
+ }, ["prevent"])),
174
+ class: "flex-v-center flex-h-center flex"
175
+ }, [
176
+ J,
177
+ o("input", {
178
+ type: "file",
179
+ ref_key: "fileInput",
180
+ ref: a,
181
+ onChange: f,
182
+ multiple: "",
183
+ style: { display: "none" }
184
+ }, null, 544)
185
+ ], 32));
186
+ }
187
+ }, Q = {
188
+ key: 0,
189
+ class: "mn-big"
190
+ }, W = { class: "flex-column block" }, X = ["src"], Y = ["onClick"], re = {
191
+ __name: "EditProductImages",
192
+ props: {
193
+ product: Object
194
+ },
195
+ setup(i) {
196
+ function c(s) {
197
+ console.log(s), console.log(x.current.images), x.current.images.push(...s);
198
+ }
199
+ function t(s) {
200
+ x.current.images.splice(s, 1);
201
+ }
202
+ return (s, a) => (n(), r("div", null, [
203
+ i.product.images.length < 1 ? (n(), r("p", Q, " The product doesn't have any images yet. ")) : y("", !0),
204
+ p(e(F), {
205
+ class: "cols-4 dragArea list-group w-full",
206
+ list: i.product.images,
207
+ sort: !0,
208
+ onChange: s.log
209
+ }, {
210
+ default: N(() => [
211
+ (n(!0), r(D, null, S(i.product.images, (l, f) => (n(), r("div", W, [
212
+ o("img", {
213
+ class: "w-100 mn-small",
214
+ src: l
215
+ }, null, 8, X),
216
+ o("a", {
217
+ onClick: (v) => t(f),
218
+ class: "w-100 br-grey br-solid br-1px button"
219
+ }, "Удалить", 8, Y)
220
+ ]))), 256))
221
+ ]),
222
+ _: 1
223
+ }, 8, ["list", "onChange"]),
224
+ p(K, {
225
+ "onUpdate:images": c,
226
+ uploadPath: "organizations/" + s.$route.params._id + "/products",
227
+ class: "mn-t-semi pd-small w-100 button bg-main"
228
+ }, null, 8, ["uploadPath"])
229
+ ]));
230
+ }
231
+ };
232
+ export {
233
+ ne as _,
234
+ oe as a,
235
+ re as b
236
+ };