@ozdao/prometheus-framework 0.2.196 → 0.2.197

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  3. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
  5. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  7. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  9. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  11. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  13. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  15. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  21. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +46 -44
  23. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  31. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  39. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  41. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  47. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  53. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  69. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  73. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  79. package/package.json +1 -1
  80. package/src/modules/globals/views/components/layouts/Client.vue +4 -3
@@ -1,97 +1,99 @@
1
- import { ref as e, computed as k, onMounted as C, resolveComponent as y, openBlock as r, createElementBlock as P, createVNode as o, Transition as u, withCtx as a, createBlock as s, createCommentVNode as m, Suspense as O, resolveDynamicComponent as L } from "vue";
2
- import { useRoute as S, useRouter as x } from "vue-router";
1
+ import { ref as e, computed as C, onMounted as y, resolveComponent as P, openBlock as r, createElementBlock as O, createVNode as o, Transition as m, withCtx as a, unref as f, createBlock as i, createCommentVNode as d, Suspense as S, withDirectives as L, resolveDynamicComponent as x, vShow as B } from "vue";
2
+ import { useRoute as I, useRouter as E } from "vue-router";
3
3
  import { state as t } from "../../store/globals.js";
4
- import B from "../../../../../components/Loader/Loader.vue2.js";
5
- import I from "../../../../../components/Status/Status.vue.js";
6
- import E from "../../../../../components/Popup/Popup.vue.js";
4
+ import W from "../../../../../components/Loader/Loader.vue2.js";
5
+ import $ from "../../../../../components/Status/Status.vue.js";
6
+ import N from "../../../../../components/Popup/Popup.vue2.js";
7
7
  import "vue-i18n";
8
8
  /* empty css */
9
- import W from "../partials/LocationSelection.vue.js";
9
+ import T from "../partials/LocationSelection.vue.js";
10
10
  import "../../../../products/store/categories.js";
11
- import $ from "../../../../orders/components/partials/ShopCart.vue.js";
11
+ import V from "../../../../orders/components/partials/ShopCart.vue.js";
12
12
  /* empty css */
13
- const N = {
13
+ const b = {
14
14
  id: "app-wrapper",
15
15
  class: "pos-relative"
16
- }, H = {
16
+ }, U = {
17
17
  __name: "Client",
18
- setup(T) {
19
- const p = S();
20
- x();
21
- let f = e(!1);
22
- const i = e(null);
18
+ setup(D) {
19
+ const c = I();
20
+ E();
21
+ let s = e(!1);
22
+ const l = e(null);
23
23
  e(null);
24
- const c = e(p.query.referalCode);
25
- function d() {
24
+ const u = e(c.query.referalCode);
25
+ function _() {
26
26
  t.isOpenLocationPopup = !1;
27
27
  }
28
- function _() {
28
+ function v() {
29
29
  document.getElementById("app").scrollIntoView();
30
30
  }
31
- const v = e(0);
32
- return e(null), k(() => v.value > 50 ? "light" : p.meta.header_theme || "light"), C(async () => {
31
+ const g = e(0);
32
+ return e(null), C(() => g.value > 50 ? "light" : c.meta.header_theme || "light"), y(async () => {
33
33
  "serviceWorker" in navigator && window.addEventListener("load", () => {
34
34
  navigator.serviceWorker.register("/service-worker.js").then((n) => {
35
35
  console.log("SW registered: ", n);
36
36
  }).catch((n) => {
37
37
  console.log("SW registration failed: ", n);
38
38
  });
39
- }), i && (f.value = !0);
40
- const l = localStorage.getItem("position");
41
- l ? t.position = JSON.parse(l) : t.isOpenLocationPopup = !0, c.value && localStorage.setItem("referalCode", c.value);
42
- }), (l, n) => {
43
- const g = y("router-view");
44
- return r(), P("div", N, [
45
- o(u, {
39
+ }), l && (s.value = !0);
40
+ const p = localStorage.getItem("position");
41
+ p ? t.position = JSON.parse(p) : t.isOpenLocationPopup = !0, u.value && localStorage.setItem("referalCode", u.value);
42
+ }), (p, n) => {
43
+ const h = P("router-view");
44
+ return r(), O("div", b, [
45
+ o(m, {
46
46
  name: "moveFromTop",
47
47
  appear: ""
48
48
  }, {
49
49
  default: a(() => [
50
- i.value ? m("", !0) : (r(), s(B, {
50
+ !l.value && !f(s) ? (r(), i(W, {
51
51
  key: 0,
52
52
  class: "pos-fixed"
53
- }))
53
+ })) : d("", !0)
54
54
  ]),
55
55
  _: 1
56
56
  }),
57
- o(E, {
58
- onClosePopup: d,
57
+ o(N, {
58
+ onClosePopup: _,
59
59
  isPopupOpen: t.isOpenLocationPopup,
60
60
  class: "bg-white pd-semi w-m-33r radius-big"
61
61
  }, {
62
62
  default: a(() => [
63
- o(W)
63
+ o(T)
64
64
  ]),
65
65
  _: 1
66
66
  }, 8, ["isPopupOpen"]),
67
- o($),
68
- t.error.show ? (r(), s(I, {
67
+ o(V),
68
+ t.error.show ? (r(), i($, {
69
69
  key: 0,
70
70
  data: t.error,
71
71
  class: "z-index-7"
72
- }, null, 8, ["data"])) : m("", !0),
73
- (r(), s(O, null, {
72
+ }, null, 8, ["data"])) : d("", !0),
73
+ (r(), i(S, null, {
74
74
  default: a(() => [
75
- o(g, { class: "o-scroll" }, {
76
- default: a(({ Component: h, route: w }) => [
77
- o(u, {
78
- onBeforeEnter: _,
75
+ L(o(h, { class: "o-scroll" }, {
76
+ default: a(({ Component: w, route: k }) => [
77
+ o(m, {
78
+ onBeforeEnter: v,
79
79
  name: "scaleIn",
80
80
  mode: "out-in",
81
81
  appear: ""
82
82
  }, {
83
83
  default: a(() => [
84
- (r(), s(L(h), {
84
+ (r(), i(x(w), {
85
85
  ref_key: "page",
86
- ref: i,
87
- key: w.path
86
+ ref: l,
87
+ key: k.path
88
88
  }))
89
89
  ]),
90
90
  _: 2
91
91
  }, 1024)
92
92
  ]),
93
93
  _: 1
94
- })
94
+ }, 512), [
95
+ [B, f(s)]
96
+ ])
95
97
  ]),
96
98
  _: 1
97
99
  }))
@@ -100,5 +102,5 @@ const N = {
100
102
  }
101
103
  };
102
104
  export {
103
- H as default
105
+ U as default
104
106
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),b=require("vue-i18n"),a=require("../../store/globals.cjs"),n=require("../../../../orders/store/shopcart.cjs"),m=require("../../../../auth/views/store/auth.cjs");;/* empty css */const h=require("../../../../../components/Button/Button.vue2.cjs"),g=require("../../../../../components/Select/Select.vue.cjs"),f=require("../../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../icons/entities/IconShopcart.vue.cjs"),p=require("../../../../icons/entities/IconProfile.vue.cjs");;/* empty css */const w={class:"i-small",fill:"inherit",xmlns:"http://www.w3.org/2000/svg",width:"50",height:"67",viewBox:"0 0 50 67"},v=e.createElementVNode("path",{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",fill:"inherit"},null,-1),C=[v],S={__name:"Header",props:{theme:{type:String,default:"light"},logotype:{type:Object}},setup(t){const s=t,o=u.useRouter();u.useRoute(),b.useI18n();function d(){a.state.isOpenLocationPopup=!0}return e.onMounted(()=>{n.actions.setShopcart()}),(i,l)=>{var c;return e.openBlock(),e.createElementBlock("header",{id:"header",class:e.normalizeClass(["pd-thin gap-micro flex-center flex-nowrap flex h-4r w-100 z-index-2",{"t-black bg-white":t.theme==="light","t-white bg-black":t.theme==="dark"}])},[e.createElementVNode("button",{"aria-label":"menu",onClick:l[0]||(l[0]=()=>a.state.isOpenSidebar=!a.state.isOpenSidebar),class:e.normalizeClass(["mobile-only menu-btn",{"menu-btn_active":a.state.isOpenSidebar}])},[e.createElementVNode("span",{class:e.normalizeClass(["no-events",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},[e.createElementVNode("span",{class:e.normalizeClass(["menu-btn__before",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},null,2),e.createElementVNode("span",{class:e.normalizeClass(["menu-btn__after",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},null,2)],2)],2),s.logotype?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.logotype),{key:0,onClick:l[1]||(l[1]=r=>e.unref(o).push({path:"/"})),theme:t.theme,class:"h-2r w-auto cursor-pointer"},null,8,["theme"])):e.createCommentVNode("",!0),e.createElementVNode("button",{"aria-label":"button_location",class:e.normalizeClass(["cursor-pointer bg-transp pd-l-micro pd-r-micro radius-extra uppercase t-semi br-solid br-2px transition-linear",{"fill-black br-black t-black hover-bg-black hover-t-white hover-fill-white":t.theme==="light","fill-white br-white t-white hover-bg-white hover-t-black hover-fill-black":t.theme==="dark"}]),onClick:l[2]||(l[2]=r=>d())},[(e.openBlock(),e.createElementBlock("svg",w,C)),e.createTextVNode(" "+e.toDisplayString((c=a.state.position)!=null&&c.country?a.state.position.country:"World"),1)],2),e.renderSlot(i.$slots,"default"),e.createVNode(f.default,{name:"darkmode",label:"Darkmode",radio:a.state.theme.darkmode,"onUpdate:radio":l[3]||(l[3]=r=>a.actions.toggleTheme()),class:e.normalizeClass(["mn-l-thin mn-r-auto desktop-only t-semi pd-micro br-2px br-solid radius-extra",{"br-light t-black":t.theme==="light","br-dark t-white":t.theme==="dark"}]),theme:t.theme},null,8,["radio","theme","class"]),e.createVNode(h.default,{"aria-label":"shopcart",submit:r=>n.actions.toggleShopcart(),counter:n.getters.cartTotalAmount,showSucces:!1,showLoader:!1,class:"pd-zero mn-l-auto mn-r-micro"},{default:e.withCtx(()=>[e.createVNode(k.default,{class:"i-semi",fill:t.theme==="light"?"rgb(var(--black))":"rgb(var(--white))"},null,8,["fill"])]),_:1},8,["submit","counter"]),e.createVNode(h.default,{"aria-label":"profile",class:"pd-zero bg-transp",submit:m.state.access.status===!1?r=>e.unref(o).push({name:"Sign In"}):r=>e.unref(o).push({name:"User Profile",params:{_id:m.state.user._id}}),showSucces:!1,showLoader:!1},{default:e.withCtx(()=>[e.createVNode(p.default,{class:"i-semi",fill:t.theme==="light"?"rgb(var(--black))":"rgb(var(--white))"},null,8,["fill"])]),_:1},8,["submit"]),e.createVNode(g.default,{select:i.$i18n.locale,"onUpdate:select":l[4]||(l[4]=r=>i.$i18n.locale=r),options:[{name:"🌎 En",value:"en"},{name:"🇷🇺 Ru",value:"ru"}],property:"value",class:e.normalizeClass(["pos-relative uppercase pd-micro t-semi radius-thin",{"bg-light t-black":t.theme==="light","bg-dark t-white":t.theme==="dark"}])},null,8,["select","class"])],2)}}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),b=require("vue-i18n"),a=require("../../store/globals.cjs"),n=require("../../../../orders/store/shopcart.cjs"),m=require("../../../../auth/views/store/auth.cjs");;/* empty css */const h=require("../../../../../components/Button/Button.vue2.cjs"),g=require("../../../../../components/Select/Select.vue2.cjs"),f=require("../../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../icons/entities/IconShopcart.vue.cjs"),p=require("../../../../icons/entities/IconProfile.vue.cjs");;/* empty css */const w={class:"i-small",fill:"inherit",xmlns:"http://www.w3.org/2000/svg",width:"50",height:"67",viewBox:"0 0 50 67"},v=e.createElementVNode("path",{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",fill:"inherit"},null,-1),C=[v],S={__name:"Header",props:{theme:{type:String,default:"light"},logotype:{type:Object}},setup(t){const s=t,o=u.useRouter();u.useRoute(),b.useI18n();function d(){a.state.isOpenLocationPopup=!0}return e.onMounted(()=>{n.actions.setShopcart()}),(i,l)=>{var c;return e.openBlock(),e.createElementBlock("header",{id:"header",class:e.normalizeClass(["pd-thin gap-micro flex-center flex-nowrap flex h-4r w-100 z-index-2",{"t-black bg-white":t.theme==="light","t-white bg-black":t.theme==="dark"}])},[e.createElementVNode("button",{"aria-label":"menu",onClick:l[0]||(l[0]=()=>a.state.isOpenSidebar=!a.state.isOpenSidebar),class:e.normalizeClass(["mobile-only menu-btn",{"menu-btn_active":a.state.isOpenSidebar}])},[e.createElementVNode("span",{class:e.normalizeClass(["no-events",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},[e.createElementVNode("span",{class:e.normalizeClass(["menu-btn__before",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},null,2),e.createElementVNode("span",{class:e.normalizeClass(["menu-btn__after",{"bg-black":t.theme==="light","bg-white":t.theme==="dark"}])},null,2)],2)],2),s.logotype?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.logotype),{key:0,onClick:l[1]||(l[1]=r=>e.unref(o).push({path:"/"})),theme:t.theme,class:"h-2r w-auto cursor-pointer"},null,8,["theme"])):e.createCommentVNode("",!0),e.createElementVNode("button",{"aria-label":"button_location",class:e.normalizeClass(["cursor-pointer bg-transp pd-l-micro pd-r-micro radius-extra uppercase t-semi br-solid br-2px transition-linear",{"fill-black br-black t-black hover-bg-black hover-t-white hover-fill-white":t.theme==="light","fill-white br-white t-white hover-bg-white hover-t-black hover-fill-black":t.theme==="dark"}]),onClick:l[2]||(l[2]=r=>d())},[(e.openBlock(),e.createElementBlock("svg",w,C)),e.createTextVNode(" "+e.toDisplayString((c=a.state.position)!=null&&c.country?a.state.position.country:"World"),1)],2),e.renderSlot(i.$slots,"default"),e.createVNode(f.default,{name:"darkmode",label:"Darkmode",radio:a.state.theme.darkmode,"onUpdate:radio":l[3]||(l[3]=r=>a.actions.toggleTheme()),class:e.normalizeClass(["mn-l-thin mn-r-auto desktop-only t-semi pd-micro br-2px br-solid radius-extra",{"br-light t-black":t.theme==="light","br-dark t-white":t.theme==="dark"}]),theme:t.theme},null,8,["radio","theme","class"]),e.createVNode(h.default,{"aria-label":"shopcart",submit:r=>n.actions.toggleShopcart(),counter:n.getters.cartTotalAmount,showSucces:!1,showLoader:!1,class:"pd-zero mn-l-auto mn-r-micro"},{default:e.withCtx(()=>[e.createVNode(k.default,{class:"i-semi",fill:t.theme==="light"?"rgb(var(--black))":"rgb(var(--white))"},null,8,["fill"])]),_:1},8,["submit","counter"]),e.createVNode(h.default,{"aria-label":"profile",class:"pd-zero bg-transp",submit:m.state.access.status===!1?r=>e.unref(o).push({name:"Sign In"}):r=>e.unref(o).push({name:"User Profile",params:{_id:m.state.user._id}}),showSucces:!1,showLoader:!1},{default:e.withCtx(()=>[e.createVNode(p.default,{class:"i-semi",fill:t.theme==="light"?"rgb(var(--black))":"rgb(var(--white))"},null,8,["fill"])]),_:1},8,["submit"]),e.createVNode(g.default,{select:i.$i18n.locale,"onUpdate:select":l[4]||(l[4]=r=>i.$i18n.locale=r),options:[{name:"🌎 En",value:"en"},{name:"🇷🇺 Ru",value:"ru"}],property:"value",class:e.normalizeClass(["pos-relative uppercase pd-micro t-semi radius-thin",{"bg-light t-black":t.theme==="light","bg-dark t-white":t.theme==="dark"}])},null,8,["select","class"])],2)}}};exports.default=S;
@@ -6,7 +6,7 @@ import { actions as g, getters as N } from "../../../../orders/store/shopcart.js
6
6
  import { state as f } from "../../../../auth/views/store/auth.js";
7
7
  /* empty css */
8
8
  import p from "../../../../../components/Button/Button.vue2.js";
9
- import V from "../../../../../components/Select/Select.vue.js";
9
+ import V from "../../../../../components/Select/Select.vue2.js";
10
10
  import D from "../../../../../components/Checkbox/Checkbox.vue.js";
11
11
  import E from "../../../../icons/entities/IconShopcart.vue.js";
12
12
  import M from "../../../../icons/entities/IconProfile.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */const a=require("../../../../components/Menu/Menu.vue.cjs"),r=require("../../../../components/Menu/MenuItem.vue.cjs"),n=require("vue-router");require("../../../auth/views/store/auth.cjs");require("./Legal.vue2.cjs");const u={class:"for-transition w-100 pd-medium"},l=e.createStaticVNode('<div class="bg-light radius-medium pd-medium mn-b-small"><h2 class="mn-b-small">About No More Snow CO., LTD.</h2><p class="mn-b-small"> Welcome to NO MORE SNOW CO., LTD.! We are dedicated to providing top-notch services and creating a trustworthy environment for our users. Your trust and safety are our priority, and we are committed to being transparent about our policies and practices. </p><p class="mn-b-small"> If you have any questions, concerns, or feedback, please do not hesitate to contact us through the following details. Our team is always here to assist you! </p><p class="mn-b-small"> Address: 10/3 Laemsai Rd, Karon, Mueang Phuket District, Phuket 83100<br> Telephone: +660803202142<br> Email: <a href="mailto:hello@thecommunephuket.com">hello@thecommunephuket.com</a><br> Website: <a href="https://thecommunephuket.com" target="_blank">https://thecommunephuket.com</a></p></div>',1),i=e.createElementVNode("span",null,"Terms of Use",-1),c=e.createElementVNode("span",null,"Privacy Policy",-1),d=e.createElementVNode("span",null,"Cookie Policy",-1),m=e.createElementVNode("span",null,"EULA",-1),p={__name:"Legal",setup(h){n.useRoute();const o=n.useRouter();return e.ref(!1),(f,t)=>(e.openBlock(),e.createElementBlock("div",u,[l,e.createVNode(a.default,{class:"bg-light"},{default:e.withCtx(()=>[e.createVNode(r.default,{onClick:t[0]||(t[0]=s=>e.unref(o).push({name:"Terms of Use"})),class:"cursor-pointer"},{default:e.withCtx(()=>[i]),_:1}),e.createVNode(r.default,{onClick:t[1]||(t[1]=s=>e.unref(o).push({name:"Privacy Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[c]),_:1}),e.createVNode(r.default,{onClick:t[2]||(t[2]=s=>e.unref(o).push({name:"Cookie Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[d]),_:1}),e.createVNode(r.default,{onClick:t[3]||(t[3]=s=>e.unref(o).push({name:"EULA"})),class:"cursor-pointer"},{default:e.withCtx(()=>[m]),_:1})]),_:1})]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */const a=require("../../../../components/Menu/Menu.vue2.cjs"),r=require("../../../../components/Menu/MenuItem.vue.cjs"),n=require("vue-router");require("../../../auth/views/store/auth.cjs");require("./Legal.vue2.cjs");const u={class:"for-transition w-100 pd-medium"},l=e.createStaticVNode('<div class="bg-light radius-medium pd-medium mn-b-small"><h2 class="mn-b-small">About No More Snow CO., LTD.</h2><p class="mn-b-small"> Welcome to NO MORE SNOW CO., LTD.! We are dedicated to providing top-notch services and creating a trustworthy environment for our users. Your trust and safety are our priority, and we are committed to being transparent about our policies and practices. </p><p class="mn-b-small"> If you have any questions, concerns, or feedback, please do not hesitate to contact us through the following details. Our team is always here to assist you! </p><p class="mn-b-small"> Address: 10/3 Laemsai Rd, Karon, Mueang Phuket District, Phuket 83100<br> Telephone: +660803202142<br> Email: <a href="mailto:hello@thecommunephuket.com">hello@thecommunephuket.com</a><br> Website: <a href="https://thecommunephuket.com" target="_blank">https://thecommunephuket.com</a></p></div>',1),i=e.createElementVNode("span",null,"Terms of Use",-1),c=e.createElementVNode("span",null,"Privacy Policy",-1),d=e.createElementVNode("span",null,"Cookie Policy",-1),m=e.createElementVNode("span",null,"EULA",-1),p={__name:"Legal",setup(h){n.useRoute();const o=n.useRouter();return e.ref(!1),(f,t)=>(e.openBlock(),e.createElementBlock("div",u,[l,e.createVNode(a.default,{class:"bg-light"},{default:e.withCtx(()=>[e.createVNode(r.default,{onClick:t[0]||(t[0]=s=>e.unref(o).push({name:"Terms of Use"})),class:"cursor-pointer"},{default:e.withCtx(()=>[i]),_:1}),e.createVNode(r.default,{onClick:t[1]||(t[1]=s=>e.unref(o).push({name:"Privacy Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[c]),_:1}),e.createVNode(r.default,{onClick:t[2]||(t[2]=s=>e.unref(o).push({name:"Cookie Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[d]),_:1}),e.createVNode(r.default,{onClick:t[3]||(t[3]=s=>e.unref(o).push({name:"EULA"})),class:"cursor-pointer"},{default:e.withCtx(()=>[m]),_:1})]),_:1})]))}};exports.default=p;
@@ -2,7 +2,7 @@ import { ref as l, openBlock as m, createElementBlock as u, createVNode as t, wi
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
- import p from "../../../../components/Menu/Menu.vue.js";
5
+ import p from "../../../../components/Menu/Menu.vue2.js";
6
6
  import n from "../../../../components/Menu/MenuItem.vue.js";
7
7
  import { useRoute as d, useRouter as h } from "vue-router";
8
8
  import "../../../auth/views/store/auth.js";
@@ -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,10 +3,10 @@ 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
- /* empty css */
9
+ /* empty css */
10
10
  import "../../../../components/Menu/MenuItem.vue.js";
11
11
  import x from "../../../users/components/blocks/CardUser.vue.js";
12
12
  import j from "../blocks/CardDepartment.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router");require("vue-i18n");;/* empty css */const f=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Block/Block.vue.cjs"),c=require("../../../../components/Feed/Feed.vue.cjs"),b=require("../../../community/components/blocks/CardBlogpost.vue.cjs");;/* empty css */require("../../../../components/Menu/MenuItem.vue.cjs");;/* empty css */const h=require("../../../events/components/sections/Feed.vue.cjs"),g=require("../../../spots/components/blocks/CardSpot.vue.cjs"),v=require("../../../products/components/pages/Products.vue.cjs"),o=require("../../../auth/views/store/auth.cjs"),s=require("../../store/organizations.cjs"),B=require("../../store/memberships.cjs");require("../../store/departments.cjs");const C=require("../../../community/store/blogposts.cjs"),q=require("../../../spots/store/spots.cjs");;/* empty css */const w={key:0,class:"pd-thin for-transition w-100"},y={class:"pos-relative"},N={key:0},V={__name:"Organization",setup(x){d.useRouter();const t=d.useRoute();let p=t.query.tab?t.query.tab:"products";const l=e.ref(null);e.onMounted(async()=>{l.value=await s.actions.read({_id:t.params._id,user:o.state.user._id}),await B.actions.read({target:t.params._id})});const a=e.ref(p);return t.query.tab=a.value,(m,n)=>{const u=e.resolveComponent("router-link");return l.value?(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(f.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=r=>a.value=r),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-light"},null,8,["selected"]),e.createElementVNode("div",y,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="community"?(e.openBlock(),e.createBlock(c.default,{key:0,showLoadMore:!1,states:{empty:{title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later."}},store:{read:r=>C.read(r)},options:{status:"published",user:o.state.user._id,owner:e.unref(t).params._id},class:"row-1 gap-thin"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,i=>(e.openBlock(),e.createBlock(b.default,{key:i._id,blogpost:i,user:o.state.user._id,class:"h-max-40r mn-b-medium"},null,8,["blogpost","user"]))),128))]),_:1},8,["store","options"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="events"?(e.openBlock(),e.createBlock(h.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),a.value==="products"&&o.state.user._id===s.state.current.owner?(e.openBlock(),e.createBlock(k.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="products"?(e.openBlock(),e.createBlock(v.default,{key:0,organization:s.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="spots"?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(c.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:r=>q.actions.read(e.unref(t).params._id),state:s.state},options:{user:o.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(i,_)=>(e.openBlock(),e.createBlock(g.default,{key:_,spot:i,organization:s.state.current,class:"radius-big bg-light mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["store","options"]),o.state.user._id===s.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=r=>m.$router.push(`/spots/${s.state.current._id}/spots/create`)),class:"mn-b-thin bg-main button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router");require("vue-i18n");;/* empty css */const f=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Block/Block.vue.cjs"),c=require("../../../../components/Feed/Feed.vue.cjs"),b=require("../../../community/components/blocks/CardBlogpost.vue.cjs");;/* empty css */require("../../../../components/Menu/MenuItem.vue.cjs");;/* empty css */const h=require("../../../events/components/sections/Feed.vue.cjs"),g=require("../../../spots/components/blocks/CardSpot.vue.cjs"),v=require("../../../products/components/pages/Products.vue.cjs"),o=require("../../../auth/views/store/auth.cjs"),s=require("../../store/organizations.cjs"),B=require("../../store/memberships.cjs");require("../../store/departments.cjs");const C=require("../../../community/store/blogposts.cjs"),q=require("../../../spots/store/spots.cjs");;/* empty css */const w={key:0,class:"pd-thin for-transition w-100"},y={class:"pos-relative"},N={key:0},V={__name:"Organization",setup(x){d.useRouter();const t=d.useRoute();let p=t.query.tab?t.query.tab:"products";const l=e.ref(null);e.onMounted(async()=>{l.value=await s.actions.read({_id:t.params._id,user:o.state.user._id}),await B.actions.read({target:t.params._id})});const a=e.ref(p);return t.query.tab=a.value,(m,n)=>{const u=e.resolveComponent("router-link");return l.value?(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(f.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=r=>a.value=r),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-light"},null,8,["selected"]),e.createElementVNode("div",y,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="community"?(e.openBlock(),e.createBlock(c.default,{key:0,showLoadMore:!1,states:{empty:{title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later."}},store:{read:r=>C.read(r)},options:{status:"published",user:o.state.user._id,owner:e.unref(t).params._id},class:"row-1 gap-thin"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,i=>(e.openBlock(),e.createBlock(b.default,{key:i._id,blogpost:i,user:o.state.user._id,class:"h-max-40r mn-b-medium"},null,8,["blogpost","user"]))),128))]),_:1},8,["store","options"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="events"?(e.openBlock(),e.createBlock(h.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),a.value==="products"&&o.state.user._id===s.state.current.owner?(e.openBlock(),e.createBlock(k.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="products"?(e.openBlock(),e.createBlock(v.default,{key:0,organization:s.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="spots"?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(c.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:r=>q.actions.read(e.unref(t).params._id),state:s.state},options:{user:o.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(i,_)=>(e.openBlock(),e.createBlock(g.default,{key:_,spot:i,organization:s.state.current,class:"radius-big bg-light mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["store","options"]),o.state.user._id===s.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=r=>m.$router.push(`/spots/${s.state.current._id}/spots/create`)),class:"mn-b-thin bg-main button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=V;