@ozdao/prometheus-framework 0.2.138 → 0.2.140

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/dist/auth.server.js +30 -15
  2. package/dist/auth.server.mjs +30 -15
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/events.server.js +3 -3
  6. package/dist/events.server.mjs +3 -3
  7. package/dist/files.server.js +3 -3
  8. package/dist/files.server.mjs +3 -3
  9. package/dist/gallery.server.js +4 -4
  10. package/dist/gallery.server.mjs +4 -4
  11. package/dist/index-DNI4aUP2.js +259 -0
  12. package/dist/index-Tcyehi73.mjs +260 -0
  13. package/dist/orders.server.js +9 -8
  14. package/dist/orders.server.mjs +9 -8
  15. package/dist/organizations.server.js +31 -15
  16. package/dist/organizations.server.mjs +31 -15
  17. package/dist/products.server.js +37 -5
  18. package/dist/products.server.mjs +37 -5
  19. package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +19 -19
  21. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  23. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  27. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +32 -31
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  39. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/auth/store/auth.js +50 -47
  41. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
  47. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  49. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
  63. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +2 -2
  65. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +5 -5
  67. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  71. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  73. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +1 -1
  75. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +16 -16
  79. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +5 -5
  81. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  83. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +42 -39
  89. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +121 -112
  95. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
  97. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +17 -16
  99. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  101. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +121 -61
  103. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -6
  105. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +25 -24
  107. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  109. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  119. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +3 -3
  121. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  123. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  127. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  131. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +2 -2
  135. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +4 -4
  137. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +66 -67
  139. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +4 -4
  141. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  143. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +78 -74
  145. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +2 -2
  149. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -5
  151. package/dist/reports.server.js +0 -3
  152. package/dist/reports.server.mjs +0 -3
  153. package/dist/style.css +1 -1
  154. package/dist/wallet.server.js +5 -5
  155. package/dist/wallet.server.mjs +8 -8
  156. package/package.json +1 -1
  157. package/src/components/Completion/Completion.vue +29 -30
  158. package/src/modules/auth/components/pages/Invite.vue +4 -2
  159. package/src/modules/auth/controllers/auth.controller.js +31 -13
  160. package/src/modules/auth/middlewares/authJwt.js +80 -0
  161. package/src/modules/{middlewares/server → auth/middlewares}/index.js +1 -3
  162. package/src/modules/{middlewares/server → auth/middlewares}/verifyAccesses.js +1 -1
  163. package/src/modules/auth/routes/auth.routes.js +2 -2
  164. package/src/modules/auth/routes/twofa.routes.js +1 -1
  165. package/src/modules/auth/store/auth.js +9 -0
  166. package/src/modules/chats/routes/chats.routes.js +1 -1
  167. package/src/modules/community/routes/blog.routes.js +2 -2
  168. package/src/modules/events/routes/events.routes.js +2 -2
  169. package/src/modules/files/routes/files.routes.js +2 -2
  170. package/src/modules/gallery/components/pages/Gallery.vue +1 -1
  171. package/src/modules/gallery/routes/gallery.routes.js +4 -5
  172. package/src/modules/globals/services/globals.crud.js +2 -2
  173. package/src/modules/marketplace/store/marketplace.js +1 -1
  174. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -2
  175. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  176. package/src/modules/orders/controllers/orders.controller.js +1 -2
  177. package/src/modules/orders/routes/applications.routes.js +2 -2
  178. package/src/modules/orders/routes/orders.routes.js +2 -2
  179. package/src/modules/organizations/components/blocks/CardOrganization.vue +9 -7
  180. package/src/modules/organizations/components/pages/Members.vue +26 -15
  181. package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
  182. package/src/modules/organizations/components/sections/MembersAdd.vue +101 -43
  183. package/src/modules/organizations/controllers/invites.controller.js +18 -13
  184. package/src/modules/organizations/controllers/memberships.controller.js +16 -9
  185. package/src/modules/organizations/controllers/organizations.controller.js +3 -4
  186. package/src/modules/organizations/models/membership.model.js +2 -0
  187. package/src/modules/organizations/models/organization.model.js +4 -0
  188. package/src/modules/organizations/routes/invites.routes.js +2 -2
  189. package/src/modules/organizations/store/invites.js +2 -1
  190. package/src/modules/products/controllers/leftovers.controller.js +1 -1
  191. package/src/modules/products/middlewares/index.js +11 -0
  192. package/src/modules/products/routes/categories.routes.js +2 -2
  193. package/src/modules/reports/routes/reports.routes.js +2 -2
  194. package/src/modules/spots/components/layouts/Spots.vue +2 -2
  195. package/src/modules/spots/components/pages/Map.vue +79 -78
  196. package/src/modules/users/components/pages/ProfileEdit.vue +37 -22
  197. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -2
  198. package/src/modules/wallet/controllers/routes/rewards.routes.js +2 -2
  199. package/src/modules/middlewares/server/authJwt.js +0 -68
  200. /package/src/modules/{middlewares/server → auth/middlewares}/authSecret.js +0 -0
  201. /package/src/modules/{middlewares/server → auth/middlewares}/verifyInvites.js +0 -0
  202. /package/src/modules/{middlewares/server → auth/middlewares}/verifySignUp.js +0 -0
  203. /package/src/modules/{middlewares/server → auth/middlewares}/verifyUser.js +0 -0
  204. /package/src/modules/globals/services/{globals.cashe.js → globals.cache.js} +0 -0
  205. /package/src/modules/{middlewares/server → products/middlewares}/verifyCategory.js +0 -0
@@ -1,74 +1,134 @@
1
- import { ref as r, openBlock as t, createElementBlock as e, createElementVNode as l, toDisplayString as b, Fragment as g, renderList as h, createVNode as s, withCtx as c } from "vue";
2
- import v from "../../../../components/Field/Field.vue.js";
3
- /* empty css */
4
- import x from "../../../../components/Button/Button.vue.js";
5
- import k from "../../../icons/navigation/IconDelete.vue.js";
6
- import w from "../../../icons/navigation/IconAdd.vue.js";
1
+ import { ref as c, resolveDirective as C, openBlock as s, createElementBlock as l, createElementVNode as d, toDisplayString as $, withDirectives as U, createVNode as a, isRef as m, unref as p, withCtx as u, Fragment as _, renderList as v, createBlock as E, createCommentVNode as N } from "vue";
2
+ import S from "../../../../components/Field/Field.vue2.js";
3
+ /* empty css */
4
+ import V from "../../../../components/Button/Button.vue2.js";
5
+ import z from "../../../../components/Feed/Feed.vue.js";
6
+ import B from "../../../globals/components/blocks/BlockSearch.vue.js";
7
+ import D from "../../../users/components/blocks/CardUser.vue.js";
8
+ import M from "../../../icons/navigation/IconDelete.vue.js";
9
+ import F from "../../../icons/navigation/IconAdd.vue.js";
7
10
  import "../../../middlewares/client/inputs.validation.js";
8
- import "../../store/invites.js";
9
- const y = { class: "mn-b-thin t-transp p-medium" }, C = { class: "cols-1 mn-b-small radius-medium pd-semi bg-light" }, $ = ["onClick"], E = /* @__PURE__ */ l("span", null, "Invite to organization", -1), D = {
11
+ import { actions as L } from "../../../users/store/users.js";
12
+ const j = { class: "mn-b-thin t-transp p-medium" }, A = { class: "mn-b-thin pos-relative" }, I = {
13
+ key: 0,
14
+ class: "mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-light pd-small radius-small"
15
+ }, O = { class: "cols-1 mn-b-small radius-medium pd-semi bg-light pos-relative" }, P = ["onClick"], R = /* @__PURE__ */ d("span", null, "Invite to organization", -1), ee = {
10
16
  __name: "MembersAdd",
11
17
  props: {
12
18
  organization: Object,
13
19
  text: String
14
20
  },
15
21
  emits: ["send-invite"],
16
- setup(m, { emit: d }) {
17
- const p = r(null), u = d, i = r([{ contact: "" }]);
18
- async function f() {
19
- u("send-invite", i.value);
22
+ setup(b, { emit: g }) {
23
+ let n = c(null), t = c(!1);
24
+ const k = c(null), x = g, r = c([{ contact: "" }]);
25
+ async function w() {
26
+ return new Promise((f, o) => {
27
+ x("send-invite", r.value, f, o);
28
+ });
20
29
  }
21
- return (V, n) => (t(), e("div", null, [
22
- l("p", y, b(m.text), 1),
23
- l("section", C, [
24
- (t(!0), e(g, null, h(i.value, (o, a) => (t(), e("div", {
25
- key: a,
26
- class: "br-1px br-solid br-grey-transp-25 flex gap-thin radius-small mn-b-thin"
27
- }, [
28
- s(v, {
29
- field: o.contact,
30
- "onUpdate:field": (_) => o.contact = _,
31
- placeholder: "Enter email or phone",
32
- class: "w-100 pd-small radius-small bg-white",
33
- validation: p.value
34
- }, {
35
- default: c(() => [
36
- a < 1 ? (t(), e("div", {
37
- key: 0,
38
- onClick: n[0] || (n[0] = () => i.value.push({ contact: "" })),
39
- class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"
40
- }, [
41
- s(w, {
42
- class: "i-medium",
43
- fill: "rgb(var(--white)"
44
- })
45
- ])) : (t(), e("div", {
46
- key: 1,
47
- onClick: () => i.value.splice(a, 1),
48
- class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"
49
- }, [
50
- s(k, {
51
- class: "i-medium",
52
- fill: "rgb(var(--white)"
53
- })
54
- ], 8, $))
55
- ]),
56
- _: 2
57
- }, 1032, ["field", "onUpdate:field", "validation"])
58
- ]))), 128))
59
- ]),
60
- s(x, {
61
- submit: f,
62
- class: "w-100 bg-main"
63
- }, {
64
- default: c(() => [
65
- E
30
+ return (f, o) => {
31
+ const y = C("click-outside");
32
+ return s(), l("div", null, [
33
+ d("p", j, $(b.text), 1),
34
+ d("div", A, [
35
+ U(a(B, {
36
+ onSearch: o[0] || (o[0] = (i) => {
37
+ m(n) ? n.value = i : n = i, m(t) ? t.value = !0 : t = !0;
38
+ }),
39
+ placeholder: "Enter name, phone or email",
40
+ class: "bg-grey"
41
+ }, null, 512), [
42
+ [y, () => {
43
+ m(t) ? t.value = !1 : t = !1;
44
+ }]
45
+ ]),
46
+ p(n) && p(t) ? (s(), l("div", I, [
47
+ a(z, {
48
+ states: {
49
+ empty: {
50
+ title: "No User Found",
51
+ description: "Currently, there are no such user."
52
+ }
53
+ },
54
+ store: {
55
+ read: (i) => L.read(i),
56
+ state: null
57
+ },
58
+ options: {
59
+ search: p(n)
60
+ },
61
+ showLoadMore: !1,
62
+ class: "h-max-20r o-scroll"
63
+ }, {
64
+ default: u(({
65
+ items: i
66
+ }) => [
67
+ (s(!0), l(_, null, v(i, (e, h) => (s(), E(D, {
68
+ key: e._id,
69
+ user: e,
70
+ photo: e.profile.photo,
71
+ name: e.profile.name || e.phone || e.email,
72
+ onClick: () => {
73
+ r.value.push({ contact: e.email || e.phone }), m(t) ? t.value = !1 : t = !1;
74
+ },
75
+ class: "bg-white h-2r pd-thin radius-medium w-100 mn-b-thin"
76
+ }, null, 8, ["user", "photo", "name", "onClick"]))), 128))
77
+ ]),
78
+ _: 1
79
+ }, 8, ["store", "options"])
80
+ ])) : N("", !0)
66
81
  ]),
67
- _: 1
68
- })
69
- ]));
82
+ d("section", O, [
83
+ (s(!0), l(_, null, v(r.value, (i, e) => (s(), l("div", {
84
+ key: e,
85
+ class: "br-1px br-solid br-grey-transp-25 flex gap-thin radius-small mn-b-thin"
86
+ }, [
87
+ a(S, {
88
+ field: i.contact,
89
+ "onUpdate:field": (h) => i.contact = h,
90
+ placeholder: "Enter email or phone",
91
+ class: "w-100 pd-small radius-small bg-white",
92
+ validation: k.value
93
+ }, {
94
+ default: u(() => [
95
+ e < 1 ? (s(), l("div", {
96
+ key: 0,
97
+ onClick: o[1] || (o[1] = () => r.value.push({ contact: "" })),
98
+ class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"
99
+ }, [
100
+ a(F, {
101
+ class: "i-medium",
102
+ fill: "rgb(var(--white)"
103
+ })
104
+ ])) : (s(), l("div", {
105
+ key: 1,
106
+ onClick: () => r.value.splice(e, 1),
107
+ class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"
108
+ }, [
109
+ a(M, {
110
+ class: "i-medium",
111
+ fill: "rgb(var(--white)"
112
+ })
113
+ ], 8, P))
114
+ ]),
115
+ _: 2
116
+ }, 1032, ["field", "onUpdate:field", "validation"])
117
+ ]))), 128))
118
+ ]),
119
+ a(V, {
120
+ submit: w,
121
+ class: "w-100 bg-main"
122
+ }, {
123
+ default: u(() => [
124
+ R
125
+ ]),
126
+ _: 1
127
+ })
128
+ ]);
129
+ };
70
130
  }
71
131
  };
72
132
  export {
73
- D as default
133
+ ee as default
74
134
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const q=require("../../../auth/store/auth.cjs");require("../../store/memberships.cjs");require("vue-i18n");;/* empty css */require("../../../reports/store/reports.cjs");const y=require("../../store/organizations.cjs"),m=require("../blocks/CardOrganization.vue.cjs"),b=require("../blocks/EmptyState.vue.cjs");;/* empty css */;/* empty css */const g={class:"for-transition bg-white radius-big w-100"},k={class:""},_={key:1,class:"cols-1"},h={__name:"Organizations",props:{owner:{type:String,default:null},user:{type:[String,Number],default:null},onlyuser:{type:[String,Number],default:null}},async setup(c){let t,u;const o=c,a=e.ref(null);a.value=([t,u]=e.withAsyncContext(()=>y.actions.read({owner:o.owner,user:o.user,onlyuser:o.onlyuser})),t=await t,u(),t);const d=s.useRouter(),n=s.useRoute();let p=n.query.tab?n.query.tab:"details";const i=e.ref(p);return n.query.tab=i.value,e.watch(i,r=>{d.replace({query:{...n.query,tab:r}})}),(r,v)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",k,[a.value<1?(e.openBlock(),e.createBlock(b.default,{key:0,title:"You Haven't Joined Any Organization Yet",description:"Weeder is all about community. Join an organization or maybe you want to create your own?",action:"Create organization",callback:r.a=()=>r.$router.push("/app/organization/create/details")},null,8,["callback"])):(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createBlock(m.default,{key:l._id,organization:l,user:q.state.user,onUpdateMembership:r.handleMembershipUpdate,class:e.normalizeClass(["w-100",{"mn-r-small":r.index!==a.value.length-1}])},null,8,["organization","user","onUpdateMembership","class"]))),128))]))])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const q=require("../../../auth/store/auth.cjs");require("../../store/memberships.cjs");require("vue-i18n");;/* empty css */require("../../../reports/store/reports.cjs");const y=require("../../store/organizations.cjs"),m=require("../blocks/CardOrganization.vue.cjs"),b=require("../blocks/EmptyState.vue.cjs");;/* empty css */;/* empty css */const g={class:"for-transition bg-white radius-big w-100"},k={class:""},_={key:1,class:"cols-1"},h={__name:"Organizations",props:{owner:{type:String,default:null},user:{type:[String,Number],default:null},onlyuser:{type:[String,Number],default:null}},async setup(c){let t,u;const o=c,a=e.ref(null);a.value=([t,u]=e.withAsyncContext(()=>y.actions.read({owner:o.owner,user:o.user,onlyuser:o.onlyuser})),t=await t,u(),t);const d=s.useRouter(),n=s.useRoute();let p=n.query.tab?n.query.tab:"details";const i=e.ref(p);return n.query.tab=i.value,e.watch(i,r=>{d.replace({query:{...n.query,tab:r}})}),(r,v)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",k,[a.value<1?(e.openBlock(),e.createBlock(b.default,{key:0,title:"You Haven't Joined Any Organization Yet",description:"Weeder is all about community. Join an organization or maybe you want to create your own?",action:"Create organization",callback:r.a=()=>r.$router.push("/app/organization/create/details")},null,8,["callback"])):(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createBlock(m.default,{key:l._id,organization:l,user:q.state.user,onUpdateMembership:r.handleMembershipUpdate,class:e.normalizeClass(["w-100",{"mn-r-small":r.index!==a.value.length-1}])},null,8,["organization","user","onUpdateMembership","class"]))),128))]))])]))}};exports.default=h;
@@ -2,16 +2,16 @@ import { ref as m, withAsyncContext as b, watch as _, openBlock as t, createElem
2
2
  import { useRouter as v, useRoute as z } from "vue-router";
3
3
  import "../../../../../../node_modules/js-cookie/dist/js.cookie.js";
4
4
  /* empty css */
5
- /* empty css */
6
- /* empty css */
7
- /* empty css */
8
- /* empty css */
9
- /* empty css */
10
5
  /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
11
  import { state as k } from "../../../auth/store/auth.js";
12
12
  import "../../store/memberships.js";
13
13
  import "vue-i18n";
14
- /* empty css */
14
+ /* empty css */
15
15
  import "../../../reports/store/reports.js";
16
16
  import { actions as q } from "../../store/organizations.js";
17
17
  import $ from "../blocks/CardOrganization.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("axios"),n=require("vue"),a=require("../../globals/store/globals.cjs"),i=require("../../auth/store/auth.cjs"),s=c.create({baseURL:process.env.API_URL,withCredentials:!0}),r=n.reactive({invites:[],invite:null,error:null}),l={async read(t){try{const e=await s.get(`/api/invites/${t.owner}`);return r.invites=e.data,r.error=null,e.data}catch(e){a.setError(e)}},async readOne(t){try{const e=await s.get(`/api/invites/get/${t}`);r.invite=e.data,i.state.user.phone=e.data.phone,i.state.user.email=e.data.email}catch(e){a.setError(e)}},async create(t){try{await s.post("/api/invites/create",t),r.error=null}catch(e){a.setError(e)}},async update(t,e){try{await s.put("/api/invites/update",e),r.error=null}catch(o){a.setError(o)}},async delete(t){try{await s.delete(`/api/invites/delete/${t}`),r.error=null}catch(e){a.setError(e)}}};n.watch(r,(t,e)=>{});exports.actions=l;exports.state=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("axios"),i=require("vue"),a=require("../../globals/store/globals.cjs"),n=require("../../auth/store/auth.cjs"),s=c.create({baseURL:process.env.API_URL,withCredentials:!0}),r=i.reactive({invites:[],invite:null,error:null}),l={async read(t){try{const e=await s.get(`/api/invites/${t.owner}`);return r.invites=e.data,r.error=null,e.data}catch(e){a.setError(e)}},async readOne(t){try{const e=await s.get(`/api/invites/get/${t}`);r.invite=e.data,n.state.user.phone=e.data.phone,n.state.user.email=e.data.email}catch(e){a.setError(e)}},async create(t){try{const e=await s.post("/api/invites/create",t);return Promise.resolve(e.data)}catch(e){a.setError(e)}},async update(t,e){try{await s.put("/api/invites/update",e),r.error=null}catch(o){a.setError(o)}},async delete(t){try{await s.delete(`/api/invites/delete/${t}`),r.error=null}catch(e){a.setError(e)}}};i.watch(r,(t,e)=>{});exports.actions=l;exports.state=r;
@@ -1,51 +1,52 @@
1
1
  import s from "axios";
2
2
  import { reactive as c, watch as l } from "vue";
3
3
  import { setError as a } from "../../globals/store/globals.js";
4
- import { state as n } from "../../auth/store/auth.js";
4
+ import { state as o } from "../../auth/store/auth.js";
5
5
  const i = s.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = c({
6
6
  invites: [],
7
7
  invite: null,
8
8
  error: null
9
9
  }), m = {
10
- async read(e) {
10
+ async read(t) {
11
11
  try {
12
- const t = await i.get(`/api/invites/${e.owner}`);
13
- return r.invites = t.data, r.error = null, t.data;
14
- } catch (t) {
15
- a(t);
12
+ const e = await i.get(`/api/invites/${t.owner}`);
13
+ return r.invites = e.data, r.error = null, e.data;
14
+ } catch (e) {
15
+ a(e);
16
16
  }
17
17
  },
18
- async readOne(e) {
18
+ async readOne(t) {
19
19
  try {
20
- const t = await i.get(`/api/invites/get/${e}`);
21
- r.invite = t.data, n.user.phone = t.data.phone, n.user.email = t.data.email;
22
- } catch (t) {
23
- a(t);
20
+ const e = await i.get(`/api/invites/get/${t}`);
21
+ r.invite = e.data, o.user.phone = e.data.phone, o.user.email = e.data.email;
22
+ } catch (e) {
23
+ a(e);
24
24
  }
25
25
  },
26
- async create(e) {
26
+ async create(t) {
27
27
  try {
28
- await i.post("/api/invites/create", e), r.error = null;
29
- } catch (t) {
30
- a(t);
28
+ const e = await i.post("/api/invites/create", t);
29
+ return Promise.resolve(e.data);
30
+ } catch (e) {
31
+ a(e);
31
32
  }
32
33
  },
33
- async update(e, t) {
34
+ async update(t, e) {
34
35
  try {
35
- await i.put("/api/invites/update", t), r.error = null;
36
- } catch (o) {
37
- a(o);
36
+ await i.put("/api/invites/update", e), r.error = null;
37
+ } catch (n) {
38
+ a(n);
38
39
  }
39
40
  },
40
- async delete(e) {
41
+ async delete(t) {
41
42
  try {
42
- await i.delete(`/api/invites/delete/${e}`), r.error = null;
43
- } catch (t) {
44
- a(t);
43
+ await i.delete(`/api/invites/delete/${t}`), r.error = null;
44
+ } catch (e) {
45
+ a(e);
45
46
  }
46
47
  }
47
48
  };
48
- l(r, (e, t) => {
49
+ l(r, (t, e) => {
49
50
  });
50
51
  export {
51
52
  m as actions,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../../../../components/Field/Field.vue.cjs"),c=require("../../../../components/Select/Select.vue.cjs");;/* empty css */const y=require("../../../icons/navigation/IconAdd.vue.cjs"),k=require("../../../icons/navigation/IconDelete.vue.cjs"),h={class:"gap-thin"},w={class:"gap-thin mn-b-thin flex-nowrap flex"},g={class:"bg-white w-100 w-min-15r br-solid br-1px br-black-transp-5 pd-small radius-small"},x=["disabled"],V={key:0,class:"gap-thin flex-nowrap flex"},N={__name:"CardPosition",props:{product:Object,products:Array,array:Array,showPrice:{type:Boolean,default:!0}},emits:["add","delete","update"],setup(s,{emit:p}){const l=s,n=p,u=e.ref(null),t=e.ref(1),a=e.ref("pcs"),d=e.ref(0),m=e.computed(()=>u.value&&t.value>0&&d.value>=0);e.watch(l.array,()=>{u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type}),l.product&&(u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type),e.watch([u,t,d,a],()=>{n("update",{...u.value,price:d.value,quantity:t.value||1,type:a.value})});function v(){n("add",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}function b(){n("delete",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}return(f,r)=>(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",w,[e.createElementVNode("div",g,e.toDisplayString(u.value.name||u.value._id.name),1),s.showPrice?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i.default,{key:0,field:t.value,"onUpdate:field":r[1]||(r[1]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 w-max-10r br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(c.default,{select:a.value,"onUpdate:select":r[0]||(r[0]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-light pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,disabled:!m.value,onClick:v,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(y.default),{class:"i-semi"})],8,x)),s.product?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:b,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(k.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),s.showPrice?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(i.default,{field:d.value,"onUpdate:field":r[2]||(r[2]=o=>d.value=o),type:"number",label:"Price",symbol:f.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(i.default,{field:t.value,"onUpdate:field":r[4]||(r[4]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(c.default,{select:a.value,"onUpdate:select":r[3]||(r[3]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-light pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])):e.createCommentVNode("",!0)]))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../../../../components/Field/Field.vue2.cjs"),c=require("../../../../components/Select/Select.vue2.cjs");;/* empty css */const y=require("../../../icons/navigation/IconAdd.vue.cjs"),k=require("../../../icons/navigation/IconDelete.vue.cjs"),h={class:"gap-thin"},w={class:"gap-thin mn-b-thin flex-nowrap flex"},g={class:"bg-white w-100 w-min-15r br-solid br-1px br-black-transp-5 pd-small radius-small"},x=["disabled"],V={key:0,class:"gap-thin flex-nowrap flex"},N={__name:"CardPosition",props:{product:Object,products:Array,array:Array,showPrice:{type:Boolean,default:!0}},emits:["add","delete","update"],setup(s,{emit:p}){const l=s,n=p,u=e.ref(null),t=e.ref(1),a=e.ref("pcs"),d=e.ref(0),m=e.computed(()=>u.value&&t.value>0&&d.value>=0);e.watch(l.array,()=>{u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type}),l.product&&(u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type),e.watch([u,t,d,a],()=>{n("update",{...u.value,price:d.value,quantity:t.value||1,type:a.value})});function v(){n("add",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}function b(){n("delete",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}return(f,r)=>(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",w,[e.createElementVNode("div",g,e.toDisplayString(u.value.name||u.value._id.name),1),s.showPrice?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i.default,{key:0,field:t.value,"onUpdate:field":r[1]||(r[1]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 w-max-10r br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(c.default,{select:a.value,"onUpdate:select":r[0]||(r[0]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-light pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,disabled:!m.value,onClick:v,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(y.default),{class:"i-semi"})],8,x)),s.product?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:b,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(k.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),s.showPrice?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(i.default,{field:d.value,"onUpdate:field":r[2]||(r[2]=o=>d.value=o),type:"number",label:"Price",symbol:f.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(i.default,{field:t.value,"onUpdate:field":r[4]||(r[4]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(c.default,{select:a.value,"onUpdate:select":r[3]||(r[3]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-light pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])):e.createCommentVNode("",!0)]))}};exports.default=N;
@@ -1,6 +1,6 @@
1
1
  import { ref as n, computed as _, watch as v, openBlock as o, createElementBlock as p, createElementVNode as f, toDisplayString as q, createBlock as U, withCtx as y, createVNode as i, createCommentVNode as c, unref as h } from "vue";
2
- import b from "../../../../components/Field/Field.vue.js";
3
- import w from "../../../../components/Select/Select.vue.js";
2
+ import b from "../../../../components/Field/Field.vue2.js";
3
+ import w from "../../../../components/Select/Select.vue2.js";
4
4
  /* empty css */
5
5
  import B from "../../../icons/navigation/IconAdd.vue.js";
6
6
  import Q from "../../../icons/navigation/IconDelete.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Popup/Popup.vue.cjs"),i=require("../../../../components/PhotoViewer/PhotoViewer.vue.cjs");;/* empty css */const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),d={class:"o-scroll product-images"},_={class:"no-responsive flex flex-nowrap gap-thin"},m=["src","onClick"],h={__name:"ImagesThumbnails",props:{images:{type:Array,required:!0}},setup(r){const t=e.ref(!1),l=e.ref(null),n=o=>{l.value=o,t.value=!0},u=()=>{t.value=!1};return(o,g)=>(e.openBlock(),e.createElementBlock("div",d,[e.createElementVNode("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.images,(s,a)=>(e.openBlock(),e.createElementBlock("img",{key:a,src:(o.FILE_SERVER_URL||"")+s,onClick:v=>n(s),class:"flex-child flex-child-grow-1 aspect-1x1 radius-semi bg-white o-hidden thumbnail"},null,8,m))),128))]),e.createVNode(c.default,{onClosePopup:u,isPopupOpen:t.value,class:"radius-medium o-hidden"},{default:e.withCtx(()=>[e.createVNode(i.default,{photoUrl:(o.FILE_SERVER_URL||"")+l.value},null,8,["photoUrl"])]),_:1},8,["isPopupOpen"])]))}},f=p.default(h,[["__scopeId","data-v-103087bb"]]);exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Popup/Popup.vue2.cjs"),i=require("../../../../components/PhotoViewer/PhotoViewer.vue.cjs");;/* empty css */const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),d={class:"o-scroll product-images"},_={class:"no-responsive flex flex-nowrap gap-thin"},m=["src","onClick"],h={__name:"ImagesThumbnails",props:{images:{type:Array,required:!0}},setup(r){const t=e.ref(!1),l=e.ref(null),n=o=>{l.value=o,t.value=!0},u=()=>{t.value=!1};return(o,g)=>(e.openBlock(),e.createElementBlock("div",d,[e.createElementVNode("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.images,(s,a)=>(e.openBlock(),e.createElementBlock("img",{key:a,src:(o.FILE_SERVER_URL||"")+s,onClick:v=>n(s),class:"flex-child flex-child-grow-1 aspect-1x1 radius-semi bg-white o-hidden thumbnail"},null,8,m))),128))]),e.createVNode(c.default,{onClosePopup:u,isPopupOpen:t.value,class:"radius-medium o-hidden"},{default:e.withCtx(()=>[e.createVNode(i.default,{photoUrl:(o.FILE_SERVER_URL||"")+l.value},null,8,["photoUrl"])]),_:1},8,["isPopupOpen"])]))}},f=p.default(h,[["__scopeId","data-v-103087bb"]]);exports.default=f;
@@ -1,5 +1,5 @@
1
1
  import { ref as n, openBlock as s, createElementBlock as t, createElementVNode as m, Fragment as d, renderList as _, createVNode as i, withCtx as f } from "vue";
2
- import h from "../../../../components/Popup/Popup.vue.js";
2
+ import h from "../../../../components/Popup/Popup.vue2.js";
3
3
  import g from "../../../../components/PhotoViewer/PhotoViewer.vue.js";
4
4
  /* empty css */
5
5
  import v from "../../../../../../_virtual/_plugin-vue_export-helper.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue.cjs"),d=require("../../store/leftovers.cjs");;/* empty css */const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-light pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-light pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue2.cjs"),d=require("../../store/leftovers.cjs");;/* empty css */const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-light pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-light pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as l, createElementBlock as o, createElementVNode as i, createCommentVNode as u, Fragment as f, renderList as p, toDisplayString as y, createVNode as r } from "vue";
2
2
  import { useRouter as b, useRoute as _ } from "vue-router";
3
- import a from "../../../../components/Field/Field.vue.js";
3
+ import a from "../../../../components/Field/Field.vue2.js";
4
4
  import { actions as g } from "../../store/leftovers.js";
5
5
  /* empty css */
6
6
  const h = { class: "flex-column flex-wrap block" }, k = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");;/* empty css */const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");;/* empty css */const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");;/* empty css */const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");;/* empty css */const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as e, createElementBlock as t, createElementVNode as n, createCommentVNode as d, Fragment as a, renderList as m, toDisplayString as p, createVNode as u } from "vue";
2
2
  import { useRouter as f, useRoute as _ } from "vue-router";
3
- /* empty css */
3
+ /* empty css */
4
4
  import x from "./CardPosition.vue.js";
5
5
  import { actions as h } from "../../store/leftovers.js";
6
6
  /* empty css */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-light radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-light radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
@@ -2,7 +2,7 @@ import { onMounted as p, resolveComponent as _, openBlock as i, createElementBlo
2
2
  import { VueDraggableNext as k } from "../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js";
3
3
  import { useRoute as w, useRouter as x } from "vue-router";
4
4
  import { actions as n, state as a } from "../../store/categories.js";
5
- import $ from "../../../../components/Button/Button.vue.js";
5
+ import $ from "../../../../components/Button/Button.vue2.js";
6
6
  import v from "../../../../components/Block/Block.vue.js";
7
7
  import A from "../blocks/CardCategory.vue.js";
8
8
  const E = { class: "pd-thin" }, N = /* @__PURE__ */ b("h1", { class: "mn-r-auto" }, " Product Categories ", -1), T = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Select/Select.vue.cjs"),d=require("../../../../components/Field/Field.vue.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");;/* empty css */const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../../components/Select/Select.vue2.cjs"),d=require("../../../../components/Field/Field.vue2.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");;/* empty css */const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
@@ -1,9 +1,9 @@
1
1
  import { computed as h, openBlock as o, createElementBlock as c, Fragment as m, createVNode as l, withCtx as u, createElementVNode as d, toDisplayString as y, unref as U, createTextVNode as C, renderList as b } from "vue";
2
2
  import { useRoute as k, useRouter as v } from "vue-router";
3
3
  import g from "../../../icons/navigation/IconDelete.vue.js";
4
- import S from "../../../../components/Button/Button.vue.js";
5
- import E from "../../../../components/Select/Select.vue.js";
6
- import i from "../../../../components/Field/Field.vue.js";
4
+ import S from "../../../../components/Button/Button.vue2.js";
5
+ import E from "../../../../components/Select/Select.vue2.js";
6
+ import i from "../../../../components/Field/Field.vue2.js";
7
7
  import p from "../../../../components/Block/Block.vue.js";
8
8
  import { actions as f, state as t } from "../../store/categories.js";
9
9
  /* empty css */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),w=require("../../../../components/Field/Field.vue.cjs"),N=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");;/* empty css */const P=require("../blocks/CardPosition.vue.cjs"),x=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),V=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");;/* empty css */const B={class:"pd-thin"},E={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D={class:"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},L={class:"gap-thin flex-v-center flex-nojustify flex"},R={class:"mn-r-auto"},F={__name:"EditLeftover",setup(O){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function g(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}catch{console.error("error")}});function _(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:V.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("header",E,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",D,[e.createVNode(N.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,l)=>(e.openBlock(),e.createBlock(x.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>g()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(w.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",L,[e.createElementVNode("h3",R," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>_())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=F;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),w=require("../../../../components/Field/Field.vue2.cjs"),N=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue2.cjs"),q=require("../../../../components/Popup/Popup.vue2.cjs");;/* empty css */const P=require("../blocks/CardPosition.vue.cjs"),x=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),V=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");;/* empty css */const B={class:"pd-thin"},E={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D={class:"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},L={class:"gap-thin flex-v-center flex-nojustify flex"},R={class:"mn-r-auto"},F={__name:"EditLeftover",setup(O){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function g(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}catch{console.error("error")}});function _(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:V.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("header",E,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",D,[e.createVNode(N.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,l)=>(e.openBlock(),e.createBlock(x.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>g()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(w.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",L,[e.createElementVNode("h3",R," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>_())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=F;
@@ -1,9 +1,9 @@
1
1
  import { ref as h, computed as z, onMounted as E, openBlock as l, createElementBlock as p, createElementVNode as n, toDisplayString as k, unref as b, createVNode as a, withCtx as c, Fragment as P, renderList as $, createBlock as x, createCommentVNode as U } from "vue";
2
2
  import v from "../../../../components/Block/Block.vue.js";
3
- import B from "../../../../components/Field/Field.vue.js";
3
+ import B from "../../../../components/Field/Field.vue2.js";
4
4
  import I from "../../../../components/Feed/Feed.vue.js";
5
- import O from "../../../../components/Select/Select.vue.js";
6
- import V from "../../../../components/Popup/Popup.vue.js";
5
+ import O from "../../../../components/Select/Select.vue2.js";
6
+ import V from "../../../../components/Popup/Popup.vue2.js";
7
7
  /* empty css */
8
8
  import A from "../blocks/CardPosition.vue.js";
9
9
  import F from "../../../orders/components/blocks/CardOrderItem.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");;/* empty css */const o=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const d=require("../../../../components/Field/Field.vue.cjs"),B=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue.cjs"),C=require("../../../../components/Popup/Popup.vue.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),q=require("../../../../components/EditImages/EditImages.vue.cjs"),b=require("../../../icons/navigation/IconDelete.vue.cjs"),y=require("../blocks/CardPosition.vue.cjs"),P=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),E=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),w=require("../../store/categories.cjs");;/* empty css */const U={class:"for-transition w-100 cols-1 pd-thin gap-thin"},z={class:"mn-r-auto"},F={class:"cols-2 gap-thin"},I={key:0,class:"cols-1 gap-thin"},O={class:"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},D={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},L={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},S={__name:"ProductEdit",setup(T){const l=k.useRoute(),f=k.useRouter(),h=e.ref(t.state.all),p=e.ref(!1);function N(s){p.value=!0}function i(){p.value=!1}e.onMounted(async()=>{t.mutations.resetProduct(),l.params.product&&await t.actions.read({_id:l.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[]),await w.actions.fetchCategories();try{const s=await t.actions.read({organization:l.params._id,limit:100});h.value=s}catch{console.error("error")}});function v(){l.params.product?t.actions.update(l.params.product,t.state.current):t.actions.create(l.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){f.push({name:"Organization",params:{_id:l.params._id}})}return(s,c)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",z,e.toDisplayString(e.unref(l).params.product?t.state.current.name:"Create Product"),1),e.unref(l).params.product?(e.openBlock(),e.createBlock(_.default,{key:0,submit:x,callback:g,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(_.default,{submit:v,callback:g,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(q.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":c[0]||(c[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",F,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(E.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Ingredients",placeholder:"No ingridients added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[t.state.current.ingredients.length>0?(e.openBlock(),e.createElementBlock("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,n)=>(e.openBlock(),e.createBlock(y.default,{key:a._id,product:a,array:t.state.current.ingredients,products:h.value,showPrice:!1,onAdd:c[1]||(c[1]=r=>{u.actions.add(t.state.current.ingredients,r),i()}),onUpdate:r=>{u.actions.update(t.state.current.ingredients,r,n),i()},onDelete:r=>{u.actions.delete(t.state.current.ingredients,r,n),i()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["actions"]),e.createVNode(C.default,{title:"Add ingredient",onClosePopup:i,isPopupOpen:p.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(V.default,{search:{class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:a=>t.actions.read(a),state:null},options:{organization:e.unref(l).params._id},class:""},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(n,r)=>(e.openBlock(),e.createBlock(P.default,{key:n._id,editable:!1,product:n,onClick:()=>{let m={...n};m.quantity=1,m.type="pcs",u.actions.add(t.state.current.ingredients,m),i()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"])]),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(f).push({name:"Categories Organization",params:{_id:e.unref(l).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,n)=>(e.openBlock(),e.createBlock(B.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":r=>t.state.current.category=r},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:n},[e.createVNode(d.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(b.default,{onClick:()=>t.state.current.information.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:n},[e.createVNode(d.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",L,[e.createVNode(b.default,{onClick:()=>t.state.current.localization.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]))}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");;/* empty css */const o=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const d=require("../../../../components/Field/Field.vue2.cjs"),B=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../../components/Popup/Popup.vue2.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),q=require("../../../../components/EditImages/EditImages.vue.cjs"),b=require("../../../icons/navigation/IconDelete.vue.cjs"),y=require("../blocks/CardPosition.vue.cjs"),P=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),E=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),w=require("../../store/categories.cjs");;/* empty css */const U={class:"for-transition w-100 cols-1 pd-thin gap-thin"},z={class:"mn-r-auto"},F={class:"cols-2 gap-thin"},I={key:0,class:"cols-1 gap-thin"},O={class:"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},D={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},L={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},S={__name:"ProductEdit",setup(T){const l=k.useRoute(),f=k.useRouter(),h=e.ref(t.state.all),p=e.ref(!1);function N(s){p.value=!0}function i(){p.value=!1}e.onMounted(async()=>{t.mutations.resetProduct(),l.params.product&&await t.actions.read({_id:l.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[]),await w.actions.fetchCategories();try{const s=await t.actions.read({organization:l.params._id,limit:100});h.value=s}catch{console.error("error")}});function v(){l.params.product?t.actions.update(l.params.product,t.state.current):t.actions.create(l.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){f.push({name:"Organization",params:{_id:l.params._id}})}return(s,c)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",z,e.toDisplayString(e.unref(l).params.product?t.state.current.name:"Create Product"),1),e.unref(l).params.product?(e.openBlock(),e.createBlock(_.default,{key:0,submit:x,callback:g,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(_.default,{submit:v,callback:g,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(q.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":c[0]||(c[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",F,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(E.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Ingredients",placeholder:"No ingridients added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[t.state.current.ingredients.length>0?(e.openBlock(),e.createElementBlock("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,n)=>(e.openBlock(),e.createBlock(y.default,{key:a._id,product:a,array:t.state.current.ingredients,products:h.value,showPrice:!1,onAdd:c[1]||(c[1]=r=>{u.actions.add(t.state.current.ingredients,r),i()}),onUpdate:r=>{u.actions.update(t.state.current.ingredients,r,n),i()},onDelete:r=>{u.actions.delete(t.state.current.ingredients,r,n),i()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["actions"]),e.createVNode(C.default,{title:"Add ingredient",onClosePopup:i,isPopupOpen:p.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(V.default,{search:{class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:a=>t.actions.read(a),state:null},options:{organization:e.unref(l).params._id},class:""},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(n,r)=>(e.openBlock(),e.createBlock(P.default,{key:n._id,editable:!1,product:n,onClick:()=>{let m={...n};m.quantity=1,m.type="pcs",u.actions.add(t.state.current.ingredients,m),i()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"])]),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(f).push({name:"Categories Organization",params:{_id:e.unref(l).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,n)=>(e.openBlock(),e.createBlock(B.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":r=>t.state.current.category=r},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:n},[e.createVNode(d.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(b.default,{onClick:()=>t.state.current.information.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:n},[e.createVNode(d.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",L,[e.createVNode(b.default,{onClick:()=>t.state.current.localization.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]))}};exports.default=S;
@@ -5,10 +5,10 @@ import "../../../globals/localization/vue-i18n.js";
5
5
  /* empty css */
6
6
  import d from "../../../../components/Block/Block.vue.js";
7
7
  /* empty css */
8
- import v from "../../../../components/Field/Field.vue.js";
8
+ import v from "../../../../components/Field/Field.vue2.js";
9
9
  import T from "../../../../components/Checkbox/Checkbox.vue.js";
10
- import N from "../../../../components/Button/Button.vue.js";
11
- import A from "../../../../components/Popup/Popup.vue.js";
10
+ import N from "../../../../components/Button/Button.vue2.js";
11
+ import A from "../../../../components/Popup/Popup.vue2.js";
12
12
  import F from "../../../../components/Feed/Feed.vue.js";
13
13
  import L from "../../../../components/EditImages/EditImages.vue.js";
14
14
  import D from "../../../icons/navigation/IconDelete.vue.js";