import "./menu-bar.css";
/* script */
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
import { createComponentName, componentMixin } from '../../utils/base';
import Button from '../button';
import Udesk from '../udesk';
import Badge from '../badge';
const __vue_script__ = {
  name: createComponentName('editor-help-menu-bar'),
  components: {
    Button,
    Udesk,
    Badge
  },
  mixins: [componentMixin],
  model: {
    name: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: Number
    },
    // 展示未读消息
    unread: {
      type: Boolean,
      default: false
    },
    list: {
      type: Array,
      default: () => []
    },
    // udesk 配置
    udeskConfig: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    onChange(value) {
      if (this.value === value) {
        this.$emit('change', undefined);
      } else {
        this.$emit('change', value);
      }
    }

  }
};
/* template */

var __vue_render__ = function () {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c("div", {
    class: _vm.bem()
  }, [_c("div", {
    class: _vm.bem("title")
  }, [_vm._v("您想要了解:")]), _vm._v(" "), _c("div", {
    class: _vm.bem("list")
  }, _vm._l(_vm.list, function (cell) {
    return _c("div", {
      key: cell.id,
      class: _vm.bem("cell", {
        active: cell.id === _vm.value
      }),
      on: {
        click: function () {
          return _vm.onChange(cell.id);
        }
      }
    }, [_vm._v("\n            " + _vm._s(cell.title) + "\n        ")]);
  }), 0), _vm._v(" "), _c("div", {
    class: _vm.bem("footer")
  }, [_vm._t("default", [_c("Udesk", {
    attrs: {
      config: _vm.udeskConfig
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function (props) {
        return _c("Button", {
          class: _vm.bem("udesk-btn")
        }, [_c("Badge", {
          attrs: {
            value: _vm.unread ? props.unread : 0,
            dotStyle: {
              top: "-2px",
              right: "4px"
            }
          }
        }, [_vm._v("\n                        在线客服\n                    ")])], 1);
      }
    }])
  })])], 2)]);
};

var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */

const __vue_inject_styles__ = undefined;
/* scoped */

const __vue_scope_id__ = undefined;
/* module identifier */

const __vue_module_identifier__ = undefined;
/* functional template */

const __vue_is_functional_template__ = false;
/* component normalizer */

import __vue_normalize__ from '../../utils/vue-normalize-component.js';
/* style inject */

/* style inject SSR */

export default __vue_normalize__({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined);