@ozdao/prometheus-framework 0.2.189 → 0.2.191

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/dist/builder.js +1 -1
  2. package/dist/builder.mjs +1 -1
  3. package/dist/prometheus-framework/src/components/LocationSelection/LocationSelection.vue.cjs +1 -0
  4. package/dist/prometheus-framework/src/components/LocationSelection/LocationSelection.vue.js +96 -0
  5. package/dist/prometheus-framework/src/components/Sidebar/Sidebar.vue.cjs +1 -0
  6. package/dist/prometheus-framework/src/components/Sidebar/Sidebar.vue.js +74 -0
  7. package/dist/prometheus-framework/src/components/Status/Status.vue.cjs +1 -0
  8. package/dist/prometheus-framework/src/components/Status/Status.vue.js +29 -0
  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 +1 -1
  21. package/dist/prometheus-framework/src/modules/globals/globals.client.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/globals/globals.client.js +21 -18
  23. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js +85 -28
  25. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -0
  26. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +166 -0
  27. package/dist/prometheus-framework/src/modules/globals/views/components/pages/401.vue.cjs +1 -0
  28. package/dist/prometheus-framework/src/modules/globals/views/components/pages/401.vue.js +10 -0
  29. package/dist/prometheus-framework/src/modules/globals/views/components/pages/404.vue.cjs +1 -0
  30. package/dist/prometheus-framework/src/modules/globals/views/components/pages/404.vue.js +10 -0
  31. package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigation.vue.cjs +1 -0
  32. package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigation.vue.js +157 -0
  33. package/dist/prometheus-framework/src/modules/globals/views/components/partials/LocationSelection.vue.cjs +1 -0
  34. package/dist/prometheus-framework/src/modules/globals/views/components/partials/LocationSelection.vue.js +96 -0
  35. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -0
  36. package/dist/prometheus-framework/src/modules/globals/views/components/partials/Navigation.vue.js +95 -0
  37. package/dist/prometheus-framework/src/modules/globals/views/components/sections/Walkthrough.vue.cjs +1 -0
  38. package/dist/prometheus-framework/src/modules/globals/views/components/sections/Walkthrough.vue.js +126 -0
  39. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.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 +1 -1
  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/ImagesThumbnails.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  67. package/dist/style.css +1 -1
  68. package/package.json +1 -1
  69. package/src/builder/webpack/webpack.config.base.js +1 -1
  70. package/src/components/index.js +0 -1
  71. package/src/main.js +0 -3
  72. package/src/modules/globals/globals.client.js +9 -4
  73. package/src/modules/globals/views/components/layouts/App.vue +65 -6
  74. package/src/modules/globals/views/components/layouts/Client.vue +26 -93
  75. package/src/modules/globals/views/components/partials/BottomNavigation.vue +0 -2
  76. package/src/modules/globals/views/components/partials/Header.vue +14 -10
  77. package/src/{components/LocationSelection → modules/globals/views/components/partials}/LocationSelection.vue +5 -6
  78. package/src/modules/globals/views/components/partials/Navigation.vue +4 -4
  79. package/src/modules/globals/views/components/sections/Walkthrough.vue +6 -6
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),d=require("../../../../../components/Address/Address.vue2.cjs"),p=require("../../../../../components/LocationMarker/LocationMarker.vue2.cjs"),i=require("vue-router"),c=require("vue-i18n"),l=require("../../store/globals.cjs"),m={class:"t-center flex-center"},v=s.createElementVNode("p",{class:"h1 mn-b-medium"},"🌍",-1),y={class:"mn-b-semi"},b={class:"mn-b-small t-transp p-medium"},f={__name:"LocationSelection",setup(g){i.useRoute(),i.useRouter();const o=s.ref({country:null,state:null,city:null,address:null,location:null});function r(){l.state.position={...o.value},l.state.isOpenLocationPopup=!1,localStorage.setItem("position",JSON.stringify(l.state.position))}s.onMounted(()=>{o.value={...l.state.position}});const u={messages:{en:{title:"Choose Your Location",description:"Enter your address or select it on the map to see the nearest offers to you."},ru:{title:"Выбор Локации",description:"Пожалуйста, выберите вашу страну из списка ниже, чтобы увидеть варианты доставки и другую актуальную информацию:"}}},{t:a}=c.useI18n(u);return(n,e)=>(s.openBlock(),s.createElementBlock("div",m,[v,s.createElementVNode("h3",y,s.toDisplayString(s.unref(a)("title")),1),s.createElementVNode("p",b,s.toDisplayString(s.unref(a)("description")),1),(s.openBlock(),s.createBlock(d.default,{key:n.$i18n.locale,apiKey:n.GOOGLE_MAPS_API_KEY,locale:n.$i18n.locale,address:o.value.address,location:o.value.location,placeholder:"Enter your address",class:"bg-white radius-tl-medium radius-tr-medium t-black br-grey-transp-25 br-solid br-2px pd-medium","onUpdate:country":e[0]||(e[0]=t=>{o.value.country=t}),"onUpdate:state":e[1]||(e[1]=t=>{o.value.state=t}),"onUpdate:city":e[2]||(e[2]=t=>{o.value.city=t}),"onUpdate:location":e[3]||(e[3]=t=>{o.value.location=t}),"onUpdate:address":e[4]||(e[4]=t=>{o.value.address=t})},null,8,["apiKey","locale","address","location"])),(s.openBlock(),s.createBlock(p.default,{key:n.$i18n.locale,apiKey:n.GOOGLE_MAPS_API_KEY,locale:n.$i18n.locale,address:o.value.address,location:o.value.location,class:"bg-light radius-bl-medium radius-br-medium h-15r o-hidden","onUpdate:country":e[5]||(e[5]=t=>{o.value.country=t}),"onUpdate:state":e[6]||(e[6]=t=>{o.value.state=t}),"onUpdate:city":e[7]||(e[7]=t=>{o.value.city=t}),"onUpdate:location":e[8]||(e[8]=t=>{o.value.location=t}),"onUpdate:address":e[9]||(e[9]=t=>{o.value.address=t})},null,8,["apiKey","locale","address","location"])),s.createElementVNode("button",{onClick:e[10]||(e[10]=t=>r()),class:"w-100 mn-t-medium bg-main radius-extra button"},"Save Position")]))}};exports.default=f;
@@ -0,0 +1,96 @@
1
+ import { ref as y, onMounted as c, openBlock as l, createElementBlock as v, createElementVNode as i, toDisplayString as r, unref as d, createBlock as u } from "vue";
2
+ import f from "../../../../../components/Address/Address.vue2.js";
3
+ import b from "../../../../../components/LocationMarker/LocationMarker.vue2.js";
4
+ import { useRoute as U, useRouter as g } from "vue-router";
5
+ import { useI18n as E } from "vue-i18n";
6
+ import { state as n } from "../../store/globals.js";
7
+ const k = { class: "t-center flex-center" }, P = /* @__PURE__ */ i("p", { class: "h1 mn-b-medium" }, "🌍", -1), S = { class: "mn-b-semi" }, $ = { class: "mn-b-small t-transp p-medium" }, M = {
8
+ __name: "LocationSelection",
9
+ setup(K) {
10
+ U(), g();
11
+ const e = y({
12
+ country: null,
13
+ state: null,
14
+ city: null,
15
+ address: null,
16
+ location: null
17
+ });
18
+ function p() {
19
+ n.position = { ...e.value }, n.isOpenLocationPopup = !1, localStorage.setItem("position", JSON.stringify(n.position));
20
+ }
21
+ c(() => {
22
+ e.value = { ...n.position };
23
+ });
24
+ const m = {
25
+ messages: {
26
+ en: {
27
+ title: "Choose Your Location",
28
+ description: "Enter your address or select it on the map to see the nearest offers to you."
29
+ },
30
+ ru: {
31
+ title: "Выбор Локации",
32
+ description: "Пожалуйста, выберите вашу страну из списка ниже, чтобы увидеть варианты доставки и другую актуальную информацию:"
33
+ }
34
+ }
35
+ }, { t: a } = E(m);
36
+ return (s, o) => (l(), v("div", k, [
37
+ P,
38
+ i("h3", S, r(d(a)("title")), 1),
39
+ i("p", $, r(d(a)("description")), 1),
40
+ (l(), u(f, {
41
+ key: s.$i18n.locale,
42
+ apiKey: s.GOOGLE_MAPS_API_KEY,
43
+ locale: s.$i18n.locale,
44
+ address: e.value.address,
45
+ location: e.value.location,
46
+ placeholder: "Enter your address",
47
+ class: "bg-white radius-tl-medium radius-tr-medium t-black br-grey-transp-25 br-solid br-2px pd-medium",
48
+ "onUpdate:country": o[0] || (o[0] = (t) => {
49
+ e.value.country = t;
50
+ }),
51
+ "onUpdate:state": o[1] || (o[1] = (t) => {
52
+ e.value.state = t;
53
+ }),
54
+ "onUpdate:city": o[2] || (o[2] = (t) => {
55
+ e.value.city = t;
56
+ }),
57
+ "onUpdate:location": o[3] || (o[3] = (t) => {
58
+ e.value.location = t;
59
+ }),
60
+ "onUpdate:address": o[4] || (o[4] = (t) => {
61
+ e.value.address = t;
62
+ })
63
+ }, null, 8, ["apiKey", "locale", "address", "location"])),
64
+ (l(), u(b, {
65
+ key: s.$i18n.locale,
66
+ apiKey: s.GOOGLE_MAPS_API_KEY,
67
+ locale: s.$i18n.locale,
68
+ address: e.value.address,
69
+ location: e.value.location,
70
+ class: "bg-light radius-bl-medium radius-br-medium h-15r o-hidden",
71
+ "onUpdate:country": o[5] || (o[5] = (t) => {
72
+ e.value.country = t;
73
+ }),
74
+ "onUpdate:state": o[6] || (o[6] = (t) => {
75
+ e.value.state = t;
76
+ }),
77
+ "onUpdate:city": o[7] || (o[7] = (t) => {
78
+ e.value.city = t;
79
+ }),
80
+ "onUpdate:location": o[8] || (o[8] = (t) => {
81
+ e.value.location = t;
82
+ }),
83
+ "onUpdate:address": o[9] || (o[9] = (t) => {
84
+ e.value.address = t;
85
+ })
86
+ }, null, 8, ["apiKey", "locale", "address", "location"])),
87
+ i("button", {
88
+ onClick: o[10] || (o[10] = (t) => p()),
89
+ class: "w-100 mn-t-medium bg-main radius-extra button"
90
+ }, "Save Position")
91
+ ]));
92
+ }
93
+ };
94
+ export {
95
+ M as default
96
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("vue-router"),d=require("vue-i18n"),t=require("../../store/globals.cjs");;/* empty css */const p=require("../../../../../../../_virtual/_plugin-vue_export-helper.cjs"),_={class:"t-semi gap-small flex-nowrap flex-center flex"},A={__name:"Navigation",setup(R){N.useRoute();const u={messages:{en:{HEADER:{MENU:{HOME:"Home",MARKETPLACE:"Marketplace",DISPENSARIES:"Spots",GALLERY:"Gallery",EVENTS:"Events",BLOG:"Community",GOVERNANCE:"Governance"}}},ru:{HEADER:{MENU:{HOME:"Главная",MARKETPLACE:"Маркетплейс",DISPENSARIES:"Места",GALLERY:"Галерея",EVENTS:"События",BLOG:"Сообщество",GOVERNANCE:"Управление"}}}}},{t:o}=d.useI18n(u);return(s,S)=>{var r,a,l,i,c,E;const n=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("ul",_,[e.createElementVNode("li",null,[e.createVNode(n,{to:s.getMarketplaceLink(null,(r=t.state.position)==null?void 0:r.country,(a=t.state.position)==null?void 0:a.state,(l=t.state.position)==null?void 0:l.city),class:"font-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("HEADER.MENU.MARKETPLACE")),1)]),_:1},8,["to"])]),e.createElementVNode("li",null,[e.createVNode(n,{class:"font-second",to:s.getSpotsLink((i=t.state.position)==null?void 0:i.country,(c=t.state.position)==null?void 0:c.state,(E=t.state.position)==null?void 0:E.city)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("HEADER.MENU.DISPENSARIES")),1)]),_:1},8,["to"])]),e.createElementVNode("li",null,[e.createVNode(n,{to:"/community",class:"font-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("HEADER.MENU.BLOG")),1)]),_:1})]),e.createElementVNode("li",null,[e.createVNode(n,{to:"/governance",class:"font-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("HEADER.MENU.GOVERNANCE")),1)]),_:1})])])}}},f=p.default(A,[["__scopeId","data-v-380d7b3b"]]);exports.default=f;
@@ -0,0 +1,95 @@
1
+ import { resolveComponent as _, openBlock as R, createElementBlock as d, createElementVNode as n, createVNode as s, withCtx as E, createTextVNode as l, toDisplayString as i, unref as a } from "vue";
2
+ import { useRoute as S } from "vue-router";
3
+ import { useI18n as M } from "vue-i18n";
4
+ import { state as t } from "../../store/globals.js";
5
+ /* empty css */
6
+ import L from "../../../../../../../_virtual/_plugin-vue_export-helper.js";
7
+ const D = { class: "t-semi gap-small flex-nowrap flex-center flex" }, G = {
8
+ __name: "Navigation",
9
+ setup(C) {
10
+ S();
11
+ const A = {
12
+ messages: {
13
+ en: {
14
+ HEADER: {
15
+ MENU: {
16
+ HOME: "Home",
17
+ MARKETPLACE: "Marketplace",
18
+ DISPENSARIES: "Spots",
19
+ GALLERY: "Gallery",
20
+ EVENTS: "Events",
21
+ BLOG: "Community",
22
+ GOVERNANCE: "Governance"
23
+ }
24
+ }
25
+ },
26
+ ru: {
27
+ HEADER: {
28
+ MENU: {
29
+ HOME: "Главная",
30
+ MARKETPLACE: "Маркетплейс",
31
+ DISPENSARIES: "Места",
32
+ GALLERY: "Галерея",
33
+ EVENTS: "События",
34
+ BLOG: "Сообщество",
35
+ GOVERNANCE: "Управление"
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }, { t: o } = M(A);
41
+ return (r, H) => {
42
+ var c, p, m, u, N, f;
43
+ const e = _("router-link");
44
+ return R(), d("ul", D, [
45
+ n("li", null, [
46
+ s(e, {
47
+ to: r.getMarketplaceLink(null, (c = t.position) == null ? void 0 : c.country, (p = t.position) == null ? void 0 : p.state, (m = t.position) == null ? void 0 : m.city),
48
+ class: "font-second"
49
+ }, {
50
+ default: E(() => [
51
+ l(i(a(o)("HEADER.MENU.MARKETPLACE")), 1)
52
+ ]),
53
+ _: 1
54
+ }, 8, ["to"])
55
+ ]),
56
+ n("li", null, [
57
+ s(e, {
58
+ class: "font-second",
59
+ to: r.getSpotsLink((u = t.position) == null ? void 0 : u.country, (N = t.position) == null ? void 0 : N.state, (f = t.position) == null ? void 0 : f.city)
60
+ }, {
61
+ default: E(() => [
62
+ l(i(a(o)("HEADER.MENU.DISPENSARIES")), 1)
63
+ ]),
64
+ _: 1
65
+ }, 8, ["to"])
66
+ ]),
67
+ n("li", null, [
68
+ s(e, {
69
+ to: "/community",
70
+ class: "font-second"
71
+ }, {
72
+ default: E(() => [
73
+ l(i(a(o)("HEADER.MENU.BLOG")), 1)
74
+ ]),
75
+ _: 1
76
+ })
77
+ ]),
78
+ n("li", null, [
79
+ s(e, {
80
+ to: "/governance",
81
+ class: "font-second"
82
+ }, {
83
+ default: E(() => [
84
+ l(i(a(o)("HEADER.MENU.GOVERNANCE")), 1)
85
+ ]),
86
+ _: 1
87
+ })
88
+ ])
89
+ ]);
90
+ };
91
+ }
92
+ }, v = /* @__PURE__ */ L(G, [["__scopeId", "data-v-380d7b3b"]]);
93
+ export {
94
+ v as default
95
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),T=require("vue-router"),M=require("../../../../../../../node_modules/embla-carousel-vue/esm/embla-carousel-vue.esm.cjs"),y=require("../../../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs");;/* empty css */const P={class:"w-100 embla__container z-index-1"},q=["src"],L={class:"mn-b-thin"},$={class:"p-big t-transp"},O={class:"flex-center flex-column flex pd-big embla__slide"},U=e.createElementVNode("img",{src:"/logo/logo_square.svg",class:"i-extra radius-medium mn-b-small"},null,-1),z=e.createElementVNode("h2",{class:"t-center mn-b-small"},"Welcome to The Commune",-1),D=e.createElementVNode("p",{class:"p-medium t-transp mn-b-semi mn-r-auto mn-l-auto t-center"},"Join our community to connect, share, and learn from the best. Discover new opportunities and grow with us!",-1),I=e.createElementVNode("p",{class:"p-medium text-center mn-b-thin"},"Or explore as a guest:",-1),R={class:"z-index-5 flex-nowrap flex flex-center gap-small w-100 embla__dots"},W=["onClick"],x=3,J={__name:"Walkthrough",props:["slides","options"],emits:["updateFirstUse"],setup(A,{emit:N}){const g=N,V=T.useRouter();async function b(){await y.Preferences.set({key:"first-use",value:JSON.stringify(!1)}),g("updateFirstUse",!1)}async function v(o){await V.push({name:o}),await y.Preferences.set({key:"first-use",value:JSON.stringify(!1)}),g("updateFirstUse",!1)}let S=[{title:"Communicate",subtitle:"Write posts, comments and put likes."},{title:"Party & Fun",subtitle:"Check the calendar for new events."},{title:"Discover",subtitle:"Browse the gallery of photos."}];const[C,n]=M.default({loop:!1}),d=e.ref(0),h=e.ref([]),B=e.ref([]),i=e.ref([]),F=o=>n.value&&n.value.scrollTo(o),_=o=>{h.value=n.value.scrollSnapList()},p=o=>{d.value=n.value.selectedScrollSnap()},k=o=>{const s=n.value.internalEngine(),t=n.value.scrollProgress(),l=n.value.scrollSnapList().map((a,f)=>{let r=a-t;s.options.loop&&s.slideLooper.loopPoints.forEach(c=>{const u=c.target();if(f===c.index&&u!==0){const E=Math.sign(u);E===-1&&(r=a-(1+t)),E===1&&(r=a+(1-t))}});const m=1-Math.abs(r*x);return Math.min(Math.max(m,0),1)});i.value=l;const w=n.value.scrollSnapList().map((a,f)=>{let r=a-t;return s.options.loop&&s.slideLooper.loopPoints.forEach(m=>{const c=m.target();if(f===m.index&&c!==0){const u=Math.sign(c);u===-1&&(r=a-(1+t)),u===1&&(r=a+(1-t))}}),r*(1/x)*100});B.value=w};return e.onMounted(async()=>{_(),p(),k(),n.value.on("reInit",_),n.value.on("reInit",p),n.value.on("select",p),n.value.on("scroll",k)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:"pos-fixed pos-t-0 pos-l-0 w-100 h-100vh z-index-6 bg-white flex embla",ref_key:"emblaNode",ref:C},[e.createElementVNode("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),(t,l)=>(e.openBlock(),e.createElementBlock("div",{key:l,class:"flex-center pd-thin t-center flex-column flex embla__slide",style:e.normalizeStyle({opacity:i.value.length?i.value[l]:void 0,transform:i.value[l]?`scale(${i.value[l]})`:""})},[e.createElementVNode("img",{class:"w-100",src:require(`@/assets/images/walkthrough/walkthrough_${l}.png`).default},null,8,q),e.createElementVNode("h3",L,e.toDisplayString(t.title),1),e.createElementVNode("p",$,e.toDisplayString(t.subtitle),1)],4))),128)),e.createElementVNode("div",O,[U,z,D,e.createElementVNode("button",{onClick:s[0]||(s[0]=t=>v("Sign Up")),class:"w-100 bg-main button mn-b-thin"},"Sign Up"),e.createElementVNode("button",{onClick:s[1]||(s[1]=t=>v("Sign In")),class:"w-100 bg-white button mn-b-semi"},"Sign In"),I,e.createElementVNode("button",{onClick:s[2]||(s[2]=t=>b()),class:"button bg-white w-100"},"Continue without registration")])]),e.createElementVNode("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{key:l,onClick:w=>F(l),class:e.normalizeClass(["embla__dot i-small radius-extra br-solid br-main br-2px",{"bg-light":l!==d.value},{"bg-main":l===d.value}])},null,10,W))),128)),e.createElementVNode("div",{onClick:s[3]||(s[3]=t=>b()),class:"pd-small radius-small br-solid br-main br-2px uppercase t-semi t-main pos-absolute pos-r-10"}," skip ")])],512))}};exports.default=J;
@@ -0,0 +1,126 @@
1
+ import { ref as f, onMounted as I, openBlock as m, createElementBlock as p, createElementVNode as t, Fragment as F, renderList as T, unref as V, normalizeStyle as W, toDisplayString as E, normalizeClass as B } from "vue";
2
+ import { useRouter as D } from "vue-router";
3
+ import J from "../../../../../../../node_modules/embla-carousel-vue/esm/embla-carousel-vue.esm.js";
4
+ import { Preferences as $ } from "../../../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
5
+ /* empty css */
6
+ const R = { class: "w-100 embla__container z-index-1" }, q = ["src"], A = { class: "mn-b-thin" }, j = { class: "p-big t-transp" }, G = { class: "flex-center flex-column flex pd-big embla__slide" }, H = /* @__PURE__ */ t("img", {
7
+ src: "/logo/logo_square.svg",
8
+ class: "i-extra radius-medium mn-b-small"
9
+ }, null, -1), K = /* @__PURE__ */ t("h2", { class: "t-center mn-b-small" }, "Welcome to The Commune", -1), Q = /* @__PURE__ */ t("p", { class: "p-medium t-transp mn-b-semi mn-r-auto mn-l-auto t-center" }, "Join our community to connect, share, and learn from the best. Discover new opportunities and grow with us!", -1), X = /* @__PURE__ */ t("p", { class: "p-medium text-center mn-b-thin" }, "Or explore as a guest:", -1), Y = { class: "z-index-5 flex-nowrap flex flex-center gap-small w-100 embla__dots" }, Z = ["onClick"], L = 3, ae = {
10
+ __name: "Walkthrough",
11
+ props: ["slides", "options"],
12
+ emits: ["updateFirstUse"],
13
+ setup(ee, { emit: M }) {
14
+ const v = M, N = D();
15
+ async function _() {
16
+ await $.set({
17
+ key: "first-use",
18
+ value: JSON.stringify(!1)
19
+ }), v("updateFirstUse", !1);
20
+ }
21
+ async function w(l) {
22
+ await N.push({ name: l }), await $.set({
23
+ key: "first-use",
24
+ value: JSON.stringify(!1)
25
+ }), v("updateFirstUse", !1);
26
+ }
27
+ let P = [{
28
+ title: "Communicate",
29
+ subtitle: "Write posts, comments and put likes."
30
+ }, {
31
+ title: "Party & Fun",
32
+ subtitle: "Check the calendar for new events."
33
+ }, {
34
+ title: "Discover",
35
+ subtitle: "Browse the gallery of photos."
36
+ }];
37
+ const [U, n] = J({ loop: !1 }), g = f(0), k = f([]), z = f([]), r = f([]), O = (l) => n.value && n.value.scrollTo(l), y = (l) => {
38
+ k.value = n.value.scrollSnapList();
39
+ }, b = (l) => {
40
+ g.value = n.value.selectedScrollSnap();
41
+ }, x = (l) => {
42
+ const s = n.value.internalEngine(), e = n.value.scrollProgress(), o = n.value.scrollSnapList().map((a, h) => {
43
+ let i = a - e;
44
+ s.options.loop && s.slideLooper.loopPoints.forEach((u) => {
45
+ const c = u.target();
46
+ if (h === u.index && c !== 0) {
47
+ const S = Math.sign(c);
48
+ S === -1 && (i = a - (1 + e)), S === 1 && (i = a + (1 - e));
49
+ }
50
+ });
51
+ const d = 1 - Math.abs(i * L);
52
+ return Math.min(Math.max(d, 0), 1);
53
+ });
54
+ r.value = o;
55
+ const C = n.value.scrollSnapList().map((a, h) => {
56
+ let i = a - e;
57
+ return s.options.loop && s.slideLooper.loopPoints.forEach((d) => {
58
+ const u = d.target();
59
+ if (h === d.index && u !== 0) {
60
+ const c = Math.sign(u);
61
+ c === -1 && (i = a - (1 + e)), c === 1 && (i = a + (1 - e));
62
+ }
63
+ }), i * (1 / L) * 100;
64
+ });
65
+ z.value = C;
66
+ };
67
+ return I(async () => {
68
+ y(), b(), x(), n.value.on("reInit", y), n.value.on("reInit", b), n.value.on("select", b), n.value.on("scroll", x);
69
+ }), (l, s) => (m(), p("div", {
70
+ class: "pos-fixed pos-t-0 pos-l-0 w-100 h-100vh z-index-6 bg-white flex embla",
71
+ ref_key: "emblaNode",
72
+ ref: U
73
+ }, [
74
+ t("div", R, [
75
+ (m(!0), p(F, null, T(V(P), (e, o) => (m(), p("div", {
76
+ key: o,
77
+ class: "flex-center pd-thin t-center flex-column flex embla__slide",
78
+ style: W({ opacity: r.value.length ? r.value[o] : void 0, transform: r.value[o] ? `scale(${r.value[o]})` : "" })
79
+ }, [
80
+ t("img", {
81
+ class: "w-100",
82
+ src: require(`@/assets/images/walkthrough/walkthrough_${o}.png`).default
83
+ }, null, 8, q),
84
+ t("h3", A, E(e.title), 1),
85
+ t("p", j, E(e.subtitle), 1)
86
+ ], 4))), 128)),
87
+ t("div", G, [
88
+ H,
89
+ K,
90
+ Q,
91
+ t("button", {
92
+ onClick: s[0] || (s[0] = (e) => w("Sign Up")),
93
+ class: "w-100 bg-main button mn-b-thin"
94
+ }, "Sign Up"),
95
+ t("button", {
96
+ onClick: s[1] || (s[1] = (e) => w("Sign In")),
97
+ class: "w-100 bg-white button mn-b-semi"
98
+ }, "Sign In"),
99
+ X,
100
+ t("button", {
101
+ onClick: s[2] || (s[2] = (e) => _()),
102
+ class: "button bg-white w-100"
103
+ }, "Continue without registration")
104
+ ])
105
+ ]),
106
+ t("div", Y, [
107
+ (m(!0), p(F, null, T(k.value, (e, o) => (m(), p("div", {
108
+ key: o,
109
+ onClick: (C) => O(o),
110
+ class: B([
111
+ "embla__dot i-small radius-extra br-solid br-main br-2px",
112
+ { "bg-light": o !== g.value },
113
+ { "bg-main": o === g.value }
114
+ ])
115
+ }, null, 10, Z))), 128)),
116
+ t("div", {
117
+ onClick: s[3] || (s[3] = (e) => _()),
118
+ class: "pd-small radius-small br-solid br-main br-2px uppercase t-semi t-main pos-absolute pos-r-10"
119
+ }, " skip ")
120
+ ])
121
+ ], 512));
122
+ }
123
+ };
124
+ export {
125
+ ae as default
126
+ };
@@ -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.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;
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;
@@ -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.vue2.js";
6
+ import Y from "../../../../components/Popup/Popup.vue.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.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;
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;
@@ -3,7 +3,7 @@ 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.vue2.js";
6
+ import O from "../../../../components/Popup/Popup.vue.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";
@@ -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.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;
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;
@@ -13,7 +13,7 @@ import "../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
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.vue2.js";
16
+ import F from "../../../../components/Popup/Popup.vue.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.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;
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;
@@ -3,7 +3,7 @@ import { useRoute as V, useRouter as R } from "vue-router";
3
3
  import $ from "../../../../components/Feed/Feed.vue.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
- import E from "../../../../components/Popup/Popup.vue2.js";
6
+ import E from "../../../../components/Popup/Popup.vue.js";
7
7
  import L from "../../../globals/views/components/sections/SectionPageTitle.vue.js";
8
8
  import T from "../sections/MembersAdd.vue.js";
9
9
  /* empty css */