import { n as normalizeComponent, u as use, r as registerComponent } from './normalize-component-63e8c7a0.js';
import './es.number.constructor-16a232f3.js';
import './es.array.includes-1f433385.js';
import BaseIcon from './BaseIcon-d03b1fa2.js';
import './export-ecf4b1cb.js';
import './object-set-prototype-of-9853ad1a.js';
import './object-keys-a5d351f7.js';
import './es.array.concat-9f3136dc.js';
import './array-species-create-afb281e6.js';
import './create-property-c00b5c27.js';
import './array-method-has-species-support-d96108b0.js';
import './es.array.join-6ca857ff.js';
import './array-method-is-strict-903f485b.js';

/**
 * The status bar displayed during file upload
 * ** WILL BE DEPRECATED **
 * ** USE IMPROVED COMPONENT BASEPROGESSBAR **
  */

var script = {
  name: 'BaseUploadBar',
  components: {
    BaseIcon: BaseIcon
  },
  props: {
    /**
     * filename that will be displayed in the bar
     */
    filename: {
      type: String,
      required: true
    },

    /**
     * filesize that will be displayed in the bar
     */
    filesize: {
      type: String,
      default: ''
    },

    /**
     * progress of the upload (percentage ratio)
     */
    progress: {
      type: [Number, String],
      default: 0
    },

    /**
     * indicate the success or fail of an upload <br>
     *   allowed values: 'sucess' | 'fail' | ''
     */
    status: {
      type: String,
      default: '',
      validator: function validator(val) {
        return ['success', 'fail', ''].includes(val);
      }
    },

    /**
     * show an remove icon
     */
    showRemove: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      progressWidth: 0
    };
  },
  watch: {
    progress: function progress(val) {
      this.progressWidth = val * 100;
    }
  },
  methods: {
    remove: function remove() {
      /**
       * event triggered on remove icon click
       *
       * @event remove-item
       * @type { none }
       */
      this.$emit('remove-item');
    }
  }
};

/* script */
var __vue_script__ = script;
/* template */

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

  var _h = _vm.$createElement;

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

  return _c('div', {
    staticClass: "base-upload-bar"
  }, [_c('div', {
    class: ['base-upload-bar-text', _vm.progressWidth > 80 ? 'base-upload-bar-text-complete' : 'base-upload-bar-text-incomplete']
  }, [_c('span', [_vm._v(_vm._s(_vm.$props.filename))]), _vm._v(" "), _c('span', {
    staticClass: "base-upload-bar-file-size"
  }, [_vm._v(_vm._s(_vm.$props.filesize))])]), _vm._v(" "), _c('div', {
    staticClass: "base-upload-bar-progress",
    style: {
      'width': _vm.progressWidth + '%'
    }
  }), _vm._v(" "), _vm.status === 'success' ? _c('base-icon', {
    staticClass: "base-upload-bar-status-icon base-upload-bar-status-icon-success",
    attrs: {
      "name": "success"
    }
  }) : _vm._e(), _vm._v(" "), _vm.status === 'fail' ? _c('base-icon', {
    staticClass: "base-upload-bar-status-icon base-upload-bar-status-icon-fail",
    attrs: {
      "name": "attention"
    }
  }) : _vm._e(), _vm._v(" "), _vm.showRemove ? _c('base-icon', {
    staticClass: "base-upload-bar-status-icon base-upload-bar-status-icon-remove",
    attrs: {
      "name": "remove"
    },
    on: {
      "click": _vm.remove
    }
  }) : _vm._e()], 1);
};

var __vue_staticRenderFns__ = [];
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = "data-v-07b50b84";
/* module identifier */

var __vue_module_identifier__ = undefined;
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

/* style inject shadow dom */

var __vue_component__ = /*#__PURE__*/normalizeComponent({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);

var BaseUploadBar = __vue_component__;

var Plugin = {
  install: function install(Vue) {
    registerComponent(Vue, BaseUploadBar);
  }
};
use(Plugin);

export { BaseUploadBar, Plugin as default };
