import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs2/core-js/object/get-own-property-descriptor";
import "core-js/modules/es6.number.constructor";
import _Object$assign from "@babel/runtime-corejs2/core-js/object/assign";
import "core-js/modules/web.dom.iterable";
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
import _inheritsLoose from "../../inheritsLoose";
import _defineProperty from "@babel/runtime-corejs2/helpers/defineProperty";
import _applyDecoratedDescriptor from "@babel/runtime-corejs2/helpers/applyDecoratedDescriptor";

var _dec, _class, _class2, _temp;

import Intact from 'intact-angular';
import template from './col.vdt';
import { isStringOrNumber } from '../utils';
import { breakpoints } from './utils';
import '../../styles/kpc.css';
import './index.css';
var Col = (_dec = Intact.template(), (_class = (_temp = _class2 =
/*#__PURE__*/
function (_Intact) {
  _inheritsLoose(Col, _Intact);

  function Col() {
    return _Intact.apply(this, arguments) || this;
  }

  var _proto = Col.prototype;

  _proto.defaults = function defaults() {
    return {
      span: undefined,
      offset: 0,
      gutter: 0,
      order: 0,
      pull: 0,
      push: 0,
      // responsive
      xs: undefined,
      sm: undefined,
      md: undefined,
      lg: undefined,
      xl: undefined,
      xxl: undefined
    };
  };

  _proto._init = function _init() {
    var _this = this;

    breakpoints.forEach(function (item) {
      _this.on("$receive:" + item, function (c, v) {
        if (!v) {
          _this[item] = undefined;
        } else if (isStringOrNumber(v)) {
          _this[item] = {
            span: +v
          };
        } else {
          _this[item] = v;
        }
      });
    });
  };

  _createClass(Col, [{
    key: "template",
    get: function get() {
      return template;
    }
  }]);

  return Col;
}(Intact), _defineProperty(_class2, "propTypes", _Object$assign({
  gutter: [String, Number],
  span: [String, Number],
  offset: [String, Number],
  order: [String, Number],
  pull: [String, Number],
  push: [String, Number]
}, breakpoints.reduce(function (memo, item) {
  memo[item] = [String, Number, Object];
  return memo;
}, {}))), _temp), (_applyDecoratedDescriptor(_class.prototype, "template", [_dec], _Object$getOwnPropertyDescriptor(_class.prototype, "template"), _class.prototype)), _class));
export { Col as default };