text: import { BitrixVue } from 'ui.vue';
  import 'germes.multibasket.components.cart.cart_total_bottons';
  import 'germes.multibasket.components.fields.file'
  import 'germes.multibasket.components.fields.image'
  import 'germes.multibasket.components.fields.link'
  import 'germes.multibasket.components.fields.string'
  BitrixVue.component('vue-cart-detail-user-property', {
      data() {
          return {
              step: null,
          };
      },
      props: {
          error: {
              type: Object,
              required: false
          },
          cart: {
              type: Object,
              required: true
          }
      },
      computed: {
          cartId: (state) => state.cart.ID,
          cartCount: (state) => state.cart.COUNT,
          localize: (state) => BitrixVue.getFilteredPhrases(""),
          currentUser: (state) => state.$store.getters['getCurrentUser'],
          currentUserID: (state) => state.currentUser?.ID,
          currentUserLOGIN: (state) => state.currentUser?.LOGIN,
          currentUserTYPE: (state) => state.currentUser?.LOGIN ? 2 : 1, // TODO доработать данные из админки
          contragentSource: (state) => state.cart.CONTRAGENT?.SOURCE,
          componentError: {
              get() {
                  return this.error;
              },
              set(errorText) {
                  this.error = errorText;
                  this.$root.$emit('componentError', {
                      id: this.$options.name,
                      text: errorText
                  });
              }
          },
          exComponentList: (state) => {
              return Object.values([])?.sort((a, b) => {
                  if (a.sort == undefined) a.sort = 100;
                  if (b.sort == undefined) b.sort = 100;
                  if (a.sort > b.sort) return 1;
                  if (a.sort < b.sort) return -1;
                  return 0;
              });
          },
          exComponentListCount: (state) =>
              state.exComponentList
                  ? Object.assign(state.exComponentList)?.length
                  : 0,
  
          cartDescription: {
              get() {
                  return this.cart.DESCRIPTION
              },
              set(value) {
                  this.cart.DESCRIPTION = value
              }
          },
          stepNumber: (state) => {
              if (!state.step) {
                  state.step = ++state.$parent.stepNumber;
              }
              return state.step;
          },
      },
      template: `
          <div v-cloak v-if="cartId" class="order-step order-step-userporps">
              <input type="hidden" name="USER_ID" :value="currentUserID"/>
              <input type="hidden" name="USER_LOGIN" :value="currentUserLOGIN"/>
              <input type="hidden" name="FUSER_TYPE_ID" :value="currentUserTYPE"/>
              <input type="hidden" name="CITY" :value="contragentSource"/>
              <span v-if="stepNumber" class="step-number">{{stepNumber}}</span>
              <template v-for="(component, i) in exComponentList">
                  <component :is="component.name"></component>
              </template>
              <div class="basket-checkout-block-commets" :class="{'border-bottom': cartCount}">
                  <label for="BASKET_DESCRIPTION" class="title font-weight-bold">
                      <i class="far fa-comment"></i>&nbsp;{{localize.BASKET_TOTAL_DESCRIPTION}}
                  </label>
                  <div class="">
                      <textarea
                          class="w-100"
                          id="BASKET_DESCRIPTION"
                          name="DESCRIPTION"
                          data-entity="basket-comments-input"
                          tabindex="1" autofocus accesskey="c" style="min-height: 85px;font-size: 14px;"
                          :title="localize.BASKET_TOTAL_DESCRIPTION_TITLE+ '(Alt+C)'"
                          :placeholder="localize.BASKET_TOTAL_DESCRIPTION_PLACEHOLDER"
                          v-model.lazy.trim="cartDescription"
                          >{{cartDescription}}
                      </textarea>
                  </div>
              </div>
              <vue-cart-detail-total-buttons :cart="cart" :basket-error="error" v-if="cartCount"/>
          </div>
      `
  });
  