@ozdao/prometheus-framework 0.2.193 → 0.2.195

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  3. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  5. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  7. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  9. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  11. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  13. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  15. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  17. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js +108 -59
  19. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +73 -99
  21. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +60 -57
  23. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  27. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  35. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  39. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  45. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  55. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  61. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  65. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  69. package/dist/style.css +1 -1
  70. package/package.json +1 -1
  71. package/src/modules/globals/views/components/layouts/App.vue +51 -12
  72. package/src/modules/globals/views/components/layouts/Client.vue +1 -19
  73. package/src/modules/globals/views/components/partials/Header.vue +8 -10
@@ -1,27 +1,29 @@
1
- import { onMounted as p, openBlock as m, createElementBlock as b, normalizeClass as a, createElementVNode as n, createBlock as k, resolveDynamicComponent as w, unref as h, createCommentVNode as v, createTextVNode as C, toDisplayString as y, createVNode as i, withCtx as d } from "vue";
2
- import { useRouter as S, useRoute as x } from "vue-router";
3
- import { useI18n as $ } from "vue-i18n";
4
- import { state as o, actions as N } from "../../store/globals.js";
5
- import O from "./Navigation.vue.js";
6
- import g from "../../../../../components/Button/Button.vue2.js";
7
- import z from "../../../../../components/Select/Select.vue.js";
8
- import B from "../../../../../components/Checkbox/Checkbox.vue.js";
9
- import L from "../../../../icons/entities/IconShopcart.vue.js";
10
- import V from "../../../../icons/entities/IconProfile.vue.js";
1
+ import { onMounted as w, openBlock as m, createElementBlock as b, normalizeClass as l, createElementVNode as o, createBlock as v, resolveDynamicComponent as C, unref as h, createCommentVNode as y, createTextVNode as S, toDisplayString as x, renderSlot as $, createVNode as r, withCtx as d } from "vue";
2
+ import { useRouter as O, useRoute as z } from "vue-router";
3
+ import { useI18n as B } from "vue-i18n";
4
+ import { state as i, actions as L } from "../../store/globals.js";
5
+ import { actions as g, getters as N } from "../../../../orders/store/shopcart.js";
6
+ import { state as f } from "../../../../auth/views/store/auth.js";
7
+ /* empty css */
8
+ import p from "../../../../../components/Button/Button.vue2.js";
9
+ import V from "../../../../../components/Select/Select.vue2.js";
10
+ import D from "../../../../../components/Checkbox/Checkbox.vue.js";
11
+ import E from "../../../../icons/entities/IconShopcart.vue.js";
12
+ import M from "../../../../icons/entities/IconProfile.vue.js";
11
13
  /* empty css */
12
- const D = {
14
+ const P = {
13
15
  class: "i-small",
14
16
  fill: "inherit",
15
17
  xmlns: "http://www.w3.org/2000/svg",
16
18
  width: "50",
17
19
  height: "67",
18
20
  viewBox: "0 0 50 67"
19
- }, E = /* @__PURE__ */ n("path", {
21
+ }, R = /* @__PURE__ */ o("path", {
20
22
  d: "M25 0C11.207 0 0 11.207 0 25C0 38.793 20.832 66.668 25 66.668C29.168 66.668 50 38.793 50 25C50 11.207 38.793 0 25 0ZM25 33.332C20.418 33.332 16.668 29.582 16.668 25C16.668 20.418 20.418 16.668 25 16.668C29.582 16.668 33.332 20.418 33.332 25C33.332 29.582 29.582 33.332 25 33.332Z",
21
23
  fill: "inherit"
22
- }, null, -1), M = [
23
- E
24
- ], F = {
24
+ }, null, -1), T = [
25
+ R
26
+ ], X = {
25
27
  __name: "Header",
26
28
  props: {
27
29
  theme: {
@@ -33,108 +35,109 @@ const D = {
33
35
  }
34
36
  },
35
37
  setup(e) {
36
- const c = e, s = S();
37
- x(), $();
38
- function f() {
39
- o.isOpenLocationPopup = !0;
38
+ const c = e, n = O();
39
+ z(), B();
40
+ function k() {
41
+ i.isOpenLocationPopup = !0;
40
42
  }
41
- return p(() => {
42
- }), (r, t) => {
43
+ return w(() => {
44
+ g.setShopcart();
45
+ }), (s, t) => {
43
46
  var u;
44
47
  return m(), b("header", {
45
48
  id: "header",
46
- class: a(["pd-thin gap-micro flex-center flex-nowrap flex h-4r w-100 z-index-2", {
49
+ class: l(["pd-thin gap-micro flex-center flex-nowrap flex h-4r w-100 z-index-2", {
47
50
  "t-black bg-white": e.theme === "light",
48
51
  "t-white bg-black": e.theme === "dark"
49
52
  }])
50
53
  }, [
51
- n("button", {
54
+ o("button", {
52
55
  "aria-label": "menu",
53
- onClick: t[0] || (t[0] = () => o.isOpenSidebar = !o.isOpenSidebar),
54
- class: a(["mobile-only menu-btn", {
55
- "menu-btn_active": o.isOpenSidebar
56
+ onClick: t[0] || (t[0] = () => i.isOpenSidebar = !i.isOpenSidebar),
57
+ class: l(["mobile-only menu-btn", {
58
+ "menu-btn_active": i.isOpenSidebar
56
59
  }])
57
60
  }, [
58
- n("span", {
59
- class: a(["no-events", {
61
+ o("span", {
62
+ class: l(["no-events", {
60
63
  "bg-black": e.theme === "light",
61
64
  "bg-white": e.theme === "dark"
62
65
  }])
63
66
  }, [
64
- n("span", {
65
- class: a(["menu-btn__before", { "bg-black": e.theme === "light", "bg-white": e.theme === "dark" }])
67
+ o("span", {
68
+ class: l(["menu-btn__before", { "bg-black": e.theme === "light", "bg-white": e.theme === "dark" }])
66
69
  }, null, 2),
67
- n("span", {
68
- class: a(["menu-btn__after", { "bg-black": e.theme === "light", "bg-white": e.theme === "dark" }])
70
+ o("span", {
71
+ class: l(["menu-btn__after", { "bg-black": e.theme === "light", "bg-white": e.theme === "dark" }])
69
72
  }, null, 2)
70
73
  ], 2)
71
74
  ], 2),
72
- c.logotype ? (m(), k(w(c.logotype), {
75
+ c.logotype ? (m(), v(C(c.logotype), {
73
76
  key: 0,
74
- onClick: t[1] || (t[1] = (l) => h(s).push({ path: "/" })),
77
+ onClick: t[1] || (t[1] = (a) => h(n).push({ path: "/" })),
75
78
  theme: e.theme,
76
79
  class: "h-2r w-auto cursor-pointer"
77
- }, null, 8, ["theme"])) : v("", !0),
78
- n("button", {
80
+ }, null, 8, ["theme"])) : y("", !0),
81
+ o("button", {
79
82
  "aria-label": "button_location",
80
- class: a(["cursor-pointer bg-transp pd-l-micro pd-r-micro radius-extra uppercase t-semi br-solid br-2px transition-linear", {
83
+ class: l(["cursor-pointer bg-transp pd-l-micro pd-r-micro radius-extra uppercase t-semi br-solid br-2px transition-linear", {
81
84
  "fill-black br-black t-black hover-bg-black hover-t-white hover-fill-white": e.theme === "light",
82
85
  "fill-white br-white t-white hover-bg-white hover-t-black hover-fill-black": e.theme === "dark"
83
86
  }]),
84
- onClick: t[2] || (t[2] = (l) => f())
87
+ onClick: t[2] || (t[2] = (a) => k())
85
88
  }, [
86
- (m(), b("svg", D, M)),
87
- C(" " + y((u = o.position) != null && u.country ? o.position.country : "World"), 1)
89
+ (m(), b("svg", P, T)),
90
+ S(" " + x((u = i.position) != null && u.country ? i.position.country : "World"), 1)
88
91
  ], 2),
89
- i(O, { class: "mn-l-auto desktop-only" }),
90
- i(B, {
92
+ $(s.$slots, "default"),
93
+ r(D, {
91
94
  name: "darkmode",
92
95
  label: "Darkmode",
93
- radio: o.theme.darkmode,
94
- "onUpdate:radio": t[3] || (t[3] = (l) => N.toggleTheme()),
95
- class: a(["mn-l-thin mn-r-auto desktop-only t-semi pd-micro br-2px br-solid radius-extra", {
96
+ radio: i.theme.darkmode,
97
+ "onUpdate:radio": t[3] || (t[3] = (a) => L.toggleTheme()),
98
+ class: l(["mn-l-thin mn-r-auto desktop-only t-semi pd-micro br-2px br-solid radius-extra", {
96
99
  "br-light t-black": e.theme === "light",
97
100
  "br-dark t-white": e.theme === "dark"
98
101
  }]),
99
102
  theme: e.theme
100
103
  }, null, 8, ["radio", "theme", "class"]),
101
- i(g, {
104
+ r(p, {
102
105
  "aria-label": "shopcart",
103
- submit: (l) => r.store.shopcart.actions.toggleShopcart(),
104
- counter: r.store.shopcart.getters.cartTotalAmount,
106
+ submit: (a) => g.toggleShopcart(),
107
+ counter: N.cartTotalAmount,
105
108
  showSucces: !1,
106
109
  showLoader: !1,
107
110
  class: "pd-zero mn-l-auto mn-r-micro"
108
111
  }, {
109
112
  default: d(() => [
110
- i(L, {
113
+ r(E, {
111
114
  class: "i-semi",
112
115
  fill: e.theme === "light" ? "rgb(var(--black))" : "rgb(var(--white))"
113
116
  }, null, 8, ["fill"])
114
117
  ]),
115
118
  _: 1
116
119
  }, 8, ["submit", "counter"]),
117
- i(g, {
120
+ r(p, {
118
121
  "aria-label": "profile",
119
122
  class: "pd-zero bg-transp",
120
- submit: r.store.auth.state.access.status === !1 ? (l) => h(s).push({ name: "Sign In" }) : (l) => h(s).push({ name: "User Profile", params: { _id: r.store.auth.state.user._id } }),
123
+ submit: f.access.status === !1 ? (a) => h(n).push({ name: "Sign In" }) : (a) => h(n).push({ name: "User Profile", params: { _id: f.user._id } }),
121
124
  showSucces: !1,
122
125
  showLoader: !1
123
126
  }, {
124
127
  default: d(() => [
125
- i(V, {
128
+ r(M, {
126
129
  class: "i-semi",
127
130
  fill: e.theme === "light" ? "rgb(var(--black))" : "rgb(var(--white))"
128
131
  }, null, 8, ["fill"])
129
132
  ]),
130
133
  _: 1
131
134
  }, 8, ["submit"]),
132
- i(z, {
133
- select: r.$i18n.locale,
134
- "onUpdate:select": t[4] || (t[4] = (l) => r.$i18n.locale = l),
135
+ r(V, {
136
+ select: s.$i18n.locale,
137
+ "onUpdate:select": t[4] || (t[4] = (a) => s.$i18n.locale = a),
135
138
  options: [{ name: "🌎 En", value: "en" }, { name: "🇷🇺 Ru", value: "ru" }],
136
139
  property: "value",
137
- class: a(["pos-relative uppercase pd-micro t-semi radius-thin", {
140
+ class: l(["pos-relative uppercase pd-micro t-semi radius-thin", {
138
141
  "bg-light t-black": e.theme === "light",
139
142
  "bg-dark t-white": e.theme === "dark"
140
143
  }])
@@ -144,5 +147,5 @@ const D = {
144
147
  }
145
148
  };
146
149
  export {
147
- F as default
150
+ X as default
148
151
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const P=require("../../../../components/Popup/Popup.vue.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/views/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),l=b=>(e.pushScopeId("data-v-ad498447"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-light mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=l(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=l(()=>e.createElementVNode("br",null,null,-1)),$=l(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-light pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},le={class:"pd-small flex-nowrap flex"},re={class:"mn-r-auto"},ne=l(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=l(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=l(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=l(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),he={class:"w-100 t-right"},_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=l(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},Ee={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},ke={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const h=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),E=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(E.value=t)}function k(){f.value=!1,E.value=null}e.onMounted(async()=>{var a,r;s.value=await d.actions.read({_id:h.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(r=L.state.position)==null?void 0:r.location})});let y=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.price*r.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.quantity,0))});function _(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=_(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),k()}return(t,a)=>{var r,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&_(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),_(s.value.status)&&e.unref(h).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(_(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:k,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-light radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(_(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("div",re,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((r=s.value.customer.target)==null?void 0:r.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",he,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",_e,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(h).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",Ee,[e.createElementVNode("div",ke,[ye,e.createElementVNode("p",null,e.toDisplayString(e.unref(y))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(y)),1)])]),De,e.createVNode(M.default,{username:e.unref(h).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(h).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-ad498447"]]);exports.default=Oe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const P=require("../../../../components/Popup/Popup.vue2.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/views/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),l=b=>(e.pushScopeId("data-v-ad498447"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-light mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=l(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=l(()=>e.createElementVNode("br",null,null,-1)),$=l(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-light pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},le={class:"pd-small flex-nowrap flex"},re={class:"mn-r-auto"},ne=l(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=l(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=l(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=l(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),he={class:"w-100 t-right"},_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=l(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},Ee={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},ke={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const h=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),E=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(E.value=t)}function k(){f.value=!1,E.value=null}e.onMounted(async()=>{var a,r;s.value=await d.actions.read({_id:h.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(r=L.state.position)==null?void 0:r.location})});let y=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.price*r.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.quantity,0))});function _(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=_(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),k()}return(t,a)=>{var r,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&_(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),_(s.value.status)&&e.unref(h).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(_(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:k,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-light radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(_(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("div",re,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((r=s.value.customer.target)==null?void 0:r.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",he,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",_e,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(h).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",Ee,[e.createElementVNode("div",ke,[ye,e.createElementVNode("p",null,e.toDisplayString(e.unref(y))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(y)),1)])]),De,e.createVNode(M.default,{username:e.unref(h).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(h).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-ad498447"]]);exports.default=Oe;
@@ -3,7 +3,7 @@ import { useRouter as K, useRoute as Q } from "vue-router";
3
3
  import X from "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
- import Y from "../../../../components/Popup/Popup.vue.js";
6
+ import Y from "../../../../components/Popup/Popup.vue2.js";
7
7
  import Z from "../../../icons/entities/IconTime.vue.js";
8
8
  import L from "../blocks/CardOrderItem.vue.js";
9
9
  import tt from "../../../organizations/components/blocks/CardOrganization.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vue-router");;/* empty css */const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");;/* empty css */;/* empty css */const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/views/store/globals.cjs"),F=require("../../../auth/views/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");;/* empty css */const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-light h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=f.useRoute(),g=f.useRouter();t.mutations.resetOrder(t.state.current);let v=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function y(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){g.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-light mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let h={...o};h.quantity=1,l.actions.add(t.state.current.positions,h),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>y()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-light h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vue-router");;/* empty css */const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");;/* empty css */;/* empty css */const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/views/store/globals.cjs"),F=require("../../../auth/views/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");;/* empty css */const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-light h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=f.useRoute(),g=f.useRouter();t.mutations.resetOrder(t.state.current);let v=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function y(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){g.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-light mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let h={...o};h.quantity=1,l.actions.add(t.state.current.positions,h),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>y()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-light h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
@@ -3,11 +3,11 @@ import { useRoute as L, useRouter as M } from "vue-router";
3
3
  /* empty css */
4
4
  import j from "../../../../components/Button/Button.vue2.js";
5
5
  import G from "../../../../components/Tab/Tab.vue2.js";
6
- import O from "../../../../components/Popup/Popup.vue.js";
6
+ import O from "../../../../components/Popup/Popup.vue2.js";
7
7
  import h from "../../../../components/Block/Block.vue.js";
8
8
  import $ from "../../../../components/Feed/Feed.vue.js";
9
9
  import N from "../blocks/CardOrderItem.vue.js";
10
- /* empty css */
10
+ /* empty css */
11
11
  /* empty css */
12
12
  import B from "../../../users/components/blocks/CardUser.vue.js";
13
13
  import H from "../sections/FormAddCustomer.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const b=require("../../../../components/FieldPhone/click-outside.cjs");;/* empty css */const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/views/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/views/store/auth.cjs"),B=require("../../../globals/views/store/globals.cjs"),y=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-light pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await y.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white h-2r pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white h-2r pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-light"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(B.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const b=require("../../../../components/FieldPhone/click-outside.cjs");;/* empty css */const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/views/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/views/store/auth.cjs"),B=require("../../../globals/views/store/globals.cjs"),y=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-light pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await y.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white h-2r pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white h-2r pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-light"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(B.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
@@ -3,7 +3,7 @@ import { useRoute as U } from "vue-router";
3
3
  import N from "../../../../components/Block/Block.vue.js";
4
4
  /* empty css */
5
5
  import O from "../../../../components/FieldPhone/click-outside.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  import V from "../../../../components/Feed/Feed.vue.js";
8
8
  import B from "../../../../components/Button/Button.vue2.js";
9
9
  import F from "../../../globals/views/components/blocks/BlockSearch.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),o=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),u=require("../../../../components/Select/Select.vue.cjs"),i={class:"gap-thin flex-justify-between flex-nowrap flex"},d={__name:"FormCustomerDetails",props:{customer:Object,title:{type:String,default:"Personal Data"}},setup(a){let s=e.ref("instagram");return(m,l)=>(e.openBlock(),e.createBlock(r.default,{title:a.title,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createVNode(n.default,{field:a.customer.profile.name,"onUpdate:field":l[0]||(l[0]=t=>a.customer.profile.name=t),label:"Name",placeholder:"Enter name",class:"bg-white pd-small radius-small mn-b-thin"},null,8,["field"]),e.createVNode(o.default,{modelValue:a.customer.phone,"onUpdate:modelValue":l[1]||(l[1]=t=>a.customer.phone=t),onCountry:l[2]||(l[2]=t=>{a.customer.number=t}),inputOptions:{placeholder:"Enter phone number",type:"tel"},defaultCountry:"TH",validCharactersOnly:!0,dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},mode:"national",class:"w-100 bg-white pd-small mn-b-thin radius-small"},null,8,["modelValue"]),e.createElementVNode("div",i,[e.createVNode(u.default,{select:e.unref(s),options:[{name:"Instagram",value:"instagram"},{name:"Telegram",value:"telegram"},{name:"WhatsApp",value:"whatsapp"}],"onUpdate:select":l[3]||(l[3]=t=>e.isRef(s)?s.value=t:s=t),placeholder:"Messenger",size:"small",class:"bg-white pd-small radius-small"},null,8,["select"]),e.createVNode(n.default,{field:a.customer.socials[e.unref(s)],"onUpdate:field":l[4]||(l[4]=t=>a.customer.socials[e.unref(s)]=t),label:"@",placeholder:"Enter username",class:"bg-white pd-small radius-small w-100"},null,8,["field"])])]),_:1},8,["title"]))}};exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),o=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),u=require("../../../../components/Select/Select.vue2.cjs"),i={class:"gap-thin flex-justify-between flex-nowrap flex"},d={__name:"FormCustomerDetails",props:{customer:Object,title:{type:String,default:"Personal Data"}},setup(a){let s=e.ref("instagram");return(m,l)=>(e.openBlock(),e.createBlock(r.default,{title:a.title,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createVNode(n.default,{field:a.customer.profile.name,"onUpdate:field":l[0]||(l[0]=t=>a.customer.profile.name=t),label:"Name",placeholder:"Enter name",class:"bg-white pd-small radius-small mn-b-thin"},null,8,["field"]),e.createVNode(o.default,{modelValue:a.customer.phone,"onUpdate:modelValue":l[1]||(l[1]=t=>a.customer.phone=t),onCountry:l[2]||(l[2]=t=>{a.customer.number=t}),inputOptions:{placeholder:"Enter phone number",type:"tel"},defaultCountry:"TH",validCharactersOnly:!0,dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},mode:"national",class:"w-100 bg-white pd-small mn-b-thin radius-small"},null,8,["modelValue"]),e.createElementVNode("div",i,[e.createVNode(u.default,{select:e.unref(s),options:[{name:"Instagram",value:"instagram"},{name:"Telegram",value:"telegram"},{name:"WhatsApp",value:"whatsapp"}],"onUpdate:select":l[3]||(l[3]=t=>e.isRef(s)?s.value=t:s=t),placeholder:"Messenger",size:"small",class:"bg-white pd-small radius-small"},null,8,["select"]),e.createVNode(n.default,{field:a.customer.socials[e.unref(s)],"onUpdate:field":l[4]||(l[4]=t=>a.customer.socials[e.unref(s)]=t),label:"@",placeholder:"Enter username",class:"bg-white pd-small radius-small w-100"},null,8,["field"])])]),_:1},8,["title"]))}};exports.default=d;
@@ -2,7 +2,7 @@ import { ref as o, openBlock as m, createBlock as i, withCtx as u, createVNode a
2
2
  import p from "../../../../components/Block/Block.vue.js";
3
3
  import r from "../../../../components/Field/Field.vue2.js";
4
4
  import c from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import g from "../../../../components/Select/Select.vue.js";
5
+ import g from "../../../../components/Select/Select.vue2.js";
6
6
  const h = { class: "gap-thin flex-justify-between flex-nowrap flex" }, V = {
7
7
  __name: "FormCustomerDetails",
8
8
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Select/Select.vue.cjs"),o={class:"mn-b-small flex-nowrap flex"},s={__name:"FormPayment",props:{order:Object},setup(t){return(c,l)=>(e.openBlock(),e.createBlock(r.default,{title:"Payment"},{default:e.withCtx(()=>[e.createElementVNode("div",o,[e.createVNode(n.default,{select:t.order.payment.type,"onUpdate:select":l[0]||(l[0]=a=>t.order.payment.type=a),property:"value",options:[{name:"Cash On Delivery",value:"cash"},{name:"Bank Transfer",value:"bank"},{name:"Crypto",value:"crypto"}],placeholder:"Select type of payment",size:"small",class:"bg-white pd-medium radius-small w-100"},null,8,["select"])])]),_:1}))}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Select/Select.vue2.cjs"),o={class:"mn-b-small flex-nowrap flex"},s={__name:"FormPayment",props:{order:Object},setup(t){return(c,l)=>(e.openBlock(),e.createBlock(r.default,{title:"Payment"},{default:e.withCtx(()=>[e.createElementVNode("div",o,[e.createVNode(n.default,{select:t.order.payment.type,"onUpdate:select":l[0]||(l[0]=a=>t.order.payment.type=a),property:"value",options:[{name:"Cash On Delivery",value:"cash"},{name:"Bank Transfer",value:"bank"},{name:"Crypto",value:"crypto"}],placeholder:"Select type of payment",size:"small",class:"bg-white pd-medium radius-small w-100"},null,8,["select"])])]),_:1}))}};exports.default=s;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as r, createBlock as l, withCtx as o, createElementVNode as n, createVNode as m } from "vue";
2
2
  import s from "../../../../components/Block/Block.vue.js";
3
- import p from "../../../../components/Select/Select.vue.js";
3
+ import p from "../../../../components/Select/Select.vue2.js";
4
4
  const c = { class: "mn-b-small flex-nowrap flex" }, f = {
5
5
  __name: "FormPayment",
6
6
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");;/* empty css */const P=require("../../../../components/UploadImage/UploadImage.vue.cjs");;/* empty css */const u=require("../../../../components/Field/Field.vue2.cjs");;/* empty css */const r=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");;/* empty css */;/* empty css */;/* empty css */const f=require("../../../../components/Button/Button.vue2.cjs"),x=require("../../../../components/Popup/Popup.vue.cjs"),h=require("../../../../components/Block/Block.vue.cjs"),B=require("../../../../components/Feed/Feed.vue.cjs"),D=require("../../../icons/navigation/IconDelete.vue.cjs");;/* empty css */;/* empty css */const b=require("../../../users/components/blocks/CardUser.vue.cjs"),g=require("../../../globals/views/store/globals.cjs"),t=require("../../store/departments.cjs"),w=require("../../store/memberships.cjs"),U={class:"for-transition pd-thin w-100"},C={class:"mn-b-thin flex-nowrap flex bg-light pd-medium radius-big"},O={key:0,class:"mn-r-auto"},M={key:1,class:"mn-r-auto"},R={class:"flex-nowrap flex gap-thin pd-thin"},S={class:"cols-2-fit-content"},T={class:"w-100 flex-child-grow-1 flex-child"},z={class:"cols-2 gap-thin"},A={class:"bg-light pd-medium o-hidden radius-big"},F=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),I=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),L={class:"cols-1 gap-thin"},j={class:"bg-light pd-medium o-hidden radius-big"},G=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),H=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),J={class:"cols-1 gap-thin"},K=e.createElementVNode("h4",null,"Gallery",-1),Q=e.createElementVNode("h4",null,"Products",-1),W=e.createElementVNode("h4",null,"Orders",-1),X=e.createElementVNode("h4",null,"Departments",-1),Y={__name:"DepartmentEdit",setup(Z){const N=c.useRouter(),d=c.useRoute();async function V(){e.ref(w.state.memberships),d.params.department&&await t.actions.readOne(d.params.department)}V();const n=e.ref(!1),_=e.ref(null);function y(o){n.value=!0}function i(){n.value=!1,_.value=null}e.ref(!1),e.ref(null);async function k(){d.params.department&&await t.actions.update(d.params._id,t.state.department),d.params.department||await t.actions.create(d.params._id,t.state.department)}function E(){N.push({name:"Organization Members",params:{_id:d.params._id}})}async function v(){confirm("Are you sure you want to delete this department?")&&await t.actions.delete(d.params._id,t.state.department)}function q(o){confirm("Are you sure you want to remove this member?")&&g.actions.delete(t.state.department.members,{_id:o.user._id})}return(o,a)=>(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("header",C,[e.unref(d).params.department?(e.openBlock(),e.createElementBlock("h1",O,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",M,"Create Department")),e.createElementVNode("section",R,[e.unref(d).params.department?(e.openBlock(),e.createBlock(f.default,{key:0,submit:v,callback:o.redirectToDash,class:"bg-red"},{default:e.withCtx(()=>[e.createTextVNode("Delete")]),_:1},8,["callback"])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:k,callback:E,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(h.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(P.default,{photo:t.state.department.profile.photo,"onUpdate:photo":a[0]||(a[0]=s=>t.state.department.profile.photo=s),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",T,[e.createVNode(u.default,{field:t.state.department.profile.name,"onUpdate:field":a[1]||(a[1]=s=>t.state.department.profile.name=s),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:o.organizationName},null,8,["field","validation"]),e.createVNode(u.default,{field:t.state.department.profile.description,"onUpdate:field":a[2]||(a[2]=s=>t.state.department.profile.description=s),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:o.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(h.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>y()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(s,l)=>(e.openBlock(),e.createBlock(b.default,{class:"h-4r bg-white pd-thin radius-medium w-100",key:l,user:s.user,photo:s.user.profile.photo,name:s.user.profile.name||s.user.phone||s.user.email||s.user._id,position:s.position,action:{label:{is:D.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>q(s)}},null,8,["user","photo","name","position","action"]))),128))]),_:1},8,["actions"]),e.createVNode(x.default,{title:"Add member",onClosePopup:i,isPopupOpen:n.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(B.default,{search:{placeholder:"Search customer...",class:"bg-light mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:s=>w.actions.read(s),state:null},options:{target:e.unref(d).params._id},class:"bg-light pd-medium w-min-20r w-max-40r radius-big h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(l,$)=>{var m,p;return e.openBlock(),e.createBlock(b.default,{key:l._id,user:l.user,photo:(m=l.user.profile)==null?void 0:m.photo,name:((p=l.user.profile)==null?void 0:p.name)||l.user.phone||l.user.email,onClick:()=>{g.actions.add(t.state.department.members,{_id:l.user._id,user:l.user,position:"Member"}),i()},class:"h-4r bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"])}),128))]),_:1},8,["store","options"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",z,[e.createElementVNode("div",A,[F,I,e.createElementVNode("div",L,[e.createVNode(r.default,{label:"Hidden department",name:"hidden",class:"w-100 mn-r-small bg-white radius-small pd-small","onUpdate:radio":a[3]||(a[3]=s=>t.state.department.hidden=!t.state.department.hidden),radio:t.state.department.hidden},null,8,["radio"])])]),e.createElementVNode("div",j,[G,H,e.createElementVNode("div",J,[K,e.createVNode(r.default,{label:"Read gallery",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.read,"onUpdate:radio":a[4]||(a[4]=s=>t.state.department.accesses.gallery.read=!t.state.department.accesses.gallery.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit gallery",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.edit,"onUpdate:radio":a[5]||(a[5]=s=>t.state.department.accesses.gallery.edit=!t.state.department.accesses.gallery.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete gallery",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.delete,"onUpdate:radio":a[6]||(a[6]=s=>t.state.department.accesses.gallery.delete=!t.state.department.accesses.gallery.delete)},null,8,["radio"]),Q,e.createVNode(r.default,{label:"Read products",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.read,"onUpdate:radio":a[7]||(a[7]=s=>t.state.department.accesses.products.read=!t.state.department.accesses.products.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit products",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.edit,"onUpdate:radio":a[8]||(a[8]=s=>t.state.department.accesses.products.edit=!t.state.department.accesses.products.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete products",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.products.delete,"onUpdate:radio":a[9]||(a[9]=s=>t.state.department.accesses.products.delete=!t.state.department.accesses.products.delete)},null,8,["radio"]),W,e.createVNode(r.default,{label:"Read orders",name:"readOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.read,"onUpdate:radio":a[10]||(a[10]=s=>t.state.department.accesses.orders.read=!t.state.department.accesses.orders.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Confirm orders",name:"confirmOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.confirm,"onUpdate:radio":a[11]||(a[11]=s=>t.state.department.accesses.orders.confirm=!t.state.department.accesses.orders.confirm)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete orders",name:"deleteOrders",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.orders.delete,"onUpdate:radio":a[12]||(a[12]=s=>t.state.department.accesses.orders.delete=!t.state.department.accesses.orders.delete)},null,8,["radio"]),X,e.createVNode(r.default,{label:"Read departments",name:"readDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.read,"onUpdate:radio":a[13]||(a[13]=s=>t.state.department.accesses.departments.read=!t.state.department.accesses.departments.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit departments",name:"editDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.edit,"onUpdate:radio":a[14]||(a[14]=s=>t.state.department.accesses.departments.edit=!t.state.department.accesses.departments.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete departments",name:"deleteDepartments",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.departments.delete,"onUpdate:radio":a[15]||(a[15]=s=>t.state.department.accesses.departments.delete=!t.state.department.accesses.departments.delete)},null,8,["radio"])])])])]))}};exports.default=Y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");;/* empty css */const P=require("../../../../components/UploadImage/UploadImage.vue.cjs");;/* empty css */const u=require("../../../../components/Field/Field.vue2.cjs");;/* empty css */const r=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");;/* empty css */;/* empty css */;/* empty css */const f=require("../../../../components/Button/Button.vue2.cjs"),x=require("../../../../components/Popup/Popup.vue2.cjs"),h=require("../../../../components/Block/Block.vue.cjs"),B=require("../../../../components/Feed/Feed.vue.cjs"),D=require("../../../icons/navigation/IconDelete.vue.cjs");;/* empty css */;/* empty css */const b=require("../../../users/components/blocks/CardUser.vue.cjs"),g=require("../../../globals/views/store/globals.cjs"),t=require("../../store/departments.cjs"),w=require("../../store/memberships.cjs"),U={class:"for-transition pd-thin w-100"},C={class:"mn-b-thin flex-nowrap flex bg-light pd-medium radius-big"},O={key:0,class:"mn-r-auto"},M={key:1,class:"mn-r-auto"},R={class:"flex-nowrap flex gap-thin pd-thin"},S={class:"cols-2-fit-content"},T={class:"w-100 flex-child-grow-1 flex-child"},z={class:"cols-2 gap-thin"},A={class:"bg-light pd-medium o-hidden radius-big"},F=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),I=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),L={class:"cols-1 gap-thin"},j={class:"bg-light pd-medium o-hidden radius-big"},G=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),H=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),J={class:"cols-1 gap-thin"},K=e.createElementVNode("h4",null,"Gallery",-1),Q=e.createElementVNode("h4",null,"Products",-1),W=e.createElementVNode("h4",null,"Orders",-1),X=e.createElementVNode("h4",null,"Departments",-1),Y={__name:"DepartmentEdit",setup(Z){const N=c.useRouter(),d=c.useRoute();async function V(){e.ref(w.state.memberships),d.params.department&&await t.actions.readOne(d.params.department)}V();const n=e.ref(!1),_=e.ref(null);function y(o){n.value=!0}function i(){n.value=!1,_.value=null}e.ref(!1),e.ref(null);async function k(){d.params.department&&await t.actions.update(d.params._id,t.state.department),d.params.department||await t.actions.create(d.params._id,t.state.department)}function E(){N.push({name:"Organization Members",params:{_id:d.params._id}})}async function v(){confirm("Are you sure you want to delete this department?")&&await t.actions.delete(d.params._id,t.state.department)}function q(o){confirm("Are you sure you want to remove this member?")&&g.actions.delete(t.state.department.members,{_id:o.user._id})}return(o,a)=>(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("header",C,[e.unref(d).params.department?(e.openBlock(),e.createElementBlock("h1",O,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",M,"Create Department")),e.createElementVNode("section",R,[e.unref(d).params.department?(e.openBlock(),e.createBlock(f.default,{key:0,submit:v,callback:o.redirectToDash,class:"bg-red"},{default:e.withCtx(()=>[e.createTextVNode("Delete")]),_:1},8,["callback"])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:k,callback:E,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(h.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(P.default,{photo:t.state.department.profile.photo,"onUpdate:photo":a[0]||(a[0]=s=>t.state.department.profile.photo=s),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",T,[e.createVNode(u.default,{field:t.state.department.profile.name,"onUpdate:field":a[1]||(a[1]=s=>t.state.department.profile.name=s),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:o.organizationName},null,8,["field","validation"]),e.createVNode(u.default,{field:t.state.department.profile.description,"onUpdate:field":a[2]||(a[2]=s=>t.state.department.profile.description=s),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:o.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(h.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>y()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(s,l)=>(e.openBlock(),e.createBlock(b.default,{class:"h-4r bg-white pd-thin radius-medium w-100",key:l,user:s.user,photo:s.user.profile.photo,name:s.user.profile.name||s.user.phone||s.user.email||s.user._id,position:s.position,action:{label:{is:D.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>q(s)}},null,8,["user","photo","name","position","action"]))),128))]),_:1},8,["actions"]),e.createVNode(x.default,{title:"Add member",onClosePopup:i,isPopupOpen:n.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(B.default,{search:{placeholder:"Search customer...",class:"bg-light mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:s=>w.actions.read(s),state:null},options:{target:e.unref(d).params._id},class:"bg-light pd-medium w-min-20r w-max-40r radius-big h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(l,$)=>{var m,p;return e.openBlock(),e.createBlock(b.default,{key:l._id,user:l.user,photo:(m=l.user.profile)==null?void 0:m.photo,name:((p=l.user.profile)==null?void 0:p.name)||l.user.phone||l.user.email,onClick:()=>{g.actions.add(t.state.department.members,{_id:l.user._id,user:l.user,position:"Member"}),i()},class:"h-4r bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"])}),128))]),_:1},8,["store","options"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",z,[e.createElementVNode("div",A,[F,I,e.createElementVNode("div",L,[e.createVNode(r.default,{label:"Hidden department",name:"hidden",class:"w-100 mn-r-small bg-white radius-small pd-small","onUpdate:radio":a[3]||(a[3]=s=>t.state.department.hidden=!t.state.department.hidden),radio:t.state.department.hidden},null,8,["radio"])])]),e.createElementVNode("div",j,[G,H,e.createElementVNode("div",J,[K,e.createVNode(r.default,{label:"Read gallery",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.read,"onUpdate:radio":a[4]||(a[4]=s=>t.state.department.accesses.gallery.read=!t.state.department.accesses.gallery.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit gallery",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.edit,"onUpdate:radio":a[5]||(a[5]=s=>t.state.department.accesses.gallery.edit=!t.state.department.accesses.gallery.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete gallery",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.gallery.delete,"onUpdate:radio":a[6]||(a[6]=s=>t.state.department.accesses.gallery.delete=!t.state.department.accesses.gallery.delete)},null,8,["radio"]),Q,e.createVNode(r.default,{label:"Read products",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.read,"onUpdate:radio":a[7]||(a[7]=s=>t.state.department.accesses.products.read=!t.state.department.accesses.products.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit products",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.edit,"onUpdate:radio":a[8]||(a[8]=s=>t.state.department.accesses.products.edit=!t.state.department.accesses.products.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete products",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.products.delete,"onUpdate:radio":a[9]||(a[9]=s=>t.state.department.accesses.products.delete=!t.state.department.accesses.products.delete)},null,8,["radio"]),W,e.createVNode(r.default,{label:"Read orders",name:"readOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.read,"onUpdate:radio":a[10]||(a[10]=s=>t.state.department.accesses.orders.read=!t.state.department.accesses.orders.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Confirm orders",name:"confirmOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.confirm,"onUpdate:radio":a[11]||(a[11]=s=>t.state.department.accesses.orders.confirm=!t.state.department.accesses.orders.confirm)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete orders",name:"deleteOrders",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.orders.delete,"onUpdate:radio":a[12]||(a[12]=s=>t.state.department.accesses.orders.delete=!t.state.department.accesses.orders.delete)},null,8,["radio"]),X,e.createVNode(r.default,{label:"Read departments",name:"readDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.read,"onUpdate:radio":a[13]||(a[13]=s=>t.state.department.accesses.departments.read=!t.state.department.accesses.departments.read)},null,8,["radio"]),e.createVNode(r.default,{label:"Edit departments",name:"editDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.edit,"onUpdate:radio":a[14]||(a[14]=s=>t.state.department.accesses.departments.edit=!t.state.department.accesses.departments.edit)},null,8,["radio"]),e.createVNode(r.default,{label:"Delete departments",name:"deleteDepartments",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.departments.delete,"onUpdate:radio":a[15]||(a[15]=s=>t.state.department.accesses.departments.delete=!t.state.department.accesses.departments.delete)},null,8,["radio"])])])])]))}};exports.default=Y;
@@ -6,14 +6,14 @@ import "vue-i18n";
6
6
  import B from "../../../../components/UploadImage/UploadImage.vue.js";
7
7
  /* empty css */
8
8
  import U from "../../../../components/Field/Field.vue2.js";
9
- /* empty css */
9
+ /* empty css */
10
10
  import d from "../../../../components/Checkbox/Checkbox.vue.js";
11
11
  import "../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
12
12
  /* empty css */
13
13
  /* empty css */
14
14
  /* empty css */
15
15
  import k from "../../../../components/Button/Button.vue2.js";
16
- import F from "../../../../components/Popup/Popup.vue.js";
16
+ import F from "../../../../components/Popup/Popup.vue2.js";
17
17
  import x from "../../../../components/Block/Block.vue.js";
18
18
  import G from "../../../../components/Feed/Feed.vue.js";
19
19
  import H 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"),g=require("vue-router"),m=require("../../../../components/Feed/Feed.vue.cjs");;/* empty css */;/* empty css */const M=require("../../../../components/Popup/Popup.vue.cjs"),N=require("../../../globals/views/components/sections/SectionPageTitle.vue.cjs"),z=require("../sections/MembersAdd.vue.cjs");;/* empty css */require("../../../../components/Menu/MenuItem.vue.cjs");const _=require("../../../users/components/blocks/CardUser.vue.cjs"),P=require("../blocks/CardDepartment.vue.cjs"),k=require("../../../icons/navigation/IconDelete.vue.cjs"),p=require("../../../auth/views/store/auth.cjs"),w=require("../../../globals/views/store/globals.cjs"),f=require("../../store/invites.cjs"),b=require("../../store/memberships.cjs"),y=require("../../store/organizations.cjs"),v=require("../../store/departments.cjs"),V={class:"pd-thin"},I={key:2,class:"cols-1 gap-thin"},A={key:3},F={__name:"Members",setup(S){const o=g.useRoute();g.useRouter();const d=e.ref(null),i=e.ref("members"),l=e.ref([]),c=e.ref(!1);function B(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{d.value=(await y.actions.read({_id:o.params._id,user:p.state.user._id}))[0]}),e.computed(()=>{const n=v.state.departments,a=n.flatMap(s=>s.subdepartments.map(t=>t._id));return n.filter(s=>!a.includes(s._id))});async function C(n,a,s){try{const t=await f.actions.create({owner:{type:"Organization",target:d.value._id},creator:{type:"User",target:p.state.user._id},invites:n});for(let r of t.createdInvites)w.actions.add(l.value,r);h(),a()}catch(t){s(t)}}async function q(n,a){confirm("Confirm remove of member")==!0&&(b.state.memberships.splice(n,1),await b.actions.delete(a))}async function x(n,a){confirm("Confirm remove of member")==!0&&(w.actions.delete(l.value,a),await f.actions.delete(a._id))}return(n,a)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",V,[e.createVNode(N.default,{title:"Members","onUpdate:tabs_current":a[0]||(a[0]=t=>i.value=t),tabs_current:i.value,tabs:[{name:`Members (${y.state.current.numberOfMembers||0})`,value:"members"},{name:"Departments",value:"departments"},{name:"Invites",value:"invites"}],actions:[{method:B,label:"Invite members"}],class:"mn-b-small bg-light bg-light radius-big"},null,8,["tabs_current","tabs","actions"]),e.createVNode(M.default,{title:"Add members",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createVNode(z.default,{text:"Please enter your email or phone number to send an invitation link:",organization:d.value,onSendInvite:C},null,8,["organization"])]),_:1},8,["isPopupOpen"]),i.value==="departments"?(e.openBlock(),e.createBlock(m.default,{key:0,states:{empty:{title:"No Departments Found",description:"Currently, there are no departments available.",action:"Add department",callback:()=>n.$router.push(`/organizations/${e.unref(o).params._id}/departments/create`)}},store:{read:t=>v.actions.read(t),state:null},options:{organization:e.unref(o).params._id,user:p.state.user._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(r,u)=>(e.openBlock(),e.createBlock(P.default,{key:u,department:r,organization:e.unref(o).params._id,class:"radius-semi bg-light pos-relative mn-b-thin"},null,8,["department","organization"]))),128))]),_:1},8,["states","store","options"])):e.createCommentVNode("",!0),i.value==="departments"&&v.state.departments.length>0?(e.openBlock(),e.createBlock(s,{key:1,to:{path:`/organizations/${e.unref(o).params._id}/departments/create`},class:"d-block flex-center flex uppercase t-semi bg-main w-100 pd-small radius-extra"},{default:e.withCtx(()=>[e.createTextVNode(" Add department ")]),_:1},8,["to"])):e.createCommentVNode("",!0),i.value==="members"?(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(m.default,{search:!0,states:{empty:{title:"No Members Found",description:"Currently, there are no members."}},store:{read:t=>b.actions.read(t)},options:{target:e.unref(o).params._id,role:["member","owner"]},class:"gap-thin cols-1"},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(r,u)=>(e.openBlock(),e.createBlock(_.default,{key:u,user:r,_id:r.user._id,photo:r.user.profile.photo,phone:r.user.phone,email:r.user.email,name:r.user.profile.name||"No name",role:r.label||r.role,onClick:$=>n.$router.push(`/profile/${r.user._id}`),action:r.role!=="owner"?{label:{is:k.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>q(u,r)}:null,class:"h-4r w-100 bg-light radius-big flex-nowrap flex pd-medium"},null,8,["user","_id","photo","phone","email","name","role","onClick","action"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0),i.value==="invites"?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(m.default,{items:l.value,"onUpdate:items":a[1]||(a[1]=t=>l.value=t),states:{empty:{title:"No Invites Found",description:"Currently, there are no members."}},store:{read:t=>f.actions.read(t)},options:{owner:e.unref(o).params._id},class:"gap-thin cols-1"},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,r=>(e.openBlock(),e.createBlock(_.default,{key:n.index,user:{type:"invite"},name:r.email||r.phone,role:r.status,action:{label:{is:k.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>x(n.index,r)},class:"h-4r w-100 bg-light radius-big flex-nowrap flex pd-medium"},null,8,["name","role","action"]))),128))]),_:1},8,["items","store","options"])])):e.createCommentVNode("",!0)])}}};exports.default=F;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("vue-router"),m=require("../../../../components/Feed/Feed.vue.cjs");;/* empty css */;/* empty css */const M=require("../../../../components/Popup/Popup.vue2.cjs"),N=require("../../../globals/views/components/sections/SectionPageTitle.vue.cjs"),z=require("../sections/MembersAdd.vue.cjs");;/* empty css */require("../../../../components/Menu/MenuItem.vue.cjs");const _=require("../../../users/components/blocks/CardUser.vue.cjs"),P=require("../blocks/CardDepartment.vue.cjs"),k=require("../../../icons/navigation/IconDelete.vue.cjs"),p=require("../../../auth/views/store/auth.cjs"),w=require("../../../globals/views/store/globals.cjs"),f=require("../../store/invites.cjs"),b=require("../../store/memberships.cjs"),y=require("../../store/organizations.cjs"),v=require("../../store/departments.cjs"),V={class:"pd-thin"},I={key:2,class:"cols-1 gap-thin"},A={key:3},F={__name:"Members",setup(S){const o=g.useRoute();g.useRouter();const d=e.ref(null),i=e.ref("members"),l=e.ref([]),c=e.ref(!1);function B(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{d.value=(await y.actions.read({_id:o.params._id,user:p.state.user._id}))[0]}),e.computed(()=>{const n=v.state.departments,a=n.flatMap(s=>s.subdepartments.map(t=>t._id));return n.filter(s=>!a.includes(s._id))});async function C(n,a,s){try{const t=await f.actions.create({owner:{type:"Organization",target:d.value._id},creator:{type:"User",target:p.state.user._id},invites:n});for(let r of t.createdInvites)w.actions.add(l.value,r);h(),a()}catch(t){s(t)}}async function q(n,a){confirm("Confirm remove of member")==!0&&(b.state.memberships.splice(n,1),await b.actions.delete(a))}async function x(n,a){confirm("Confirm remove of member")==!0&&(w.actions.delete(l.value,a),await f.actions.delete(a._id))}return(n,a)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",V,[e.createVNode(N.default,{title:"Members","onUpdate:tabs_current":a[0]||(a[0]=t=>i.value=t),tabs_current:i.value,tabs:[{name:`Members (${y.state.current.numberOfMembers||0})`,value:"members"},{name:"Departments",value:"departments"},{name:"Invites",value:"invites"}],actions:[{method:B,label:"Invite members"}],class:"mn-b-small bg-light bg-light radius-big"},null,8,["tabs_current","tabs","actions"]),e.createVNode(M.default,{title:"Add members",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createVNode(z.default,{text:"Please enter your email or phone number to send an invitation link:",organization:d.value,onSendInvite:C},null,8,["organization"])]),_:1},8,["isPopupOpen"]),i.value==="departments"?(e.openBlock(),e.createBlock(m.default,{key:0,states:{empty:{title:"No Departments Found",description:"Currently, there are no departments available.",action:"Add department",callback:()=>n.$router.push(`/organizations/${e.unref(o).params._id}/departments/create`)}},store:{read:t=>v.actions.read(t),state:null},options:{organization:e.unref(o).params._id,user:p.state.user._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(r,u)=>(e.openBlock(),e.createBlock(P.default,{key:u,department:r,organization:e.unref(o).params._id,class:"radius-semi bg-light pos-relative mn-b-thin"},null,8,["department","organization"]))),128))]),_:1},8,["states","store","options"])):e.createCommentVNode("",!0),i.value==="departments"&&v.state.departments.length>0?(e.openBlock(),e.createBlock(s,{key:1,to:{path:`/organizations/${e.unref(o).params._id}/departments/create`},class:"d-block flex-center flex uppercase t-semi bg-main w-100 pd-small radius-extra"},{default:e.withCtx(()=>[e.createTextVNode(" Add department ")]),_:1},8,["to"])):e.createCommentVNode("",!0),i.value==="members"?(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(m.default,{search:!0,states:{empty:{title:"No Members Found",description:"Currently, there are no members."}},store:{read:t=>b.actions.read(t)},options:{target:e.unref(o).params._id,role:["member","owner"]},class:"gap-thin cols-1"},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(r,u)=>(e.openBlock(),e.createBlock(_.default,{key:u,user:r,_id:r.user._id,photo:r.user.profile.photo,phone:r.user.phone,email:r.user.email,name:r.user.profile.name||"No name",role:r.label||r.role,onClick:$=>n.$router.push(`/profile/${r.user._id}`),action:r.role!=="owner"?{label:{is:k.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>q(u,r)}:null,class:"h-4r w-100 bg-light radius-big flex-nowrap flex pd-medium"},null,8,["user","_id","photo","phone","email","name","role","onClick","action"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0),i.value==="invites"?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(m.default,{items:l.value,"onUpdate:items":a[1]||(a[1]=t=>l.value=t),states:{empty:{title:"No Invites Found",description:"Currently, there are no members."}},store:{read:t=>f.actions.read(t)},options:{owner:e.unref(o).params._id},class:"gap-thin cols-1"},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,r=>(e.openBlock(),e.createBlock(_.default,{key:n.index,user:{type:"invite"},name:r.email||r.phone,role:r.status,action:{label:{is:k.default,props:{class:"i-medium",fill:"rgb(var(--white)"}},method:()=>x(n.index,r)},class:"h-4r w-100 bg-light radius-big flex-nowrap flex pd-medium"},null,8,["name","role","action"]))),128))]),_:1},8,["items","store","options"])])):e.createCommentVNode("",!0)])}}};exports.default=F;
@@ -3,7 +3,7 @@ import { useRoute as V, useRouter as R } from "vue-router";
3
3
  import $ from "../../../../components/Feed/Feed.vue.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
- import E from "../../../../components/Popup/Popup.vue.js";
6
+ import E from "../../../../components/Popup/Popup.vue2.js";
7
7
  import L from "../../../globals/views/components/sections/SectionPageTitle.vue.js";
8
8
  import T from "../sections/MembersAdd.vue.js";
9
9
  /* empty css */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),i=require("vue-router");require("vue-i18n");;/* empty css */const c=require("../../../../components/FieldTags/BlockTags.vue.cjs");;/* empty css */const s=require("../../../../components/Field/Field.vue2.cjs");;/* empty css */const m=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),p=require("../../../../components/UploadImage/UploadImage.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs");;/* empty css */const b=require("../../../auth/views/store/auth.cjs"),e=require("../../store/organizations.cjs");require("../../store/memberships.cjs");const g={class:"for-transition pd-thin"},h=t.createElementVNode("h3",{class:"mn-b-small"},"Type of group",-1),V=t.createElementVNode("p",{class:"mn-b-thin"},"Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.",-1),N=t.createElementVNode("h3",{class:"mn-b-small"},"Profile",-1),q={class:"mn-b-thin radius-small w-100 h-10r bg-light flex-center flex-column flex"},w=t.createElementVNode("h4",null,"Upload photo",-1),y=t.createElementVNode("h3",{class:"mn-b-small"},"Contacts",-1),U=t.createElementVNode("h3",{class:"mn-b-small"},"Socials",-1),v=t.createElementVNode("p",{class:"mn-b-thin"},"Please provide only the username for social media profiles, without full links.",-1),E={__name:"OrganizationEdit",setup(x){const r=i.useRoute(),o=i.useRouter();e.actions.reset(),t.onMounted(async()=>{r.params._id&&await e.actions.read({_id:r.params._id})});const n=t.computed(()=>e.state.current);async function d(){r.params._id?await e.actions.update(r.params._id,n.value):await e.actions.create(e.state.current,b.state.user._id)}function u(){o.replace({name:"Organization",params:{_id:e.state.current._id}})}return(_,l)=>(t.openBlock(),t.createElementBlock("div",g,[h,V,t.createVNode(m.default,{modelValue:e.state.current.types,"onUpdate:modelValue":l[0]||(l[0]=a=>e.state.current.types=a),options:["public","exclusive","hidden"],multiple:!1,taggable:!1,placeholder:"Type to search or add type of organization",class:"mn-b-semi bg-light pd-medium radius-small"},null,8,["modelValue"]),N,t.createElementVNode("div",q,[t.createVNode(p.default,{photo:e.state.current.profile.photo,"onUpdate:photo":l[1]||(l[1]=a=>e.state.current.profile.photo=a),uploadPath:"organizations/"+e.state.current._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo","uploadPath"]),w]),t.createVNode(s.default,{field:e.state.current.profile.name,"onUpdate:field":l[2]||(l[2]=a=>e.state.current.profile.name=a),placeholder:"Name of organization",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.profile.description,"onUpdate:field":l[3]||(l[3]=a=>e.state.current.profile.description=a),placeholder:"Brief description of your group",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(c.default,{onTagsChanged:l[4]||(l[4]=a=>e.state.current.profile.tags=a),tags:e.state.current.profile.tags,class:"mn-b-small"},null,8,["tags"]),y,t.createVNode(s.default,{field:e.state.current.contacts.email,"onUpdate:field":l[5]||(l[5]=a=>e.state.current.contacts.email=a),label:"Email",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.website,"onUpdate:field":l[6]||(l[6]=a=>e.state.current.contacts.website=a),label:"Website",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.phone,"onUpdate:field":l[7]||(l[7]=a=>e.state.current.contacts.phone=a),label:"Phone",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.address,"onUpdate:field":l[8]||(l[8]=a=>e.state.current.contacts.address=a),label:"Address",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),U,v,t.createVNode(s.default,{field:e.state.current.socials.instagram,"onUpdate:field":l[9]||(l[9]=a=>e.state.current.socials.instagram=a),label:"Instagram",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.twitter,"onUpdate:field":l[10]||(l[10]=a=>e.state.current.socials.twitter=a),label:"Twitter",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.facebook,"onUpdate:field":l[11]||(l[11]=a=>e.state.current.socials.facebook=a),label:"Facebook",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.telegram,"onUpdate:field":l[12]||(l[12]=a=>e.state.current.socials.telegram=a),label:"Telegram",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.youtube,"onUpdate:field":l[13]||(l[13]=a=>e.state.current.socials.youtube=a),label:"Youtube",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(f.default,{submit:d,callback:u,class:"bg-main w-100 mn-b-thin"},{default:t.withCtx(()=>[t.createTextVNode("Save")]),_:1})]))}};exports.default=E;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),i=require("vue-router");require("vue-i18n");;/* empty css */const c=require("../../../../components/FieldTags/BlockTags.vue.cjs");;/* empty css */const s=require("../../../../components/Field/Field.vue2.cjs");;/* empty css */const m=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),p=require("../../../../components/UploadImage/UploadImage.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs");;/* empty css */const b=require("../../../auth/views/store/auth.cjs"),e=require("../../store/organizations.cjs");require("../../store/memberships.cjs");const g={class:"for-transition pd-thin"},h=t.createElementVNode("h3",{class:"mn-b-small"},"Type of group",-1),V=t.createElementVNode("p",{class:"mn-b-thin"},"Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.",-1),N=t.createElementVNode("h3",{class:"mn-b-small"},"Profile",-1),q={class:"mn-b-thin radius-small w-100 h-10r bg-light flex-center flex-column flex"},w=t.createElementVNode("h4",null,"Upload photo",-1),y=t.createElementVNode("h3",{class:"mn-b-small"},"Contacts",-1),U=t.createElementVNode("h3",{class:"mn-b-small"},"Socials",-1),v=t.createElementVNode("p",{class:"mn-b-thin"},"Please provide only the username for social media profiles, without full links.",-1),E={__name:"OrganizationEdit",setup(x){const r=i.useRoute(),o=i.useRouter();e.actions.reset(),t.onMounted(async()=>{r.params._id&&await e.actions.read({_id:r.params._id})});const n=t.computed(()=>e.state.current);async function d(){r.params._id?await e.actions.update(r.params._id,n.value):await e.actions.create(e.state.current,b.state.user._id)}function u(){o.replace({name:"Organization",params:{_id:e.state.current._id}})}return(_,l)=>(t.openBlock(),t.createElementBlock("div",g,[h,V,t.createVNode(m.default,{modelValue:e.state.current.types,"onUpdate:modelValue":l[0]||(l[0]=a=>e.state.current.types=a),options:["public","exclusive","hidden"],multiple:!1,taggable:!1,placeholder:"Type to search or add type of organization",class:"mn-b-semi bg-light pd-medium radius-small"},null,8,["modelValue"]),N,t.createElementVNode("div",q,[t.createVNode(p.default,{photo:e.state.current.profile.photo,"onUpdate:photo":l[1]||(l[1]=a=>e.state.current.profile.photo=a),uploadPath:"organizations/"+e.state.current._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo","uploadPath"]),w]),t.createVNode(s.default,{field:e.state.current.profile.name,"onUpdate:field":l[2]||(l[2]=a=>e.state.current.profile.name=a),placeholder:"Name of organization",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.profile.description,"onUpdate:field":l[3]||(l[3]=a=>e.state.current.profile.description=a),placeholder:"Brief description of your group",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(c.default,{onTagsChanged:l[4]||(l[4]=a=>e.state.current.profile.tags=a),tags:e.state.current.profile.tags,class:"mn-b-small"},null,8,["tags"]),y,t.createVNode(s.default,{field:e.state.current.contacts.email,"onUpdate:field":l[5]||(l[5]=a=>e.state.current.contacts.email=a),label:"Email",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.website,"onUpdate:field":l[6]||(l[6]=a=>e.state.current.contacts.website=a),label:"Website",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.phone,"onUpdate:field":l[7]||(l[7]=a=>e.state.current.contacts.phone=a),label:"Phone",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.contacts.address,"onUpdate:field":l[8]||(l[8]=a=>e.state.current.contacts.address=a),label:"Address",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),U,v,t.createVNode(s.default,{field:e.state.current.socials.instagram,"onUpdate:field":l[9]||(l[9]=a=>e.state.current.socials.instagram=a),label:"Instagram",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.twitter,"onUpdate:field":l[10]||(l[10]=a=>e.state.current.socials.twitter=a),label:"Twitter",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.facebook,"onUpdate:field":l[11]||(l[11]=a=>e.state.current.socials.facebook=a),label:"Facebook",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.telegram,"onUpdate:field":l[12]||(l[12]=a=>e.state.current.socials.telegram=a),label:"Telegram",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(s.default,{field:e.state.current.socials.youtube,"onUpdate:field":l[13]||(l[13]=a=>e.state.current.socials.youtube=a),label:"Youtube",placeholder:"",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field"]),t.createVNode(f.default,{submit:d,callback:u,class:"bg-main w-100 mn-b-thin"},{default:t.withCtx(()=>[t.createTextVNode("Save")]),_:1})]))}};exports.default=E;
@@ -5,11 +5,11 @@ import "vue-i18n";
5
5
  import U from "../../../../components/FieldTags/BlockTags.vue.js";
6
6
  /* empty css */
7
7
  import s from "../../../../components/Field/Field.vue2.js";
8
- /* empty css */
8
+ /* empty css */
9
9
  import _ from "../../../../components/SelectMulti/SelectMulti.vue.js";
10
10
  import x from "../../../../components/UploadImage/UploadImage.vue.js";
11
11
  import v from "../../../../components/Button/Button.vue2.js";
12
- /* empty css */
12
+ /* empty css */
13
13
  import { state as k } from "../../../auth/views/store/auth.js";
14
14
  import { actions as o, state as e } from "../../store/organizations.js";
15
15
  import "../../store/memberships.js";