'use strict';

var normalizeComponent = require('./normalize-component-6fa50395.js');
var ThemeMixin = require('./ThemeMixin-a2f817cd.js');
var fieldAtom = require('./field-atom-fe4b7c7b.js');

//
var script = {
  name: 'CircularLoaderAtom',
  props: {
    progress: {
      type: [Number, String],
      default: 0
    },
    isAnimated: {
      type: Boolean,
      default: true
    },
    size: {
      type: [Number, String],
      default: 82
    },
    stroke: {
      type: String,
      default: '#6e32c9'
    },
    lineThickness: {
      type: [Number, String],
      default: 4
    }
  },
  computed: {
    themeCssClass: function themeCssClass() {
      return {
        'circular-loader-atom': true,
        animated: this.isAnimated
      };
    },
    sizeStyle: function sizeStyle() {
      return {
        width: "".concat(this.size, "px"),
        height: "".concat(this.size, "px")
      };
    },
    radius: function radius() {
      return this.size / 2 - this.lineThickness / 2;
    },
    circleAttrs: function circleAttrs() {
      var size = this.size,
          radius = this.radius,
          stroke = this.stroke;
      return {
        r: radius,
        cx: "".concat(size / 2, "px"),
        cy: "".concat(size / 2, "px"),
        stroke: stroke
      };
    },
    strokeDasharray: function strokeDasharray() {
      var radius = this.radius,
          progress = this.progress;
      var circumference = radius * 2 * Math.PI;
      return "".concat(circumference / 100 * progress, " ").concat(circumference);
    }
  },
  mixins: [ThemeMixin.ThemeMixin],
  components: {
    FieldAtom: fieldAtom.FieldAtom
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field-atom',{class:_vm.themeCssClass,style:(_vm.sizeStyle)},[_c('svg',{staticClass:"circular-loader-atom-back",style:(_vm.sizeStyle)},[_c('circle',{attrs:{"r":_vm.circleAttrs.r,"cx":_vm.circleAttrs.cx,"cy":_vm.circleAttrs.cy,"stroke-width":_vm.lineThickness}})]),_vm._v(" "),_c('svg',{staticClass:"circular-loader-atom-over",style:(Object.assign({}, _vm.sizeStyle, {strokeDasharray: _vm.strokeDasharray, stroke: _vm.circleAttrs.stroke}))},[_c('circle',{attrs:{"r":_vm.circleAttrs.r,"cx":_vm.circleAttrs.cx,"cy":_vm.circleAttrs.cy,"stroke-width":_vm.lineThickness}})]),_vm._v(" "),_vm._t("default")],2)};
var __vue_staticRenderFns__ = [];

  /* 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;
  /* style inject */
  
  /* style inject SSR */
  

  
  var CircularLoaderAtom = normalizeComponent.__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
  );

exports.CircularLoaderAtom = CircularLoaderAtom;
