<commit_before>import Vue from 'vue'

import ListenersMixin from '../../mixins/listeners.js'

export default Vue.extend({
  name: 'QChatMessage',

  mixins: [ ListenersMixin ],

  props: {
    sent: Boolean,
    label: String,
    bgColor: String,
    textColor: String,
    name: String,
    avatar: String,
    text: Array,
    stamp: String,
    size: String,
    labelSanitize: Boolean,
    nameSanitize: Boolean,
    textSanitize: Boolean,
    stampSanitize: Boolean
  },

  computed: {
    textClass () {
      return `q-message-text-content q-message-text-content--${this.op}` +
        (this.textColor !== void 0 ? ` text-${this.textColor}` : '')
    },

    messageClass () {
      return `q-message-text q-message-text--${this.op}` +
        (this.bgColor !== void 0 ? ` text-${this.bgColor}` : '')
    },

    containerClass () {
      return `q-message-container row items-end no-wrap` +
        (this.sent === true ? ' reverse' : '')
    },

    sizeClass () {
      if (this.size !== void 0) {
        return `col-${this.size}`
      }
    },

    op () {
      return this.sent === true ? 'sent' : 'received'
    }
  },

  methods: {
    __wrapStamp (h, node) {
      if (this.$scopedSlots.stamp !== void 0) {
        return [ node, h('div', { staticClass: 'q-message-stamp' }, this.$scopedSlots.stamp()) ]
      }

      if (this.stamp) {
        const domPropStamp = this.stampSanitize === true ? 'textContent' : 'innerHTML'

        return [
          node,
          h('div', {
            staticClass: 'q-message-stamp',
            domProps: { [domPropStamp]: this.stamp }
          })
        ]
      }

      return [ node ]
    },

    __getText (h, contentList, withSlots) {
      const domPropText = this.textSanitize === true ? 'textContent' : 'innerHTML'

      if (
        withSlots === true &&
        contentList.some(entry => entry.tag === void 0 && entry.text !== void 0) === true
      ) {
        return [
          h('div', { class: this.messageClass }, [
            h('div', { class: this.textClass }, this.__wrapStamp(h, h('div', contentList)))
          ])
        ]
      }

      const content = withSlots === true
        ? (contentList.length > 1 ? text => text : text => h('div', [ text ]))
        : text => h('div', { domProps: { [domPropText]: text } })

      return contentList.map((msg, index) => h('div', {
        key: index,
        class: this.messageClass
      }, [
        h('div', { class: this.textClass }, this.__wrapStamp(h, content(msg)))
      ]))<commit_msg>fix(QChatMessage): #9902 syntax error (#9903)<commit_after>import Vue from 'vue'

import ListenersMixin from '../../mixins/listeners.js'

export default Vue.extend({
  name: 'QChatMessage',

  mixins: [ ListenersMixin ],

  props: {
    sent: Boolean,
    label: String,
    bgColor: String,
    textColor: String,
    name: String,
    avatar: String,
    text: Array,
    stamp: String,
    size: String,
    labelSanitize: Boolean,
    nameSanitize: Boolean,
    textSanitize: Boolean,
    stampSanitize: Boolean
  },

  computed: {
    textClass () {
      return `q-message-text-content q-message-text-content--${this.op}` +
        (this.textColor !== void 0 ? ` text-${this.textColor}` : '')
    },

    messageClass () {
      return `q-message-text q-message-text--${this.op}` +
        (this.bgColor !== void 0 ? ` text-${this.bgColor}` : '')
    },

    containerClass () {
      return `q-message-container row items-end no-wrap` +
        (this.sent === true ? ' reverse' : '')
    },

    sizeClass () {
      if (this.size !== void 0) {
        return `col-${this.size}`
      }
    },

    op () {
      return this.sent === true ? 'sent' : 'received'
    }
  },

  methods: {
    __wrapStamp (h, node) {
      if (this.$scopedSlots.stamp !== void 0) {
        return [ node, h('div', { staticClass: 'q-message-stamp' }, this.$scopedSlots.stamp()) ]
      }

      if (this.stamp) {
        const domPropStamp = this.stampSanitize === true ? 'textContent' : 'innerHTML'

        return [
          node,
          h('div', {
            staticClass: 'q-message-stamp',
            domProps: { [domPropStamp]: this.stamp }
          })
        ]
      }

      return [ node ]
    },

    __getText (h, contentList, withSlots) {
      const domPropText = this.textSanitize === true ? 'textContent' : 'innerHTML'

      if (
        withSlots === true &&
        contentList.some(entry => entry.tag === void 0 && entry.text !== void 0) === true
      ) {
        return [
          h('div', { class: this.messageClass }, [
            h('div', { class: this.textClass }, this.__wrapStamp(h, h('div', contentList)))
          ])
        ]
      }

      const content = withSlots === true
        ? (contentList.length > 1 ? (text => text) : (text => h('div', [ text ])))
        : (text => h('div', { domProps: { [domPropText]: text } }))

      return contentList.map((msg, index) => h('div', {
        key: index,
        class: this.messageClass
      }, [
        h('div', { class: this.textClass }, this.__wrapStamp(h, content(msg)))
      ]))
{'fraction_non_alphanumeric': 0.1681085332284703, 'fraction_numerical': 0.004325599685410932, 'mean_word_length': 2.0848999393571863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5775015', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1650, 'n_words': 350}