@ozdao/prometheus-framework 0.2.35 → 0.2.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/main.css +1 -1
  2. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  3. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +42 -52
  4. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  5. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
  6. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
  8. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +2 -49
  10. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +49 -2
  12. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  14. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +39 -242
  16. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -0
  17. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -0
  18. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -0
  19. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +4 -0
  20. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.cjs +1 -2
  21. package/dist/prometheus-framework/src/components/FieldPhone/click-outside.js +13 -13
  22. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +111 -2
  24. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
  26. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
  28. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +49 -47
  30. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  32. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +45 -44
  34. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +2 -2
  35. package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +61 -56
  36. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/events/store/events.js +59 -39
  42. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +31 -31
  46. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +85 -55
  48. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/orders/store/orders.js +30 -38
  50. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +31 -21
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +96 -93
  58. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  62. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  66. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +54 -74
  68. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +58 -48
  70. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/products/store/products.js +26 -26
  72. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  78. package/dist/prometheus-framework.cjs.js +13 -14
  79. package/dist/prometheus-framework.es.js +346 -557
  80. package/dist/style.css +1 -1
  81. package/package.json +1 -1
  82. package/src/components/Button/Button.vue +26 -19
  83. package/src/components/FieldBig/FieldBig.vue +1 -1
  84. package/src/components/FieldPhone/FieldPhone.vue +55 -304
  85. package/src/components/FieldPhone/FieldPhone2.vue +671 -0
  86. package/src/components/FieldPhone/click-outside.js +16 -11
  87. package/src/components/Footer/Footer.vue +4 -4
  88. package/src/components/Header/Header.vue +2 -1
  89. package/src/components/Select/Select.vue +2 -1
  90. package/src/modules/chats/components/sections/ChatWindow.vue +3 -1
  91. package/src/modules/chats/store/chat.store.js +1 -3
  92. package/src/modules/events/components/pages/EditEvent.vue +2 -1
  93. package/src/modules/events/components/pages/Event.vue +8 -2
  94. package/src/modules/events/components/sections/SectionMainGuest.vue +1 -1
  95. package/src/modules/events/components/sections/SectionSpecialGuests.vue +0 -1
  96. package/src/modules/events/store/events.js +23 -3
  97. package/src/modules/globals/mixins/mixins.js +33 -2
  98. package/src/modules/landing/components/sections/HeroGovernance.vue +156 -0
  99. package/src/modules/marketplace/components/sections/Filters.vue +3 -0
  100. package/src/modules/marketplace/router/marketplace.js +1 -0
  101. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -3
  102. package/src/modules/orders/components/pages/EditOrder.vue +9 -11
  103. package/src/modules/orders/components/pages/FormOrder.vue +58 -46
  104. package/src/modules/orders/components/pages/Order.vue +63 -42
  105. package/src/modules/orders/components/sections/FormOrderDetails.vue +50 -18
  106. package/src/modules/orders/controllers/orders.controller.js +10 -1
  107. package/src/modules/orders/models/order.model.js +1 -0
  108. package/src/modules/orders/store/orders.js +21 -27
  109. package/src/modules/orders/store/shopcart.js +14 -2
  110. package/src/modules/organizations/components/sections/DetailsTab.vue +2 -2
  111. package/src/modules/products/components/sections/FilterProducts.vue +3 -4
  112. package/src/modules/products/components/sections/HeroRecommendation.vue +29 -2
  113. package/src/modules/products/components/sections/SectionProduct.vue +14 -9
  114. package/src/modules/products/controllers/products.controller.js +26 -17
  115. package/src/modules/products/routes/products.routes.js +6 -6
  116. package/src/modules/products/store/products.js +10 -10
  117. package/src/styles/config.scss +10 -3
@@ -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"),m=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const n=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const i=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const b=require("../../../../components/Checkbox/Checkbox.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Popup/Popup.vue.cjs");const w=require("../../../../components/EditImages/EditImages.vue.cjs"),c=require("../../../icons/navigation/IconDelete.vue.cjs"),h=require("../blocks/CardPosition.vue.cjs"),x=require("../sections/EditProductInfo.vue.cjs"),s=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),g=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const V={class:"for-transition w-100 cols-1 pd-thin gap-thin"},v={class:"mn-r-auto"},B={class:"cols-2 gap-thin"},q={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},C={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},y={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},E={__name:"ProductEdit",setup(U){const o=m.useRoute(),k=m.useRouter(),u=e.ref(t.state.all);e.onMounted(async()=>{await g.actions.fetchCategories(),o.params.product&&await t.actions.read({_id:o.params.product})});function N(){o.params.product?t.actions.update(o.params.product,t.state.current):t.actions.create(o.params._id,t.state.current)}function _(){t.actions.deleteProduct(t.state.current._id)}function p(){k.push({name:"Organization",params:{_id:o.params._id}})}return(D,d)=>(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(n.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",v,e.toDisplayString(e.unref(o).params.product?t.state.current.name:"Create Product"),1),e.unref(o).params.product?(e.openBlock(),e.createBlock(f.default,{key:0,submit:_,callback:p,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:N,callback:p,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(n.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(w.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":d[0]||(d[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",B,[e.createVNode(n.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(x.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(n.default,{title:"Categories"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.state.all,(a,r)=>(e.openBlock(),e.createBlock(b.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1}),e.createVNode(n.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",q,[e.createVNode(c.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",C,[e.createVNode(c.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(n.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",y,[e.createVNode(c.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Add Ingridient",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(h.default,{onAdd:d[1]||(d[1]=a=>s.actions.add(t.state.current.ingridients,a)),products:u.value},null,8,["products"]),e.createVNode(n.default,{placeholder:"No positions added yet",class:"pd-zero mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingridients,(a,r)=>(e.openBlock(),e.createBlock(h.default,{key:a._id,product:a,array:t.state.current.ingridients,products:u.value,onAdd:d[2]||(d[2]=l=>s.actions.add(t.state.current.ingridients,l)),onUpdate:l=>s.actions.update(t.state.current.ingridients,l,r),onDelete:l=>s.actions.delete(t.state.current.ingridients,l,r)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1})]),_:1})]))}};exports.default=E;
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 n=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const i=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const b=require("../../../../components/Checkbox/Checkbox.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Popup/Popup.vue2.cjs");const w=require("../../../../components/EditImages/EditImages.vue.cjs"),c=require("../../../icons/navigation/IconDelete.vue.cjs"),h=require("../blocks/CardPosition.vue.cjs"),x=require("../sections/EditProductInfo.vue.cjs"),s=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),g=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const V={class:"for-transition w-100 cols-1 pd-thin gap-thin"},v={class:"mn-r-auto"},B={class:"cols-2 gap-thin"},q={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},C={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},y={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},E={__name:"ProductEdit",setup(U){const o=m.useRoute(),k=m.useRouter(),u=e.ref(t.state.all);e.onMounted(async()=>{await g.actions.fetchCategories(),o.params.product&&await t.actions.read({_id:o.params.product})});function N(){o.params.product?t.actions.update(o.params.product,t.state.current):t.actions.create(o.params._id,t.state.current)}function _(){t.actions.deleteProduct(t.state.current._id)}function p(){k.push({name:"Organization",params:{_id:o.params._id}})}return(D,d)=>(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(n.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",v,e.toDisplayString(e.unref(o).params.product?t.state.current.name:"Create Product"),1),e.unref(o).params.product?(e.openBlock(),e.createBlock(f.default,{key:0,submit:_,callback:p,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:N,callback:p,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(n.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(w.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":d[0]||(d[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",B,[e.createVNode(n.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(x.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(n.default,{title:"Categories"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.state.all,(a,r)=>(e.openBlock(),e.createBlock(b.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1}),e.createVNode(n.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",q,[e.createVNode(c.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",C,[e.createVNode(c.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(n.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",y,[e.createVNode(c.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Add Ingridient",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(h.default,{onAdd:d[1]||(d[1]=a=>s.actions.add(t.state.current.ingridients,a)),products:u.value},null,8,["products"]),e.createVNode(n.default,{placeholder:"No positions added yet",class:"pd-zero mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingridients,(a,r)=>(e.openBlock(),e.createBlock(h.default,{key:a._id,product:a,array:t.state.current.ingridients,products:u.value,onAdd:d[2]||(d[2]=l=>s.actions.add(t.state.current.ingridients,l)),onUpdate:l=>s.actions.update(t.state.current.ingridients,l,r),onDelete:l=>s.actions.delete(t.state.current.ingridients,l,r)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1})]),_:1})]))}};exports.default=E;
@@ -7,9 +7,9 @@ import s from "../../../../components/Block/Block.vue.js";
7
7
  import "../../../../components/Tab/Tab.vue.js";
8
8
  import c from "../../../../components/Field/Field.vue2.js";
9
9
  import "../../../../components/Select/Select.vue.js";
10
- import B from "../../../../components/Checkbox/Checkbox.vue2.js";
10
+ import B from "../../../../components/Checkbox/Checkbox.vue.js";
11
11
  import k from "../../../../components/Button/Button.vue2.js";
12
- import "../../../../components/Popup/Popup.vue.js";
12
+ import "../../../../components/Popup/Popup.vue2.js";
13
13
  import E from "../../../../components/EditImages/EditImages.vue.js";
14
14
  import b from "../../../icons/navigation/IconDelete.vue.js";
15
15
  import U from "../blocks/CardPosition.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Spoiler/Spoiler.vue2.cjs"),d=require("../../../../components/Checkbox/Checkbox.vue2.cjs"),w=require("vue-i18n"),y=require("vue-router"),m=require("../../store/categories.cjs"),a=require("../../../marketplace/store/marketplace.cjs");require("./FilterProducts.vue2.cjs");const x={class:"pd-medium bg-grey radius-big"},E={class:"cursor-pointer mn-r-auto t-medium p-big"},B=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),q={class:"cursor-pointer mn-r-auto t-medium p-big"},F=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),C=e.createElementVNode("p",{class:"cursor-pointer mn-r-auto t-medium p-big"},"Delivery",-1),V=e.createElementVNode("hr",{class:"mn-b-semi"},null,-1),N={__name:"FilterProducts",props:{selectedFilters:Object,prices:{type:Array,default:()=>[{label:"Under 300฿",value:"<300"},{label:"300฿ to 600฿",value:"300-600"},{label:"600฿ to 1200฿",value:"600-1200"},{label:"$1200 and above",value:">1200"}]},deliveryOptions:{type:Array,default:()=>[{label:"Pickup",value:{min:0,max:25}},{label:"Courier",value:{min:25,max:50}},{label:"Post",value:{min:50,max:100}}]}},emits:["updateFilters","resetFilters"],async setup(p,{emit:h}){let b,f;const n=y.useRoute(),v=y.useRouter();[b,f]=e.withAsyncContext(()=>m.actions.fetchCategories()),await b,f(),e.ref({categories:[],prices:[],delivery:[],extra:[]}),e.watch(()=>a.state.filter,(r,t)=>{const l={...n.query};Object.keys(t).forEach(s=>{l[s]&&delete l[s]});const i=Object.fromEntries(Object.entries(r).filter(([s,o])=>Array.isArray(o)&&o.length>0).map(([s,o])=>[s,o.join(",")]));Object.assign(l,i),v.push({query:l})},{deep:!0}),e.onMounted(async()=>{if(n.query){const r=n.query,t={categories:r.categories?r.categories.split(","):[],prices:r.prices?r.prices.split(","):[],delivery:r.delivery?r.delivery.split(","):[]};a.state.filter=t}});const k=h,_=()=>{k("resetFilters")},g={locale:"en",messages:{en:{categoriesTitle:"Category",categories:[],filters:{title:"Filters",price:{title:"Price",from:"From",to:"To"},filters:[],reset:"Reset Filters"}},ru:{categoriesTitle:"Категория",categories:[],filters:{title:"Фильтры",price:{title:"Цена",from:"От",to:"До"},filters:[],reset:"Сбросить фильтры"}}}};m.state.all.forEach(r=>{r.localization.forEach(t=>{g.messages[t.locale].categories.push(t.text)})});const{t:c}=w.useI18n(g);return(r,t)=>(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(u.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!0},{header:e.withCtx(()=>[e.createElementVNode("p",E,e.toDisplayString(e.unref(c)("categoriesTitle")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.state.all,(l,i)=>(e.openBlock(),e.createBlock(d.default,{key:i,label:l.name,value:l.url,class:"w-100 mn-t-small mn-b-small bg-white radius-small pd-small",radio:a.state.filter.categories,"onUpdate:radio":t[0]||(t[0]=s=>a.state.filter.categories=s)},null,8,["label","value","radio"]))),128))]),_:1}),B,e.createVNode(u.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!1},{header:e.withCtx(()=>[e.createElementVNode("p",q,e.toDisplayString(e.unref(c)("filters.price.title")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.prices,(l,i)=>(e.openBlock(),e.createBlock(d.default,{key:i,label:l.label,value:l.value,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:a.state.filter.prices,"onUpdate:radio":t[1]||(t[1]=s=>a.state.filter.prices=s)},null,8,["label","value","radio"]))),128))]),_:1}),F,e.createVNode(u.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!1},{header:e.withCtx(()=>[C]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.deliveryOptions,(l,i)=>(e.openBlock(),e.createBlock(d.default,{key:i,label:l.label,value:l.value,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:a.state.filter.delivery,"onUpdate:radio":t[2]||(t[2]=s=>a.state.filter.delivery=s)},null,8,["label","value","radio"]))),128))]),_:1}),V,e.createElementVNode("button",{onClick:_,class:"bg-main w-100 button"},e.toDisplayString(e.unref(c)("filters.reset")),1)]))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Spoiler/Spoiler.vue2.cjs"),f=require("../../../../components/Checkbox/Checkbox.vue.cjs"),x=require("vue-i18n"),g=require("vue-router"),u=require("../../store/categories.cjs"),a=require("../../../marketplace/store/marketplace.cjs");require("./FilterProducts.vue2.cjs");const w={class:"pd-medium bg-grey radius-big"},q={class:"cursor-pointer mn-r-auto t-medium p-big"},E=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),F={class:"cursor-pointer mn-r-auto t-medium p-big"},B=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),C={__name:"FilterProducts",props:{selectedFilters:Object,prices:{type:Array,default:()=>[{label:"Under 300฿",value:"<300"},{label:"300฿ to 600฿",value:"300-600"},{label:"600฿ to 1200฿",value:"600-1200"},{label:"$1200 and above",value:">1200"}]},deliveryOptions:{type:Array,default:()=>[{label:"Pickup",value:{min:0,max:25}},{label:"Courier",value:{min:25,max:50}},{label:"Post",value:{min:50,max:100}}]}},emits:["updateFilters","resetFilters"],async setup(y,{emit:h}){let d,m;const n=g.useRoute(),v=g.useRouter();[d,m]=e.withAsyncContext(()=>u.actions.fetchCategories()),await d,m(),e.ref({categories:[],prices:[],delivery:[],extra:[]}),e.watch(()=>a.state.filter,(t,r)=>{const l={...n.query};Object.keys(r).forEach(s=>{l[s]&&delete l[s]});const i=Object.fromEntries(Object.entries(t).filter(([s,o])=>Array.isArray(o)&&o.length>0).map(([s,o])=>[s,o.join(",")]));Object.assign(l,i),v.push({query:l})},{deep:!0}),e.onMounted(async()=>{if(n.query){const t=n.query,r={categories:t.categories?t.categories.split(","):[],prices:t.prices?t.prices.split(","):[],delivery:t.delivery?t.delivery.split(","):[]};a.state.filter=r}});const _=h,k=()=>{_("resetFilters")},p={locale:"en",messages:{en:{categoriesTitle:"Category",categories:[],filters:{title:"Filters",price:{title:"Price",from:"From",to:"To"},filters:[],reset:"Reset Filters"}},ru:{categoriesTitle:"Категория",categories:[],filters:{title:"Фильтры",price:{title:"Цена",from:"От",to:"До"},filters:[],reset:"Сбросить фильтры"}}}};u.state.all.forEach(t=>{t.localization.forEach(r=>{p.messages[r.locale].categories.push(r.text)})});const{t:c}=x.useI18n(p);return(t,r)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(b.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!0},{header:e.withCtx(()=>[e.createElementVNode("p",q,e.toDisplayString(e.unref(c)("categoriesTitle")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.state.all,(l,i)=>(e.openBlock(),e.createBlock(f.default,{key:i,label:l.name,value:l.url,class:"w-100 mn-t-small mn-b-small bg-white radius-small pd-small",radio:a.state.filter.categories,"onUpdate:radio":r[0]||(r[0]=s=>a.state.filter.categories=s)},null,8,["label","value","radio"]))),128))]),_:1}),E,e.createVNode(b.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!1},{header:e.withCtx(()=>[e.createElementVNode("p",F,e.toDisplayString(e.unref(c)("filters.price.title")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.prices,(l,i)=>(e.openBlock(),e.createBlock(f.default,{key:i,label:l.label,value:l.value,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:a.state.filter.prices,"onUpdate:radio":r[1]||(r[1]=s=>a.state.filter.prices=s)},null,8,["label","value","radio"]))),128))]),_:1}),B,e.createElementVNode("button",{onClick:k,class:"bg-main w-100 button"},e.toDisplayString(e.unref(c)("filters.reset")),1)]))}};exports.default=C;
@@ -1,12 +1,12 @@
1
- import { withAsyncContext as A, ref as P, watch as T, onMounted as U, openBlock as i, createElementBlock as c, createVNode as p, withCtx as n, createElementVNode as o, toDisplayString as b, unref as f, Fragment as g, renderList as y, createBlock as h } from "vue";
2
- import v from "../../../../components/Spoiler/Spoiler.vue2.js";
3
- import _ from "../../../../components/Checkbox/Checkbox.vue2.js";
4
- import { useI18n as V } from "vue-i18n";
5
- import { useRoute as B, useRouter as R } from "vue-router";
6
- import { actions as $, state as C } from "../../store/categories.js";
7
- import { state as s } from "../../../marketplace/store/marketplace.js";
1
+ import { withAsyncContext as A, ref as P, watch as T, onMounted as V, openBlock as a, createElementBlock as d, createVNode as h, withCtx as c, createElementVNode as o, toDisplayString as p, unref as b, Fragment as _, renderList as v, createBlock as x } from "vue";
2
+ import w from "../../../../components/Spoiler/Spoiler.vue2.js";
3
+ import F from "../../../../components/Checkbox/Checkbox.vue.js";
4
+ import { useI18n as B } from "vue-i18n";
5
+ import { useRoute as R, useRouter as U } from "vue-router";
6
+ import { actions as $, state as k } from "../../store/categories.js";
7
+ import { state as l } from "../../../marketplace/store/marketplace.js";
8
8
  import "./FilterProducts.vue2.js";
9
- const D = { class: "pd-medium bg-grey radius-big" }, N = { class: "cursor-pointer mn-r-auto t-medium p-big" }, I = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), L = { class: "cursor-pointer mn-r-auto t-medium p-big" }, M = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), Q = /* @__PURE__ */ o("p", { class: "cursor-pointer mn-r-auto t-medium p-big" }, "Delivery", -1), S = /* @__PURE__ */ o("hr", { class: "mn-b-semi" }, null, -1), Z = {
9
+ const N = { class: "pd-medium bg-grey radius-big" }, D = { class: "cursor-pointer mn-r-auto t-medium p-big" }, I = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), L = { class: "cursor-pointer mn-r-auto t-medium p-big" }, M = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), X = {
10
10
  __name: "FilterProducts",
11
11
  props: {
12
12
  selectedFilters: Object,
@@ -29,37 +29,37 @@ const D = { class: "pd-medium bg-grey radius-big" }, N = { class: "cursor-pointe
29
29
  }
30
30
  },
31
31
  emits: ["updateFilters", "resetFilters"],
32
- async setup(x, { emit: j }) {
33
- let w, F;
34
- const m = B(), E = R();
35
- [w, F] = A(() => $.fetchCategories()), await w, F(), P({
32
+ async setup(C, { emit: j }) {
33
+ let f, g;
34
+ const u = R(), E = U();
35
+ [f, g] = A(() => $.fetchCategories()), await f, g(), P({
36
36
  categories: [],
37
37
  prices: [],
38
38
  delivery: [],
39
39
  extra: []
40
- }), T(() => s.filter, (r, e) => {
41
- const t = { ...m.query };
42
- Object.keys(e).forEach((l) => {
43
- t[l] && delete t[l];
40
+ }), T(() => l.filter, (e, t) => {
41
+ const r = { ...u.query };
42
+ Object.keys(t).forEach((s) => {
43
+ r[s] && delete r[s];
44
44
  });
45
- const a = Object.fromEntries(
46
- Object.entries(r).filter(([l, u]) => Array.isArray(u) && u.length > 0).map(([l, u]) => [l, u.join(",")])
45
+ const i = Object.fromEntries(
46
+ Object.entries(e).filter(([s, n]) => Array.isArray(n) && n.length > 0).map(([s, n]) => [s, n.join(",")])
47
47
  );
48
- Object.assign(t, a), E.push({ query: t });
49
- }, { deep: !0 }), U(async () => {
50
- if (m.query) {
51
- const r = m.query, e = {
52
- categories: r.categories ? r.categories.split(",") : [],
53
- prices: r.prices ? r.prices.split(",") : [],
54
- delivery: r.delivery ? r.delivery.split(",") : []
48
+ Object.assign(r, i), E.push({ query: r });
49
+ }, { deep: !0 }), V(async () => {
50
+ if (u.query) {
51
+ const e = u.query, t = {
52
+ categories: e.categories ? e.categories.split(",") : [],
53
+ prices: e.prices ? e.prices.split(",") : [],
54
+ delivery: e.delivery ? e.delivery.split(",") : []
55
55
  // Продолжайте этот паттерн для остальных полей фильтра
56
56
  };
57
- s.filter = e;
57
+ l.filter = t;
58
58
  }
59
59
  });
60
60
  const O = j, q = () => {
61
61
  O("resetFilters");
62
- }, k = {
62
+ }, y = {
63
63
  locale: "en",
64
64
  messages: {
65
65
  en: {
@@ -92,80 +92,60 @@ const D = { class: "pd-medium bg-grey radius-big" }, N = { class: "cursor-pointe
92
92
  }
93
93
  }
94
94
  };
95
- C.all.forEach((r) => {
96
- r.localization.forEach((e) => {
97
- k.messages[e.locale].categories.push(e.text);
95
+ k.all.forEach((e) => {
96
+ e.localization.forEach((t) => {
97
+ y.messages[t.locale].categories.push(t.text);
98
98
  });
99
99
  });
100
- const { t: d } = V(k);
101
- return (r, e) => (i(), c("div", D, [
102
- p(v, {
100
+ const { t: m } = B(y);
101
+ return (e, t) => (a(), d("div", N, [
102
+ h(w, {
103
103
  class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
104
104
  status: !0
105
105
  }, {
106
- header: n(() => [
107
- o("p", N, b(f(d)("categoriesTitle")), 1)
106
+ header: c(() => [
107
+ o("p", D, p(b(m)("categoriesTitle")), 1)
108
108
  ]),
109
- content: n(() => [
110
- (i(!0), c(g, null, y(C.all, (t, a) => (i(), h(_, {
111
- key: a,
112
- label: t.name,
113
- value: t.url,
109
+ content: c(() => [
110
+ (a(!0), d(_, null, v(k.all, (r, i) => (a(), x(F, {
111
+ key: i,
112
+ label: r.name,
113
+ value: r.url,
114
114
  class: "w-100 mn-t-small mn-b-small bg-white radius-small pd-small",
115
- radio: s.filter.categories,
116
- "onUpdate:radio": e[0] || (e[0] = (l) => s.filter.categories = l)
115
+ radio: l.filter.categories,
116
+ "onUpdate:radio": t[0] || (t[0] = (s) => l.filter.categories = s)
117
117
  }, null, 8, ["label", "value", "radio"]))), 128))
118
118
  ]),
119
119
  _: 1
120
120
  }),
121
121
  I,
122
- p(v, {
122
+ h(w, {
123
123
  class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
124
124
  status: !1
125
125
  }, {
126
- header: n(() => [
127
- o("p", L, b(f(d)("filters.price.title")), 1)
126
+ header: c(() => [
127
+ o("p", L, p(b(m)("filters.price.title")), 1)
128
128
  ]),
129
- content: n(() => [
130
- (i(!0), c(g, null, y(x.prices, (t, a) => (i(), h(_, {
131
- key: a,
132
- label: t.label,
133
- value: t.value,
129
+ content: c(() => [
130
+ (a(!0), d(_, null, v(C.prices, (r, i) => (a(), x(F, {
131
+ key: i,
132
+ label: r.label,
133
+ value: r.value,
134
134
  class: "w-100 mn-t-small bg-white radius-small pd-small",
135
- radio: s.filter.prices,
136
- "onUpdate:radio": e[1] || (e[1] = (l) => s.filter.prices = l)
135
+ radio: l.filter.prices,
136
+ "onUpdate:radio": t[1] || (t[1] = (s) => l.filter.prices = s)
137
137
  }, null, 8, ["label", "value", "radio"]))), 128))
138
138
  ]),
139
139
  _: 1
140
140
  }),
141
141
  M,
142
- p(v, {
143
- class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
144
- status: !1
145
- }, {
146
- header: n(() => [
147
- Q
148
- ]),
149
- content: n(() => [
150
- (i(!0), c(g, null, y(x.deliveryOptions, (t, a) => (i(), h(_, {
151
- key: a,
152
- label: t.label,
153
- value: t.value,
154
- class: "w-100 mn-t-small bg-white radius-small pd-small",
155
- radio: s.filter.delivery,
156
- "onUpdate:radio": e[2] || (e[2] = (l) => s.filter.delivery = l)
157
- }, null, 8, ["label", "value", "radio"]))), 128))
158
- ]),
159
- _: 1
160
- }),
161
- S,
162
142
  o("button", {
163
143
  onClick: q,
164
144
  class: "bg-main w-100 button"
165
- }, b(f(d)("filters.reset")), 1)
145
+ }, p(b(m)("filters.reset")), 1)
166
146
  ]));
167
147
  }
168
148
  };
169
149
  export {
170
- Z as default
150
+ X as default
171
151
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../blocks/Images360.vue.cjs"),g=require("../blocks/ImagesThumbnails.vue.cjs"),h=require("../../../icons/navigation/IconEdit.vue.cjs");require("../elements/THC.vue2.cjs");const p=require("../elements/Price.vue.cjs"),k=require("../../../icons/placeholders/PlaceholderImage.vue.cjs"),f=require("vue-i18n"),c=require("../../../orders/store/shopcart.cjs"),y={class:"cols-2-1_2 w-100 gap-big"},b={class:"flex-nowrap flex-column flex pos-relative"},v={class:"h-100 h-max-50vh bg-grey radius-big o-hidden"},B=["src"],E={class:"pos-relative w-100 h-100 flex-column flex-justify flex col"},V={key:0,class:"t-main t-semi p-big"},N={class:"w-100 h1-product mn-b-thin"},w={key:1,class:"mn-b-semi"},C={key:2,class:"w-100 mn-b-medium t-transp"},S={key:3,class:"w-100 mn-b-medium t-transp"},q={class:"cols-2 w-100 gap-small mn-b-semi"},z={class:"w-100 pd-small radius-small bg-grey-transp-30 product-information"},I={class:"t-demi"},x={class:"max-w-33rem mobile-w-100 t-white gap-small cols-2"},D=["disabled"],P={__name:"SectionProduct",props:{product:{type:Object,required:!0},recommendation:{type:String}},setup(t){const s=t,n=e.computed(()=>s.product.images),l={messages:{en:{airecommend:"AI Recommends You",description:"",addtoorder:"Add to order",fastorder:"Fast Order"},ru:{airecommend:"AI Рекомендует вам",description:"",addtoorder:"Добавить в корзину",fastorder:"Быстрый заказ"}}},{t:i}=f.useI18n(l);function d(o){return!(o.quantity>0)}function m(o){c.state.organization!==o.organization&&(c.state.positions=[],c.state.organization=o.organization),c.actions.addProductToCart(o)}return(o,a)=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",b,[e.createElementVNode("div",v,[t.product&&t.product.image3d?(e.openBlock(),e.createBlock(u.default,{key:0,class:"h-100 w-100",imagePath:`/assets/images/products/${t.product.image3d}`,imageCount:36},null,8,["imagePath"])):e.createCommentVNode("",!0),n.value[0]&&!t.product.image3d?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-100 bg-grey w-100",style:{"object-fit":"contain"},src:(o.FILE_SERVER_URL||"")+n.value[0]},null,8,B)):e.createCommentVNode("",!0),!n.value[0]&&!t.product.image3d?(e.openBlock(),e.createBlock(k.default,{key:2,class:"h-100 w-100",style:{"object-fit":"cover"}})):e.createCommentVNode("",!0)]),n.value.length>1?(e.openBlock(),e.createBlock(g.default,{key:0,images:n.value,class:"mn-t-medium"},null,8,["images"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E,[e.createVNode(h.default,{onClick:a[0]||(a[0]=r=>o.$router.push({name:"ProductEdit",params:{_id:t.product.organization,product:t.product._id}})),class:"pos-absolute pos-t-regular pos-r-regular i-regular t-transp"}),t.recommendation?(e.openBlock(),e.createElementBlock("h2",V,e.toDisplayString(e.unref(i)("airecommend")),1)):e.createCommentVNode("",!0),e.createElementVNode("h1",N,e.toDisplayString(t.product.name),1),e.createVNode(p.default,{product:t.product,size:"big",class:"mn-b-semi"},null,8,["product"]),t.recommendation?(e.openBlock(),e.createElementBlock("h3",w,e.toDisplayString(t.recommendation),1)):e.createCommentVNode("",!0),t.product.description&&!t.product.localization<1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",C,e.toDisplayString(t.product.description),1)):e.createCommentVNode("",!0),t.product.localization&&t.product.localization.length>1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",S,e.toDisplayString(e.unref(i)("description")),1)):e.createCommentVNode("",!0),e.createElementVNode("div",q,[t.product.information.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.product.information,r=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("p",I,e.toDisplayString(r.name),1),e.createElementVNode("p",null,e.toDisplayString(r.value),1)]))),256)):e.createCommentVNode("",!0)]),e.createElementVNode("div",x,[e.createElementVNode("button",{disabled:d(t.product),onClick:a[1]||(a[1]=r=>m(t.product)),class:"w-100 mn-r-small bg-main button"},e.toDisplayString(e.unref(i)("addtoorder")),9,D)])])]))}};exports.default=P;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../icons/navigation/IconEdit.vue.cjs"),h=require("../../../icons/placeholders/PlaceholderImage.vue.cjs"),p=require("../blocks/Images360.vue.cjs"),k=require("../blocks/ImagesThumbnails.vue.cjs");require("../elements/THC.vue2.cjs");const f=require("../elements/Price.vue.cjs"),b=require("vue-i18n"),n=require("../../../orders/store/shopcart.cjs"),y={class:"cols-2-1_2 w-100 gap-big"},v={class:"flex-nowrap flex-column flex pos-relative"},B={class:"h-100 h-max-50vh bg-grey radius-big o-hidden"},V=["src"],E={class:"pos-relative w-100 h-100 flex-column flex-justify flex col"},N={key:0,class:"t-main t-semi p-big"},w={class:"w-100 h1-product mn-b-thin"},C={key:1,class:"mn-b-semi"},S={key:2,class:"w-100 mn-b-medium t-transp"},q={key:3,class:"w-100 mn-b-medium t-transp"},x={class:"cols-2 w-100 gap-small mn-b-semi"},z={class:"w-100 pd-small radius-small bg-grey-transp-30 product-information"},I={class:"t-demi"},D={class:"max-w-33rem mobile-w-100 t-white gap-small cols-2"},P={__name:"SectionProduct",props:{product:{type:Object,required:!0},recommendation:{type:String}},setup(t){const s=t,a=e.computed(()=>s.product.images),d={messages:{en:{airecommend:"AI Recommends You",description:"",addtoorder:"Add to order",fastorder:"Fast Order"},ru:{airecommend:"AI Рекомендует вам",description:"",addtoorder:"Добавить в корзину",fastorder:"Быстрый заказ"}}},{t:c}=b.useI18n(d);function l(o){return!(o.quantity>0)}function m(o){n.state.organization!==o.organization&&(n.state.positions=[],n.state.organization=o.organization),n.actions.addProductToCart(o,o.organization)}return(o,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",v,[e.createElementVNode("div",B,[t.product&&t.product.image3d?(e.openBlock(),e.createBlock(p.default,{key:0,class:"h-100 w-100",imagePath:`/assets/images/products/${t.product.image3d}`,imageCount:36},null,8,["imagePath"])):e.createCommentVNode("",!0),a.value[0]&&!t.product.image3d?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-100 bg-grey w-100",style:{"object-fit":"contain"},src:(o.FILE_SERVER_URL||"")+a.value[0]},null,8,V)):e.createCommentVNode("",!0),!a.value[0]&&!t.product.image3d?(e.openBlock(),e.createBlock(h.default,{key:2,class:"h-100 w-100",style:{"object-fit":"cover"}})):e.createCommentVNode("",!0)]),a.value.length>1?(e.openBlock(),e.createBlock(k.default,{key:0,images:a.value,class:"mn-t-medium"},null,8,["images"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E,[e.createVNode(g.default,{onClick:i[0]||(i[0]=r=>o.$router.push({name:"ProductEdit",params:{_id:t.product.organization,product:t.product._id}})),class:"pos-absolute pos-t-regular pos-r-regular i-regular t-transp"}),t.recommendation?(e.openBlock(),e.createElementBlock("h2",N,e.toDisplayString(e.unref(c)("airecommend")),1)):e.createCommentVNode("",!0),e.createElementVNode("h1",w,e.toDisplayString(t.product.name),1),e.createVNode(f.default,{product:t.product,size:"big",class:"mn-b-semi"},null,8,["product"]),t.recommendation?(e.openBlock(),e.createElementBlock("h3",C,e.toDisplayString(t.recommendation),1)):e.createCommentVNode("",!0),t.product.description&&!t.product.localization<1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",S,e.toDisplayString(t.product.description),1)):e.createCommentVNode("",!0),t.product.localization&&t.product.localization.length>1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(e.unref(c)("description")),1)):e.createCommentVNode("",!0),e.createElementVNode("div",x,[t.product.information.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.product.information,r=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("p",I,e.toDisplayString(r.name),1),e.createElementVNode("p",null,e.toDisplayString(r.value),1)]))),256)):e.createCommentVNode("",!0)]),e.createElementVNode("div",D,[e.createVNode(u.default,{submit:r=>m(t.product),disabled:l(t.product),text:{success:" ✔ Added",error:"error"},class:"w-100 mn-r-small bg-main button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("addtoorder")),1)]),_:1},8,["submit","disabled"])])])]))}};exports.default=P;
@@ -1,25 +1,26 @@
1
- import { computed as y, openBlock as e, createElementBlock as r, createElementVNode as o, createBlock as l, createCommentVNode as i, createVNode as h, toDisplayString as n, unref as u, Fragment as w, renderList as k } from "vue";
2
- import x from "../blocks/Images360.vue.js";
3
- import z from "../blocks/ImagesThumbnails.vue.js";
4
- import I from "../../../icons/navigation/IconEdit.vue.js";
5
- import "../elements/THC.vue2.js";
6
- import C from "../elements/Price.vue.js";
1
+ import { computed as y, openBlock as e, createElementBlock as a, createElementVNode as r, createBlock as m, createCommentVNode as i, createVNode as l, toDisplayString as s, unref as u, Fragment as w, renderList as k, withCtx as x, createTextVNode as z } from "vue";
2
+ import I from "../../../../components/Button/Button.vue2.js";
3
+ import C from "../../../icons/navigation/IconEdit.vue.js";
7
4
  import E from "../../../icons/placeholders/PlaceholderImage.vue.js";
8
- import { useI18n as P } from "vue-i18n";
9
- import { state as g, actions as $ } from "../../../orders/store/shopcart.js";
10
- const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-column flex pos-relative" }, S = { class: "h-100 h-max-50vh bg-grey radius-big o-hidden" }, T = ["src"], V = { class: "pos-relative w-100 h-100 flex-column flex-justify flex col" }, A = {
5
+ import P from "../blocks/Images360.vue.js";
6
+ import T from "../blocks/ImagesThumbnails.vue.js";
7
+ import "../elements/THC.vue2.js";
8
+ import V from "../elements/Price.vue.js";
9
+ import { useI18n as $ } from "vue-i18n";
10
+ import { state as g, actions as j } from "../../../orders/store/shopcart.js";
11
+ const A = { class: "cols-2-1_2 w-100 gap-big" }, N = { class: "flex-nowrap flex-column flex pos-relative" }, R = { class: "h-100 h-max-50vh bg-grey radius-big o-hidden" }, S = ["src"], B = { class: "pos-relative w-100 h-100 flex-column flex-justify flex col" }, F = {
11
12
  key: 0,
12
13
  class: "t-main t-semi p-big"
13
- }, B = { class: "w-100 h1-product mn-b-thin" }, F = {
14
+ }, L = { class: "w-100 h1-product mn-b-thin" }, q = {
14
15
  key: 1,
15
16
  class: "mn-b-semi"
16
- }, L = {
17
+ }, O = {
17
18
  key: 2,
18
19
  class: "w-100 mn-b-medium t-transp"
19
- }, N = {
20
+ }, D = {
20
21
  key: 3,
21
22
  class: "w-100 mn-b-medium t-transp"
22
- }, q = { class: "cols-2 w-100 gap-small mn-b-semi" }, O = { class: "w-100 pd-small radius-small bg-grey-transp-30 product-information" }, D = { class: "t-demi" }, U = { class: "max-w-33rem mobile-w-100 t-white gap-small cols-2" }, Y = ["disabled"], _ = {
23
+ }, U = { class: "cols-2 w-100 gap-small mn-b-semi" }, Y = { class: "w-100 pd-small radius-small bg-grey-transp-30 product-information" }, G = { class: "t-demi" }, H = { class: "max-w-33rem mobile-w-100 t-white gap-small cols-2" }, ot = {
23
24
  __name: "SectionProduct",
24
25
  props: {
25
26
  product: {
@@ -31,7 +32,7 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
31
32
  }
32
33
  },
33
34
  setup(t) {
34
- const f = t, s = y(() => f.product.images), p = {
35
+ const f = t, n = y(() => f.product.images), b = {
35
36
  messages: {
36
37
  en: {
37
38
  airecommend: "AI Recommends You",
@@ -46,43 +47,43 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
46
47
  fastorder: "Быстрый заказ"
47
48
  }
48
49
  }
49
- }, { t: m } = P(p);
50
- function b(a) {
51
- return !(a.quantity > 0);
50
+ }, { t: c } = $(b);
51
+ function p(o) {
52
+ return !(o.quantity > 0);
52
53
  }
53
- function v(a) {
54
- g.organization !== a.organization && (g.positions = [], g.organization = a.organization), $.addProductToCart(a);
54
+ function v(o) {
55
+ g.organization !== o.organization && (g.positions = [], g.organization = o.organization), j.addProductToCart(o, o.organization);
55
56
  }
56
- return (a, d) => (e(), r("div", j, [
57
- o("div", R, [
58
- o("div", S, [
59
- t.product && t.product.image3d ? (e(), l(x, {
57
+ return (o, h) => (e(), a("div", A, [
58
+ r("div", N, [
59
+ r("div", R, [
60
+ t.product && t.product.image3d ? (e(), m(P, {
60
61
  key: 0,
61
62
  class: "h-100 w-100",
62
63
  imagePath: `/assets/images/products/${t.product.image3d}`,
63
64
  imageCount: 36
64
65
  }, null, 8, ["imagePath"])) : i("", !0),
65
- s.value[0] && !t.product.image3d ? (e(), r("img", {
66
+ n.value[0] && !t.product.image3d ? (e(), a("img", {
66
67
  key: 1,
67
68
  class: "h-100 bg-grey w-100",
68
69
  style: { "object-fit": "contain" },
69
- src: (a.FILE_SERVER_URL || "") + s.value[0]
70
- }, null, 8, T)) : i("", !0),
71
- !s.value[0] && !t.product.image3d ? (e(), l(E, {
70
+ src: (o.FILE_SERVER_URL || "") + n.value[0]
71
+ }, null, 8, S)) : i("", !0),
72
+ !n.value[0] && !t.product.image3d ? (e(), m(E, {
72
73
  key: 2,
73
74
  class: "h-100 w-100",
74
75
  style: { "object-fit": "cover" }
75
76
  })) : i("", !0)
76
77
  ]),
77
- s.value.length > 1 ? (e(), l(z, {
78
+ n.value.length > 1 ? (e(), m(T, {
78
79
  key: 0,
79
- images: s.value,
80
+ images: n.value,
80
81
  class: "mn-t-medium"
81
82
  }, null, 8, ["images"])) : i("", !0)
82
83
  ]),
83
- o("div", V, [
84
- h(I, {
85
- onClick: d[0] || (d[0] = (c) => a.$router.push({
84
+ r("div", B, [
85
+ l(C, {
86
+ onClick: h[0] || (h[0] = (d) => o.$router.push({
86
87
  name: "ProductEdit",
87
88
  params: {
88
89
  _id: t.product.organization,
@@ -91,33 +92,42 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
91
92
  })),
92
93
  class: "pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
93
94
  }),
94
- t.recommendation ? (e(), r("h2", A, n(u(m)("airecommend")), 1)) : i("", !0),
95
- o("h1", B, n(t.product.name), 1),
96
- h(C, {
95
+ t.recommendation ? (e(), a("h2", F, s(u(c)("airecommend")), 1)) : i("", !0),
96
+ r("h1", L, s(t.product.name), 1),
97
+ l(V, {
97
98
  product: t.product,
98
99
  size: "big",
99
100
  class: "mn-b-semi"
100
101
  }, null, 8, ["product"]),
101
- t.recommendation ? (e(), r("h3", F, n(t.recommendation), 1)) : i("", !0),
102
- t.product.description && !t.product.localization < 1 && !t.recommendation ? (e(), r("p", L, n(t.product.description), 1)) : i("", !0),
103
- t.product.localization && t.product.localization.length > 1 && !t.recommendation ? (e(), r("p", N, n(u(m)("description")), 1)) : i("", !0),
104
- o("div", q, [
105
- t.product.information.length > 0 ? (e(!0), r(w, { key: 0 }, k(t.product.information, (c) => (e(), r("div", O, [
106
- o("p", D, n(c.name), 1),
107
- o("p", null, n(c.value), 1)
102
+ t.recommendation ? (e(), a("h3", q, s(t.recommendation), 1)) : i("", !0),
103
+ t.product.description && !t.product.localization < 1 && !t.recommendation ? (e(), a("p", O, s(t.product.description), 1)) : i("", !0),
104
+ t.product.localization && t.product.localization.length > 1 && !t.recommendation ? (e(), a("p", D, s(u(c)("description")), 1)) : i("", !0),
105
+ r("div", U, [
106
+ t.product.information.length > 0 ? (e(!0), a(w, { key: 0 }, k(t.product.information, (d) => (e(), a("div", Y, [
107
+ r("p", G, s(d.name), 1),
108
+ r("p", null, s(d.value), 1)
108
109
  ]))), 256)) : i("", !0)
109
110
  ]),
110
- o("div", U, [
111
- o("button", {
112
- disabled: b(t.product),
113
- onClick: d[1] || (d[1] = (c) => v(t.product)),
111
+ r("div", H, [
112
+ l(I, {
113
+ submit: (d) => v(t.product),
114
+ disabled: p(t.product),
115
+ text: {
116
+ success: " ✔ Added",
117
+ error: "error"
118
+ },
114
119
  class: "w-100 mn-r-small bg-main button"
115
- }, n(u(m)("addtoorder")), 9, Y)
120
+ }, {
121
+ default: x(() => [
122
+ z(s(u(c)("addtoorder")), 1)
123
+ ]),
124
+ _: 1
125
+ }, 8, ["submit", "disabled"])
116
126
  ])
117
127
  ])
118
128
  ]));
119
129
  }
120
130
  };
121
131
  export {
122
- _ as default
132
+ ot as default
123
133
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),o=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),c=o.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=n.reactive({all:[],current:{recommendation:!1,category:[],status:"unpublished",information:[],images:[],files:[],image3d:!1,name:"",sale:0,price:0,localization:[],modifications:[],quantityDiscount:[],ingridients:[],description:""}}),u={async create(e,r){const a={...r,organization:e};return await c.post("/products/create",a).then(i=>(d(i.data,"current"),Promise.resolve(i.data)),i=>(s.setError(i),Promise.reject(i)))},async read(e={}){let r={};e._id&&(r._id=e._id),e.category&&(r.category=e.category),e.organization&&(r.organization=e.organization),e.count&&(r.count=e.count),e.categories&&(r.categories=e.categories),e.prices&&(r.prices=e.prices),e.delivery&&(r.delivery=e.delivery),e.status&&(r.status=e.status),r.sort="createdAt",r.skip=e.skip||0,r.limit=e.limit||10,console.log(r);try{const a=await c.get("/products/read",{params:r});return e._id?(t.current={...a.data[0]},Promise.resolve(a.data[0])):Promise.resolve(a.data)}catch(a){return s.setError(a),Promise.reject(a)}},async update(e,r){return await c.post("/products/"+e,r).then(a=>Promise.resolve(a.data),a=>(s.setError(a),Promise.reject(a)))},async deleteProduct(e){return await c.delete("/products/"+e).then(r=>Promise.resolve(r.data),r=>(s.setError(r),Promise.reject(r)))},async submitMood(e=null){return console.log(e),c.post("/product/recommended",{mood:e}).then(r=>(t.current=r.data.product,t.current.recommendation=r.data.recommendationText,Promise.resolve(r.data)),r=>(console.log(r),s.setError(r),Promise.reject(r)))},async fetchProducts(){return await c.get("/products/read").then(e=>(t.all=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPopular(){return await c.get("/products/popular").then(e=>(t.popular=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPublished(){return await c.get("/products").then(e=>{let r=e.data.filter(function(a,i){return a.status!=="unpublished"});return t.all=r,t.filtered=r.slice(),t.filteredPrice=t.filtered,t.filteredPrice.sort(function(a,i){return a[t.sort.current]>i[t.sort.current]?t.sort.ascending?1:-1:a[t.sort.current]<i[t.sort.current]?t.sort.ascending?-1:1:0}),Promise.resolve(e.data)},e=>(s.setError(e),Promise.reject(e)))},async fetchProduct(e){try{const r=await c.get("/products/"+e);return console.log(r),t.current=r.data[0],Promise.resolve(r.data[0])}catch(r){return s.setError(r),Promise.reject(r)}},async fetchProductPopular(){return await c.get("/products").then(e=>(t.all=e.data.slice(1,5),Promise.resolve(e.data.slice(1,5))),e=>(s.setError(e),Promise.reject(e)))}};function d(e,r){t[r]=e}n.watch(t,(e,r)=>{});exports.actions=u;exports.state=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),o=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),i=o.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=n.reactive({all:[],current:{recommendation:!1,category:[],status:"unpublished",information:[],images:[],files:[],image3d:!1,name:"",sale:0,price:0,localization:[],modifications:[],quantityDiscount:[],ingridients:[],description:""}}),u={async create(e,r){const a={...r,organization:e};return await i.post("/api/products/create",a).then(c=>(d(c.data,"current"),Promise.resolve(c.data)),c=>(s.setError(c),Promise.reject(c)))},async read(e={}){let r={};e._id&&(r._id=e._id),e.category&&(r.category=e.category),e.organization&&(r.organization=e.organization),e.count&&(r.count=e.count),e.categories&&(r.categories=e.categories),e.prices&&(r.prices=e.prices),e.delivery&&(r.delivery=e.delivery),e.status&&(r.status=e.status),r.sort="createdAt",r.skip=e.skip||0,r.limit=e.limit||10,console.log(r);try{const a=await i.get("/api/products/read",{params:r});return e._id?(t.current={...a.data[0]},Promise.resolve(a.data[0])):Promise.resolve(a.data)}catch(a){return s.setError(a),Promise.reject(a)}},async update(e,r){return await i.post("/api/products/"+e,r).then(a=>Promise.resolve(a.data),a=>(s.setError(a),Promise.reject(a)))},async deleteProduct(e){return await i.delete("/api/products/"+e).then(r=>Promise.resolve(r.data),r=>(s.setError(r),Promise.reject(r)))},async submitMood(e=null){return console.log(e),i.post("/api/product/recommended",{mood:e}).then(r=>(t.current=r.data.product,t.current.recommendation=r.data.recommendationText,Promise.resolve(r.data)),r=>(console.log(r),s.setError(r),Promise.reject(r)))},async fetchProducts(){return await i.get("/api/products/read").then(e=>(t.all=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPopular(){return await i.get("/api/products/popular").then(e=>(t.popular=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPublished(){return await i.get("/api/products").then(e=>{let r=e.data.filter(function(a,c){return a.status!=="unpublished"});return t.all=r,t.filtered=r.slice(),t.filteredPrice=t.filtered,t.filteredPrice.sort(function(a,c){return a[t.sort.current]>c[t.sort.current]?t.sort.ascending?1:-1:a[t.sort.current]<c[t.sort.current]?t.sort.ascending?-1:1:0}),Promise.resolve(e.data)},e=>(s.setError(e),Promise.reject(e)))},async fetchProduct(e){try{const r=await i.get("/api/products/"+e);return console.log(r),t.current=r.data[0],Promise.resolve(r.data[0])}catch(r){return s.setError(r),Promise.reject(r)}},async fetchProductPopular(){return await i.get("/api/products").then(e=>(t.all=e.data.slice(1,5),Promise.resolve(e.data.slice(1,5))),e=>(s.setError(e),Promise.reject(e)))}};function d(e,r){t[r]=e}n.watch(t,(e,r)=>{});exports.actions=u;exports.state=t;