@ozdao/prometheus-framework 0.1.76 → 0.1.77

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +44 -2
  3. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +2 -44
  5. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
  7. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
  9. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
  11. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
  13. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +86 -89
  15. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -4
  20. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +2 -61
  21. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +4 -1
  22. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +61 -2
  23. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/package.json +1 -1
  53. package/src/modules/auth/components/pages/SignIn.vue +11 -16
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Tab.vue2.cjs");const b={class:""},m={class:"flex-nowrap flex-v-center flex"},v=["onClick"],p={__name:"Tab",props:{tabs:Array,selected:String,callback:Function},emits:["update:selected"],setup(s,{emit:o}){const l=s,n=e.ref(0);if(l.selected){const t=l.tabs.findIndex(c=>c.value===l.selected);t!==-1&&(n.value=t)}function i(t,c){n.value=t,o("update:selected",c.value),l.callback&&l.callback()}function u(t){return`${100/l.tabs.length*t}%`}function d(){return`${100/l.tabs.length}%`}const f=e.computed(()=>({left:u(n.value),width:d()}));return(t,c)=>(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tabs,(r,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,onClick:k=>i(a,r),class:e.normalizeClass([{"t-transp":a!==n.value},"z-index-1 t-center pd-small w-100"])},[e.createElementVNode("label",null,e.toDisplayString(r.name),1)],10,v))),128)),e.createElementVNode("div",{style:e.normalizeStyle(e.unref(f)),class:"radius-extra bg-main t-white tab-selector"},null,4)])]))}};exports.default=p;
@@ -1,4 +1,46 @@
1
- const e = "";
1
+ import { ref as p, computed as v, openBlock as c, createElementBlock as s, createElementVNode as r, Fragment as h, renderList as _, normalizeClass as g, toDisplayString as k, normalizeStyle as x, unref as y } from "vue";
2
+ import "./Tab.vue2.js";
3
+ const S = { class: "" }, T = { class: "flex-nowrap flex-v-center flex" }, w = ["onClick"], W = {
4
+ __name: "Tab",
5
+ props: {
6
+ tabs: Array,
7
+ selected: String,
8
+ callback: Function
9
+ },
10
+ emits: ["update:selected"],
11
+ setup(o, { emit: d }) {
12
+ const t = o, a = p(0);
13
+ if (t.selected) {
14
+ const e = t.tabs.findIndex((l) => l.value === t.selected);
15
+ e !== -1 && (a.value = e);
16
+ }
17
+ function u(e, l) {
18
+ a.value = e, d("update:selected", l.value), t.callback && t.callback();
19
+ }
20
+ function f(e) {
21
+ return `${100 / t.tabs.length * e}%`;
22
+ }
23
+ function b() {
24
+ return `${100 / t.tabs.length}%`;
25
+ }
26
+ const m = v(() => ({ left: f(a.value), width: b() }));
27
+ return (e, l) => (c(), s("div", S, [
28
+ r("div", T, [
29
+ (c(!0), s(h, null, _(o.tabs, (i, n) => (c(), s("div", {
30
+ key: n,
31
+ onClick: (z) => u(n, i),
32
+ class: g([{ "t-transp": n !== a.value }, "z-index-1 t-center pd-small w-100"])
33
+ }, [
34
+ r("label", null, k(i.name), 1)
35
+ ], 10, w))), 128)),
36
+ r("div", {
37
+ style: x(y(m)),
38
+ class: "radius-extra bg-main t-white tab-selector"
39
+ }, null, 4)
40
+ ])
41
+ ]));
42
+ }
43
+ };
2
44
  export {
3
- e as default
45
+ W as default
4
46
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Tab.vue.cjs");const b={class:""},m={class:"flex-nowrap flex-v-center flex"},v=["onClick"],p={__name:"Tab",props:{tabs:Array,selected:String,callback:Function},emits:["update:selected"],setup(s,{emit:o}){const l=s,n=e.ref(0);if(l.selected){const t=l.tabs.findIndex(c=>c.value===l.selected);t!==-1&&(n.value=t)}function i(t,c){n.value=t,o("update:selected",c.value),l.callback&&l.callback()}function u(t){return`${100/l.tabs.length*t}%`}function d(){return`${100/l.tabs.length}%`}const f=e.computed(()=>({left:u(n.value),width:d()}));return(t,c)=>(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tabs,(r,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,onClick:k=>i(a,r),class:e.normalizeClass([{"t-transp":a!==n.value},"z-index-1 t-center pd-small w-100"])},[e.createElementVNode("label",null,e.toDisplayString(r.name),1)],10,v))),128)),e.createElementVNode("div",{style:e.normalizeStyle(e.unref(f)),class:"radius-extra bg-main t-white tab-selector"},null,4)])]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,46 +1,4 @@
1
- import { ref as p, computed as v, openBlock as c, createElementBlock as s, createElementVNode as r, Fragment as h, renderList as _, normalizeClass as g, toDisplayString as k, normalizeStyle as x, unref as y } from "vue";
2
- import "./Tab.vue.js";
3
- const S = { class: "" }, T = { class: "flex-nowrap flex-v-center flex" }, w = ["onClick"], W = {
4
- __name: "Tab",
5
- props: {
6
- tabs: Array,
7
- selected: String,
8
- callback: Function
9
- },
10
- emits: ["update:selected"],
11
- setup(o, { emit: d }) {
12
- const t = o, a = p(0);
13
- if (t.selected) {
14
- const e = t.tabs.findIndex((l) => l.value === t.selected);
15
- e !== -1 && (a.value = e);
16
- }
17
- function u(e, l) {
18
- a.value = e, d("update:selected", l.value), t.callback && t.callback();
19
- }
20
- function f(e) {
21
- return `${100 / t.tabs.length * e}%`;
22
- }
23
- function b() {
24
- return `${100 / t.tabs.length}%`;
25
- }
26
- const m = v(() => ({ left: f(a.value), width: b() }));
27
- return (e, l) => (c(), s("div", S, [
28
- r("div", T, [
29
- (c(!0), s(h, null, _(o.tabs, (i, n) => (c(), s("div", {
30
- key: n,
31
- onClick: (z) => u(n, i),
32
- class: g([{ "t-transp": n !== a.value }, "z-index-1 t-center pd-small w-100"])
33
- }, [
34
- r("label", null, k(i.name), 1)
35
- ], 10, w))), 128)),
36
- r("div", {
37
- style: x(y(m)),
38
- class: "radius-extra bg-main t-white tab-selector"
39
- }, null, 4)
40
- ])
41
- ]));
42
- }
43
- };
1
+ const e = "";
44
2
  export {
45
- W as default
3
+ e as default
46
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../../../node_modules/vue3-carousel/dist/carousel.css.cjs");require("vue-i18n");require("../../../../../../node_modules/vue3-carousel/dist/carousel.es.cjs");require("../sections/SliderFeatures.vue2.cjs");const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const u={class:"cols-2-1_2 gap-small pd-small bg-white"},n=e.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),s={__name:"Auth",setup(a){return e.ref(null),e.ref(null),e.ref(null),r.useRoute(),r.useRouter(),e.ref("email"),(o,c)=>{const t=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",u,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey radius-big w-m-66r t-center"},{default:e.withCtx(({Component:i,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{ref:"page",key:l.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),n])}}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../../../node_modules/vue3-carousel/dist/carousel.css.cjs");require("vue-i18n");require("../../../../../../node_modules/vue3-carousel/dist/carousel.es.cjs");require("../sections/SliderFeatures.vue2.cjs");const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const u={class:"cols-2-1_2 gap-small pd-small bg-white"},n=e.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),s={__name:"Auth",setup(a){return e.ref(null),e.ref(null),e.ref(null),r.useRoute(),r.useRouter(),e.ref("email"),(o,c)=>{const t=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",u,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey radius-big w-m-66r t-center"},{default:e.withCtx(({Component:i,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{ref:"page",key:l.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),n])}}};exports.default=s;
@@ -1,5 +1,5 @@
1
1
  import { ref as e, resolveComponent as a, openBlock as o, createElementBlock as m, createVNode as t, withCtx as r, Transition as c, createBlock as p, resolveDynamicComponent as u, createElementVNode as d } from "vue";
2
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import "../../../../components/Field/Field.vue.js";
4
4
  import "../../../../components/Button/Button.vue.js";
5
5
  import "../../../../../../node_modules/vue3-carousel/dist/carousel.css.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),h=require("../../../../components/Button/Button.vue2.cjs"),i=require("vue-router"),y=require("vue-i18n"),t=require("../../store/auth.cjs"),u=require("../../../middlewares/client/inputs.validation.cjs");require("./EnterPassword.vue2.cjs");const d=require("./EnterPassword.vue3.cjs"),w={class:"t-left pd-medium"},g={class:"mn-small"},k={key:0,class:"mn-semi t-transp"},q={key:1,class:"mn-semi t-transp"},B={class:"mn-semi radius-small o-hidden"},v={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},b={key:1},c={__name:"EnterPassword",setup(S){const n=e.ref(null),{t:s}=y.useI18n({inheritLocale:!0,useScope:"local"}),r=i.useRoute(),p=i.useRouter();e.ref("phone");async function m(){try{await u.validateInputs(n,u.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function f(){p.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(_,o)=>(e.openBlock(),e.createElementBlock("section",w,[e.createElementVNode("h3",g,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",k,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",B,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",v,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(h.default,{submit:m,callback:f,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};typeof d.default=="function"&&d.default(c);exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),h=require("../../../../components/Button/Button.vue2.cjs"),i=require("vue-router"),y=require("vue-i18n"),t=require("../../store/auth.cjs"),u=require("../../../middlewares/client/inputs.validation.cjs");require("./EnterPassword.vue2.cjs");const d=require("./EnterPassword.vue3.cjs"),w={class:"t-left pd-medium"},g={class:"mn-small"},k={key:0,class:"mn-semi t-transp"},q={key:1,class:"mn-semi t-transp"},B={class:"mn-semi radius-small o-hidden"},v={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},b={key:1},c={__name:"EnterPassword",setup(S){const n=e.ref(null),{t:s}=y.useI18n({inheritLocale:!0,useScope:"local"}),r=i.useRoute(),p=i.useRouter();e.ref("phone");async function m(){try{await u.validateInputs(n,u.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function f(){p.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(_,o)=>(e.openBlock(),e.createElementBlock("section",w,[e.createElementVNode("h3",g,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",k,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",B,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",v,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(h.default,{submit:m,callback:f,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};typeof d.default=="function"&&d.default(c);exports.default=c;
@@ -1,5 +1,5 @@
1
1
  import { ref as u, openBlock as o, createElementBlock as a, createElementVNode as p, toDisplayString as n, unref as e, createVNode as l, createTextVNode as P, createCommentVNode as k, withCtx as b } from "vue";
2
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import c from "../../../../components/Field/Field.vue2.js";
4
4
  import q from "../../../../components/Button/Button.vue2.js";
5
5
  import { useRoute as v, useRouter as E } from "vue-router";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
@@ -1,5 +1,5 @@
1
1
  import { ref as w, withAsyncContext as h, openBlock as o, createElementBlock as r, createElementVNode as n, createVNode as i, withCtx as y, unref as b } from "vue";
2
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import p from "../../../../components/Field/Field.vue2.js";
4
4
  import v from "../../../../components/Button/Button.vue2.js";
5
5
  import { useRoute as k, useRouter as g } from "vue-router";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),_=require("../../../../components/Field/Field.vue2.cjs"),w=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),g=require("vue-i18n"),l=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const c=require("./ResetPassword.vue3.cjs"),y={class:"t-left pd-medium"},N={class:"mn-small"},b={class:"mn-small t-transp"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},E={key:0,class:"mn-semi radius-small o-hidden"},S={class:"mn-small t-transp"},k={key:0,class:"mn-semi radius-small o-hidden"},C={class:"mn-small t-transp"},m={__name:"ResetPassword",setup(P){const{t}=g.useI18n({inheritLocale:!0,useScope:"local"}),i=e.ref(null),u=e.ref(null);d.useRoute();const p=d.useRouter(),a=e.ref("phone");async function f(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(u,n.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await l.actions.resetPassword(l.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function h(){p.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",N,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",b,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",q,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":o[0]||(o[0]=s=>a.value=s),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",null,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(w.default,{modelValue:l.state.user.phone,"onUpdate:modelValue":o[1]||(o[1]=s=>l.state.user.phone=s),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(_.default,{field:l.state.user.email,"onUpdate:field":o[2]||(o[2]=s=>l.state.user.email=s),placeholder:e.unref(t)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(V.default,{submit:f,callback:h,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};typeof c.default=="function"&&c.default(m);exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue.cjs"),_=require("../../../../components/Field/Field.vue2.cjs"),w=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),g=require("vue-i18n"),l=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const c=require("./ResetPassword.vue3.cjs"),y={class:"t-left pd-medium"},N={class:"mn-small"},b={class:"mn-small t-transp"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},E={key:0,class:"mn-semi radius-small o-hidden"},S={class:"mn-small t-transp"},k={key:0,class:"mn-semi radius-small o-hidden"},C={class:"mn-small t-transp"},m={__name:"ResetPassword",setup(P){const{t}=g.useI18n({inheritLocale:!0,useScope:"local"}),i=e.ref(null),u=e.ref(null);d.useRoute();const p=d.useRouter(),a=e.ref("phone");async function f(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(u,n.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await l.actions.resetPassword(l.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function h(){p.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",N,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",b,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",q,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":o[0]||(o[0]=s=>a.value=s),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",null,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(w.default,{modelValue:l.state.user.phone,"onUpdate:modelValue":o[1]||(o[1]=s=>l.state.user.phone=s),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(_.default,{field:l.state.user.email,"onUpdate:field":o[2]||(o[2]=s=>l.state.user.email=s),placeholder:e.unref(t)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(V.default,{submit:f,callback:h,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};typeof c.default=="function"&&c.default(m);exports.default=m;
@@ -1,5 +1,5 @@
1
1
  import { ref as m, openBlock as u, createElementBlock as p, createElementVNode as s, toDisplayString as r, unref as o, createVNode as i, Transition as _, withCtx as c, createCommentVNode as v, createTextVNode as P } from "vue";
2
- import k from "../../../../components/Tab/Tab.vue2.js";
2
+ import k from "../../../../components/Tab/Tab.vue.js";
3
3
  import C from "../../../../components/Field/Field.vue2.js";
4
4
  import E from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
5
  import I from "../../../../components/Button/Button.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue2.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),N=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs"),p=require("vue-router"),E=require("vue-i18n"),a=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const m=require("./SignIn.vue3.cjs"),y={class:""},S={class:"mn-medium"},x=e.createElementVNode("br",null,null,-1),P={class:"t-semi"},q={class:"mn-big"},C={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},D={class:""},I={class:"mn-thin radius-small"},T={class:"mn-thin radius-small o-hidden"},U={class:"w-100 mn-big"},h={__name:"SignIn",setup(j){const{t:n}=E.useI18n({inheritLocale:!0,useScope:"local"}),d=e.ref(null),f=e.ref(null),u=e.ref(null);p.useRoute();const _=p.useRouter(),l=e.ref("phone");e.inject("APPLE_CLIENTID"),e.inject("APPLE_REDIRECT_URL");const v=r=>new Promise((s,o)=>{const t=document.createElement("script");t.type="text/javascript",t.src=r,t.onload=s,t.onerror=o,document.head.appendChild(t)});e.onMounted(async()=>{await v("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function w(){try{l.value==="phone"&&await i.validateInputs(d,i.validatePhone,a.state.user.phone,"Некорректный телефон"),l.value==="email"&&await i.validateInputs(u,i.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}a.state.user.phone=a.state.user.phone.number,await a.actions.login(a.state.user,l.value)}function V(){_.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(r,s)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",S,[e.createTextVNode(e.toDisplayString(e.unref(n)("title"))+" ",1),x,e.createElementVNode("span",P,e.toDisplayString(e.unref(n)("subtitle")),1)]),e.createElementVNode("p",q,[e.createVNode(o,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("signup")),1)]),_:1})]),e.createElementVNode("div",C,[e.createVNode(g.default,{selected:l.value,"onUpdate:selected":s[0]||(s[0]=t=>l.value=t),tabs:[{name:e.unref(n)("phone"),value:"phone"},{name:e.unref(n)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",D,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(N.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(n)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,l.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(n)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,l.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:f.value,placeholder:e.unref(n)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",U,[e.createVNode(o,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("forgotPassword")),1)]),_:1})]),e.createVNode(b.default,{submit:w,callback:V,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("signin")),1)]),_:1})])}}};typeof m.default=="function"&&m.default(h);exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("../../../../components/Tab/Tab.vue.cjs"),u=require("../../../../components/Field/Field.vue2.cjs"),g=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),N=require("../../../../components/Button/Button.vue2.cjs"),c=require("vue-router");require("vue-i18n");const l=require("../../store/auth.cjs"),n=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const p=require("./SignIn.vue3.cjs"),b={class:""},E={class:"mn-medium"},y=e.createElementVNode("br",null,null,-1),S={class:"t-semi"},P={class:"mn-big"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},C={class:""},D={class:"mn-thin radius-small"},T={class:"mn-thin radius-small o-hidden"},$={class:"w-100 mn-big"},m={__name:"SignIn",setup(I){const r=e.ref(null),h=e.ref(null),d=e.ref(null);c.useRoute();const v=c.useRouter(),o=e.ref("phone");e.inject("APPLE_CLIENTID"),e.inject("APPLE_REDIRECT_URL");const f=t=>new Promise((s,i)=>{const a=document.createElement("script");a.type="text/javascript",a.src=t,a.onload=s,a.onerror=i,document.head.appendChild(a)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function _(){try{o.value==="phone"&&await n.validateInputs(r,n.validatePhone,l.state.user.phone,"Некорректный телефон"),o.value==="email"&&await n.validateInputs(d,n.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}l.state.user.phone=l.state.user.phone.number,await l.actions.login(l.state.user,o.value)}function w(){v.push({name:"User Profile",params:{_id:l.state.user._id},query:{afterAuth:"true"}})}return(t,s)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(t.$t("title"))+" ",1),y,e.createElementVNode("span",S,e.toDisplayString(t.$t("subtitle")),1)]),e.createElementVNode("p",P,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("signup")),1)]),_:1})]),e.createElementVNode("div",q,[e.createVNode(V.default,{selected:o.value,"onUpdate:selected":s[0]||(s[0]=a=>o.value=a),tabs:[{name:t.$t("phone"),value:"phone"},{name:t.$t("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",C,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createVNode(g.default,{modelValue:l.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=a=>l.state.user.phone=a),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:r.value,mode:"national",inputOptions:{placeholder:t.$t("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,o.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(u.default,{field:l.state.user.email,"onUpdate:field":s[2]||(s[2]=a=>l.state.user.email=a),placeholder:t.$t("emailPlaceholder"),validation:d.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,o.value==="email"]])]),_:1})]),e.createVNode(u.default,{field:l.state.user.password,"onUpdate:field":s[3]||(s[3]=a=>l.state.user.password=a),type:"password",validation:h.value,placeholder:t.$t("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",$,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("forgotPassword")),1)]),_:1})]),e.createVNode(N.default,{submit:_,callback:w,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$t("signin")),1)]),_:1})])}}};typeof p.default=="function"&&p.default(m);exports.default=m;
@@ -1,153 +1,150 @@
1
- import { ref as p, inject as _, onMounted as k, resolveComponent as C, openBlock as x, createElementBlock as D, createElementVNode as i, createTextVNode as m, toDisplayString as r, unref as l, createVNode as s, withCtx as d, Transition as v, withDirectives as w, vShow as b } from "vue";
2
- import L from "../../../../components/Tab/Tab.vue2.js";
3
- import g from "../../../../components/Field/Field.vue2.js";
4
- import R from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import T from "../../../../components/Button/Button.vue2.js";
6
- import { useRoute as j, useRouter as A } from "vue-router";
7
- import { useI18n as N } from "vue-i18n";
8
- import { state as t, actions as F } from "../../store/auth.js";
9
- import { validateInputs as y, validatePhone as O, validateEmail as B } from "../../../middlewares/client/inputs.validation.js";
1
+ import { ref as u, inject as h, onMounted as S, resolveComponent as U, openBlock as k, createElementBlock as C, createElementVNode as s, createTextVNode as p, toDisplayString as n, createVNode as l, withCtx as r, Transition as f, withDirectives as v, vShow as _ } from "vue";
2
+ import I from "../../../../components/Tab/Tab.vue.js";
3
+ import w from "../../../../components/Field/Field.vue2.js";
4
+ import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
+ import L from "../../../../components/Button/Button.vue2.js";
6
+ import { useRoute as R, useRouter as T } from "vue-router";
7
+ import "vue-i18n";
8
+ import { state as a, actions as j } from "../../store/auth.js";
9
+ import { validateInputs as b, validatePhone as A, validateEmail as N } from "../../../middlewares/client/inputs.validation.js";
10
10
  import "./SignIn.vue2.js";
11
- import P from "./SignIn.vue3.js";
12
- const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br", null, null, -1), z = { class: "t-semi" }, G = { class: "mn-big" }, H = { class: "mn-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, J = { class: "" }, K = { class: "mn-thin radius-small" }, Q = { class: "mn-thin radius-small o-hidden" }, W = { class: "w-100 mn-big" }, X = {
11
+ import g from "./SignIn.vue3.js";
12
+ const F = { class: "" }, O = { class: "mn-medium" }, B = /* @__PURE__ */ s("br", null, null, -1), q = { class: "t-semi" }, M = { class: "mn-big" }, z = { class: "mn-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, G = { class: "" }, H = { class: "mn-thin radius-small" }, J = { class: "mn-thin radius-small o-hidden" }, K = { class: "w-100 mn-big" }, Q = {
13
13
  __name: "SignIn",
14
- setup(Y) {
15
- const { t: o } = N({
16
- inheritLocale: !0,
17
- useScope: "local"
18
- }), h = p(null), E = p(null), f = p(null);
19
- j();
20
- const S = A(), n = p("phone");
21
- _("APPLE_CLIENTID"), _("APPLE_REDIRECT_URL");
22
- const V = (c) => new Promise((a, u) => {
23
- const e = document.createElement("script");
24
- e.type = "text/javascript", e.src = c, e.onload = a, e.onerror = u, document.head.appendChild(e);
14
+ setup(W) {
15
+ const m = u(null), y = u(null), c = u(null);
16
+ R();
17
+ const P = T(), i = u("phone");
18
+ h("APPLE_CLIENTID"), h("APPLE_REDIRECT_URL");
19
+ const $ = (e) => new Promise((o, d) => {
20
+ const t = document.createElement("script");
21
+ t.type = "text/javascript", t.src = e, t.onload = o, t.onerror = d, document.head.appendChild(t);
25
22
  });
26
- k(async () => {
27
- await V("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
23
+ S(async () => {
24
+ await $("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
28
25
  });
29
- async function I() {
26
+ async function E() {
30
27
  try {
31
- n.value === "phone" && await y(
32
- h,
33
- O,
34
- t.user.phone,
28
+ i.value === "phone" && await b(
29
+ m,
30
+ A,
31
+ a.user.phone,
35
32
  "Некорректный телефон"
36
- ), n.value === "email" && await y(
37
- f,
38
- B,
39
- t.user.email,
33
+ ), i.value === "email" && await b(
34
+ c,
35
+ N,
36
+ a.user.email,
40
37
  "Некорректный email"
41
38
  );
42
39
  } catch {
43
40
  throw new Error();
44
41
  }
45
- t.user.phone = t.user.phone.number, await F.login(t.user, n.value);
42
+ a.user.phone = a.user.phone.number, await j.login(a.user, i.value);
46
43
  }
47
- function U() {
48
- S.push({
44
+ function V() {
45
+ P.push({
49
46
  name: "User Profile",
50
47
  params: {
51
- _id: t.user._id
48
+ _id: a.user._id
52
49
  },
53
50
  query: { afterAuth: "true" }
54
51
  });
55
52
  }
56
- return (c, a) => {
57
- const u = C("router-link");
58
- return x(), D("section", $, [
59
- i("h3", q, [
60
- m(r(l(o)("title")) + " ", 1),
61
- M,
62
- i("span", z, r(l(o)("subtitle")), 1)
53
+ return (e, o) => {
54
+ const d = U("router-link");
55
+ return k(), C("section", F, [
56
+ s("h3", O, [
57
+ p(n(e.$t("title")) + " ", 1),
58
+ B,
59
+ s("span", q, n(e.$t("subtitle")), 1)
63
60
  ]),
64
- i("p", G, [
65
- s(u, {
61
+ s("p", M, [
62
+ l(d, {
66
63
  to: { name: "Sign Up" },
67
64
  class: "underline t-second"
68
65
  }, {
69
- default: d(() => [
70
- m(r(l(o)("signup")), 1)
66
+ default: r(() => [
67
+ p(n(e.$t("signup")), 1)
71
68
  ]),
72
69
  _: 1
73
70
  })
74
71
  ]),
75
- i("div", H, [
76
- s(L, {
77
- selected: n.value,
78
- "onUpdate:selected": a[0] || (a[0] = (e) => n.value = e),
72
+ s("div", z, [
73
+ l(I, {
74
+ selected: i.value,
75
+ "onUpdate:selected": o[0] || (o[0] = (t) => i.value = t),
79
76
  tabs: [
80
- { name: l(o)("phone"), value: "phone" },
81
- { name: l(o)("email"), value: "email" }
77
+ { name: e.$t("phone"), value: "phone" },
78
+ { name: e.$t("email"), value: "email" }
82
79
  ]
83
80
  }, null, 8, ["selected", "tabs"])
84
81
  ]),
85
- i("div", J, [
86
- s(v, { name: "slide-fade" }, {
87
- default: d(() => [
88
- w(i("div", K, [
89
- s(R, {
90
- modelValue: t.user.phone,
91
- "onUpdate:modelValue": a[1] || (a[1] = (e) => t.user.phone = e),
82
+ s("div", G, [
83
+ l(f, { name: "slide-fade" }, {
84
+ default: r(() => [
85
+ v(s("div", H, [
86
+ l(D, {
87
+ modelValue: a.user.phone,
88
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => a.user.phone = t),
92
89
  dropdownOptions: {
93
90
  showDialCodeInSelection: !0,
94
91
  showFlags: !0,
95
92
  showDialCodeInList: !0
96
93
  },
97
- validation: h.value,
94
+ validation: m.value,
98
95
  mode: "national",
99
- inputOptions: { placeholder: l(o)("phonePlaceholder") },
96
+ inputOptions: { placeholder: e.$t("phonePlaceholder") },
100
97
  class: "bg-grey pd-small radius-small mn-thin"
101
98
  }, null, 8, ["modelValue", "validation", "inputOptions"])
102
99
  ], 512), [
103
- [b, n.value === "phone"]
100
+ [_, i.value === "phone"]
104
101
  ])
105
102
  ]),
106
103
  _: 1
107
104
  }),
108
- s(v, { name: "slide-fade" }, {
109
- default: d(() => [
110
- w(i("div", Q, [
111
- s(g, {
112
- field: t.user.email,
113
- "onUpdate:field": a[2] || (a[2] = (e) => t.user.email = e),
114
- placeholder: l(o)("emailPlaceholder"),
115
- validation: f.value,
105
+ l(f, { name: "slide-fade" }, {
106
+ default: r(() => [
107
+ v(s("div", J, [
108
+ l(w, {
109
+ field: a.user.email,
110
+ "onUpdate:field": o[2] || (o[2] = (t) => a.user.email = t),
111
+ placeholder: e.$t("emailPlaceholder"),
112
+ validation: c.value,
116
113
  class: "bg-grey pd-medium radius-small"
117
114
  }, null, 8, ["field", "placeholder", "validation"])
118
115
  ], 512), [
119
- [b, n.value === "email"]
116
+ [_, i.value === "email"]
120
117
  ])
121
118
  ]),
122
119
  _: 1
123
120
  })
124
121
  ]),
125
- s(g, {
126
- field: t.user.password,
127
- "onUpdate:field": a[3] || (a[3] = (e) => t.user.password = e),
122
+ l(w, {
123
+ field: a.user.password,
124
+ "onUpdate:field": o[3] || (o[3] = (t) => a.user.password = t),
128
125
  type: "password",
129
- validation: E.value,
130
- placeholder: l(o)("passwordPlaceholder"),
126
+ validation: y.value,
127
+ placeholder: e.$t("passwordPlaceholder"),
131
128
  class: "bg-grey pd-medium radius-small mn-semi"
132
129
  }, null, 8, ["field", "validation", "placeholder"]),
133
- i("div", W, [
134
- s(u, {
130
+ s("div", K, [
131
+ l(d, {
135
132
  to: "/auth/reset-password",
136
133
  class: "underline d-block t-blue"
137
134
  }, {
138
- default: d(() => [
139
- m(r(l(o)("forgotPassword")), 1)
135
+ default: r(() => [
136
+ p(n(e.$t("forgotPassword")), 1)
140
137
  ]),
141
138
  _: 1
142
139
  })
143
140
  ]),
144
- s(T, {
145
- submit: I,
146
- callback: U,
141
+ l(L, {
142
+ submit: E,
143
+ callback: V,
147
144
  class: "mn-thin"
148
145
  }, {
149
- default: d(() => [
150
- m(r(l(o)("signin")), 1)
146
+ default: r(() => [
147
+ p(n(e.$t("signin")), 1)
151
148
  ]),
152
149
  _: 1
153
150
  })
@@ -155,7 +152,7 @@ const $ = { class: "" }, q = { class: "mn-medium" }, M = /* @__PURE__ */ i("br",
155
152
  };
156
153
  }
157
154
  };
158
- typeof P == "function" && P(X);
155
+ typeof g == "function" && g(Q);
159
156
  export {
160
- X as default
157
+ Q as default
161
158
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),V=require("../../../../components/Field/Field.vue2.cjs"),g=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),N=require("vue-i18n"),n=require("../../store/auth.cjs"),b=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const c=require("./SignUp.vue3.cjs"),y={class:"t-left pd-medium"},S={class:"mn-small"},E={class:"mn-small t-transp"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},C={class:""},D={class:"mn-semi radius-small"},x={class:"mn-small t-transp"},T={class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},I={class:"w-100"},m={__name:"SignUp",setup(P){const{t}=N.useI18n({inheritLocale:!0,useScope:"local"}),i=e.ref(null),r=e.ref(null);d.useRoute();const p=d.useRouter(),a=e.ref("phone");async function h(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await b.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function f(){p.push({name:"Enter Code"})}return(u,l)=>{const _=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",E,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",q,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",C,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(g.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(V.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(w.default,{submit:h,callback:f,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",I,[e.createVNode(_,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};typeof c.default=="function"&&c.default(m);exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue.cjs"),V=require("../../../../components/Field/Field.vue2.cjs"),g=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),N=require("vue-i18n"),n=require("../../store/auth.cjs"),b=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const c=require("./SignUp.vue3.cjs"),y={class:"t-left pd-medium"},S={class:"mn-small"},E={class:"mn-small t-transp"},q={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},C={class:""},D={class:"mn-semi radius-small"},x={class:"mn-small t-transp"},T={class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},I={class:"w-100"},m={__name:"SignUp",setup(P){const{t}=N.useI18n({inheritLocale:!0,useScope:"local"}),i=e.ref(null),r=e.ref(null);d.useRoute();const p=d.useRouter(),a=e.ref("phone");async function h(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await b.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function f(){p.push({name:"Enter Code"})}return(u,l)=>{const _=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",E,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",q,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",C,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(g.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(V.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(w.default,{submit:h,callback:f,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",I,[e.createVNode(_,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};typeof c.default=="function"&&c.default(m);exports.default=m;
@@ -1,5 +1,5 @@
1
1
  import { ref as d, resolveComponent as C, openBlock as E, createElementBlock as S, createElementVNode as o, toDisplayString as n, unref as t, createVNode as a, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
2
- import N from "../../../../components/Tab/Tab.vue2.js";
2
+ import N from "../../../../components/Tab/Tab.vue.js";
3
3
  import x from "../../../../components/Field/Field.vue2.js";
4
4
  import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
5
  import I from "../../../../components/Button/Button.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue2.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
@@ -1,5 +1,5 @@
1
1
  import { ref as r, onMounted as V, computed as _, openBlock as u, createElementBlock as i, unref as a, createElementVNode as p, createVNode as n, createCommentVNode as m, withCtx as w, createTextVNode as z } from "vue";
2
- import D from "../../../constructor/components/elements/Textarea.vue.js";
2
+ import D from "../../../constructor/components/elements/Textarea.vue2.js";
3
3
  import N from "../../../constructor/components/sections/Constructor.vue.js";
4
4
  import O from "../../../../components/Popup/Popup.vue2.js";
5
5
  import "../../../../components/FieldTags/tag-input.vue.js";
@@ -1,4 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue2.cjs");const f=["placeholder"],k={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:c}){const t=l;e.ref(t);const o=e.ref(null);e.ref(0);function d(a){let n=a.target.value.split(/\n+/);if(n.length>1){t.prop[t.content]=n[0],e.nextTick(()=>{r()});let u=n.slice(1).map(p=>({__name:"Textarea",content:p}));c("addBlock","Textarea","",t.index,{blocks:u,ref:o})}else a.target.value.trim()===""&&a.target.value.includes(`
2
-
3
- `)&&(console.log("We are adding new block:"+t.index+newBlocks+o),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:o})),r()}function i(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function s(){e.nextTick(()=>{o.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){o.value.style.height="1rem",o.value.style.height=o.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{s()}),r()}),(a,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":n[0]||(n[0]=u=>l.prop[l.content]=u),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:d,onFocus:n[1]||(n[1]=u=>c("focus",o.value)),onKeyup:i,ref_key:"textarea",ref:o,class:"text-area mn-thin"},`
4
- `,40,f),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;