@ozdao/prometheus-framework 0.2.137 → 0.2.139

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. package/dist/auth.server.js +29 -14
  2. package/dist/auth.server.mjs +29 -14
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/events.server.js +3 -3
  6. package/dist/events.server.mjs +3 -3
  7. package/dist/files.server.js +3 -3
  8. package/dist/files.server.mjs +3 -3
  9. package/dist/gallery.server.js +4 -4
  10. package/dist/gallery.server.mjs +4 -4
  11. package/dist/index-DNI4aUP2.js +259 -0
  12. package/dist/index-Tcyehi73.mjs +260 -0
  13. package/dist/main-DTHFR7H_.mjs +14510 -0
  14. package/dist/main-wXdocsbd.js +92 -0
  15. package/dist/main.css +1 -1
  16. package/dist/orders.server.js +9 -8
  17. package/dist/orders.server.mjs +9 -8
  18. package/dist/organizations.server.js +32 -17
  19. package/dist/organizations.server.mjs +32 -17
  20. package/dist/products.server.js +37 -5
  21. package/dist/products.server.mjs +37 -5
  22. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  24. package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +19 -19
  26. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  28. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Map/Map.vue.js +3 -2
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +32 -31
  32. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/store/auth.js +50 -47
  34. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  36. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +1 -1
  44. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +12 -12
  46. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +41 -38
  50. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +123 -114
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +51 -52
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +16 -15
  58. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +120 -60
  60. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +25 -24
  64. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +7 -7
  66. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +65 -66
  70. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +81 -76
  72. package/dist/prometheus-framework/src/modules/spots/router/spots.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/spots/router/spots.js +1 -1
  74. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +78 -74
  78. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  80. package/dist/prometheus-framework.cjs.js +1 -1
  81. package/dist/prometheus-framework.es.js +1 -1
  82. package/dist/reports.server.js +0 -3
  83. package/dist/reports.server.mjs +0 -3
  84. package/dist/spots.server.js +3 -3
  85. package/dist/spots.server.mjs +3 -3
  86. package/dist/style.css +1 -1
  87. package/dist/wallet.server.js +5 -5
  88. package/dist/wallet.server.mjs +8 -8
  89. package/dist/web-Dh669DqQ.mjs +54 -0
  90. package/dist/web-Dt2RCU54.js +1 -0
  91. package/package.json +1 -1
  92. package/src/components/Completion/Completion.vue +29 -30
  93. package/src/components/Map/Map.vue +2 -2
  94. package/src/modules/auth/components/pages/Invite.vue +4 -2
  95. package/src/modules/auth/controllers/auth.controller.js +30 -12
  96. package/src/modules/auth/middlewares/authJwt.js +80 -0
  97. package/src/modules/{middlewares/server → auth/middlewares}/index.js +1 -3
  98. package/src/modules/{middlewares/server → auth/middlewares}/verifyAccesses.js +1 -1
  99. package/src/modules/auth/routes/auth.routes.js +2 -2
  100. package/src/modules/auth/routes/twofa.routes.js +1 -1
  101. package/src/modules/auth/store/auth.js +9 -0
  102. package/src/modules/chats/routes/chats.routes.js +1 -1
  103. package/src/modules/community/routes/blog.routes.js +2 -2
  104. package/src/modules/events/routes/events.routes.js +2 -2
  105. package/src/modules/files/routes/files.routes.js +2 -2
  106. package/src/modules/gallery/routes/gallery.routes.js +4 -5
  107. package/src/modules/globals/services/globals.crud.js +2 -2
  108. package/src/modules/marketplace/store/marketplace.js +1 -1
  109. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -2
  110. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  111. package/src/modules/orders/controllers/orders.controller.js +1 -0
  112. package/src/modules/orders/routes/applications.routes.js +2 -2
  113. package/src/modules/orders/routes/orders.routes.js +2 -2
  114. package/src/modules/organizations/components/blocks/CardOrganization.vue +9 -7
  115. package/src/modules/organizations/components/pages/Members.vue +26 -15
  116. package/src/modules/organizations/components/pages/Organization.vue +3 -3
  117. package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
  118. package/src/modules/organizations/components/sections/MembersAdd.vue +101 -43
  119. package/src/modules/organizations/controllers/invites.controller.js +18 -13
  120. package/src/modules/organizations/controllers/memberships.controller.js +18 -11
  121. package/src/modules/organizations/controllers/organizations.controller.js +3 -4
  122. package/src/modules/organizations/models/membership.model.js +2 -0
  123. package/src/modules/organizations/models/organization.model.js +4 -0
  124. package/src/modules/organizations/routes/invites.routes.js +2 -2
  125. package/src/modules/organizations/store/invites.js +2 -1
  126. package/src/modules/products/controllers/leftovers.controller.js +1 -1
  127. package/src/modules/products/middlewares/index.js +11 -0
  128. package/src/modules/products/routes/categories.routes.js +2 -2
  129. package/src/modules/reports/routes/reports.routes.js +2 -2
  130. package/src/modules/spots/components/blocks/CardSpot.vue +0 -1
  131. package/src/modules/spots/components/layouts/Spots.vue +2 -2
  132. package/src/modules/spots/components/pages/Map.vue +79 -78
  133. package/src/modules/spots/components/pages/SpotEdit.vue +8 -5
  134. package/src/modules/spots/controllers/spots.controller.js +1 -5
  135. package/src/modules/spots/router/spots.js +1 -1
  136. package/src/modules/users/components/pages/ProfileEdit.vue +37 -22
  137. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -2
  138. package/src/modules/wallet/controllers/routes/rewards.routes.js +2 -2
  139. package/src/modules/middlewares/server/authJwt.js +0 -68
  140. /package/src/modules/{middlewares/server → auth/middlewares}/authSecret.js +0 -0
  141. /package/src/modules/{middlewares/server → auth/middlewares}/verifyInvites.js +0 -0
  142. /package/src/modules/{middlewares/server → auth/middlewares}/verifySignUp.js +0 -0
  143. /package/src/modules/{middlewares/server → auth/middlewares}/verifyUser.js +0 -0
  144. /package/src/modules/globals/services/{globals.cashe.js → globals.cache.js} +0 -0
  145. /package/src/modules/{middlewares/server → products/middlewares}/verifyCategory.js +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("vue-router"),V=require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs"),j=require("../../../../components/Button/Button.vue2.cjs"),b=require("../../../organizations/store/organizations.cjs"),p=require("../../../globals/store/globals.cjs"),h=require("../../../marketplace/store/marketplace.cjs");;/* empty css */const K=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),F=y=>(o.pushScopeId("data-v-4c504b8d"),y=y(),o.popScopeId(),y),G={class:"h-100 w-100 pos-relative"},Z={class:"w-100 pos-absolute z-index-2 pos-b-10"},H=F(()=>o.createElementVNode("div",{id:"map",class:"h-100 w-100 pos-relative o-hidden"},null,-1)),U={__name:"Map",props:{localPosition:Object,location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String,locale:{type:String,default:"en"}},setup(y){const w=I.useRouter(),e=I.useRoute(),E=y;let n=o.ref(null),c=o.ref([]),O=o.ref(0),L=o.ref(50),u=o.ref({lat:0,lng:0}),_=o.ref(null);async function C(){try{const a=await(await fetch("https://ip2c.org/s")).text();if(!a||a[0]!=="1")throw new Error("Unable to fetch the country");const t=a.split(";");if(t.length<4)throw new Error("Invalid response format");return console.log(t[3]),t[3]}catch(s){throw console.error(s),s}}o.onMounted(async()=>{var v,T,f,k,q,x,z,P;let s=parseFloat(e.query.lat||((T=(v=p.state.position)==null?void 0:v.location)==null?void 0:T.lat)),a=parseFloat(e.query.lng||((k=(f=p.state.position)==null?void 0:f.location)==null?void 0:k.lng)),t;if(e.params.location||(q=p.state.position)!=null&&q.location?t=12:e.params.country||(x=p.state.position)!=null&&x.country?t=9:e.params.state||(z=p.state.position)!=null&&z.state?t=6:e.params.city||(P=p.state.position)!=null&&P.city?t=4:t=2,!s||!a){let r;const i=new google.maps.Geocoder;try{r=await C()}catch{r="Thailand",console.log(error)}try{const l=await i.geocode({address:r});console.log(l),l?(s=l.results[0].geometry.location.lat(),a=l.results[0].geometry.location.lng(),t=6):console.error("No results found for the country code.")}catch(l){console.error("Error getting coordinates from country code:",l)}}if(!s&&!a&&(e.params.country||e.params.state||e.params.city)){const r=new google.maps.Geocoder,i=[e.params.city,e.params.state,e.params.country].filter(Boolean).join(", ");try{const l=await r.geocode({address:i});l[0]&&(s=l[0].geometry.location.lat(),a=l[0].geometry.location.lng())}catch(l){console.error("Error getting coordinates:",l)}}const m=new V.Loader({apiKey:E.apiKey,version:"weekly",libraries:["places"],language:"en"});O.value+=L.value;const d={country:e.params.country,state:e.params.state,city:e.params.city,categories:e.query.categories,prices:e.query.prices,delivery:e.query.delivery,sortParam:e.query.sortParam||h.state.sort.param,sortOrder:e.query.sortOrder||h.state.sort.order,location:{coordinates:[a,s]},locationRadius:1e3,limit:500};console.log(d);const g=await b.actions.read(d);b.state.all=[...b.state.all,...g],m.load().then(()=>{n.value=new google.maps.Map(document.getElementById("map"),{mapTypeControl:!1,fullscreenControl:!1,styles:[{elementType:"geometry",stylers:[{color:"#212121"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{elementType:"labels.text.stroke",stylers:[{color:"#212121"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#757575"},{visibility:"off"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"administrative.land_parcel",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative.neighborhood",stylers:[]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#181818"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"poi.park",elementType:"labels.text.stroke",stylers:[{color:"#1b1b1b"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#2c2c2c"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#8a8a8a"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#373737"}]},{featureType:"road.arterial",elementType:"labels",stylers:[]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#3c3c3c"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#4e4e4e"}]},{featureType:"road.local",stylers:[]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"}]},{featureType:"water",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#3d3d3d"}]}],center:{lat:s,lng:a},zoom:parseInt(e.query.zoom||t||"12")});for(let r of c.value)r.setMap(null);c.value=[],c.value=g.map(r=>{var l;let i=(l=r.spots[0])==null?void 0:l.location;if(i&&i.type==="Point"){let[N,R]=i.coordinates,S="/marker_2.png";r.products&&r.products.length===0&&(S="/marker.png");const M=new google.maps.Marker({position:{lng:N,lat:R},map:n.value,icon:{url:S,scaledSize:new google.maps.Size(32,48),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(16,48)}});return M.addListener("click",()=>{w.push({name:"Organization",params:{_id:r._id}})}),M}return null}).filter(r=>r!==null),google.maps.event.addListener(n.value,"center_changed",()=>{let r=n.value.getCenter();u.value={lat:r.lat(),lng:r.lng()}}),google.maps.event.addListener(n.value,"zoom_changed",()=>{_.value=n.value.getZoom()})})});const B=async()=>{const s={country:e.params.country,state:e.params.state,city:e.params.city,categories:e.query.categories,prices:e.query.prices,delivery:e.query.delivery,sortParam:e.query.sortParam||h.state.sort.param,sortOrder:e.query.sortOrder||h.state.sort.order,locationRadius:8e3/_.value,limit:100,location:{type:"Point",coordinates:[u.value.lng,u.value.lat]}};console.log([u.value.lng,u.value.lat]);try{const a=await b.actions.read(s);for(let t of c.value)t.setMap(null);c.value=[],c.value=a.map(t=>{var d;let m=(d=t.spots[0])==null?void 0:d.location;if(m&&m.type==="Point"){let[g,v]=m.coordinates,T=t.products&&t.products.length>0?"/marker_2.png":"/marker.png";const f=new google.maps.Marker({position:{lng:g,lat:v},map:n.value,icon:{url:T,scaledSize:new google.maps.Size(32,48),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(16,48)}});return f.addListener("click",()=>{w.push({name:"Organization",params:{_id:t._id}})}),f}return null}).filter(t=>t!==null)}catch(a){console.error("Error fetching organizations:",a)}};return(s,a)=>(o.openBlock(),o.createElementBlock("div",G,[o.createElementVNode("div",Z,[o.createVNode(j.default,{submit:B,class:"mn-l-auto mn-r-auto bg-black t-white w-min-20 button"},{default:o.withCtx(()=>[o.createTextVNode(" Search in This Location ")]),_:1})]),H]))}},A=K.default(U,[["__scopeId","data-v-4c504b8d"]]);exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("vue-router"),V=require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs"),j=require("../../../../components/Button/Button.vue2.cjs"),b=require("../../../organizations/store/organizations.cjs"),p=require("../../../globals/store/globals.cjs"),h=require("../../../marketplace/store/marketplace.cjs");;/* empty css */const K=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),F=y=>(o.pushScopeId("data-v-b8675d5a"),y=y(),o.popScopeId(),y),G={class:"h-100 w-100 pos-relative"},Z={class:"w-100 pos-absolute z-index-2 pos-b-10"},H=F(()=>o.createElementVNode("div",{id:"map",class:"h-100 w-100 pos-relative o-hidden"},null,-1)),U={__name:"Map",props:{localPosition:Object,location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String,locale:{type:String,default:"en"}},setup(y){const w=I.useRouter(),e=I.useRoute(),E=y;let n=o.ref(null),c=o.ref([]),O=o.ref(0),L=o.ref(50),u=o.ref({lat:0,lng:0}),_=o.ref(null);async function C(){try{const a=await(await fetch("https://ip2c.org/s")).text();if(!a||a[0]!=="1")throw new Error("Unable to fetch the country");const t=a.split(";");if(t.length<4)throw new Error("Invalid response format");return console.log(t[3]),t[3]}catch(s){throw console.error(s),s}}o.onMounted(async()=>{var m,g,v,T,d,k,q,x;let s=parseFloat(e.query.lat||((g=(m=p.state.position)==null?void 0:m.location)==null?void 0:g.lat)),a=parseFloat(e.query.lng||((T=(v=p.state.position)==null?void 0:v.location)==null?void 0:T.lng)),t;e.params.location||(d=p.state.position)!=null&&d.location?t=15:e.params.country||(k=p.state.position)!=null&&k.country?t=9:e.params.state||(q=p.state.position)!=null&&q.state?t=6:e.params.city||(x=p.state.position)!=null&&x.city?t=14:t=2,new V.Loader({apiKey:E.apiKey,version:"weekly",libraries:["places"],language:"en"}).load().then(async()=>{if(!s||!a){let r;const i=new google.maps.Geocoder;try{r=await C()}catch{r="Thailand",console.log(error)}try{const l=await i.geocode({address:r});console.log(l),l?(s=l.results[0].geometry.location.lat(),a=l.results[0].geometry.location.lng(),t=6):console.error("No results found for the country code.")}catch(l){console.error("Error getting coordinates from country code:",l)}}if(!s&&!a&&(e.params.country||e.params.state||e.params.city)){const r=new google.maps.Geocoder,i=[e.params.city,e.params.state,e.params.country].filter(Boolean).join(", ");try{const l=await r.geocode({address:i});l[0]&&(s=l[0].geometry.location.lat(),a=l[0].geometry.location.lng())}catch(l){console.error("Error getting coordinates:",l)}}O.value+=L.value;const z={country:e.params.country,state:e.params.state,city:e.params.city,categories:e.query.categories,prices:e.query.prices,delivery:e.query.delivery,sortParam:e.query.sortParam||h.state.sort.param,sortOrder:e.query.sortOrder||h.state.sort.order,location:{coordinates:[a,s]},locationRadius:1e3,limit:500};console.log(z);const P=await b.actions.read(z);b.state.all=[...b.state.all,...P],n.value=new google.maps.Map(document.getElementById("map"),{mapTypeControl:!1,fullscreenControl:!1,styles:[{elementType:"geometry",stylers:[{color:"#212121"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{elementType:"labels.text.stroke",stylers:[{color:"#212121"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#757575"},{visibility:"off"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"administrative.land_parcel",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative.neighborhood",stylers:[]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#181818"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"poi.park",elementType:"labels.text.stroke",stylers:[{color:"#1b1b1b"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#2c2c2c"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#8a8a8a"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#373737"}]},{featureType:"road.arterial",elementType:"labels",stylers:[]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#3c3c3c"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#4e4e4e"}]},{featureType:"road.local",stylers:[]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"}]},{featureType:"water",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#3d3d3d"}]}],center:{lat:s,lng:a},zoom:parseInt(e.query.zoom||t||"12")});for(let r of c.value)r.setMap(null);c.value=[],c.value=P.map(r=>{var l;let i=(l=r.spots[0])==null?void 0:l.location;if(i&&i.type==="Point"){let[N,R]=i.coordinates,S="/marker_2.png";r.products&&r.products.length===0&&(S="/marker.png");const M=new google.maps.Marker({position:{lng:N,lat:R},map:n.value,icon:{url:S,scaledSize:new google.maps.Size(32,48),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(16,48)}});return M.addListener("click",()=>{w.push({name:"Organization",params:{_id:r._id}})}),M}return null}).filter(r=>r!==null),google.maps.event.addListener(n.value,"center_changed",()=>{let r=n.value.getCenter();u.value={lat:r.lat(),lng:r.lng()}}),google.maps.event.addListener(n.value,"zoom_changed",()=>{_.value=n.value.getZoom()})})});const B=async()=>{const s={country:e.params.country,state:e.params.state,city:e.params.city,categories:e.query.categories,prices:e.query.prices,delivery:e.query.delivery,sortParam:e.query.sortParam||h.state.sort.param,sortOrder:e.query.sortOrder||h.state.sort.order,locationRadius:8e3/_.value,limit:100,location:{type:"Point",coordinates:[u.value.lng,u.value.lat]}};console.log([u.value.lng,u.value.lat]);try{const a=await b.actions.read(s);for(let t of c.value)t.setMap(null);c.value=[],c.value=a.map(t=>{var m;let f=(m=t.spots[0])==null?void 0:m.location;if(f&&f.type==="Point"){let[g,v]=f.coordinates,T=t.products&&t.products.length>0?"/marker_2.png":"/marker.png";const d=new google.maps.Marker({position:{lng:g,lat:v},map:n.value,icon:{url:T,scaledSize:new google.maps.Size(32,48),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(16,48)}});return d.addListener("click",()=>{w.push({name:"Organization",params:{_id:t._id}})}),d}return null}).filter(t=>t!==null)}catch(a){console.error("Error fetching organizations:",a)}};return(s,a)=>(o.openBlock(),o.createElementBlock("div",G,[o.createElementVNode("div",Z,[o.createVNode(j.default,{submit:B,class:"mn-l-auto mn-r-auto bg-black t-white w-min-20 button"},{default:o.withCtx(()=>[o.createTextVNode(" Search in This Location ")]),_:1})]),H]))}},A=K.default(U,[["__scopeId","data-v-b8675d5a"]]);exports.default=A;
@@ -7,7 +7,7 @@ import { state as p } from "../../../globals/store/globals.js";
7
7
  import { state as h } from "../../../marketplace/store/marketplace.js";
8
8
  /* empty css */
9
9
  import W from "../../../../../../_virtual/_plugin-vue_export-helper.js";
10
- const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-100 pos-relative" }, ee = { class: "w-100 pos-absolute z-index-2 pos-b-10" }, te = /* @__PURE__ */ X(() => /* @__PURE__ */ E("div", {
10
+ const X = (y) => (U("data-v-b8675d5a"), y = y(), A(), y), Y = { class: "h-100 w-100 pos-relative" }, ee = { class: "w-100 pos-absolute z-index-2 pos-b-10" }, te = /* @__PURE__ */ X(() => /* @__PURE__ */ E("div", {
11
11
  id: "map",
12
12
  class: "h-100 w-100 pos-relative o-hidden"
13
13
  }, null, -1)), oe = {
@@ -45,66 +45,65 @@ const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-
45
45
  }
46
46
  }
47
47
  K(async () => {
48
- var T, v, f, _, k, x, q, z;
49
- let l = parseFloat(e.query.lat || ((v = (T = p.position) == null ? void 0 : T.location) == null ? void 0 : v.lat)), r = parseFloat(e.query.lng || ((_ = (f = p.position) == null ? void 0 : f.location) == null ? void 0 : _.lng)), t;
50
- if (e.params.location || (k = p.position) != null && k.location ? t = 12 : e.params.country || (x = p.position) != null && x.country ? t = 9 : e.params.state || (q = p.position) != null && q.state ? t = 6 : e.params.city || (z = p.position) != null && z.city ? t = 4 : t = 2, !l || !r) {
51
- let o;
52
- const n = new google.maps.Geocoder();
53
- try {
54
- o = await B();
55
- } catch {
56
- o = "Thailand", console.log(error);
57
- }
58
- try {
59
- const a = await n.geocode({ address: o });
60
- console.log(a), a ? (l = a.results[0].geometry.location.lat(), r = a.results[0].geometry.location.lng(), t = 6) : console.error("No results found for the country code.");
61
- } catch (a) {
62
- console.error("Error getting coordinates from country code:", a);
63
- }
64
- }
65
- if (!l && !r && (e.params.country || e.params.state || e.params.city)) {
66
- const o = new google.maps.Geocoder(), n = [
67
- e.params.city,
68
- e.params.state,
69
- e.params.country
70
- ].filter(Boolean).join(", ");
71
- try {
72
- const a = await o.geocode({ address: n });
73
- a[0] && (l = a[0].geometry.location.lat(), r = a[0].geometry.location.lng());
74
- } catch (a) {
75
- console.error("Error getting coordinates:", a);
76
- }
77
- }
78
- const u = new J({
48
+ var u, g, T, v, d, _, k, x;
49
+ let l = parseFloat(e.query.lat || ((g = (u = p.position) == null ? void 0 : u.location) == null ? void 0 : g.lat)), r = parseFloat(e.query.lng || ((v = (T = p.position) == null ? void 0 : T.location) == null ? void 0 : v.lng)), t;
50
+ e.params.location || (d = p.position) != null && d.location ? t = 15 : e.params.country || (_ = p.position) != null && _.country ? t = 9 : e.params.state || (k = p.position) != null && k.state ? t = 6 : e.params.city || (x = p.position) != null && x.city ? t = 14 : t = 2, new J({
79
51
  apiKey: L.apiKey,
80
52
  version: "weekly",
81
53
  libraries: ["places"],
82
54
  language: "en"
83
- });
84
- O.value += C.value;
85
- const d = {
86
- // country: route.params.country,
87
- // state: route.params.state,
88
- // city: route.params.city,
89
- // categories: route.query.categories,
90
- // prices: route.query.prices,
91
- // delivery: route.query.delivery,
92
- country: e.params.country,
93
- state: e.params.state,
94
- city: e.params.city,
95
- categories: e.query.categories,
96
- prices: e.query.prices,
97
- delivery: e.query.delivery,
98
- sortParam: e.query.sortParam || h.sort.param,
99
- sortOrder: e.query.sortOrder || h.sort.order,
100
- location: { coordinates: [r, l] },
101
- locationRadius: 1e3,
102
- limit: 500
103
- };
104
- console.log(d);
105
- const g = await I.read(d);
106
- M.all = [...M.all, ...g], u.load().then(() => {
107
- s.value = new google.maps.Map(document.getElementById("map"), {
55
+ }).load().then(async () => {
56
+ if (!l || !r) {
57
+ let o;
58
+ const n = new google.maps.Geocoder();
59
+ try {
60
+ o = await B();
61
+ } catch {
62
+ o = "Thailand", console.log(error);
63
+ }
64
+ try {
65
+ const a = await n.geocode({ address: o });
66
+ console.log(a), a ? (l = a.results[0].geometry.location.lat(), r = a.results[0].geometry.location.lng(), t = 6) : console.error("No results found for the country code.");
67
+ } catch (a) {
68
+ console.error("Error getting coordinates from country code:", a);
69
+ }
70
+ }
71
+ if (!l && !r && (e.params.country || e.params.state || e.params.city)) {
72
+ const o = new google.maps.Geocoder(), n = [
73
+ e.params.city,
74
+ e.params.state,
75
+ e.params.country
76
+ ].filter(Boolean).join(", ");
77
+ try {
78
+ const a = await o.geocode({ address: n });
79
+ a[0] && (l = a[0].geometry.location.lat(), r = a[0].geometry.location.lng());
80
+ } catch (a) {
81
+ console.error("Error getting coordinates:", a);
82
+ }
83
+ }
84
+ O.value += C.value;
85
+ const q = {
86
+ // country: route.params.country,
87
+ // state: route.params.state,
88
+ // city: route.params.city,
89
+ // categories: route.query.categories,
90
+ // prices: route.query.prices,
91
+ // delivery: route.query.delivery,
92
+ country: e.params.country,
93
+ state: e.params.state,
94
+ city: e.params.city,
95
+ categories: e.query.categories,
96
+ prices: e.query.prices,
97
+ delivery: e.query.delivery,
98
+ sortParam: e.query.sortParam || h.sort.param,
99
+ sortOrder: e.query.sortOrder || h.sort.order,
100
+ location: { coordinates: [r, l] },
101
+ locationRadius: 1e3,
102
+ limit: 500
103
+ };
104
+ console.log(q);
105
+ const z = await I.read(q);
106
+ M.all = [...M.all, ...z], s.value = new google.maps.Map(document.getElementById("map"), {
108
107
  mapTypeControl: !1,
109
108
  fullscreenControl: !1,
110
109
  styles: [
@@ -370,7 +369,7 @@ const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-
370
369
  });
371
370
  for (let o of i.value)
372
371
  o.setMap(null);
373
- i.value = [], i.value = g.map((o) => {
372
+ i.value = [], i.value = z.map((o) => {
374
373
  var a;
375
374
  let n = (a = o.spots[0]) == null ? void 0 : a.location;
376
375
  if (n && n.type === "Point") {
@@ -429,11 +428,11 @@ const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-
429
428
  for (let t of i.value)
430
429
  t.setMap(null);
431
430
  i.value = [], i.value = r.map((t) => {
432
- var d;
433
- let u = (d = t.spots[0]) == null ? void 0 : d.location;
434
- if (u && u.type === "Point") {
435
- let [g, T] = u.coordinates, v = t.products && t.products.length > 0 ? "/marker_2.png" : "/marker.png";
436
- const f = new google.maps.Marker({
431
+ var u;
432
+ let f = (u = t.spots[0]) == null ? void 0 : u.location;
433
+ if (f && f.type === "Point") {
434
+ let [g, T] = f.coordinates, v = t.products && t.products.length > 0 ? "/marker_2.png" : "/marker.png";
435
+ const d = new google.maps.Marker({
437
436
  position: { lng: g, lat: T },
438
437
  map: s.value,
439
438
  icon: {
@@ -447,9 +446,9 @@ const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-
447
446
  // point on the icon that corresponds to the geographic location of the marker
448
447
  }
449
448
  });
450
- return f.addListener("click", () => {
449
+ return d.addListener("click", () => {
451
450
  b.push({ name: "Organization", params: { _id: t._id } });
452
- }), f;
451
+ }), d;
453
452
  }
454
453
  return null;
455
454
  }).filter((t) => t !== null);
@@ -472,7 +471,7 @@ const X = (y) => (U("data-v-4c504b8d"), y = y(), A(), y), Y = { class: "h-100 w-
472
471
  te
473
472
  ]));
474
473
  }
475
- }, me = /* @__PURE__ */ W(oe, [["__scopeId", "data-v-4c504b8d"]]);
474
+ }, me = /* @__PURE__ */ W(oe, [["__scopeId", "data-v-b8675d5a"]]);
476
475
  export {
477
476
  me as default
478
477
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router"),d=require("../../../../components/Block/Block.vue.cjs"),h=require("../../../../components/UploadImage/UploadImage.vue.cjs");;/* empty css */const r=require("../../../../components/Field/Field.vue2.cjs"),N=require("../../../../components/Select/Select.vue.cjs"),n=require("../../../../components/Checkbox/Checkbox.vue.cjs"),g=require("../../../../components/Address/Address.vue2.cjs"),w=require("../../../../components/LocationMarker/LocationMarker.vue2.cjs"),u=require("../../../../components/Button/Button.vue2.cjs");require("vue-i18n");;/* empty css */const t=require("../../store/spots.cjs"),V={class:"for-transition w-100 cols-1 pd-thin gap-thin"},y={class:"mn-r-auto"},E={class:"cols-2 gap-thin"},S={class:"gap-small mn-b-small cols-2-fit-content"},k={class:"w-100"},q=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please the available delivery options:",-1),U=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select the available payment methods:",-1),_=e.createElementVNode("p",{class:"mn-b-small p-medium"},"Options:",-1),P={__name:"SpotEdit",setup(x){const m=p.useRouter(),l=p.useRoute();e.ref("details"),e.ref(!1),e.onMounted(async()=>{await c()});async function c(){var s,o;l.params.spot&&await t.actions.readOne(l.params.spot);const i=(s=t.state.spot.location)==null?void 0:s.coordinates[0],a=(o=t.state.spot.location)==null?void 0:o.coordinates[1];t.state.spot.location={lat:a||1,lng:i||1}}async function f(){t.state.spot.location={type:"Point",coordinates:[t.state.spot.location.lng,t.state.spot.location.lat]},l.params.spot&&await t.actions.update(l.params._id,t.state.spot),l.params.spot||await t.actions.create(l.params._id,t.state.spot)}function b(){m.replace({name:"Spot",params:{_id:l.params._id,spot:t.state.spot._id}})}async function v(){await t.actions.delete(l.params._id,t.state.spot)}return(i,a)=>(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(d.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",y,e.toDisplayString(e.unref(l).params.spot?t.state.spot.profile.name:"Create Spot"),1),e.createVNode(u.default,{submit:f,callback:b,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save Spot ")]),_:1})]),_:1}),e.createElementVNode("div",E,[e.createVNode(d.default,{title:"Profile",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(h.default,{photo:t.state.spot.profile.photo,"onUpdate:photo":a[0]||(a[0]=s=>t.state.spot.profile.photo=s),uploadPath:"organizations/"+t.state.spot.name+"/avatars",class:"aspect-1x1 w-8r o-hidden radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",k,[e.createVNode(r.default,{field:t.state.spot.profile.name,"onUpdate:field":a[1]||(a[1]=s=>t.state.spot.profile.name=s),label:"Name",placeholder:"Spot Name",class:"mn-b-small bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"]),e.createVNode(r.default,{field:t.state.spot.profile.description,"onUpdate:field":a[2]||(a[2]=s=>t.state.spot.profile.description=s),label:"Description",placeholder:"Spot description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"])])]),e.createVNode(N.default,{select:t.state.spot.status,"onUpdate:select":a[3]||(a[3]=s=>t.state.spot.status=s),label:"Status",options:["unpublished","published","archivied"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),q,(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["pickup","courier","post"],s=>e.createVNode(n.default,{label:s,name:"Delivery",value:s,class:"w-100 mn-b-small bg-white radius-small pd-small",radio:t.state.spot.delivery,"onUpdate:radio":a[4]||(a[4]=o=>t.state.spot.delivery=o)},null,8,["label","value","radio"])),64)),U,(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["cash","bank transfer","crypto"],s=>e.createVNode(n.default,{label:s,name:"Payment",value:s,class:"w-100 mn-b-small bg-white radius-small pd-small",radio:t.state.spot.payment,"onUpdate:radio":a[5]||(a[5]=o=>t.state.spot.payment=o)},null,8,["label","value","radio"])),64))]),_:1}),e.createVNode(d.default,{title:"Location",class:"pos-relative"},{default:e.withCtx(()=>{var s;return[e.createVNode(g.default,{apiKey:i.GOOGLE_MAPS_API_KEY,address:t.state.spot.address,location:t.state.spot.location,label:"Address",placeholder:"Enter delivery address",class:"bg-white pd-small radius-tl-medium radius-tr-medium","onUpdate:location":a[6]||(a[6]=o=>{t.state.spot.location=o}),"onUpdate:address":a[7]||(a[7]=o=>{t.state.spot.address=o})},null,8,["apiKey","address","location"]),e.createVNode(w.default,{apiKey:i.GOOGLE_MAPS_API_KEY,address:t.state.spot.address,location:t.state.spot.location,class:"h-20r mn-b-small radius-bl-medium radius-br-medium o-hidden","onUpdate:location":a[8]||(a[8]=o=>{t.state.spot.location=o}),"onUpdate:address":a[9]||(a[9]=o=>{t.state.spot.address=o})},null,8,["apiKey","address","location"]),_,e.createVNode(n.default,{label:"Hide address",name:"address",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:(s=t.state.spot.position)==null?void 0:s.hide,"onUpdate:radio":a[10]||(a[10]=o=>t.state.spot.position.hide=o)},null,8,["radio"]),e.createVNode(r.default,{field:t.state.spot.minorder,"onUpdate:field":a[11]||(a[11]=o=>t.state.spot.minorder=o),label:"Min.order",placeholder:"Enter minimum order value",class:"bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"])]}),_:1})]),e.createVNode(u.default,{submit:v,callback:i.redirectToDash,class:"w-100 bg-light"},{default:e.withCtx(()=>[e.createTextVNode("Delete Spot")]),_:1},8,["callback"])]))}};exports.default=P;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),d=require("../../../../components/Block/Block.vue.cjs"),g=require("../../../../components/UploadImage/UploadImage.vue.cjs");;/* empty css */const r=require("../../../../components/Field/Field.vue2.cjs"),N=require("../../../../components/Select/Select.vue.cjs"),n=require("../../../../components/Checkbox/Checkbox.vue.cjs"),w=require("../../../../components/Address/Address.vue2.cjs"),V=require("../../../../components/LocationMarker/LocationMarker.vue2.cjs"),m=require("../../../../components/Button/Button.vue2.cjs");require("vue-i18n");;/* empty css */const t=require("../../store/spots.cjs"),y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},S={class:"cols-2 gap-thin"},q={class:"gap-small mn-b-small cols-2-fit-content"},k={class:"w-100"},U=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please the available delivery options:",-1),_=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select the available payment methods:",-1),P=e.createElementVNode("p",{class:"mn-b-small p-medium"},"Options:",-1),O={__name:"SpotEdit",setup(x){const p=u.useRouter(),l=u.useRoute();e.ref("details"),e.ref(!1),e.onMounted(async()=>{await c()});async function c(){var s,o;l.params.spot&&await t.actions.readOne(l.params.spot);const i=(s=t.state.spot.location)==null?void 0:s.coordinates[0],a=(o=t.state.spot.location)==null?void 0:o.coordinates[1];t.state.spot.location={lat:a||1,lng:i||1}}async function f(){t.state.spot.location={type:"Point",coordinates:[t.state.spot.location.lng,t.state.spot.location.lat]},l.params.spot&&await t.actions.update(l.params._id,t.state.spot),l.params.spot||await t.actions.create(l.params._id,t.state.spot)}function b(){p.push({name:"Organization",params:{_id:l.params._id}})}async function h(){await t.actions.delete(l.params._id,t.state.spot)}function v(){p.push({name:"Organization",params:{_id:l.params._id}})}return(i,a)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(d.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(l).params.spot?t.state.spot.profile.name:"Create Spot"),1),e.createVNode(m.default,{submit:f,callback:b,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save Spot ")]),_:1})]),_:1}),e.createElementVNode("div",S,[e.createVNode(d.default,{title:"Profile",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(g.default,{photo:t.state.spot.profile.photo,"onUpdate:photo":a[0]||(a[0]=s=>t.state.spot.profile.photo=s),uploadPath:"organizations/"+t.state.spot.name+"/avatars",class:"aspect-1x1 w-8r o-hidden radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",k,[e.createVNode(r.default,{field:t.state.spot.profile.name,"onUpdate:field":a[1]||(a[1]=s=>t.state.spot.profile.name=s),label:"Name",placeholder:"Spot Name",class:"mn-b-small bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"]),e.createVNode(r.default,{field:t.state.spot.profile.description,"onUpdate:field":a[2]||(a[2]=s=>t.state.spot.profile.description=s),label:"Description",placeholder:"Spot description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"])])]),e.createVNode(N.default,{select:t.state.spot.status,"onUpdate:select":a[3]||(a[3]=s=>t.state.spot.status=s),label:"Status",options:["unpublished","published","archivied"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),U,(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["pickup","courier","post"],s=>e.createVNode(n.default,{label:s,name:"Delivery",value:s,class:"w-100 mn-b-small bg-white radius-small pd-small",radio:t.state.spot.delivery,"onUpdate:radio":a[4]||(a[4]=o=>t.state.spot.delivery=o)},null,8,["label","value","radio"])),64)),_,(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["cash","bank transfer","crypto"],s=>e.createVNode(n.default,{label:s,name:"Payment",value:s,class:"w-100 mn-b-small bg-white radius-small pd-small",radio:t.state.spot.payment,"onUpdate:radio":a[5]||(a[5]=o=>t.state.spot.payment=o)},null,8,["label","value","radio"])),64))]),_:1}),e.createVNode(d.default,{title:"Location",class:"pos-relative"},{default:e.withCtx(()=>{var s;return[e.createVNode(w.default,{apiKey:i.GOOGLE_MAPS_API_KEY,address:t.state.spot.address,location:t.state.spot.location,locale:i.$i18n.locale,label:"Address",placeholder:"Enter delivery address",class:"bg-white pd-small radius-tl-medium radius-tr-medium","onUpdate:location":a[6]||(a[6]=o=>{t.state.spot.location=o}),"onUpdate:address":a[7]||(a[7]=o=>{t.state.spot.address=o})},null,8,["apiKey","address","location","locale"]),e.createVNode(V.default,{apiKey:i.GOOGLE_MAPS_API_KEY,address:t.state.spot.address,location:t.state.spot.location,locale:i.$i18n.locale,class:"h-20r mn-b-small radius-bl-medium radius-br-medium o-hidden","onUpdate:location":a[8]||(a[8]=o=>{t.state.spot.location=o}),"onUpdate:address":a[9]||(a[9]=o=>{t.state.spot.address=o})},null,8,["apiKey","address","location","locale"]),P,e.createVNode(n.default,{label:"Hide address",name:"address",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:(s=t.state.spot.position)==null?void 0:s.hide,"onUpdate:radio":a[10]||(a[10]=o=>t.state.spot.position.hide=o)},null,8,["radio"]),e.createVNode(r.default,{field:t.state.spot.minorder,"onUpdate:field":a[11]||(a[11]=o=>t.state.spot.minorder=o),label:"Min.order",placeholder:"Enter minimum order value",class:"bg-white radius-small pd-medium",validation:i.organizationName},null,8,["field","validation"])]}),_:1})]),e.createVNode(m.default,{submit:h,callback:v,class:"w-100 bg-light"},{default:e.withCtx(()=>[e.createTextVNode("Delete Spot")]),_:1})]))}};exports.default=O;
@@ -1,28 +1,28 @@
1
- import { ref as b, onMounted as E, openBlock as p, createElementBlock as m, createVNode as e, withCtx as n, createElementVNode as d, toDisplayString as D, unref as N, createTextVNode as v, Fragment as h, renderList as _ } from "vue";
2
- import { useRouter as k, useRoute as $ } from "vue-router";
1
+ import { ref as v, onMounted as $, openBlock as p, createElementBlock as m, createVNode as l, withCtx as d, createElementVNode as n, toDisplayString as D, unref as N, createTextVNode as h, Fragment as g, renderList as _ } from "vue";
2
+ import { useRouter as O, useRoute as k } from "vue-router";
3
3
  import u from "../../../../components/Block/Block.vue.js";
4
- import K from "../../../../components/UploadImage/UploadImage.vue.js";
4
+ import z from "../../../../components/UploadImage/UploadImage.vue.js";
5
5
  /* empty css */
6
6
  import c from "../../../../components/Field/Field.vue2.js";
7
- import O from "../../../../components/Select/Select.vue.js";
7
+ import K from "../../../../components/Select/Select.vue.js";
8
8
  import f from "../../../../components/Checkbox/Checkbox.vue.js";
9
9
  import A from "../../../../components/Address/Address.vue2.js";
10
- import x from "../../../../components/LocationMarker/LocationMarker.vue2.js";
11
- import g from "../../../../components/Button/Button.vue2.js";
10
+ import G from "../../../../components/LocationMarker/LocationMarker.vue2.js";
11
+ import w from "../../../../components/Button/Button.vue2.js";
12
12
  import "vue-i18n";
13
13
  /* empty css */
14
14
  import { actions as r, state as a } from "../../store/spots.js";
15
- const z = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class: "mn-r-auto" }, L = { class: "cols-2 gap-thin" }, M = { class: "gap-small mn-b-small cols-2-fit-content" }, T = { class: "w-100" }, V = /* @__PURE__ */ d("p", { class: "p-medium mn-b-small" }, "Please the available delivery options:", -1), B = /* @__PURE__ */ d("p", { class: "p-medium mn-b-small" }, "Please select the available payment methods:", -1), C = /* @__PURE__ */ d("p", { class: "mn-b-small p-medium" }, "Options:", -1), sa = {
15
+ const L = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, M = { class: "mn-r-auto" }, x = { class: "cols-2 gap-thin" }, V = { class: "gap-small mn-b-small cols-2-fit-content" }, B = { class: "w-100" }, C = /* @__PURE__ */ n("p", { class: "p-medium mn-b-small" }, "Please the available delivery options:", -1), I = /* @__PURE__ */ n("p", { class: "p-medium mn-b-small" }, "Please select the available payment methods:", -1), R = /* @__PURE__ */ n("p", { class: "mn-b-small p-medium" }, "Options:", -1), la = {
16
16
  __name: "SpotEdit",
17
- setup(I) {
18
- const w = k(), l = $();
19
- b("details"), b(!1), E(async () => {
17
+ setup(T) {
18
+ const b = O(), e = k();
19
+ v("details"), v(!1), $(async () => {
20
20
  await y();
21
21
  });
22
22
  async function y() {
23
- var t, s;
24
- l.params.spot && await r.readOne(l.params.spot);
25
- const i = (t = a.spot.location) == null ? void 0 : t.coordinates[0], o = (s = a.spot.location) == null ? void 0 : s.coordinates[1];
23
+ var s, t;
24
+ e.params.spot && await r.readOne(e.params.spot);
25
+ const i = (s = a.spot.location) == null ? void 0 : s.coordinates[0], o = (t = a.spot.location) == null ? void 0 : t.coordinates[1];
26
26
  a.spot.location = {
27
27
  lat: o || 1,
28
28
  lng: i || 1
@@ -32,65 +32,68 @@ const z = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
32
32
  a.spot.location = {
33
33
  type: "Point",
34
34
  coordinates: [a.spot.location.lng, a.spot.location.lat]
35
- }, l.params.spot && await r.update(
36
- l.params._id,
35
+ }, e.params.spot && await r.update(
36
+ e.params._id,
37
37
  a.spot
38
- ), l.params.spot || await r.create(
39
- l.params._id,
38
+ ), e.params.spot || await r.create(
39
+ e.params._id,
40
40
  a.spot
41
41
  );
42
42
  }
43
43
  function U() {
44
- w.replace({ name: "Spot", params: { _id: l.params._id, spot: a.spot._id } });
44
+ b.push({ name: "Organization", params: { _id: e.params._id } });
45
45
  }
46
46
  async function P() {
47
47
  await r.delete(
48
- l.params._id,
48
+ e.params._id,
49
49
  a.spot
50
50
  );
51
51
  }
52
- return (i, o) => (p(), m("div", z, [
53
- e(u, { class: "flex-nowrap flex-v-center flex" }, {
54
- default: n(() => [
55
- d("h1", G, D(N(l).params.spot ? a.spot.profile.name : "Create Spot"), 1),
56
- e(g, {
52
+ function E() {
53
+ b.push({ name: "Organization", params: { _id: e.params._id } });
54
+ }
55
+ return (i, o) => (p(), m("div", L, [
56
+ l(u, { class: "flex-nowrap flex-v-center flex" }, {
57
+ default: d(() => [
58
+ n("h1", M, D(N(e).params.spot ? a.spot.profile.name : "Create Spot"), 1),
59
+ l(w, {
57
60
  submit: S,
58
61
  callback: U,
59
62
  class: "bg-main"
60
63
  }, {
61
- default: n(() => [
62
- v(" Save Spot ")
64
+ default: d(() => [
65
+ h(" Save Spot ")
63
66
  ]),
64
67
  _: 1
65
68
  })
66
69
  ]),
67
70
  _: 1
68
71
  }),
69
- d("div", L, [
70
- e(u, {
72
+ n("div", x, [
73
+ l(u, {
71
74
  title: "Profile",
72
75
  class: "mn-b-semi"
73
76
  }, {
74
- default: n(() => [
75
- d("div", M, [
76
- e(K, {
77
+ default: d(() => [
78
+ n("div", V, [
79
+ l(z, {
77
80
  photo: a.spot.profile.photo,
78
- "onUpdate:photo": o[0] || (o[0] = (t) => a.spot.profile.photo = t),
81
+ "onUpdate:photo": o[0] || (o[0] = (s) => a.spot.profile.photo = s),
79
82
  uploadPath: "organizations/" + a.spot.name + "/avatars",
80
83
  class: "aspect-1x1 w-8r o-hidden radius-extra"
81
84
  }, null, 8, ["photo", "uploadPath"]),
82
- d("div", T, [
83
- e(c, {
85
+ n("div", B, [
86
+ l(c, {
84
87
  field: a.spot.profile.name,
85
- "onUpdate:field": o[1] || (o[1] = (t) => a.spot.profile.name = t),
88
+ "onUpdate:field": o[1] || (o[1] = (s) => a.spot.profile.name = s),
86
89
  label: "Name",
87
90
  placeholder: "Spot Name",
88
91
  class: "mn-b-small bg-white radius-small pd-medium",
89
92
  validation: i.organizationName
90
93
  }, null, 8, ["field", "validation"]),
91
- e(c, {
94
+ l(c, {
92
95
  field: a.spot.profile.description,
93
- "onUpdate:field": o[2] || (o[2] = (t) => a.spot.profile.description = t),
96
+ "onUpdate:field": o[2] || (o[2] = (s) => a.spot.profile.description = s),
94
97
  label: "Description",
95
98
  placeholder: "Spot description (max 120 symbols)",
96
99
  class: "bg-white radius-small pd-medium",
@@ -98,9 +101,9 @@ const z = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
98
101
  }, null, 8, ["field", "validation"])
99
102
  ])
100
103
  ]),
101
- e(O, {
104
+ l(K, {
102
105
  select: a.spot.status,
103
- "onUpdate:select": o[3] || (o[3] = (t) => a.spot.status = t),
106
+ "onUpdate:select": o[3] || (o[3] = (s) => a.spot.status = s),
104
107
  label: "Status",
105
108
  options: [
106
109
  "unpublished",
@@ -110,71 +113,73 @@ const z = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
110
113
  placeholder: "Display product",
111
114
  class: "pos-relative w-100 mn-b-small bg-white radius-small pd-medium"
112
115
  }, null, 8, ["select"]),
113
- V,
114
- (p(), m(h, null, _(["pickup", "courier", "post"], (t) => e(f, {
115
- label: t,
116
+ C,
117
+ (p(), m(g, null, _(["pickup", "courier", "post"], (s) => l(f, {
118
+ label: s,
116
119
  name: "Delivery",
117
- value: t,
120
+ value: s,
118
121
  class: "w-100 mn-b-small bg-white radius-small pd-small",
119
122
  radio: a.spot.delivery,
120
- "onUpdate:radio": o[4] || (o[4] = (s) => a.spot.delivery = s)
123
+ "onUpdate:radio": o[4] || (o[4] = (t) => a.spot.delivery = t)
121
124
  }, null, 8, ["label", "value", "radio"])), 64)),
122
- B,
123
- (p(), m(h, null, _(["cash", "bank transfer", "crypto"], (t) => e(f, {
124
- label: t,
125
+ I,
126
+ (p(), m(g, null, _(["cash", "bank transfer", "crypto"], (s) => l(f, {
127
+ label: s,
125
128
  name: "Payment",
126
- value: t,
129
+ value: s,
127
130
  class: "w-100 mn-b-small bg-white radius-small pd-small",
128
131
  radio: a.spot.payment,
129
- "onUpdate:radio": o[5] || (o[5] = (s) => a.spot.payment = s)
132
+ "onUpdate:radio": o[5] || (o[5] = (t) => a.spot.payment = t)
130
133
  }, null, 8, ["label", "value", "radio"])), 64))
131
134
  ]),
132
135
  _: 1
133
136
  }),
134
- e(u, {
137
+ l(u, {
135
138
  title: "Location",
136
139
  class: "pos-relative"
137
140
  }, {
138
- default: n(() => {
139
- var t;
141
+ default: d(() => {
142
+ var s;
140
143
  return [
141
- e(A, {
144
+ l(A, {
142
145
  apiKey: i.GOOGLE_MAPS_API_KEY,
143
146
  address: a.spot.address,
144
147
  location: a.spot.location,
148
+ locale: i.$i18n.locale,
145
149
  label: "Address",
146
150
  placeholder: "Enter delivery address",
147
151
  class: "bg-white pd-small radius-tl-medium radius-tr-medium",
148
- "onUpdate:location": o[6] || (o[6] = (s) => {
149
- a.spot.location = s;
152
+ "onUpdate:location": o[6] || (o[6] = (t) => {
153
+ a.spot.location = t;
150
154
  }),
151
- "onUpdate:address": o[7] || (o[7] = (s) => {
152
- a.spot.address = s;
155
+ "onUpdate:address": o[7] || (o[7] = (t) => {
156
+ a.spot.address = t;
153
157
  })
154
- }, null, 8, ["apiKey", "address", "location"]),
155
- e(x, {
158
+ }, null, 8, ["apiKey", "address", "location", "locale"]),
159
+ l(G, {
156
160
  apiKey: i.GOOGLE_MAPS_API_KEY,
157
161
  address: a.spot.address,
158
162
  location: a.spot.location,
163
+ locale: i.$i18n.locale,
159
164
  class: "h-20r mn-b-small radius-bl-medium radius-br-medium o-hidden",
160
- "onUpdate:location": o[8] || (o[8] = (s) => {
161
- a.spot.location = s;
165
+ "onUpdate:location": o[8] || (o[8] = (t) => {
166
+ a.spot.location = t;
162
167
  }),
163
- "onUpdate:address": o[9] || (o[9] = (s) => {
164
- a.spot.address = s;
168
+ "onUpdate:address": o[9] || (o[9] = (t) => {
169
+ a.spot.address = t;
165
170
  })
166
- }, null, 8, ["apiKey", "address", "location"]),
167
- C,
168
- e(f, {
171
+ }, null, 8, ["apiKey", "address", "location", "locale"]),
172
+ R,
173
+ l(f, {
169
174
  label: "Hide address",
170
175
  name: "address",
171
176
  class: "w-100 mn-r-small bg-white radius-small pd-small",
172
- radio: (t = a.spot.position) == null ? void 0 : t.hide,
173
- "onUpdate:radio": o[10] || (o[10] = (s) => a.spot.position.hide = s)
177
+ radio: (s = a.spot.position) == null ? void 0 : s.hide,
178
+ "onUpdate:radio": o[10] || (o[10] = (t) => a.spot.position.hide = t)
174
179
  }, null, 8, ["radio"]),
175
- e(c, {
180
+ l(c, {
176
181
  field: a.spot.minorder,
177
- "onUpdate:field": o[11] || (o[11] = (s) => a.spot.minorder = s),
182
+ "onUpdate:field": o[11] || (o[11] = (t) => a.spot.minorder = t),
178
183
  label: "Min.order",
179
184
  placeholder: "Enter minimum order value",
180
185
  class: "bg-white radius-small pd-medium",
@@ -185,19 +190,19 @@ const z = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
185
190
  _: 1
186
191
  })
187
192
  ]),
188
- e(g, {
193
+ l(w, {
189
194
  submit: P,
190
- callback: i.redirectToDash,
195
+ callback: E,
191
196
  class: "w-100 bg-light"
192
197
  }, {
193
- default: n(() => [
194
- v("Delete Spot")
198
+ default: d(() => [
199
+ h("Delete Spot")
195
200
  ]),
196
201
  _: 1
197
- }, 8, ["callback"])
202
+ })
198
203
  ]));
199
204
  }
200
205
  };
201
206
  export {
202
- sa as default
207
+ la as default
203
208
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../globals/components/layouts/Empty.vue.cjs"),r=require("../components/layouts/Spots.vue.cjs"),e=require("../../middlewares/client/auth.validation.cjs"),o={path:"spots",component:t.default,meta:{title:{en:"Spots",ru:"Места"}},children:[{path:":country?",component:r.default,meta:{title:{en:"Spots",ru:"Места"},header_theme:"dark",footer_theme:"dark"},children:[{path:":state?",name:"Spots tate",component:()=>Promise.resolve().then(()=>require("../components/pages/Map.vue.cjs")),children:[{path:":city?",name:"Spots City",component:()=>Promise.resolve().then(()=>require("../components/pages/Map.vue.cjs"))}]}]},{path:":_id/spots/create",name:"Spot Creation",meta:{title:"Создание точки"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/SpotEdit.vue.cjs"))},{path:":_id/spots/:deparment",name:"Spot",meta:{title:"Точка"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/Spot.vue.cjs"))},{path:":_id/spots/:spot/edit",name:"Spot Edit",meta:{title:"Редактирование точки"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/SpotEdit.vue.cjs"))}]};exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../globals/components/layouts/Empty.vue.cjs"),o=require("../components/layouts/Spots.vue.cjs"),e=require("../../middlewares/client/auth.validation.cjs"),r={path:"spots",component:t.default,meta:{title:{en:"Spots",ru:"Места"}},children:[{path:":country?",component:o.default,meta:{title:{en:"Spots",ru:"Места"},header_theme:"dark",footer_theme:"dark"},children:[{path:":state?",name:"Spots tate",component:()=>Promise.resolve().then(()=>require("../components/pages/Map.vue.cjs")),children:[{path:":city?",name:"Spots City",component:()=>Promise.resolve().then(()=>require("../components/pages/Map.vue.cjs"))}]}]},{path:":_id/spots/create",name:"Spot Creation",meta:{title:"Создание точки"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/SpotEdit.vue.cjs"))},{path:":_id/spots/:spot",name:"Spot",meta:{title:"Точка"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/Spot.vue.cjs"))},{path:":_id/spots/:spot/edit",name:"Spot Edit",meta:{title:"Редактирование точки"},beforeEnter:[e.requiresAuth],component:()=>Promise.resolve().then(()=>require("../components/pages/SpotEdit.vue.cjs"))}]};exports.default=r;
@@ -58,7 +58,7 @@ const n = {
58
58
  )
59
59
  },
60
60
  {
61
- path: ":_id/spots/:deparment",
61
+ path: ":_id/spots/:spot",
62
62
  name: "Spot",
63
63
  meta: {
64
64
  title: "Точка"
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */const h=require("../../../../components/Dropdown/Dropdown.vue.cjs"),g=require("../../../../components/Completion/Completion.vue.cjs"),d=require("../../../../components/Menu/Menu.vue.cjs"),l=require("../../../../components/Menu/MenuItem.vue.cjs"),p=require("../../../organizations/components/elements/ButtonToggleMembership.vue.cjs"),N=require("../../../reports/components/sections/FormReport.vue.cjs"),V=require("../../../organizations/components/blocks/Socials.vue.cjs"),B=require("../../../icons/entities/IconEvents.vue.cjs"),f=require("../../../icons/entities/IconGroups.vue.cjs"),w=require("../../../icons/entities/IconCommunity.vue.cjs"),C=require("../../../icons/navigation/IconEdit.vue.cjs"),E=require("../../../icons/placeholders/PlaceholderUserpic.vue.cjs"),_=require("vue-router"),o=require("../../../auth/store/auth.cjs"),t=require("../../store/users.cjs"),v=require("../../../organizations/store/memberships.cjs");require("./Profile.vue2.cjs");const x={key:0,class:"for-transition w-100"},y={key:0,class:"flex-center flex pd-medium radius-big bg-light uppercase t-semi w-100 h-100"},q={key:1,_id:"dash",class:"pd-b-extra pd-thin w-100"},S={class:"flex-center pos-relative flex flex-column t-center w-100 mn-b-semi radius-medium pd-medium bg-light"},U={class:"bg-black pd-thin radius-small"},M=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),P=["src"],R={class:"mn-b-thin"},$={key:4,class:"mn-b-thin t-main t-semi"},D={class:"mn-b-small p-medium"},I={class:"mn-b-medium flex-center flex-nowrap flex"},F={class:"t-semi mn-b-small"},L={key:6,class:"mn-t-small mn-b-thin"},O=e.createElementVNode("span",null,"Events",-1),A=e.createElementVNode("span",null,"Groups",-1),j=e.createElementVNode("span",null,"Posts",-1),W=e.createElementVNode("span",null,"Wallet",-1),z=e.createElementVNode("span",null," Settings ",-1),G=e.createElementVNode("span",null," About ",-1),T=e.createElementVNode("span",{class:"t-red"}," Logout ",-1),H={__name:"Profile",setup(J){const a=_.useRoute(),n=_.useRouter(),u=e.ref(!1);e.onMounted(async()=>{await t.actions.read({_id:a.params._id,user:o.state.user._id}),u.value=!0});const m=({membership:i,status:r,target:s},c,k)=>{v.mutations.handleMembershipUpdate(t.state.current,i,r,s,c,k)};function b(){o.actions.logout(),n.push({name:"Sign In"})}return(i,r)=>u.value?(e.openBlock(),e.createElementBlock("div",x,[t.state.current.status==="removed"?(e.openBlock(),e.createElementBlock("div",y," Sorry, user has been removed. ")):(e.openBlock(),e.createElementBlock("div",q,[e.unref(a).params._id===o.state.user._id&&u.value?(e.openBlock(),e.createBlock(g.default,{key:0,user:o.state.user._id,target:t.state.current,cta:!0,text_cta:"Fill Profile",text:"Profile completed at",class:"mn-b-medium"},null,8,["user","target"])):e.createCommentVNode("",!0),e.createElementVNode("section",S,[e.unref(a).params._id&&e.unref(a).params._id!==o.state.user._id?(e.openBlock(),e.createBlock(h.default,{key:0,label:"...",align:"right",class:"cursor-pointer pos-absolute pos-r-0 pos-t-0 pd-thin radius-extra"},{default:e.withCtx(()=>[e.createElementVNode("section",U,[e.createVNode(N.default,{user:o.state.user._id,type:"user",target:t.state.current._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[M]),_:1},8,["user","target"]),o.state.user._id?(e.openBlock(),e.createBlock(p.default,{key:0,user:o.state.user._id,type:"user",role:"blocked",target:t.state.current._id,status:t.state.current.isBlocked,text:{create:"Block",remove:"Unblock"},onUpdateMembership:r[0]||(r[0]=s=>m(s,"isBlocked")),class:"t-white mn-t-thin bg-red"},null,8,["user","target","status"])):e.createCommentVNode("",!0)])]),_:1})):e.createCommentVNode("",!0),e.unref(a).params._id===o.state.user._id?(e.openBlock(),e.createBlock(C.default,{key:1,onClick:r[1]||(r[1]=s=>i.$router.push({name:"User Edit Profile",params:{_id:o.state.user._id}})),class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),t.state.current.profile.photo&&t.state.current.profile.photo.length>0?(e.openBlock(),e.createElementBlock("img",{key:2,src:(i.FILE_SERVER_URL||"")+t.state.current.profile.photo,class:"radius-extra bg-white mn-b-small object-fit-cover i-extra"},null,8,P)):(e.openBlock(),e.createBlock(E.default,{key:3,class:"radius-medium mn-b-small i-extra"})),e.createElementVNode("h3",R,e.toDisplayString(t.state.current.profile.name?t.state.current.profile.name:"Anonymous"),1),t.state.current.username?(e.openBlock(),e.createElementBlock("p",$," @"+e.toDisplayString(t.state.current.username?t.state.current.username:"Not specified"),1)):e.createCommentVNode("",!0),e.createElementVNode("p",D,e.toDisplayString(t.state.current.profile.description?t.state.current.profile.description:"Bio not specified"),1),e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.roles,(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-white",{"mn-r-thin":c!==t.state.current.roles.length-1}])},e.toDisplayString(s.icon)+" "+e.toDisplayString(s.name),3))),256))]),e.createElementVNode("p",F," 👨‍👨‍👧‍👧 "+e.toDisplayString(t.state.current.numberOfSubscribers)+" followers ",1),o.state.user._id&&e.unref(a).params._id&&e.unref(a).params._id!==o.state.user._id?(e.openBlock(),e.createBlock(p.default,{key:5,user:o.state.user._id,type:"user",role:"subscriber",target:t.state.current._id,status:t.state.current.isSubscriber,text:{create:"Follow",remove:"Unfollow"},onUpdateMembership:r[2]||(r[2]=s=>m(s,"isSubscriber","numberOfSubscribers")),class:"w-min mn-b-medium mn-r-auto mn-l-auto"},null,8,["user","target","status"])):e.createCommentVNode("",!0),Object.values(t.state.current.socials).some(s=>s)?(e.openBlock(),e.createElementBlock("h4",L," Find Me in Socials ")):e.createCommentVNode("",!0),e.createVNode(V.default,{telegram:t.state.current.socials.telegram,facebook:t.state.current.socials.facebook,instagram:t.state.current.socials.instagram,twitter:t.state.current.socials.twitter,class:"mn-r-auto mn-l-auto"},null,8,["telegram","facebook","instagram","twitter"])]),e.createVNode(d.default,{class:"mn-b-regular bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[3]||(r[3]=s=>e.unref(n).push({name:"User Events",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(B.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),O]),_:1}),e.createVNode(l.default,{onClick:r[4]||(r[4]=s=>e.unref(n).push({name:"User Organizations",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(f.default,{class:"i-semi",icon:!0}),A]),_:1}),e.createVNode(l.default,{onClick:r[5]||(r[5]=s=>e.unref(n).push({name:"User Blogposts",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(w.default,{class:"i-semi",icon:!0}),j]),_:1})]),_:1}),i.APP_NAME==="Weeder"?(e.openBlock(),e.createBlock(d.default,{key:1,class:"mn-b-regular bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[6]||(r[6]=s=>e.unref(n).push({name:"User Wallet",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(f.default,{class:"i-semi",icon:!0}),W]),_:1})]),_:1})):e.createCommentVNode("",!0),o.state.user._id===e.unref(a).params._id?(e.openBlock(),e.createBlock(d.default,{key:2,class:"bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[7]||(r[7]=s=>e.unref(n).push({name:"User Edit Profile",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[z]),_:1}),e.createVNode(l.default,{onClick:r[8]||(r[8]=s=>e.unref(n).push({name:"Legal",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[G]),_:1}),e.createVNode(l.default,{class:"cursor-pointer",onClick:r[9]||(r[9]=s=>b())},{default:e.withCtx(()=>[T]),_:1})]),_:1})):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)}};exports.default=H;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */const h=require("../../../../components/Dropdown/Dropdown.vue2.cjs"),g=require("../../../../components/Completion/Completion.vue.cjs"),d=require("../../../../components/Menu/Menu.vue2.cjs"),l=require("../../../../components/Menu/MenuItem.vue.cjs"),p=require("../../../organizations/components/elements/ButtonToggleMembership.vue.cjs"),N=require("../../../reports/components/sections/FormReport.vue.cjs"),V=require("../../../organizations/components/blocks/Socials.vue.cjs"),B=require("../../../icons/entities/IconEvents.vue.cjs"),f=require("../../../icons/entities/IconGroups.vue.cjs"),w=require("../../../icons/entities/IconCommunity.vue.cjs"),C=require("../../../icons/navigation/IconEdit.vue.cjs"),E=require("../../../icons/placeholders/PlaceholderUserpic.vue.cjs"),_=require("vue-router"),o=require("../../../auth/store/auth.cjs"),t=require("../../store/users.cjs"),v=require("../../../organizations/store/memberships.cjs");require("./Profile.vue2.cjs");const x={key:0,class:"for-transition w-100"},y={key:0,class:"flex-center flex pd-medium radius-big bg-light uppercase t-semi w-100 h-100"},q={key:1,_id:"dash",class:"pd-b-extra pd-thin w-100"},S={class:"flex-center pos-relative flex flex-column t-center w-100 mn-b-semi radius-medium pd-medium bg-light"},U={class:"bg-black pd-thin radius-small"},M=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),P=["src"],R={class:"mn-b-thin"},$={key:4,class:"mn-b-thin t-main t-semi"},D={class:"mn-b-small p-medium"},I={class:"mn-b-medium flex-center flex-nowrap flex"},F={class:"t-semi mn-b-small"},L={key:6,class:"mn-t-small mn-b-thin"},O=e.createElementVNode("span",null,"Events",-1),A=e.createElementVNode("span",null,"Groups",-1),j=e.createElementVNode("span",null,"Posts",-1),W=e.createElementVNode("span",null,"Wallet",-1),z=e.createElementVNode("span",null," Settings ",-1),G=e.createElementVNode("span",null," About ",-1),T=e.createElementVNode("span",{class:"t-red"}," Logout ",-1),H={__name:"Profile",setup(J){const a=_.useRoute(),n=_.useRouter(),u=e.ref(!1);e.onMounted(async()=>{await t.actions.read({_id:a.params._id,user:o.state.user._id}),u.value=!0});const m=({membership:i,status:r,target:s},c,k)=>{v.mutations.handleMembershipUpdate(t.state.current,i,r,s,c,k)};function b(){o.actions.logout(),n.push({name:"Sign In"})}return(i,r)=>u.value?(e.openBlock(),e.createElementBlock("div",x,[t.state.current.status==="removed"?(e.openBlock(),e.createElementBlock("div",y," Sorry, user has been removed. ")):(e.openBlock(),e.createElementBlock("div",q,[e.unref(a).params._id===o.state.user._id&&u.value?(e.openBlock(),e.createBlock(g.default,{key:0,user:o.state.user._id,target:t.state.current,cta:!0,text_cta:"Fill Profile",text:"Profile completed at",class:"mn-b-medium"},null,8,["user","target"])):e.createCommentVNode("",!0),e.createElementVNode("section",S,[e.unref(a).params._id&&e.unref(a).params._id!==o.state.user._id?(e.openBlock(),e.createBlock(h.default,{key:0,label:"...",align:"right",class:"cursor-pointer pos-absolute pos-r-0 pos-t-0 pd-thin radius-extra"},{default:e.withCtx(()=>[e.createElementVNode("section",U,[e.createVNode(N.default,{user:o.state.user._id,type:"user",target:t.state.current._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[M]),_:1},8,["user","target"]),o.state.user._id?(e.openBlock(),e.createBlock(p.default,{key:0,user:o.state.user._id,type:"user",role:"blocked",target:t.state.current._id,status:t.state.current.isBlocked,text:{create:"Block",remove:"Unblock"},onUpdateMembership:r[0]||(r[0]=s=>m(s,"isBlocked")),class:"t-white mn-t-thin bg-red"},null,8,["user","target","status"])):e.createCommentVNode("",!0)])]),_:1})):e.createCommentVNode("",!0),e.unref(a).params._id===o.state.user._id?(e.openBlock(),e.createBlock(C.default,{key:1,onClick:r[1]||(r[1]=s=>i.$router.push({name:"User Edit Profile",params:{_id:o.state.user._id}})),class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),t.state.current.profile.photo&&t.state.current.profile.photo.length>0?(e.openBlock(),e.createElementBlock("img",{key:2,src:(i.FILE_SERVER_URL||"")+t.state.current.profile.photo,class:"radius-extra bg-white mn-b-small object-fit-cover i-extra"},null,8,P)):(e.openBlock(),e.createBlock(E.default,{key:3,class:"radius-medium mn-b-small i-extra"})),e.createElementVNode("h3",R,e.toDisplayString(t.state.current.profile.name?t.state.current.profile.name:"Anonymous"),1),t.state.current.username?(e.openBlock(),e.createElementBlock("p",$," @"+e.toDisplayString(t.state.current.username?t.state.current.username:"Not specified"),1)):e.createCommentVNode("",!0),e.createElementVNode("p",D,e.toDisplayString(t.state.current.profile.description?t.state.current.profile.description:"Bio not specified"),1),e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.roles,(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-white",{"mn-r-thin":c!==t.state.current.roles.length-1}])},e.toDisplayString(s.icon)+" "+e.toDisplayString(s.name),3))),256))]),e.createElementVNode("p",F," 👨‍👨‍👧‍👧 "+e.toDisplayString(t.state.current.numberOfSubscribers)+" followers ",1),o.state.user._id&&e.unref(a).params._id&&e.unref(a).params._id!==o.state.user._id?(e.openBlock(),e.createBlock(p.default,{key:5,user:o.state.user._id,type:"user",role:"subscriber",target:t.state.current._id,status:t.state.current.isSubscriber,text:{create:"Follow",remove:"Unfollow"},onUpdateMembership:r[2]||(r[2]=s=>m(s,"isSubscriber","numberOfSubscribers")),class:"w-min mn-b-medium mn-r-auto mn-l-auto"},null,8,["user","target","status"])):e.createCommentVNode("",!0),Object.values(t.state.current.socials).some(s=>s)?(e.openBlock(),e.createElementBlock("h4",L," Find Me in Socials ")):e.createCommentVNode("",!0),e.createVNode(V.default,{telegram:t.state.current.socials.telegram,facebook:t.state.current.socials.facebook,instagram:t.state.current.socials.instagram,twitter:t.state.current.socials.twitter,class:"mn-r-auto mn-l-auto"},null,8,["telegram","facebook","instagram","twitter"])]),e.createVNode(d.default,{class:"mn-b-regular bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[3]||(r[3]=s=>e.unref(n).push({name:"User Events",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(B.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),O]),_:1}),e.createVNode(l.default,{onClick:r[4]||(r[4]=s=>e.unref(n).push({name:"User Organizations",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(f.default,{class:"i-semi",icon:!0}),A]),_:1}),e.createVNode(l.default,{onClick:r[5]||(r[5]=s=>e.unref(n).push({name:"User Blogposts",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(w.default,{class:"i-semi",icon:!0}),j]),_:1})]),_:1}),i.APP_NAME==="Weeder"?(e.openBlock(),e.createBlock(d.default,{key:1,class:"mn-b-regular bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[6]||(r[6]=s=>e.unref(n).push({name:"User Wallet",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(f.default,{class:"i-semi",icon:!0}),W]),_:1})]),_:1})):e.createCommentVNode("",!0),o.state.user._id===e.unref(a).params._id?(e.openBlock(),e.createBlock(d.default,{key:2,class:"bg-light"},{default:e.withCtx(()=>[e.createVNode(l.default,{onClick:r[7]||(r[7]=s=>e.unref(n).push({name:"User Edit Profile",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[z]),_:1}),e.createVNode(l.default,{onClick:r[8]||(r[8]=s=>e.unref(n).push({name:"Legal",params:{_id:e.unref(a).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[G]),_:1}),e.createVNode(l.default,{class:"cursor-pointer",onClick:r[9]||(r[9]=s=>b())},{default:e.withCtx(()=>[T]),_:1})]),_:1})):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)}};exports.default=H;