@ozdao/prometheus-framework 0.2.67 → 0.2.69

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. package/dist/products.server.js +1 -0
  2. package/dist/products.server.mjs +1 -0
  3. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Button/Button.vue.js +225 -1
  5. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -225
  7. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  9. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  11. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  13. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -1
  15. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -72
  17. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/components/Select/Select.vue.js +97 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -97
  21. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +46 -1
  23. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +1 -46
  25. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  27. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  39. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
  43. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +4 -4
  45. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  50. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  53. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +4 -4
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
  63. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +3 -3
  65. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  67. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  69. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  75. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +4 -4
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
  81. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +5 -5
  85. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  87. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  95. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  97. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +5 -5
  99. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  101. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  105. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  107. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  111. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +3 -3
  113. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
  117. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  123. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  125. package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/store/leftovers.js +9 -8
  127. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  129. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  131. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  135. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +3 -3
  139. package/dist/style.css +1 -1
  140. package/package.json +1 -1
  141. package/src/components/ButtonSegmented/ButtonSegmented.vue +78 -0
  142. package/src/components/Completion/Completion.vue +76 -0
  143. package/src/components/Feed/Feed.vue +46 -18
  144. package/src/components/Tab/Tab.vue +11 -30
  145. package/src/modules/auth/components/pages/Invite.vue +1 -1
  146. package/src/modules/auth/controllers/auth.controller.js +10 -21
  147. package/src/modules/backoffice/router/backoffice.js +3 -3
  148. package/src/modules/events/components/elements/ButtonCheck.vue +15 -15
  149. package/src/modules/events/components/pages/EditEventTickets.vue +39 -13
  150. package/src/modules/events/components/pages/Event.vue +1 -2
  151. package/src/modules/events/controllers/tickets.controller.js +151 -98
  152. package/src/modules/events/controllers/utils/templateEmail.js +14 -0
  153. package/src/modules/events/controllers/utils/templateTicket.js +194 -0
  154. package/src/modules/events/router/events.js +3 -0
  155. package/src/modules/events/store/tickets.js +2 -2
  156. package/src/modules/globals/controllers/utils/queryProcessor.js +31 -6
  157. package/src/modules/globals/utils/mailing.js +19 -12
  158. package/src/modules/icons/entities/IconEvents.vue +7 -2
  159. package/src/modules/landing/components/pages/Home.vue +1 -1
  160. package/src/modules/orders/components/blocks/CardOrder.vue +1 -1
  161. package/src/modules/orders/components/blocks/CardOrderVar1.vue +97 -0
  162. package/src/modules/orders/components/pages/{FormOrder.vue → OrderCreate.vue} +20 -11
  163. package/src/modules/orders/components/pages/{EditOrder.vue → OrderCreateBackoffice.vue} +74 -17
  164. package/src/modules/orders/components/pages/Orders.vue +181 -70
  165. package/src/modules/orders/components/pages/Orders_refact.vue +2 -2
  166. package/src/modules/orders/components/sections/FormClientDetails.vue +24 -26
  167. package/src/modules/{applications → orders}/components/sections/SubscribeNewsletter.vue +1 -1
  168. package/src/modules/orders/controllers/orders.controller.js +46 -7
  169. package/src/modules/orders/models/customer.model.js +31 -0
  170. package/src/modules/orders/models/order.model.js +8 -13
  171. package/src/modules/orders/orders.client.js +67 -0
  172. package/src/modules/orders/orders.server.js +15 -0
  173. package/src/modules/orders/router/orders.router.js +1 -1
  174. package/src/modules/orders/store/orders.js +17 -2
  175. package/src/modules/products/controllers/leftovers.controller.js +1 -0
  176. package/src/modules/products/store/leftovers.js +3 -2
  177. package/src/modules/users/components/pages/Profile.vue +6 -4
  178. package/src/modules/users/components/sections/ProfileCompletion.vue +30 -15
  179. package/src/modules/users/controllers/users.controller.js +0 -2
  180. package/src/modules/users/models/user.model.js +6 -5
  181. package/src/modules/users/users.server.js +1 -0
  182. package/src/styles/base/borders.scss +5 -2
  183. package/src/styles/config.scss +3 -4
  184. package/src/modules/applications/applications.client.js +0 -1
  185. package/src/modules/orders/components/blocks/Positions.vue +0 -177
  186. package/src/modules/users/models/client.model.js +0 -60
  187. /package/src/modules/{applications → orders}/controllers/applications.controller.js +0 -0
  188. /package/src/modules/{testimonials → orders}/controllers/testimonials.controller.js +0 -0
  189. /package/src/modules/{applications → orders}/models/application.model.js +0 -0
  190. /package/src/modules/{testimonials → orders}/models/testimonial.model.js +0 -0
  191. /package/src/modules/{applications → orders}/routes/applications.routes.js +0 -0
  192. /package/src/modules/{testimonials → orders}/routes/testimonials.routes.js +0 -0
  193. /package/src/modules/{applications → orders}/store/applications.js +0 -0
  194. /package/src/modules/{testimonials → orders}/store/testimonials.js +0 -0
  195. /package/src/modules/{payments → wallet}/components/pages/Payments.vue +0 -0
  196. /package/src/modules/{payments → wallet}/controllers/payments.controller.js +0 -0
  197. /package/src/modules/{payments → wallet}/controllers/payments.tinkoff.controller.js +0 -0
  198. /package/src/modules/{payments → wallet}/models/payment.model.js +0 -0
  199. /package/src/modules/{payments → wallet}/models/payment.tinkoff.model.js +0 -0
  200. /package/src/modules/{payments → wallet}/routes/payments.routes.js +0 -0
  201. /package/src/modules/{payments → wallet}/routes/payments.tinkoff.routes.js +0 -0
  202. /package/src/modules/{payments → wallet}/store/payments.js +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const C=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const v=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const n=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const N=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../../components/Popup/Popup.vue2.cjs"),V=require("../../../../components/Block/Block.vue.cjs");require("../blocks/EditArray.vue2.cjs");const P=require("../blocks/DepartmentSub.vue.cjs"),k=require("../blocks/DepartmentMemberModify.vue.cjs"),x=require("../blocks/User.vue.cjs"),t=require("../../store/departments.cjs"),p=require("../../store/memberships.cjs"),O={class:"for-transition pd-thin w-100"},M={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},S={key:0,class:"mn-r-auto"},T={key:1,class:"mn-r-auto"},U={class:"flex-nowrap flex pd-thin"},z={class:"cols-2-fit-content"},F={class:"w-100 flex-child-grow-1 flex-child"},R={class:"cols-2 gap-thin"},$={class:"bg-grey pd-medium o-hidden radius-big"},A=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),L=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),j={class:"cols-1 gap-thin"},H=e.createElementVNode("h4",null,"Products",-1),I={class:"bg-grey pd-medium o-hidden radius-big"},G=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),J=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),K={class:"cols-1 gap-thin"},Q=e.createElementVNode("h4",null,"Products",-1),W=e.createElementVNode("h4",null,"Orders",-1),X={key:1,class:"flex-nowrap flex pd-thin"},Y={id:"dash",class:"pd-medium bg-white"},Z={class:"mn-b-regular flex-v-center flex-nowrap flex"},ee=e.createElementVNode("h3",{class:"mn-r-small"},"Подотделы ",-1),te={class:"mn-b-small"},ae={key:0},le={__name:"DepartmentEdit",setup(re){const w=_.useRouter(),l=_.useRoute();async function y(){l.params.department&&await p.actions.read({target:l.params._id}),e.ref(p.state.memberships),await t.actions.read(l.params._id),l.params.department&&await t.actions.readOne(l.params.department)}y();const d=e.ref(!1),i=e.ref(null);function u(r){d.value=!0,typeof r=="number"&&(i.value=r)}function f(){d.value=!1,i.value=null}const m=e.ref(!1),c=e.ref(null);function h(r){m.value=!0,typeof r=="number"&&(c.value=r)}function b(){m.value=!1,c.value=null}async function E(){l.params.department&&await t.actions.update(l.params._id,t.state.department),l.params.department||await t.actions.create(l.params._id,t.state.department)}function D(){w.replace({name:"Department",params:{_id:l.params._id,department:t.state.department._id}})}async function q(){await t.actions.delete(l.params._id,t.state.department)}return(r,s)=>(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("header",M,[e.unref(l).params.department?(e.openBlock(),e.createElementBlock("h1",S,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",T,"Create Department")),e.createElementVNode("section",U,[e.createVNode(N.default,{submit:E,callback:D,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save Department")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(V.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(C.default,{photo:t.state.department.profile.photo,"onUpdate:photo":s[0]||(s[0]=a=>t.state.department.profile.photo=a),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",F,[e.createVNode(v.default,{field:t.state.department.profile.name,"onUpdate:field":s[1]||(s[1]=a=>t.state.department.profile.name=a),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"]),e.createVNode(v.default,{field:t.state.department.profile.description,"onUpdate:field":s[2]||(s[2]=a=>t.state.department.profile.description=a),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(V.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>u()}],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,(a,o)=>(e.openBlock(),e.createBlock(x.default,{class:"bg-grey o-hidden radius-small mn-b-thin",key:o,user:a.user,photo:a.user.profile.photo,name:a.user.profile.name||a.user.phone||a.user.email||a.user._id,position:a.position,onClick:B=>u(o)},null,8,["user","photo","name","position","onClick"]))),128))]),_:1},8,["actions"]),e.createVNode(g.default,{title:"Добавить участника",onClosePopup:f,isPopupOpen:d.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(k.default,{members:t.state.department.members,member:i.value,users:p.state.memberships,onCallback:f},null,8,["members","member","users"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",R,[e.createElementVNode("div",$,[A,L,e.createElementVNode("div",j,[H,e.createVNode(n.default,{label:"Hidden department",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])]),e.createElementVNode("div",I,[G,J,e.createElementVNode("div",K,[Q,e.createVNode(n.default,{label:"See products",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Edit products",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),W,e.createVNode(n.default,{label:"See orders",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Confirm orders",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])])]),e.unref(l).params.department?(e.openBlock(),e.createElementBlock("section",X,[e.createVNode(N.default,{submit:q,callback:r.redirectToDash,class:"bg-grey"},{default:e.withCtx(()=>[e.createTextVNode("Delete Department")]),_:1},8,["callback"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y,[e.createVNode(g.default,{title:"Добавить подотдел",onClosePopup:b,isPopupOpen:m.value},{default:e.withCtx(()=>[e.createVNode(k.default,{departments:t.state.department.subdepartments,department:c.value,maindepartment:t.state.department,alldepartments:t.state.departments,onCallback:b},null,8,["departments","department","maindepartment","alldepartments"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",Z,[ee,e.createElementVNode("div",null,[e.createElementVNode("a",{class:"t-main h5",onClick:s[3]||(s[3]=a=>h())},"+")])]),e.createElementVNode("ul",te,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",ae,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(a,o)=>(e.openBlock(),e.createBlock(P.default,{key:o,class:"bg-grey o-hidden radius-small mn-b-thin",department:a,onClick:B=>h(o)},null,8,["department","onClick"]))),128))])])]))}};exports.default=le;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const C=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue2.cjs");const v=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");const n=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const N=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Popup/Popup.vue.cjs"),V=require("../../../../components/Block/Block.vue.cjs");require("../blocks/EditArray.vue2.cjs");const P=require("../blocks/DepartmentSub.vue.cjs"),k=require("../blocks/DepartmentMemberModify.vue.cjs"),x=require("../blocks/User.vue.cjs"),t=require("../../store/departments.cjs"),p=require("../../store/memberships.cjs"),O={class:"for-transition pd-thin w-100"},M={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},S={key:0,class:"mn-r-auto"},T={key:1,class:"mn-r-auto"},U={class:"flex-nowrap flex pd-thin"},z={class:"cols-2-fit-content"},F={class:"w-100 flex-child-grow-1 flex-child"},R={class:"cols-2 gap-thin"},$={class:"bg-grey pd-medium o-hidden radius-big"},A=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),L=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),j={class:"cols-1 gap-thin"},H=e.createElementVNode("h4",null,"Products",-1),I={class:"bg-grey pd-medium o-hidden radius-big"},G=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),J=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),K={class:"cols-1 gap-thin"},Q=e.createElementVNode("h4",null,"Products",-1),W=e.createElementVNode("h4",null,"Orders",-1),X={key:1,class:"flex-nowrap flex pd-thin"},Y={id:"dash",class:"pd-medium bg-white"},Z={class:"mn-b-regular flex-v-center flex-nowrap flex"},ee=e.createElementVNode("h3",{class:"mn-r-small"},"Подотделы ",-1),te={class:"mn-b-small"},ae={key:0},le={__name:"DepartmentEdit",setup(re){const w=_.useRouter(),l=_.useRoute();async function y(){l.params.department&&await p.actions.read({target:l.params._id}),e.ref(p.state.memberships),await t.actions.read(l.params._id),l.params.department&&await t.actions.readOne(l.params.department)}y();const d=e.ref(!1),i=e.ref(null);function u(r){d.value=!0,typeof r=="number"&&(i.value=r)}function f(){d.value=!1,i.value=null}const m=e.ref(!1),c=e.ref(null);function h(r){m.value=!0,typeof r=="number"&&(c.value=r)}function b(){m.value=!1,c.value=null}async function E(){l.params.department&&await t.actions.update(l.params._id,t.state.department),l.params.department||await t.actions.create(l.params._id,t.state.department)}function D(){w.replace({name:"Department",params:{_id:l.params._id,department:t.state.department._id}})}async function q(){await t.actions.delete(l.params._id,t.state.department)}return(r,s)=>(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("header",M,[e.unref(l).params.department?(e.openBlock(),e.createElementBlock("h1",S,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",T,"Create Department")),e.createElementVNode("section",U,[e.createVNode(N.default,{submit:E,callback:D,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save Department")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(V.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(C.default,{photo:t.state.department.profile.photo,"onUpdate:photo":s[0]||(s[0]=a=>t.state.department.profile.photo=a),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",F,[e.createVNode(v.default,{field:t.state.department.profile.name,"onUpdate:field":s[1]||(s[1]=a=>t.state.department.profile.name=a),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"]),e.createVNode(v.default,{field:t.state.department.profile.description,"onUpdate:field":s[2]||(s[2]=a=>t.state.department.profile.description=a),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(V.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>u()}],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,(a,o)=>(e.openBlock(),e.createBlock(x.default,{class:"bg-grey o-hidden radius-small mn-b-thin",key:o,user:a.user,photo:a.user.profile.photo,name:a.user.profile.name||a.user.phone||a.user.email||a.user._id,position:a.position,onClick:B=>u(o)},null,8,["user","photo","name","position","onClick"]))),128))]),_:1},8,["actions"]),e.createVNode(g.default,{title:"Добавить участника",onClosePopup:f,isPopupOpen:d.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(k.default,{members:t.state.department.members,member:i.value,users:p.state.memberships,onCallback:f},null,8,["members","member","users"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",R,[e.createElementVNode("div",$,[A,L,e.createElementVNode("div",j,[H,e.createVNode(n.default,{label:"Hidden department",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])]),e.createElementVNode("div",I,[G,J,e.createElementVNode("div",K,[Q,e.createVNode(n.default,{label:"See products",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Edit products",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),W,e.createVNode(n.default,{label:"See orders",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Confirm orders",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(n.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])])]),e.unref(l).params.department?(e.openBlock(),e.createElementBlock("section",X,[e.createVNode(N.default,{submit:q,callback:r.redirectToDash,class:"bg-grey"},{default:e.withCtx(()=>[e.createTextVNode("Delete Department")]),_:1},8,["callback"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y,[e.createVNode(g.default,{title:"Добавить подотдел",onClosePopup:b,isPopupOpen:m.value},{default:e.withCtx(()=>[e.createVNode(k.default,{departments:t.state.department.subdepartments,department:c.value,maindepartment:t.state.department,alldepartments:t.state.departments,onCallback:b},null,8,["departments","department","maindepartment","alldepartments"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",Z,[ee,e.createElementVNode("div",null,[e.createElementVNode("a",{class:"t-main h5",onClick:s[3]||(s[3]=a=>h())},"+")])]),e.createElementVNode("ul",te,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",ae,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(a,o)=>(e.openBlock(),e.createBlock(P.default,{key:o,class:"bg-grey o-hidden radius-small mn-b-thin",department:a,onClick:B=>h(o)},null,8,["department","onClick"]))),128))])])]))}};exports.default=le;
@@ -5,15 +5,15 @@ import "vue-i18n";
5
5
  import "../../../globals/localization/vue-i18n.js";
6
6
  import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
7
7
  import L from "../../../../components/UploadImage/UploadImage.vue.js";
8
- import "../../../../components/Tab/Tab.vue.js";
9
- import $ from "../../../../components/Field/Field.vue2.js";
10
- import "../../../../components/Select/Select.vue.js";
8
+ import "../../../../components/Tab/Tab.vue2.js";
9
+ import $ from "../../../../components/Field/Field.vue.js";
10
+ import "../../../../components/Select/Select.vue2.js";
11
11
  import m from "../../../../components/Checkbox/Checkbox.vue.js";
12
12
  import "../../../../components/Address/Address.vue.js";
13
13
  import "../../../../components/Loader/Loader.vue.js";
14
14
  import "../../../../components/LocationMarker/LocationMarker.vue.js";
15
- import O from "../../../../components/Button/Button.vue2.js";
16
- import S from "../../../../components/Popup/Popup.vue2.js";
15
+ import O from "../../../../components/Button/Button.vue.js";
16
+ import S from "../../../../components/Popup/Popup.vue.js";
17
17
  import E from "../../../../components/Block/Block.vue.js";
18
18
  import "../blocks/EditArray.vue2.js";
19
19
  import j from "../blocks/DepartmentSub.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("../../../../components/Loader/Loader.vue.cjs");require("vue-i18n");require("../../../../components/Field/Field.vue.cjs");const _=require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Tooltip/Tooltip.vue.cjs");const b=require("../sections/MembersAdd.vue.cjs");require("../../../mobile/components/Menu/Menu.vue.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");const v=require("../blocks/User.vue.cjs"),g=require("../../../auth/store/auth.cjs"),a=require("../../store/invites.cjs"),d=require("../../store/memberships.cjs"),h=require("../../store/organizations.cjs"),f=require("../../store/departments.cjs"),k={class:"pd-thin"},q=e.createElementVNode("section",{class:"mn-b-medium radius-medium pd-semi bg-grey"},[e.createElementVNode("h2",{class:"mn-b-regular"},"Members"),e.createElementVNode("p",{class:"t-transp p-big"},"Add new memberships to the group and configure access rights.")],-1),E={class:"mn-b-big radius-medium bg-white"},y={key:0,class:"cols-1 gap-thin"},B={key:1},N={class:"br-grey br-1px br-solid radius-small mn-b-thin flex-nowrap flex-v-center flex pd-medium"},V={class:"w-100 mn-r-small"},w={class:"t-transp"},x={class:"mn-l-medium flex-v-center flex"},M=["onClick"],C={__name:"Members",setup(S){const l=c.useRoute();c.useRouter();const o=e.ref(null),i=e.ref("members");e.onMounted(async()=>{o.value=(await h.actions.read({_id:l.params._id,user:g.state.user._id}))[0],await d.actions.read({target:l.params._id}),await a.actions.read(o.value._id)}),e.computed(()=>{const s=f.state.departments,n=s.flatMap(t=>t.subdepartments.map(r=>r._id));return s.filter(t=>!n.includes(t._id))});async function u(s){await a.actions.create(o.value._id,s)}async function m(s,n){a.state.invites.splice(s,1),await a.actions.delete(n._id)}return(s,n)=>(e.openBlock(),e.createBlock(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createElementVNode("div",k,[q,e.createVNode(b.default,{organization:o.value,onSendInvite:u},null,8,["organization"]),e.createVNode(_.default,{selected:i.value,"onUpdate:selected":n[0]||(n[0]=t=>i.value=t),class:"mn-b-medium bg-grey radius-small",tabs:[{name:"Members",value:"members"},{name:"Invites",value:"invites"}]},null,8,["selected"]),e.createElementVNode("section",E,[i.value==="members"?(e.openBlock(),e.createElementBlock("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.state.memberships,(t,r)=>(e.openBlock(),e.createBlock(v.default,{key:r,user:t,onClick:p=>s.$router.push(`/app/profile/${t._id}`),class:"bg-grey radius-small flex-nowrap flex pd-medium"},null,8,["user","onClick"]))),128))])):e.createCommentVNode("",!0),i.value==="invites"?(e.openBlock(),e.createElementBlock("div",B,[e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.state.invites,(t,r)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("span",V,e.toDisplayString(t.invitedEmail)+" "+e.toDisplayString(t.invitedPhone),1),e.createElementVNode("span",w,e.toDisplayString(t.status),1),e.createElementVNode("div",x,[e.createElementVNode("button",{onClick:p=>m(r,t),class:"button-small button"},"×",8,M)])]))),256))])):e.createCommentVNode("",!0)])])]),_:1}))}};exports.default=C;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../components/Loader/Loader.vue.cjs");require("vue-i18n");require("../../../../components/Field/Field.vue2.cjs");const _=require("../../../../components/Tab/Tab.vue.cjs");require("../../../../components/Tooltip/Tooltip.vue.cjs");const b=require("../sections/MembersAdd.vue.cjs");require("../../../mobile/components/Menu/Menu.vue.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");const v=require("../blocks/User.vue.cjs"),g=require("../../../auth/store/auth.cjs"),a=require("../../store/invites.cjs"),d=require("../../store/memberships.cjs"),h=require("../../store/organizations.cjs"),f=require("../../store/departments.cjs"),k={class:"pd-thin"},q=e.createElementVNode("section",{class:"mn-b-medium radius-medium pd-semi bg-grey"},[e.createElementVNode("h2",{class:"mn-b-regular"},"Members"),e.createElementVNode("p",{class:"t-transp p-big"},"Add new memberships to the group and configure access rights.")],-1),E={class:"mn-b-big radius-medium bg-white"},y={key:0,class:"cols-1 gap-thin"},B={key:1},N={class:"br-grey br-1px br-solid radius-small mn-b-thin flex-nowrap flex-v-center flex pd-medium"},V={class:"w-100 mn-r-small"},w={class:"t-transp"},x={class:"mn-l-medium flex-v-center flex"},M=["onClick"],C={__name:"Members",setup(S){const l=c.useRoute();c.useRouter();const o=e.ref(null),i=e.ref("members");e.onMounted(async()=>{o.value=(await h.actions.read({_id:l.params._id,user:g.state.user._id}))[0],await d.actions.read({target:l.params._id}),await a.actions.read(o.value._id)}),e.computed(()=>{const s=f.state.departments,n=s.flatMap(t=>t.subdepartments.map(r=>r._id));return s.filter(t=>!n.includes(t._id))});async function u(s){await a.actions.create(o.value._id,s)}async function m(s,n){a.state.invites.splice(s,1),await a.actions.delete(n._id)}return(s,n)=>(e.openBlock(),e.createBlock(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createElementVNode("div",k,[q,e.createVNode(b.default,{organization:o.value,onSendInvite:u},null,8,["organization"]),e.createVNode(_.default,{selected:i.value,"onUpdate:selected":n[0]||(n[0]=t=>i.value=t),class:"mn-b-medium bg-grey radius-small",tabs:[{name:"Members",value:"members"},{name:"Invites",value:"invites"}]},null,8,["selected"]),e.createElementVNode("section",E,[i.value==="members"?(e.openBlock(),e.createElementBlock("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.state.memberships,(t,r)=>(e.openBlock(),e.createBlock(v.default,{key:r,user:t,onClick:p=>s.$router.push(`/app/profile/${t._id}`),class:"bg-grey radius-small flex-nowrap flex pd-medium"},null,8,["user","onClick"]))),128))])):e.createCommentVNode("",!0),i.value==="invites"?(e.openBlock(),e.createElementBlock("div",B,[e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.state.invites,(t,r)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("span",V,e.toDisplayString(t.invitedEmail)+" "+e.toDisplayString(t.invitedPhone),1),e.createElementVNode("span",w,e.toDisplayString(t.status),1),e.createElementVNode("div",x,[e.createElementVNode("button",{onClick:p=>m(r,t),class:"button-small button"},"×",8,M)])]))),256))])):e.createCommentVNode("",!0)])])]),_:1}))}};exports.default=C;
@@ -2,8 +2,8 @@ import { ref as p, onMounted as $, computed as k, openBlock as a, createBlock as
2
2
  import { useRoute as M, useRouter as I } from "vue-router";
3
3
  import "../../../../components/Loader/Loader.vue.js";
4
4
  import "vue-i18n";
5
- import "../../../../components/Field/Field.vue.js";
6
- import S from "../../../../components/Tab/Tab.vue2.js";
5
+ import "../../../../components/Field/Field.vue2.js";
6
+ import S from "../../../../components/Tab/Tab.vue.js";
7
7
  import "../../../../components/Tooltip/Tooltip.vue.js";
8
8
  import z from "../sections/MembersAdd.vue.js";
9
9
  import "../../../mobile/components/Menu/Menu.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const k=require("../../../../components/Tab/Tab.vue2.cjs"),p=require("../../../../components/Block/Block.vue.cjs"),f=require("../../../../components/Feed/Feed.vue.cjs");require("../../../mobile/components/Menu/Menu.vue.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");require("../blocks/DepartmentSub.vue2.cjs");require("../blocks/User.vue2.cjs");const h=require("../blocks/CardDepartment.vue.cjs"),v=require("../../../events/components/sections/Feed.vue.cjs"),g=require("../../../community/components/sections/Feed.vue.cjs"),q=require("../../../spots/components/blocks/CardSpot.vue.cjs"),w=require("../sections/DetailsTab.vue.cjs"),C=require("../../../products/components/pages/Products.vue.cjs"),s=require("../../../auth/store/auth.cjs"),o=require("../../store/organizations.cjs"),y=require("../../store/memberships.cjs"),B=require("../../store/departments.cjs"),N=require("../../../spots/store/spots.cjs");require("./Organization.vue2.cjs");const V={key:0,class:"pd-thin for-transition w-100"},x={class:"pos-relative"},z={key:0},T={__name:"Organization",setup($){const _=m.useRouter(),t=m.useRoute();let b=t.query.tab?t.query.tab:"products";const c=e.ref(null);e.onMounted(async()=>{c.value=await o.actions.read({_id:t.params._id,user:s.state.user._id}),await y.actions.read(t.params._id)});const r=e.ref(b);return t.query.tab=r.value,e.watch(r,i=>{_.replace({query:null})}),(i,n)=>{const u=e.resolveComponent("router-link");return c.value?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(w.default,{organization:o.state.current,user:s.state.user,class:"mn-b-semi"},null,8,["organization","user"]),e.createVNode(p.default,{title:`${o.state.current.numberOfMembers} members`,actions:[{label:">",function:()=>i.$router.push(`/organizations/${e.unref(t).params._id}/departments/create`)}],class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(f.default,{states:{empty:{title:"No Departments Found",description:"Currently, there are no departments available."}},store:{read:a=>B.actions.read(a),state:null},options:{organization:e.unref(t).params._id,user:s.state.user._id,hidden:!1}},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,d)=>(e.openBlock(),e.createBlock(h.default,{key:d,department:l,organization:e.unref(t).params._id,class:"radius-big bg-white pos-relative mn-b-thin"},null,8,["department","organization"]))),128))]),_:1},8,["states","store","options"])]),_:1},8,["title","actions"]),e.createVNode(k.default,{selected:r.value,"onUpdate:selected":n[0]||(n[0]=a=>r.value=a),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createElementVNode("div",x,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="community"?(e.openBlock(),e.createBlock(g.default,{key:0,user:s.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="events"?(e.openBlock(),e.createBlock(v.default,{key:0,user:s.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner","sortParam"])):e.createCommentVNode("",!0)]),_:1}),r.value==="products"&&s.state.user._id===o.state.current.owner?(e.openBlock(),e.createBlock(p.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="products"?(e.openBlock(),e.createBlock(C.default,{key:0,organization:o.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="spots"?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(f.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:a=>N.actions.read(e.unref(t).params._id),state:o.state},options:{user:s.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,d)=>(e.openBlock(),e.createBlock(q.default,{key:d,spot:l,organization:o.state.current,class:"radius-big bg-grey mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["states","store","options"]),s.state.user._id===o.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=a=>i.$router.push(`/spots/${o.state.current._id}/spots/create`)),class:"mn-b-thin button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const k=require("../../../../components/Tab/Tab.vue.cjs"),p=require("../../../../components/Block/Block.vue.cjs"),f=require("../../../../components/Feed/Feed.vue.cjs");require("../../../mobile/components/Menu/Menu.vue.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");require("../blocks/DepartmentSub.vue2.cjs");require("../blocks/User.vue2.cjs");const h=require("../blocks/CardDepartment.vue.cjs"),v=require("../../../events/components/sections/Feed.vue.cjs"),g=require("../../../community/components/sections/Feed.vue.cjs"),q=require("../../../spots/components/blocks/CardSpot.vue.cjs"),w=require("../sections/DetailsTab.vue.cjs"),C=require("../../../products/components/pages/Products.vue.cjs"),s=require("../../../auth/store/auth.cjs"),o=require("../../store/organizations.cjs"),y=require("../../store/memberships.cjs"),B=require("../../store/departments.cjs"),N=require("../../../spots/store/spots.cjs");require("./Organization.vue2.cjs");const V={key:0,class:"pd-thin for-transition w-100"},x={class:"pos-relative"},z={key:0},T={__name:"Organization",setup($){const _=m.useRouter(),t=m.useRoute();let b=t.query.tab?t.query.tab:"products";const c=e.ref(null);e.onMounted(async()=>{c.value=await o.actions.read({_id:t.params._id,user:s.state.user._id}),await y.actions.read(t.params._id)});const r=e.ref(b);return t.query.tab=r.value,e.watch(r,i=>{_.replace({query:null})}),(i,n)=>{const u=e.resolveComponent("router-link");return c.value?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(w.default,{organization:o.state.current,user:s.state.user,class:"mn-b-semi"},null,8,["organization","user"]),e.createVNode(p.default,{title:`${o.state.current.numberOfMembers} members`,actions:[{label:">",function:()=>i.$router.push(`/organizations/${e.unref(t).params._id}/departments/create`)}],class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(f.default,{states:{empty:{title:"No Departments Found",description:"Currently, there are no departments available."}},store:{read:a=>B.actions.read(a),state:null},options:{organization:e.unref(t).params._id,user:s.state.user._id,hidden:!1}},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,d)=>(e.openBlock(),e.createBlock(h.default,{key:d,department:l,organization:e.unref(t).params._id,class:"radius-big bg-white pos-relative mn-b-thin"},null,8,["department","organization"]))),128))]),_:1},8,["states","store","options"])]),_:1},8,["title","actions"]),e.createVNode(k.default,{selected:r.value,"onUpdate:selected":n[0]||(n[0]=a=>r.value=a),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createElementVNode("div",x,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="community"?(e.openBlock(),e.createBlock(g.default,{key:0,user:s.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="events"?(e.openBlock(),e.createBlock(v.default,{key:0,user:s.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner","sortParam"])):e.createCommentVNode("",!0)]),_:1}),r.value==="products"&&s.state.user._id===o.state.current.owner?(e.openBlock(),e.createBlock(p.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="products"?(e.openBlock(),e.createBlock(C.default,{key:0,organization:o.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="spots"?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(f.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:a=>N.actions.read(e.unref(t).params._id),state:o.state},options:{user:s.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(l,d)=>(e.openBlock(),e.createBlock(q.default,{key:d,spot:l,organization:o.state.current,class:"radius-big bg-grey mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["states","store","options"]),s.state.user._id===o.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=a=>i.$router.push(`/spots/${o.state.current._id}/spots/create`)),class:"mn-b-thin button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=T;
@@ -3,7 +3,7 @@ import { useRouter as q, useRoute as M } from "vue-router";
3
3
  import "vue-i18n";
4
4
  import "../../../globals/localization/vue-i18n.js";
5
5
  import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
6
- import P from "../../../../components/Tab/Tab.vue2.js";
6
+ import P from "../../../../components/Tab/Tab.vue.js";
7
7
  import $ from "../../../../components/Block/Block.vue.js";
8
8
  import z from "../../../../components/Feed/Feed.vue.js";
9
9
  import "../../../mobile/components/Menu/Menu.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),n=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const p=require("../../../../components/FieldTags/BlockTags.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const f=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../../components/UploadImage/UploadImage.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Popup/Popup.vue.cjs");const h=require("../../../auth/store/auth.cjs"),e=require("../../store/organizations.cjs");require("../../store/memberships.cjs");const y={class:"for-transition pd-thin"},V=t.createElementVNode("h3",{class:"mn-b-small"},"Type of group",-1),N=t.createElementVNode("p",{class:"mn-b-thin"},"Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.",-1),_=t.createElementVNode("h3",{class:"mn-b-small"},"Profile",-1),q={class:"mn-b-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},v=t.createElementVNode("h4",null,"Upload photo",-1),w=t.createElementVNode("h3",{class:"mn-b-small"},"Socials",-1),x=t.createElementVNode("p",{class:"mn-b-thin"},"Please provide only the username for social media profiles, without full links.",-1),U={__name:"OrganizationEdit",async setup(T){let o,i;const s=n.useRoute(),d=n.useRouter();e.actions.reset(),s.params._id&&([o,i]=t.withAsyncContext(()=>e.actions.read({_id:s.params._id})),await o,i());const u=t.computed(()=>e.state.current);async function c(){s.params._id?await e.actions.update(s.params._id,u.value):await e.actions.create(e.state.current,h.state.user._id)}function m(){d.replace({name:"Organization",params:{_id:e.state.current._id}})}return(k,a)=>(t.openBlock(),t.createElementBlock("div",y,[V,N,t.createVNode(f.default,{modelValue:e.state.current.types,"onUpdate:modelValue":a[0]||(a[0]=r=>e.state.current.types=r),options:["public","exclusive","hidden"],multiple:!1,taggable:!1,placeholder:"Type to search or add type of organization",class:"mn-b-semi bg-grey pd-medium radius-small"},null,8,["modelValue"]),_,t.createElementVNode("div",q,[t.createVNode(g.default,{photo:e.state.current.profile.photo,"onUpdate:photo":a[1]||(a[1]=r=>e.state.current.profile.photo=r),uploadPath:"organizations/"+e.state.current._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo","uploadPath"]),v]),t.createVNode(l.default,{field:e.state.current.profile.name,"onUpdate:field":a[2]||(a[2]=r=>e.state.current.profile.name=r),placeholder:"Name of organization",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.profile.description,"onUpdate:field":a[3]||(a[3]=r=>e.state.current.profile.description=r),placeholder:"Brief description of your group",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(p.default,{onTagsChanged:a[4]||(a[4]=r=>e.state.current.profile.tags=r),tags:e.state.current.profile.tags},null,8,["tags"]),w,x,t.createVNode(l.default,{field:e.state.current.socials.instagram,"onUpdate:field":a[5]||(a[5]=r=>e.state.current.socials.instagram=r),label:"Instagram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.twitter,"onUpdate:field":a[6]||(a[6]=r=>e.state.current.socials.twitter=r),label:"Twitter",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.facebook,"onUpdate:field":a[7]||(a[7]=r=>e.state.current.socials.facebook=r),label:"Facebook",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.telegram,"onUpdate:field":a[8]||(a[8]=r=>e.state.current.socials.telegram=r),label:"Telegram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.youtube,"onUpdate:field":a[9]||(a[9]=r=>e.state.current.socials.youtube=r),label:"Telegram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(b.default,{submit:c,callback:m,class:"bg-main w-100 mn-b-thin"},{default:t.withCtx(()=>[t.createTextVNode("Save")]),_:1})]))}};exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),n=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const p=require("../../../../components/FieldTags/BlockTags.vue.cjs");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");const f=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../../components/UploadImage/UploadImage.vue.cjs"),b=require("../../../../components/Button/Button.vue.cjs");require("../../../../components/Popup/Popup.vue2.cjs");const h=require("../../../auth/store/auth.cjs"),e=require("../../store/organizations.cjs");require("../../store/memberships.cjs");const y={class:"for-transition pd-thin"},V=t.createElementVNode("h3",{class:"mn-b-small"},"Type of group",-1),N=t.createElementVNode("p",{class:"mn-b-thin"},"Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.",-1),_=t.createElementVNode("h3",{class:"mn-b-small"},"Profile",-1),q={class:"mn-b-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},v=t.createElementVNode("h4",null,"Upload photo",-1),w=t.createElementVNode("h3",{class:"mn-b-small"},"Socials",-1),x=t.createElementVNode("p",{class:"mn-b-thin"},"Please provide only the username for social media profiles, without full links.",-1),U={__name:"OrganizationEdit",async setup(T){let o,i;const s=n.useRoute(),d=n.useRouter();e.actions.reset(),s.params._id&&([o,i]=t.withAsyncContext(()=>e.actions.read({_id:s.params._id})),await o,i());const u=t.computed(()=>e.state.current);async function c(){s.params._id?await e.actions.update(s.params._id,u.value):await e.actions.create(e.state.current,h.state.user._id)}function m(){d.replace({name:"Organization",params:{_id:e.state.current._id}})}return(k,a)=>(t.openBlock(),t.createElementBlock("div",y,[V,N,t.createVNode(f.default,{modelValue:e.state.current.types,"onUpdate:modelValue":a[0]||(a[0]=r=>e.state.current.types=r),options:["public","exclusive","hidden"],multiple:!1,taggable:!1,placeholder:"Type to search or add type of organization",class:"mn-b-semi bg-grey pd-medium radius-small"},null,8,["modelValue"]),_,t.createElementVNode("div",q,[t.createVNode(g.default,{photo:e.state.current.profile.photo,"onUpdate:photo":a[1]||(a[1]=r=>e.state.current.profile.photo=r),uploadPath:"organizations/"+e.state.current._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo","uploadPath"]),v]),t.createVNode(l.default,{field:e.state.current.profile.name,"onUpdate:field":a[2]||(a[2]=r=>e.state.current.profile.name=r),placeholder:"Name of organization",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.profile.description,"onUpdate:field":a[3]||(a[3]=r=>e.state.current.profile.description=r),placeholder:"Brief description of your group",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(p.default,{onTagsChanged:a[4]||(a[4]=r=>e.state.current.profile.tags=r),tags:e.state.current.profile.tags},null,8,["tags"]),w,x,t.createVNode(l.default,{field:e.state.current.socials.instagram,"onUpdate:field":a[5]||(a[5]=r=>e.state.current.socials.instagram=r),label:"Instagram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.twitter,"onUpdate:field":a[6]||(a[6]=r=>e.state.current.socials.twitter=r),label:"Twitter",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.facebook,"onUpdate:field":a[7]||(a[7]=r=>e.state.current.socials.facebook=r),label:"Facebook",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.telegram,"onUpdate:field":a[8]||(a[8]=r=>e.state.current.socials.telegram=r),label:"Telegram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(l.default,{field:e.state.current.socials.youtube,"onUpdate:field":a[9]||(a[9]=r=>e.state.current.socials.youtube=r),label:"Telegram",placeholder:"",class:"mn-b-thin bg-grey pd-medium radius-small"},null,8,["field"]),t.createVNode(b.default,{submit:c,callback:m,class:"bg-main w-100 mn-b-thin"},{default:t.withCtx(()=>[t.createTextVNode("Save")]),_:1})]))}};exports.default=U;
@@ -4,13 +4,13 @@ import "vue-i18n";
4
4
  import "../../../globals/localization/vue-i18n.js";
5
5
  import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
6
6
  import v from "../../../../components/FieldTags/BlockTags.vue.js";
7
- import "../../../../components/Tab/Tab.vue.js";
8
- import i from "../../../../components/Field/Field.vue2.js";
9
- import "../../../../components/Select/Select.vue.js";
7
+ import "../../../../components/Tab/Tab.vue2.js";
8
+ import i from "../../../../components/Field/Field.vue.js";
9
+ import "../../../../components/Select/Select.vue2.js";
10
10
  import U from "../../../../components/SelectMulti/SelectMulti.vue.js";
11
11
  import k from "../../../../components/UploadImage/UploadImage.vue.js";
12
- import T from "../../../../components/Button/Button.vue2.js";
13
- import "../../../../components/Popup/Popup.vue.js";
12
+ import T from "../../../../components/Button/Button.vue.js";
13
+ import "../../../../components/Popup/Popup.vue2.js";
14
14
  import { state as z } from "../../../auth/store/auth.js";
15
15
  import { actions as s, state as e } from "../../store/organizations.js";
16
16
  import "../../store/memberships.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("../../../../components/Tab/Tab.vue2.cjs"),u=require("../sections/Feed.vue.cjs"),n=require("../../../auth/store/auth.cjs"),m={class:"pd-thin"},b={class:"mn-b-medium flex-v-center flex-nowrap flex"},f=e.createElementVNode("h2",{class:"mn-r-medium"},"Groups",-1),_={__name:"Organizations",setup(p){const t=l.useRoute(),d=l.useRouter();let i=t.query.tab?t.query.tab:"owner";const r=e.ref(i);return t.query.tab=r.value,e.watch(r,o=>{d.replace({query:{...t.query,tab:o}})}),(o,a)=>(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",b,[f,e.createElementVNode("button",{onClick:a[0]||(a[0]=s=>o.$router.push({name:"Create Organization"})),class:"bg-second radius-100 i-big hover-scale-1 cursor-pointer t-whitebg-second"}," + ")]),e.createVNode(c.default,{selected:r.value,"onUpdate:selected":a[1]||(a[1]=s=>r.value=s),tabs:[{name:"Owner",value:"owner"},{name:"Member",value:"member"},{name:"Follower",value:"follower"}],class:"mn-b-medium o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="owner"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="member"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,member:e.unref(t).params._id},null,8,["user","member"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="follower"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,subscriber:e.unref(t).params._id},null,8,["user","subscriber"])):e.createCommentVNode("",!0)]),_:1})]))}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("../../../../components/Tab/Tab.vue.cjs"),u=require("../sections/Feed.vue.cjs"),n=require("../../../auth/store/auth.cjs"),m={class:"pd-thin"},b={class:"mn-b-medium flex-v-center flex-nowrap flex"},f=e.createElementVNode("h2",{class:"mn-r-medium"},"Groups",-1),_={__name:"Organizations",setup(p){const t=l.useRoute(),d=l.useRouter();let i=t.query.tab?t.query.tab:"owner";const r=e.ref(i);return t.query.tab=r.value,e.watch(r,o=>{d.replace({query:{...t.query,tab:o}})}),(o,a)=>(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",b,[f,e.createElementVNode("button",{onClick:a[0]||(a[0]=s=>o.$router.push({name:"Create Organization"})),class:"bg-second radius-100 i-big hover-scale-1 cursor-pointer t-whitebg-second"}," + ")]),e.createVNode(c.default,{selected:r.value,"onUpdate:selected":a[1]||(a[1]=s=>r.value=s),tabs:[{name:"Owner",value:"owner"},{name:"Member",value:"member"},{name:"Follower",value:"follower"}],class:"mn-b-medium o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="owner"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="member"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,member:e.unref(t).params._id},null,8,["user","member"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="follower"?(e.openBlock(),e.createBlock(u.default,{key:0,user:n.state.user._id,subscriber:e.unref(t).params._id},null,8,["user","subscriber"])):e.createCommentVNode("",!0)]),_:1})]))}};exports.default=_;
@@ -1,6 +1,6 @@
1
1
  import { ref as v, watch as w, openBlock as a, createElementBlock as h, createElementVNode as b, createVNode as s, Transition as n, withCtx as u, createBlock as l, unref as m, createCommentVNode as i } from "vue";
2
2
  import { useRoute as g, useRouter as y } from "vue-router";
3
- import k from "../../../../components/Tab/Tab.vue2.js";
3
+ import k from "../../../../components/Tab/Tab.vue.js";
4
4
  import d from "../sections/Feed.vue.js";
5
5
  import { state as c } from "../../../auth/store/auth.js";
6
6
  const q = { class: "pd-thin" }, x = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, C = /* @__PURE__ */ b("h2", { class: "mn-r-medium" }, "Groups", -1), E = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),m=require("../../../../components/Field/Field.vue2.cjs");require("vue-i18n");const _=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("./Documents.vue2.cjs");const f=o=>(e.pushScopeId("data-v-f93fcad7"),o=o(),e.popScopeId(),o),v={class:"documents"},h=f(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Список документов",-1)),k={class:"mn-b-big cols-4"},b=["onClick"],y={class:"mn-b-small"},E={class:"t-semi t-transp radius-small"},B={__name:"Documents",setup(o){r.useRouter(),r.useRoute();let l=[{name:"Паспорт",status:"Не добавлен",inputs:[{type:"text",name:"Номер и серия"},{type:"text",name:"Место выдачи"},{type:"text",name:"Дата выдачи"}]},{name:"ИНН",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"СНИЛС",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"Военный билет",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]}];const s=e.ref(!1),a=e.ref(null),p=u=>{a.value=u,s.value=!0},c=()=>{s.value=!1},i=()=>{c()};return e.watchEffect(()=>{}),(u,x)=>{const d=e.resolveComponent("Popup");return e.openBlock(),e.createElementBlock("div",v,[h,e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,onClick:P=>p(n),class:"h-100 pd-medium bg-white radius-small"},[e.createElementVNode("h3",y,e.toDisplayString(t.name),1),e.createElementVNode("p",E,e.toDisplayString(t.status),1)],8,b))),128))]),e.createVNode(d,{title:"Добавить документ",onClosePopup:c,isPopupOpen:s.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l)[a.value].inputs,t=>(e.openBlock(),e.createElementBlock("div",{key:t.name},[e.createVNode(m.default,{field:t.value,"onUpdate:field":n=>t.value=n,label:t.name,_id:t.name,placeholder:t.name,class:"w-100"},null,8,["field","onUpdate:field","label","_id","placeholder"])]))),128)),e.createElementVNode("button",{onClick:i,class:"w-100 mn-b-small button"},"Отправить на верификацию")]),_:1},8,["isPopupOpen"])])}}},g=_.default(B,[["__scopeId","data-v-f93fcad7"]]);exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),m=require("../../../../components/Field/Field.vue.cjs");require("vue-i18n");const _=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/Button/Button.vue2.cjs");require("./Documents.vue2.cjs");const f=o=>(e.pushScopeId("data-v-f93fcad7"),o=o(),e.popScopeId(),o),v={class:"documents"},h=f(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Список документов",-1)),k={class:"mn-b-big cols-4"},b=["onClick"],y={class:"mn-b-small"},E={class:"t-semi t-transp radius-small"},B={__name:"Documents",setup(o){r.useRouter(),r.useRoute();let l=[{name:"Паспорт",status:"Не добавлен",inputs:[{type:"text",name:"Номер и серия"},{type:"text",name:"Место выдачи"},{type:"text",name:"Дата выдачи"}]},{name:"ИНН",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"СНИЛС",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"Военный билет",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]}];const s=e.ref(!1),a=e.ref(null),p=u=>{a.value=u,s.value=!0},c=()=>{s.value=!1},i=()=>{c()};return e.watchEffect(()=>{}),(u,x)=>{const d=e.resolveComponent("Popup");return e.openBlock(),e.createElementBlock("div",v,[h,e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,onClick:P=>p(n),class:"h-100 pd-medium bg-white radius-small"},[e.createElementVNode("h3",y,e.toDisplayString(t.name),1),e.createElementVNode("p",E,e.toDisplayString(t.status),1)],8,b))),128))]),e.createVNode(d,{title:"Добавить документ",onClosePopup:c,isPopupOpen:s.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l)[a.value].inputs,t=>(e.openBlock(),e.createElementBlock("div",{key:t.name},[e.createVNode(m.default,{field:t.value,"onUpdate:field":n=>t.value=n,label:t.name,_id:t.name,placeholder:t.name,class:"w-100"},null,8,["field","onUpdate:field","label","_id","placeholder"])]))),128)),e.createElementVNode("button",{onClick:i,class:"w-100 mn-b-small button"},"Отправить на верификацию")]),_:1},8,["isPopupOpen"])])}}},g=_.default(B,[["__scopeId","data-v-f93fcad7"]]);exports.default=g;
@@ -1,10 +1,10 @@
1
1
  import { ref as r, watchEffect as y, resolveComponent as P, openBlock as t, createElementBlock as s, createElementVNode as o, Fragment as i, renderList as d, unref as _, toDisplayString as f, createVNode as h, withCtx as k, pushScopeId as w, popScopeId as C } from "vue";
2
2
  import { useRouter as I, useRoute as g } from "vue-router";
3
- import D from "../../../../components/Field/Field.vue2.js";
3
+ import D from "../../../../components/Field/Field.vue.js";
4
4
  import "vue-i18n";
5
5
  import S from "../../../../../../_virtual/_plugin-vue_export-helper.js";
6
- import "../../../../components/Popup/Popup.vue.js";
7
- import "../../../../components/Button/Button.vue.js";
6
+ import "../../../../components/Popup/Popup.vue2.js";
7
+ import "../../../../components/Button/Button.vue2.js";
8
8
  import "./Documents.vue2.js";
9
9
  const E = (a) => (w("data-v-f93fcad7"), a = a(), C(), a), B = { class: "documents" }, F = /* @__PURE__ */ E(() => /* @__PURE__ */ o("h3", { class: "mn-b-small" }, "Список документов", -1)), N = { class: "mn-b-big cols-4" }, O = ["onClick"], R = { class: "mn-b-small" }, U = { class: "t-semi t-transp radius-small" }, V = {
10
10
  __name: "Documents",
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../../components/Field/Field.vue2.cjs"),b=require("../../../../components/Select/Select.vue2.cjs"),v=require("../../../../components/Button/Button.vue2.cjs");require("../../../middlewares/client/inputs.validation.cjs");const s=require("../../store/invites.cjs"),f={class:"mn-b-medium radius-medium pd-semi bg-grey"},h=e.createElementVNode("h3",{class:"mn-b-medium"},"Add members",-1),g=e.createElementVNode("p",{class:"mn-b-small t-transp p-medium"},"Укажите email или телефон, чтобы отправить ссылку с приглашением:",-1),k={key:0,class:"mn-r-medium flex-v-center flex"},E=["onClick"],V=e.createElementVNode("p",{class:"t-blue mn-r-small"},"+ Добавить приглашение",-1),N=[V],w=e.createElementVNode("span",null,"Invite to organization",-1),B={__name:"MembersAdd",props:{organization:Object},emits:["send-invite"],setup(c,{emit:q}){const i=c,r=e.ref(null),t=e.ref([{contact:"",role:""}]);function d(){t.value.push({contact:"",role:""})}function m(l){t.value.splice(l,1)}async function u(l){await s.actions.create(i.organization._id,t.value)}function p(){}return(l,x)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("section",f,[h,g,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"br-1px br-solid br-grey flex gap-thin radius-small mn-b-thin"},[e.createVNode(_.default,{field:n.contact,"onUpdate:field":o=>n.contact=o,placeholder:"Enter email or phone",class:"pd-small radius-small w-100 bg-white",validation:r.value},null,8,["field","onUpdate:field","validation"]),e.createVNode(b.default,{select:n.role,"onUpdate:select":o=>n.role=o,label:"Role",options:["owner","manager","member"],placeholder:"Select",class:"pos-relative w-100 bg-white radius-small pd-small"},null,8,["select","onUpdate:select"]),a>0?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("button",{onClick:o=>m(a),class:"button-small button"},"×",8,E)])):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("div",{onClick:d,class:"mn-b-small flex-v-center flex-nowrap flex"},N),e.createVNode(v.default,{submit:l.a=()=>u(s.state.invites),callback:p,class:"w-100 bg-main"},{default:e.withCtx(()=>[w]),_:1},8,["submit"])])]))}};exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../../components/Field/Field.vue.cjs"),b=require("../../../../components/Select/Select.vue.cjs"),v=require("../../../../components/Button/Button.vue.cjs");require("../../../middlewares/client/inputs.validation.cjs");const s=require("../../store/invites.cjs"),f={class:"mn-b-medium radius-medium pd-semi bg-grey"},h=e.createElementVNode("h3",{class:"mn-b-medium"},"Add members",-1),g=e.createElementVNode("p",{class:"mn-b-small t-transp p-medium"},"Укажите email или телефон, чтобы отправить ссылку с приглашением:",-1),k={key:0,class:"mn-r-medium flex-v-center flex"},E=["onClick"],V=e.createElementVNode("p",{class:"t-blue mn-r-small"},"+ Добавить приглашение",-1),N=[V],w=e.createElementVNode("span",null,"Invite to organization",-1),B={__name:"MembersAdd",props:{organization:Object},emits:["send-invite"],setup(c,{emit:q}){const i=c,r=e.ref(null),t=e.ref([{contact:"",role:""}]);function d(){t.value.push({contact:"",role:""})}function m(l){t.value.splice(l,1)}async function u(l){await s.actions.create(i.organization._id,t.value)}function p(){}return(l,x)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("section",f,[h,g,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(n,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"br-1px br-solid br-grey flex gap-thin radius-small mn-b-thin"},[e.createVNode(_.default,{field:n.contact,"onUpdate:field":o=>n.contact=o,placeholder:"Enter email or phone",class:"pd-small radius-small w-100 bg-white",validation:r.value},null,8,["field","onUpdate:field","validation"]),e.createVNode(b.default,{select:n.role,"onUpdate:select":o=>n.role=o,label:"Role",options:["owner","manager","member"],placeholder:"Select",class:"pos-relative w-100 bg-white radius-small pd-small"},null,8,["select","onUpdate:select"]),a>0?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("button",{onClick:o=>m(a),class:"button-small button"},"×",8,E)])):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("div",{onClick:d,class:"mn-b-small flex-v-center flex-nowrap flex"},N),e.createVNode(v.default,{submit:l.a=()=>u(s.state.invites),callback:p,class:"w-100 bg-main"},{default:e.withCtx(()=>[w]),_:1},8,["submit"])])]))}};exports.default=B;
@@ -1,7 +1,7 @@
1
1
  import { ref as r, openBlock as a, createElementBlock as s, createElementVNode as e, Fragment as v, renderList as h, createVNode as c, createCommentVNode as g, withCtx as w } from "vue";
2
- import k from "../../../../components/Field/Field.vue2.js";
3
- import x from "../../../../components/Select/Select.vue2.js";
4
- import y from "../../../../components/Button/Button.vue2.js";
2
+ import k from "../../../../components/Field/Field.vue.js";
3
+ import x from "../../../../components/Select/Select.vue.js";
4
+ import y from "../../../../components/Button/Button.vue.js";
5
5
  import "../../../middlewares/client/inputs.validation.js";
6
6
  import { state as C, actions as U } from "../../store/invites.js";
7
7
  const V = { class: "mn-b-medium radius-medium pd-semi bg-grey" }, z = /* @__PURE__ */ e("h3", { class: "mn-b-medium" }, "Add members", -1), E = /* @__PURE__ */ e("p", { class: "mn-b-small t-transp p-medium" }, "Укажите email или телефон, чтобы отправить ссылку с приглашением:", -1), M = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../../../components/Tab/Tab.vue.cjs");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../components/Dropdown/Dropdown.vue2.cjs");require("../../../../components/Chips/Chips.vue2.cjs");const q=require("../../../auth/store/auth.cjs");require("../../store/memberships.cjs");require("vue-i18n");require("../../../../components/Popup/Popup.vue.cjs");require("../../../reports/store/reports.cjs");const y=require("../../store/organizations.cjs"),m=require("../blocks/CardOrganization.vue.cjs"),b=require("../blocks/EmptyState.vue.cjs");require("./Unit.vue.cjs");require("./Organizations.vue2.cjs");const g={class:"for-transition bg-white radius-big w-100"},k={class:""},_={key:1,class:"cols-1"},h={__name:"Organizations",props:{owner:{type:String,default:null},user:{type:[String,Number],default:null},onlyuser:{type:[String,Number],default:null}},async setup(c){let t,u;const o=c,a=e.ref(null);a.value=([t,u]=e.withAsyncContext(()=>y.actions.read({owner:o.owner,user:o.user,onlyuser:o.onlyuser})),t=await t,u(),t);const d=s.useRouter(),n=s.useRoute();let p=n.query.tab?n.query.tab:"details";const i=e.ref(p);return n.query.tab=i.value,e.watch(i,r=>{d.replace({query:{...n.query,tab:r}})}),(r,v)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",k,[a.value<1?(e.openBlock(),e.createBlock(b.default,{key:0,title:"You Haven't Joined Any Organization Yet",description:"Weeder is all about community. Join an organization or maybe you want to create your own?",action:"Create organization",callback:r.a=()=>r.$router.push("/app/organization/create/details")},null,8,["callback"])):(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createBlock(m.default,{key:l._id,organization:l,user:q.state.user,onUpdateMembership:r.handleMembershipUpdate,class:e.normalizeClass(["w-100",{"mn-r-small":r.index!==a.value.length-1}])},null,8,["organization","user","onUpdateMembership","class"]))),128))]))])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Dropdown/Dropdown.vue2.cjs");require("../../../../components/Chips/Chips.vue2.cjs");const q=require("../../../auth/store/auth.cjs");require("../../store/memberships.cjs");require("vue-i18n");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../reports/store/reports.cjs");const y=require("../../store/organizations.cjs"),m=require("../blocks/CardOrganization.vue.cjs"),b=require("../blocks/EmptyState.vue.cjs");require("./Unit.vue.cjs");require("./Organizations.vue2.cjs");const g={class:"for-transition bg-white radius-big w-100"},k={class:""},_={key:1,class:"cols-1"},h={__name:"Organizations",props:{owner:{type:String,default:null},user:{type:[String,Number],default:null},onlyuser:{type:[String,Number],default:null}},async setup(c){let t,u;const o=c,a=e.ref(null);a.value=([t,u]=e.withAsyncContext(()=>y.actions.read({owner:o.owner,user:o.user,onlyuser:o.onlyuser})),t=await t,u(),t);const d=s.useRouter(),n=s.useRoute();let p=n.query.tab?n.query.tab:"details";const i=e.ref(p);return n.query.tab=i.value,e.watch(i,r=>{d.replace({query:{...n.query,tab:r}})}),(r,v)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",k,[a.value<1?(e.openBlock(),e.createBlock(b.default,{key:0,title:"You Haven't Joined Any Organization Yet",description:"Weeder is all about community. Join an organization or maybe you want to create your own?",action:"Create organization",callback:r.a=()=>r.$router.push("/app/organization/create/details")},null,8,["callback"])):(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createBlock(m.default,{key:l._id,organization:l,user:q.state.user,onUpdateMembership:r.handleMembershipUpdate,class:e.normalizeClass(["w-100",{"mn-r-small":r.index!==a.value.length-1}])},null,8,["organization","user","onUpdateMembership","class"]))),128))]))])]))}};exports.default=h;
@@ -1,16 +1,16 @@
1
1
  import { ref as m, withAsyncContext as b, watch as _, openBlock as t, createElementBlock as i, createElementVNode as f, createBlock as p, Fragment as g, renderList as h, normalizeClass as w } from "vue";
2
2
  import { useRouter as v, useRoute as z } from "vue-router";
3
3
  import "../../../../../../node_modules/js-cookie/dist/js.cookie.js";
4
- import "../../../../components/Tab/Tab.vue.js";
5
- import "../../../../components/Field/Field.vue.js";
6
- import "../../../../components/Select/Select.vue.js";
7
- import "../../../../components/Button/Button.vue.js";
4
+ import "../../../../components/Tab/Tab.vue2.js";
5
+ import "../../../../components/Field/Field.vue2.js";
6
+ import "../../../../components/Select/Select.vue2.js";
7
+ import "../../../../components/Button/Button.vue2.js";
8
8
  import "../../../../components/Dropdown/Dropdown.vue2.js";
9
9
  import "../../../../components/Chips/Chips.vue2.js";
10
10
  import { state as k } from "../../../auth/store/auth.js";
11
11
  import "../../store/memberships.js";
12
12
  import "vue-i18n";
13
- import "../../../../components/Popup/Popup.vue.js";
13
+ import "../../../../components/Popup/Popup.vue2.js";
14
14
  import "../../../reports/store/reports.js";
15
15
  import { actions as q } from "../../store/organizations.js";
16
16
  import $ from "../blocks/CardOrganization.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Select/Select.vue2.cjs"),y=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../icons/navigation/IconAdd.vue.cjs"),V=require("../../../icons/navigation/IconDelete.vue.cjs"),k={class:"gap-thin"},h={class:"gap-thin mn-b-thin flex-nowrap flex"},q=["disabled"],w={class:"gap-thin flex-nowrap flex"},x={__name:"CardPosition",props:{product:Object,array:Array,products:Array},emits:["add","delete","update"],setup(s,{emit:i}){const t=s,c=i,l=e.ref(null),a=e.ref(1),r=e.ref("pcs"),u=e.ref(0),p=e.computed(()=>l.value&&a.value>0&&u.value>0);e.watch(t.array,()=>{l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type}),t.product&&(l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type),e.watch([l,a,u,r],()=>{c("update",{...l.value,price:u.value,quantity:a.value||1,type:r.value})});function m(){c("add",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}function v(){c("delete",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}return(b,d)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",h,[e.createVNode(y.default,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=o=>l.value=o),options:s.products,label:"name",multiple:!1,taggable:!1,placeholder:"Select a product",class:"bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["modelValue","options"]),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,disabled:!p.value,onClick:m,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(g.default),{class:"i-semi"})],8,q)),s.product?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:v,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(V.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createVNode(n.default,{field:u.value,"onUpdate:field":d[1]||(d[1]=o=>u.value=o),type:"number",label:"Price",symbol:b.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(n.default,{field:a.value,"onUpdate:field":d[3]||(d[3]=o=>a.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(f.default,{select:r.value,"onUpdate:select":d[2]||(d[2]=o=>r.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])]))}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Select/Select.vue.cjs"),y=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../icons/navigation/IconAdd.vue.cjs"),V=require("../../../icons/navigation/IconDelete.vue.cjs"),k={class:"gap-thin"},h={class:"gap-thin mn-b-thin flex-nowrap flex"},q=["disabled"],w={class:"gap-thin flex-nowrap flex"},x={__name:"CardPosition",props:{product:Object,array:Array,products:Array},emits:["add","delete","update"],setup(s,{emit:i}){const t=s,c=i,l=e.ref(null),a=e.ref(1),r=e.ref("pcs"),u=e.ref(0),p=e.computed(()=>l.value&&a.value>0&&u.value>0);e.watch(t.array,()=>{l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type}),t.product&&(l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type),e.watch([l,a,u,r],()=>{c("update",{...l.value,price:u.value,quantity:a.value||1,type:r.value})});function m(){c("add",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}function v(){c("delete",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}return(b,d)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",h,[e.createVNode(y.default,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=o=>l.value=o),options:s.products,label:"name",multiple:!1,taggable:!1,placeholder:"Select a product",class:"bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["modelValue","options"]),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,disabled:!p.value,onClick:m,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(g.default),{class:"i-semi"})],8,q)),s.product?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:v,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(V.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createVNode(n.default,{field:u.value,"onUpdate:field":d[1]||(d[1]=o=>u.value=o),type:"number",label:"Price",symbol:b.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(n.default,{field:a.value,"onUpdate:field":d[3]||(d[3]=o=>a.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(f.default,{select:r.value,"onUpdate:select":d[2]||(d[2]=o=>r.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])]))}};exports.default=x;
@@ -1,6 +1,6 @@
1
1
  import { ref as i, computed as V, watch as m, openBlock as n, createElementBlock as c, createElementVNode as v, createVNode as s, unref as b, createCommentVNode as f, withCtx as C } from "vue";
2
- import y from "../../../../components/Field/Field.vue2.js";
3
- import P from "../../../../components/Select/Select.vue2.js";
2
+ import y from "../../../../components/Field/Field.vue.js";
3
+ import P from "../../../../components/Select/Select.vue.js";
4
4
  import q from "../../../../components/SelectMulti/SelectMulti.vue.js";
5
5
  import S from "../../../icons/navigation/IconAdd.vue.js";
6
6
  import U 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"),u=require("../../../../components/Popup/Popup.vue2.cjs"),c=require("../../../../components/Magnifier/Magnifier.vue.cjs");require("./ImagesThumbnails.vue2.cjs");const d=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),p={class:"product-images"},m={class:"no-responsive cols-4 gap-thin"},_=["src","onClick"],g={__name:"ImagesThumbnails",props:{images:{type:Array,required:!0}},setup(o){const t=e.ref(!1),n=e.ref(0),a=s=>{n.value=s,t.value=!0},i=()=>{t.value=!1};return(s,v)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.images,(l,r)=>(e.openBlock(),e.createElementBlock("img",{key:r,src:(s.FILE_SERVER_URL||"")+l,onClick:h=>a(r),class:"radius-medium bg-white o-hidden thumbnail"},null,8,_))),128))]),e.createVNode(u.default,{onClosePopup:i,isPopupOpen:t.value,class:"radius-medium o-hidden"},{default:e.withCtx(()=>[e.createVNode(c.default,{imageSrc:(s.FILE_SERVER_URL||"")+o.images[n.value],class:"magnifier z-index-4"},null,8,["imageSrc"])]),_:1},8,["isPopupOpen"])]))}},f=d.default(g,[["__scopeId","data-v-5058c750"]]);exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Popup/Popup.vue.cjs"),c=require("../../../../components/Magnifier/Magnifier.vue.cjs");require("./ImagesThumbnails.vue2.cjs");const d=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),p={class:"product-images"},m={class:"no-responsive cols-4 gap-thin"},_=["src","onClick"],g={__name:"ImagesThumbnails",props:{images:{type:Array,required:!0}},setup(o){const t=e.ref(!1),n=e.ref(0),a=s=>{n.value=s,t.value=!0},i=()=>{t.value=!1};return(s,v)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.images,(l,r)=>(e.openBlock(),e.createElementBlock("img",{key:r,src:(s.FILE_SERVER_URL||"")+l,onClick:h=>a(r),class:"radius-medium bg-white o-hidden thumbnail"},null,8,_))),128))]),e.createVNode(u.default,{onClosePopup:i,isPopupOpen:t.value,class:"radius-medium o-hidden"},{default:e.withCtx(()=>[e.createVNode(c.default,{imageSrc:(s.FILE_SERVER_URL||"")+o.images[n.value],class:"magnifier z-index-4"},null,8,["imageSrc"])]),_:1},8,["isPopupOpen"])]))}},f=d.default(g,[["__scopeId","data-v-5058c750"]]);exports.default=f;
@@ -1,5 +1,5 @@
1
1
  import { ref as r, openBlock as o, createElementBlock as i, createElementVNode as p, Fragment as d, renderList as _, createVNode as c, withCtx as g } from "vue";
2
- import f from "../../../../components/Popup/Popup.vue2.js";
2
+ import f from "../../../../components/Popup/Popup.vue.js";
3
3
  import h from "../../../../components/Magnifier/Magnifier.vue.js";
4
4
  import "./ImagesThumbnails.vue2.js";
5
5
  import v from "../../../../../../_virtual/_plugin-vue_export-helper.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue2.cjs"),d=require("../../store/leftovers.cjs");require("./LeftoverPositions.vue2.cjs");const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-grey pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-grey pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue.cjs"),d=require("../../store/leftovers.cjs");require("./LeftoverPositions.vue2.cjs");const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-grey pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-grey pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as o, createElementBlock as l, createElementVNode as s, createCommentVNode as u, Fragment as f, renderList as p, toDisplayString as y, createVNode as i } from "vue";
2
2
  import { useRouter as b, useRoute as _ } from "vue-router";
3
- import a from "../../../../components/Field/Field.vue2.js";
3
+ import a from "../../../../components/Field/Field.vue.js";
4
4
  import { actions as g } from "../../store/leftovers.js";
5
5
  import "./LeftoverPositions.vue2.js";
6
6
  const k = { class: "flex-column flex-wrap block" }, h = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");require("./ListPositions.vue2.cjs");const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");require("../../../../components/Field/Field.vue2.cjs");const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");require("./ListPositions.vue2.cjs");const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as e, createElementBlock as t, createElementVNode as n, createCommentVNode as d, Fragment as a, renderList as m, toDisplayString as p, createVNode as u } from "vue";
2
2
  import { useRouter as f, useRoute as _ } from "vue-router";
3
- import "../../../../components/Field/Field.vue.js";
3
+ import "../../../../components/Field/Field.vue2.js";
4
4
  import x from "./CardPosition.vue.js";
5
5
  import { actions as h } from "../../store/leftovers.js";
6
6
  import "./ListPositions.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-grey radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-grey radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
@@ -2,7 +2,7 @@ import { onMounted as p, resolveComponent as _, openBlock as i, createElementBlo
2
2
  import { VueDraggableNext as k } from "../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js";
3
3
  import { useRoute as w, useRouter as x } from "vue-router";
4
4
  import { actions as n, state as a } from "../../store/categories.js";
5
- import $ from "../../../../components/Button/Button.vue2.js";
5
+ import $ from "../../../../components/Button/Button.vue.js";
6
6
  import v from "../../../../components/Block/Block.vue.js";
7
7
  import A from "../blocks/CardCategory.vue.js";
8
8
  const E = { class: "pd-thin" }, N = /* @__PURE__ */ b("h1", { class: "mn-r-auto" }, " Product Categories ", -1), T = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../../components/Select/Select.vue2.cjs"),d=require("../../../../components/Field/Field.vue2.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Select/Select.vue.cjs"),d=require("../../../../components/Field/Field.vue.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
@@ -1,9 +1,9 @@
1
1
  import { computed as h, openBlock as o, createElementBlock as c, Fragment as m, createVNode as l, withCtx as u, createElementVNode as d, toDisplayString as _, unref as U, createTextVNode as C, renderList as b } from "vue";
2
2
  import { useRoute as k, useRouter as v } from "vue-router";
3
3
  import g from "../../../icons/navigation/IconDelete.vue.js";
4
- import S from "../../../../components/Button/Button.vue2.js";
5
- import E from "../../../../components/Select/Select.vue2.js";
6
- import i from "../../../../components/Field/Field.vue2.js";
4
+ import S from "../../../../components/Button/Button.vue.js";
5
+ import E from "../../../../components/Select/Select.vue.js";
6
+ import i from "../../../../components/Field/Field.vue.js";
7
7
  import p from "../../../../components/Block/Block.vue.js";
8
8
  import { actions as f, state as t } from "../../store/categories.js";
9
9
  import "./CategoryEdit.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),N=require("../../../../components/Field/Field.vue2.cjs"),w=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue2.cjs"),q=require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),V=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),x=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const E={class:"pd-thin"},B={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),L={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},R={class:"gap-thin flex-v-center flex-nojustify flex"},F={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function _(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}catch{console.error("error")}});function g(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:x.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("header",B,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[D,e.createElementVNode("div",L,[e.createVNode(w.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,l)=>(e.openBlock(),e.createBlock(V.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>_()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(N.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",R,[e.createElementVNode("h3",F," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),N=require("../../../../components/Field/Field.vue.cjs"),w=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),V=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),x=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const E={class:"pd-thin"},B={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),L={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},R={class:"gap-thin flex-v-center flex-nojustify flex"},F={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function _(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}catch{console.error("error")}});function g(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:x.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("header",B,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[D,e.createElementVNode("div",L,[e.createVNode(w.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,l)=>(e.openBlock(),e.createBlock(V.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>_()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(N.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",R,[e.createElementVNode("h3",F," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
@@ -1,9 +1,9 @@
1
1
  import { ref as h, computed as z, onMounted as E, openBlock as l, createElementBlock as p, createElementVNode as n, toDisplayString as k, unref as b, createVNode as a, withCtx as c, Fragment as P, renderList as x, createBlock as $, createCommentVNode as U } from "vue";
2
2
  import v from "../../../../components/Block/Block.vue.js";
3
- import A from "../../../../components/Field/Field.vue2.js";
3
+ import A from "../../../../components/Field/Field.vue.js";
4
4
  import B from "../../../../components/Feed/Feed.vue.js";
5
- import F from "../../../../components/Select/Select.vue2.js";
6
- import I from "../../../../components/Popup/Popup.vue2.js";
5
+ import F from "../../../../components/Select/Select.vue.js";
6
+ import I from "../../../../components/Popup/Popup.vue.js";
7
7
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
8
8
  import O from "../blocks/CardPosition.vue.js";
9
9
  import V from "../../../orders/components/blocks/CardOrderItem.vue.js";