{"version":3,"sources":["webpack:///./src/pages/events.vue?1672","webpack:///./src/domain/composables/use-registration.js","webpack:///./src/components/common/app-event-tab.vue?caed","webpack:///./src/components/common/app-event-card.vue?a526","webpack:///./src/pages/events.vue","webpack:///./src/components/common/app-event-card.vue","webpack:///src/components/common/app-event-card.vue","webpack:///./src/components/common/app-event-card.vue?36e5","webpack:///./src/components/common/app-event-card.vue?16c8","webpack:///./src/components/common/app-event-tab.vue","webpack:///src/components/common/app-event-tab.vue","webpack:///./src/components/common/app-event-tab.vue?9520","webpack:///./src/components/common/app-event-tab.vue?77d2","webpack:///src/pages/events.vue","webpack:///./src/pages/events.vue?3f8b","webpack:///./src/pages/events.vue?680f"],"names":["useRegistration","async","getFormData","formId","api","getExistingApiInstance","data","form","getOne","include","join","isUserHasRegistration","email","eventId","authGroupId","payload","meta","isError","registration","isExist","isRegistrationExist","exist","getFieldValues","userId","params","filter","sort","fields","getMany","registrationData","getRegistrationCode","registrationCode","getUserTicket","worksheets","ticketNumber","getRegistrationsByUser","eventIds","perPage","quickRegistration","fromEventId","LogicError","render","_vm","this","_c","_self","isReady","staticClass","attrs","formattedTabs","model","value","selectedId","callback","$$v","expression","isLoading","staticStyle","_l","visibleEvents","eventToEvent","key","id","loadingDataIds","includes","eventsWithRegistration","child","on","onRegister","onToEvent","_e","staticRenderFns","statusAlert","type","_v","_s","text","registrationExist","allowRedirect","isRegVisible","isRegDisabled","actionDisabled","$event","$emit","$tr","isToEventVisible","components","AppEventInfo","props","default","computed","registrationStatus","component","list","item","class","selectTab","label","selectedTab","methods","TYPES_DEVICE","DESKTOP","TABLET","MOBILE","middleware","AppEventCard","AppEventTab","tabs","name","splitEvents","splitEventsWithRegistration","windowWith","paramsLegalAgreement","inject","filteredEvents","inProgress","willStart","past","my","typeDevice","tab","eventLinksWithEventData","console","getChildrenForCabinet","makeSplitEvents","accum","timeStatus","path","pages","domainId","currentEventId","agreement","query"],"mappings":"0GAAA,W,yDCAA,8DAMe,SAASA,IACtBC,e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F,QAAAF,yCAKA0F,yBAEAvB,UACA/B,gBACA,WACA,mCAEA,sBACA,sBACA,sBAIAuD,iBACA,WAAAN,GAAA,2CACA,WACAO,eACAC,UACAC,QACAC,MACA,iBAEA,mBACA,YAEA,SACA,OAGA,QAEAC,aACA,2BACA,kCAEA,qBACA,kCAEA,oCAEAtE,gBACA,yBAEAuE,SACA,sDAEAA,+BAEA,MAIA,sBACA,sBACA,gBACA,kCACA,IACA,gDACA,oDACA,kDACA,sBACA,4CAGA,kBAEA,uCACA,aACA,mDAEA,0CACAC,UAAA,UAAAvD,GAAA,iBAEA,wBACA,SACAwD,iBAEA,QACA,4CACA,oBAGAvB,SACA,0BACA,4BAAAwB,GAAA,iBAEA,UACA,4CACA,mBACA,UACAD,iBACA,KAGA,UAGAE,mBACA,0BACA,gBACA,yHAiBA,OAfA,uBACAC,oBAEA,wBACAA,qBAEA,kBACAA,eAGAC,kBACA,iDAEAD,aAEA,GAEA,CAAAV,cAAAC,aAAAC,QAAAC,SAIA,8CACA,6BAAAnF,GAAA,iBACA,gCACA,eACA,mCACA,iDAGA,oBACA,0BACA,gCAEA,4BAIA,mBACA,sBAIA,gBAHAuF,mDAMA,2BACA,uBAKA,IACA,qDACA,kBAAApF,GAAA,iBACA,qCACA,gBACA,mDACA,kBACA,SACAoF,yBACA,QACA,+CACA5D,aAEA,0CACA,2CAlBA4D,iDAuBA,4BACA,IACA,kDACA,qCACA,qBAAAK,uBACA,SACAL,uBACA,qBAAAK,cACA,QACA,8CAIA,iBACA,IACA,kDACA,+BACA,qCACA,6BACAnE,QACAoE,SAEA,qBAAAD,SACA,SACAL,uBACA,qBAAAK,cACA,QACA,8CAGA,uBACA,yCACA,8CACA,8CACAE,EACAC,EACA,mBAEA,0BACA,2CACA,2BAEA,aACA,OAEA,oBACA,eACAC,yBAEA,4BAEA,GACA,mBACAJ,aACAK,OACAD,mBC9SgV,ICQ5U,G,UAAY,eACd,EACA1F,EACA8B,GACA,EACA,KACA,KACA,OAIa,e","file":"js/events.bb6d4cb8.js","sourcesContent":["export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/style-resources-loader/lib/index.js??ref--9-oneOf-1-4!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./events.vue?vue&type=style&index=0&id=b6f045a4&prod&lang=scss&\"","import { getExistingApiInstance } from '@/api'\nimport LogicError from '@/domain/errors/logic-error'\n\n/**\n * Функция используется для работы с анкетой пользователя\n */\nexport default function useRegistration() {\n  async function getFormData(formId) {\n    const api = getExistingApiInstance()\n\n    const { data } = await api.form.getOne(formId, {\n      include: ['fields.values', 'groups'].join(','),\n    })\n    return data\n  }\n\n  async function isUserHasRegistration(email, eventId, authGroupId) {\n    const api = getExistingApiInstance()\n\n    const payload = {\n      eventId,\n      email,\n      authGroupId,\n    }\n    let isError = false\n    let meta\n\n    try {\n      ({ meta } = await api.registration.isExist(payload))\n    } catch {\n      isError = true\n    }\n\n    return { data: { isRegistrationExist: meta?.exist }, isError }\n  }\n\n  async function getFieldValues(userId, eventId) {\n    const params = {\n      include: ['fields.field'].join(','),\n      filter: {\n        userId,\n        eventId,\n      },\n      sort: 'id',\n      'per-page': 1,\n      fields: {\n        registration: ['id'].join(','),\n      },\n    }\n\n    const { data } = await getExistingApiInstance().registration.getMany(params)\n\n    const [registrationData] = data\n\n    return registrationData?.fields\n  }\n\n  async function getRegistrationCode(userId, eventId) {\n    const params = {\n      filter: {\n        userId,\n        eventId,\n      },\n      fields: {\n        registration: ['registrationCode'].join(','),\n      },\n    }\n\n    const { data } = await getExistingApiInstance().registration.getMany(params)\n\n    const [registrationData] = data\n\n    return registrationData?.registrationCode\n  }\n\n  async function getUserTicket(userId, eventId) {\n    const params = {\n      filter: {\n        userId,\n        eventId,\n      },\n      sort: 'id',\n      'per-page': 1,\n      fields: {\n        registration: ['ticketNumber'].join(','),\n      },\n    }\n\n    const { data } = await getExistingApiInstance().registration.getMany(params)\n\n    const [worksheets] = data\n\n    const ticketNumber = worksheets.ticketNumber\n\n    return ticketNumber\n  }\n\n  async function getRegistrationsByUser(eventIds, userId) {\n    const api = getExistingApiInstance()\n    const params = {\n      filter: {\n        userId,\n        eventId: eventIds,\n      },\n      perPage: 0,\n    }\n\n    const { data } = await api.registration.getMany(params)\n\n    return data\n  }\n\n  async function quickRegistration(eventId, fromEventId) {\n    if (fromEventId === eventId) {\n      throw new LogicError('Попытка быстрой регистрации на евент-кабинет')\n    }\n\n    const api = getExistingApiInstance()\n\n    const data = { fromEventId, eventId }\n\n    await api.registration.quickRegistration(data)\n  }\n\n  return {\n    getFormData,\n    getFieldValues,\n    getRegistrationCode,\n    getUserTicket,\n    getRegistrationsByUser,\n    quickRegistration,\n    isUserHasRegistration,\n  }\n}\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/style-resources-loader/lib/index.js??ref--9-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-tab.vue?vue&type=style&index=0&id=35490837&prod&lang=scss&\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/style-resources-loader/lib/index.js??ref--9-oneOf-1-4!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-card.vue?vue&type=style&index=0&id=3fc7c6bd&prod&scoped=true&lang=scss&\"","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.isReady)?_c('div',{staticClass:\"other-events\"},[_c('AppEventTab',{attrs:{\"list\":_vm.formattedTabs},model:{value:(_vm.selectedId),callback:function ($$v) {_vm.selectedId=$$v},expression:\"selectedId\"}}),_c('div',{staticClass:\"row\"},[(!_vm.isLoading)?_vm._l((_vm.visibleEvents),function(eventToEvent){return _c('AppEventCard',{key:eventToEvent.id,staticClass:\"col-12 col-xlg-3 col-lg-4 col-sm-6\",attrs:{\"event-to-event\":eventToEvent,\"action-disabled\":_vm.loadingDataIds.includes(eventToEvent.id),\"registration-exist\":_vm.eventsWithRegistration.includes(+eventToEvent.child.id)},on:{\"register\":_vm.onRegister,\"to-event\":_vm.onToEvent}})}):_c('div',{staticClass:\"s-card col-12\",staticStyle:{\"position\":\"relative\",\"min-height\":\"200px\"}},[_c('Spin',{attrs:{\"fix\":\"\"}})],1)],2)],1):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"event-card\"},[_c('div',{staticClass:\"s-card s-card--no-padding\"},[_c('Alert',{staticStyle:{\"text-align\":\"center\"},attrs:{\"type\":_vm.statusAlert.type,\"banner\":\"\"}},[_vm._v(\" \"+_vm._s(_vm.statusAlert.text)+\" \")]),_c('AppEventInfo',{attrs:{\"event\":_vm.eventToEvent.child,\"type\":\"event\"}}),_c('div',[(_vm.registrationExist && !_vm.eventToEvent.allowRedirect)?_c('Alert',{staticStyle:{\"margin-top\":\"15px\",\"text-align\":\"center\"},attrs:{\"type\":\"success\"}},[_vm._v(\" Вы успешно зарегистрировались \")]):_vm._e(),(_vm.isRegVisible)?_c('Button',{staticClass:\"event-card__btn\",attrs:{\"disabled\":_vm.isRegDisabled || _vm.actionDisabled,\"type\":\"primary\"},on:{\"click\":function($event){return _vm.$emit('register', _vm.eventToEvent)}}},[_vm._v(\" \"+_vm._s(_vm.$tr('events.registration'))+\" \")]):_vm._e(),(_vm.isToEventVisible)?_c('Button',{staticClass:\"event-card__btn\",attrs:{\"type\":\"primary\",\"disabled\":_vm.actionDisabled},on:{\"click\":function($event){return _vm.$emit('to-event', _vm.eventToEvent)}}},[_vm._v(\" \"+_vm._s(_vm.$tr('events.toEvent'))+\" \")]):_vm._e()],1)],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div class=\"event-card\">\n    <div class=\"s-card s-card--no-padding\">\n      <Alert :type=\"statusAlert.type\" style=\"text-align: center\" banner>\n        {{ statusAlert.text }}\n      </Alert>\n      <AppEventInfo :event=\"eventToEvent.child\" type=\"event\" />\n      <div>\n        <Alert\n          v-if=\"registrationExist && !eventToEvent.allowRedirect\"\n          style=\"margin-top: 15px; text-align: center\"\n          type=\"success\"\n        >\n          Вы успешно зарегистрировались\n        </Alert>\n        <Button\n          v-if=\"isRegVisible\"\n          :disabled=\"isRegDisabled || actionDisabled\"\n          type=\"primary\"\n          class=\"event-card__btn\"\n          @click=\"$emit('register', eventToEvent)\"\n        >\n          {{ $tr('events.registration') }}\n        </Button>\n        <Button\n          v-if=\"isToEventVisible\"\n          type=\"primary\"\n          :disabled=\"actionDisabled\"\n          class=\"event-card__btn\"\n          @click=\"$emit('to-event', eventToEvent)\"\n        >\n          {{ $tr('events.toEvent') }}\n        </Button>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport { TIME_STATUSES } from '@/utils'\nimport AppEventInfo from '@/components/base/app-event-info'\n\nexport default {\n  components: {\n    AppEventInfo,\n  },\n  props: {\n    eventToEvent: { type: Object, default: () => {} },\n    registrationExist: { type: Boolean, default: false },\n    actionDisabled: { type: Boolean, default: false },\n  },\n  computed: {\n    statusAlert() {\n      if (this.registrationStatus === TIME_STATUSES.IN_PROGRESS) {\n        return {\n          type: 'success',\n          text: this.$tr('eventCard.duringRegistration'),\n        }\n      }\n      if (this.registrationStatus === TIME_STATUSES.WILL_START) {\n        return {\n          type: 'warning',\n          text: this.$tr('eventCard.beforeRegistration'),\n        }\n      }\n      if (this.registrationStatus === TIME_STATUSES.ENDED) {\n        return { type: 'error', text: this.$tr('eventCard.endedRegistration') }\n      }\n      return { type: 'info', text: '' }\n    },\n\n    registrationStatus() {\n      return this.eventToEvent.child.registrationTimeStatus\n    },\n\n    isRegDisabled() {\n      return (\n        this.registrationStatus === TIME_STATUSES.WILL_START ||\n        (this.registrationStatus === TIME_STATUSES.ENDED &&\n          !this.registrationExist)\n      )\n    },\n    isRegVisible() {\n      return (\n        this.registrationStatus === TIME_STATUSES.IN_PROGRESS &&\n        !this.registrationExist\n      )\n    },\n    isToEventVisible() {\n      return this.registrationExist && this.eventToEvent.allowRedirect\n    },\n  },\n}\n</script>\n\n<style scoped lang=\"scss\">\n.ivu-alert {\n  padding: 9px 24px 9px 24px;\n}\n.event-card {\n  margin-bottom: 16px;\n\n  .s-card {\n    height: 100%;\n    padding-bottom: 16px !important;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n\n  &__btn {\n    margin: 24px 24px 0;\n    width: calc(100% - 48px);\n  }\n\n  & .event-info-main__caption {\n    font-size: 14px;\n    font-family: var(--s-regular-font);\n    font-weight: 400;\n    line-height: 1.57;\n  }\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-card.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-card.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./app-event-card.vue?vue&type=template&id=3fc7c6bd&scoped=true&\"\nimport script from \"./app-event-card.vue?vue&type=script&lang=js&\"\nexport * from \"./app-event-card.vue?vue&type=script&lang=js&\"\nimport style0 from \"./app-event-card.vue?vue&type=style&index=0&id=3fc7c6bd&prod&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"3fc7c6bd\",\n  null\n  \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"s-card s-card--no-padding\"},[_c('div',{staticClass:\"event-time-line other-events__event-time-line\"},_vm._l((_vm.list),function(item){return _c('div',{key:item.id,staticClass:\"event-time-line__item\",class:{ 'event-time-line__item--active': +_vm.value === +item.id },on:{\"click\":function($event){return _vm.selectTab(item.id)}}},[_c('span',{staticClass:\"s-subtitle\"},[_vm._v(_vm._s(item.label))])])}),0)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <div class=\"s-card s-card--no-padding\">\n    <div class=\"event-time-line other-events__event-time-line\">\n      <div\n        v-for=\"item in list\"\n        :key=\"item.id\"\n        :class=\"{ 'event-time-line__item--active': +value === +item.id }\"\n        class=\"event-time-line__item\"\n        @click=\"selectTab(item.id)\"\n      >\n        <span class=\"s-subtitle\">{{ item.label }}</span>\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nexport default {\n  props: {\n    value: {\n      type: [Number, String, null],\n      default: null,\n    },\n    list: {\n      type: Array,\n      default: () => [],\n    },\n  },\n  data() {\n    return {\n      selectedTab: null,\n    }\n  },\n  methods: {\n    selectTab(id) {\n      this.$emit('input', id)\n      this.$emit('tab-select', this.list.find((item) => +item.id === +id).name)\n    },\n  },\n}\n</script>\n\n<style lang=\"scss\">\n.event-time-line {\n  display: flex;\n\n  &__item {\n    position: relative;\n    margin: 0px 4px;\n    padding: 13px 20px;\n    color: var(--s-black-color-80);\n    cursor: pointer;\n    font-size: 14px;\n\n    &::after {\n      content: '';\n      position: absolute;\n      right: -4.5px;\n      height: 24px;\n      width: 1px;\n      background-color: var(--s-black-color-10);\n    }\n\n    &:last-child {\n      &::after {\n        content: none;\n      }\n    }\n\n    &--active {\n      color: var(--s-primary-color);\n\n      &::before {\n        content: '';\n        position: absolute;\n        bottom: 0;\n        left: 0;\n        height: 2px;\n        width: 100%;\n        border-radius: 2px;\n        background-color: var(--s-primary-color);\n      }\n    }\n  }\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-tab.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./app-event-tab.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./app-event-tab.vue?vue&type=template&id=35490837&\"\nimport script from \"./app-event-tab.vue?vue&type=script&lang=js&\"\nexport * from \"./app-event-tab.vue?vue&type=script&lang=js&\"\nimport style0 from \"./app-event-tab.vue?vue&type=style&index=0&id=35490837&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","<template>\n  <div v-if=\"isReady\" class=\"other-events\">\n    <AppEventTab v-model=\"selectedId\" :list=\"formattedTabs\" />\n    <div class=\"row\">\n      <template v-if=\"!isLoading\">\n        <AppEventCard\n          v-for=\"eventToEvent in visibleEvents\"\n          :key=\"eventToEvent.id\"\n          :event-to-event=\"eventToEvent\"\n          :action-disabled=\"loadingDataIds.includes(eventToEvent.id)\"\n          :registration-exist=\"\n            eventsWithRegistration.includes(+eventToEvent.child.id)\n          \"\n          class=\"col-12 col-xlg-3 col-lg-4 col-sm-6\"\n          @register=\"onRegister\"\n          @to-event=\"onToEvent\"\n        />\n      </template>\n      <div\n        v-else\n        class=\"s-card col-12\"\n        style=\"position: relative; min-height: 200px\"\n      >\n        <Spin fix />\n      </div>\n    </div>\n  </div>\n</template>\n\n<script>\nimport { sort } from 'rambda'\n\nimport AppEventCard from '@/components/common/app-event-card'\nimport AppEventTab from '@/components/common/app-event-tab'\nimport useEvent from '@/domain/composables/use-event'\nimport useDomainContent from '@/domain/composables/use-domain-content'\nimport useLegalAgreement from '@/domain/composables/use-legal-agreement'\nimport EventDateService from '@/domain/services/event-date-service'\nimport { TIME_STATUSES } from '@/utils'\nimport useRegistration from '@/domain/composables/use-registration'\nimport LangService from '@/domain/services/lang-service'\nimport EventService from '@/domain/services/event-service'\n// вынести сервис\nexport default {\n  TYPES_DEVICE: {\n    DESKTOP: 'desktop',\n    TABLET: 'tablet',\n    MOBILE: 'mobile',\n  },\n  middleware: ['main-event-init', 'only-en-guard'],\n  components: {\n    AppEventCard,\n    AppEventTab,\n  },\n  data() {\n    return {\n      selectedId: 1,\n      isReady: false,\n      tabs: [\n        { name: 'actual', label: this.$tr('events.tabs.actual'), id: 1 },\n        { name: 'my', label: this.$tr('events.tabs.my'), id: 2 },\n        { name: 'past', label: this.$tr('events.tabs.past'), id: 3 },\n      ],\n      splitEvents: {},\n      eventsWithRegistration: [],\n      loadingDataIds: [],\n      isLoading: false,\n      splitEventsWithRegistration: [],\n      windowWith: null,\n      paramsLegalAgreement: {\n        filter: { userId: this.$store.state.auth.userId },\n      },\n    }\n  },\n\n  inject: ['loadFullEvent'],\n\n  computed: {\n    visibleEvents() {\n      const getStartDate = (e2e) =>\n        new EventDateService(e2e.child).startEventTime\n\n      return sort(\n        (a, b) => (getStartDate(a) < getStartDate(b) ? -1 : 1),\n        this.filteredEvents\n      )\n    },\n\n    filteredEvents() {\n      const { name } = this.tabs.find((tab) => tab.id === this.selectedId)\n      const {\n        inProgress = [],\n        willStart = [],\n        past = [],\n        my = [],\n      } = this.splitEvents\n\n      if (name === 'actual') {\n        return [...inProgress, ...willStart]\n      }\n      if (name === 'my') {\n        return [...my]\n      }\n\n      return [...past]\n    },\n    typeDevice() {\n      if (this.windowWith < 768) {\n        return this.$options.TYPES_DEVICE.MOBILE\n      }\n      if (this.windowWith < 1399) {\n        return this.$options.TYPES_DEVICE.TABLET\n      }\n      return this.$options.TYPES_DEVICE.DESKTOP\n    },\n    formattedTabs() {\n      return this.tabs.map((tab) => {\n        if (\n          (tab.id === 2) &\n          (this.typeDevice === this.$options.TYPES_DEVICE.MOBILE)\n        ) {\n          tab.label = tab.label.split(' ')[0]\n        }\n        return tab\n      })\n    },\n  },\n  async created() {\n    await this.checkAgreement()\n    this.isReady = true\n    this.windowWith = window.innerWidth\n    try {\n      if (this.$store.getters['isActiveEventIsChild']) {\n        const parentEventId = this.$store.getters['domain/parentEventId']\n        this.$store.commit('SET_APP_IS_LOADING', true)\n        await this.loadFullEvent(parentEventId)\n        this.$store.commit('SET_APP_IS_LOADING', false)\n      }\n\n      this.isLoading = true\n\n      const eventLinksWithEventData = await this.getChildrenEvents()\n      if (!eventLinksWithEventData.length) {\n        throw new Error('Нет связанных мероприятий')\n      }\n      await this.getEventsWithRegistrationsByThisUser(\n        eventLinksWithEventData.map(({ child }) => child.id)\n      )\n      this.makeSplitEvents(eventLinksWithEventData)\n    } catch (e) {\n      console.error(e)\n      // await LangService.toLocalePath({ path: '/404' })\n    } finally {\n      this.$store.commit('SET_APP_IS_LOADING', false)\n      this.isLoading = false\n    }\n  },\n  methods: {\n    async getChildrenEvents() {\n      const { getChildrenForCabinet } = useEvent()\n\n      const eventLinksWithEventData = await getChildrenForCabinet(\n        this.$store.getters['domain/parentEventId'],\n        this.$i18n.locale\n      ).catch((e) => {\n        console.error(e)\n        return []\n      })\n\n      return eventLinksWithEventData\n    },\n\n    makeSplitEvents(eventLinksWithEventData) {\n      this.splitEvents = eventLinksWithEventData.reduce(\n        (accum, current) => {\n          const timeStatus = current?.child?.eventOccasion?.timeStatus\n\n          if (timeStatus === TIME_STATUSES.WILL_START) {\n            accum.willStart.push(current)\n          }\n          if (timeStatus === TIME_STATUSES.IN_PROGRESS) {\n            accum.inProgress.push(current)\n          }\n          if (timeStatus === TIME_STATUSES.ENDED) {\n            accum.past.push(current)\n          }\n          if (\n            timeStatus !== TIME_STATUSES.ENDED &&\n            this.eventsWithRegistration.includes(current.childId)\n          )\n            accum.my.push(current)\n\n          return accum\n        },\n        { inProgress: [], willStart: [], past: [], my: [] }\n      )\n    },\n\n    async getEventsWithRegistrationsByThisUser(eventIds) {\n      const { getRegistrationsByUser } = useRegistration()\n      const userId = this.$store.state.auth.userId\n      const registration = await getRegistrationsByUser(eventIds, userId)\n      this.splitEventsWithRegistration = registration\n      this.eventsWithRegistration = registration.map((r) => r.eventId)\n    },\n\n    async onRegister(eventToEvent) {\n      if (eventToEvent.quickRegistration) {\n        await this.quickRegistration(eventToEvent)\n      } else {\n        await this.toFullRegistration(eventToEvent)\n      }\n    },\n\n    async onToEvent(eventToEvent) {\n      if (!eventToEvent.allowRedirect) {\n        console.error('Нельзя перейти к другому евенту!')\n        return\n      }\n      await this.toEvent(eventToEvent)\n    },\n\n    async quickRegistration(eventToEvent) {\n      if (!eventToEvent.quickRegistration) {\n        console.error('Быстрая регистрация невозможна')\n        return\n      }\n\n      try {\n        const fromEventId = this.$store.getters['event/currentEventId']\n        const { quickRegistration } = useRegistration()\n        this.loadingDataIds.push(eventToEvent.id)\n        await quickRegistration(eventToEvent.child.id, fromEventId)\n        this.eventsWithRegistration.push(eventToEvent.child.id)\n        await this.onToEvent(eventToEvent)\n      } catch (e) {\n        console.error(e.message)\n      } finally {\n        this.loadingDataIds = this.loadingDataIds.filter(\n          (id) => id !== eventToEvent.id\n        )\n        this.getEventsWithRegistrationsByThisUser(\n          this.visibleEvents.map((e2e) => e2e.childId)\n        )\n      }\n    },\n\n    async toFullRegistration(eventToEvent) {\n      try {\n        this.$store.commit('SET_APP_IS_LOADING', true)\n        await this.loadFullEvent(eventToEvent.child.id)\n        await LangService.toLocalePath({ path: '/registration' })\n      } catch (e) {\n        console.error(e)\n        await LangService.toLocalePath({ path: '/404' })\n      } finally {\n        this.$store.commit('SET_APP_IS_LOADING', false)\n      }\n    },\n\n    async toEvent(eventToEvent) {\n      try {\n        this.$store.commit('SET_APP_IS_LOADING', true)\n        await this.loadFullEvent(eventToEvent.child.id)\n        const pages = this.$store.state.pages.data\n        const startPagePath = EventService.defineStartPagePath(\n          eventToEvent.child,\n          pages\n        )\n        await LangService.toLocalePath({ path: startPagePath })\n      } catch (e) {\n        console.error(e)\n        await LangService.toLocalePath({ path: '/404' })\n      } finally {\n        this.$store.commit('SET_APP_IS_LOADING', false)\n      }\n    },\n    async checkAgreement() {\n      const domainId = this.$store.state.domain.data.id\n      const currentEventId = this.$store.getters['event/currentEventId']\n      const contentItems = await useDomainContent().getAgreementItemList(\n        domainId,\n        currentEventId,\n        this.$i18n.locale\n      )\n      const requiredAgreements = contentItems.filter((item) => item.required)\n      const userAgreements = await useLegalAgreement().getLegalAgreement(\n        this.paramsLegalAgreement\n      )\n      if (!contentItems.length) {\n        return\n      }\n      const allAgreementsApproved = requiredAgreements.every((required) => {\n        const userAgreement = userAgreements.find(\n          (agreement) => +agreement.contentId === +required.id\n        )\n        return userAgreement && userAgreement.approved === true\n      })\n      if (!allAgreementsApproved) {\n        this.$router.push({\n          path: `/user`,\n          query: {\n            agreement: true,\n          },\n        })\n      }\n    },\n  },\n}\n</script>\n\n<style lang=\"scss\">\n.other-events {\n  position: relative;\n  &__title {\n    color: var(--s-black-color-80);\n    margin-bottom: 24px;\n  }\n\n  &__event-time-line {\n    margin-bottom: 24px;\n  }\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./events.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./events.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./events.vue?vue&type=template&id=b6f045a4&\"\nimport script from \"./events.vue?vue&type=script&lang=js&\"\nexport * from \"./events.vue?vue&type=script&lang=js&\"\nimport style0 from \"./events.vue?vue&type=style&index=0&id=b6f045a4&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}