webpackJsonp([14],[
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module, exports) {

module.exports = React;

/***/ }),
/* 3 */,
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.sum = exports.isUndefined = exports.isNaN = exports.isNull = exports.isFunction = exports.isObject = exports.isArray = exports.isBoolean = exports.isString = exports.isNumber = exports.contains = exports.orderBy = exports.sortBy = exports.keyBy = exports.includes = exports.findIndex = exports.find = exports.union = exports.range = exports.debounce = exports.uniqueId = exports.now = undefined;

var _lodash = __webpack_require__(607);

var _lodash2 = _interopRequireDefault(_lodash);

var _lodash3 = __webpack_require__(614);

var _lodash4 = _interopRequireDefault(_lodash3);

var _lodash5 = __webpack_require__(590);

var _lodash6 = _interopRequireDefault(_lodash5);

var _lodash7 = __webpack_require__(609);

var _lodash8 = _interopRequireDefault(_lodash7);

var _lodash9 = __webpack_require__(613);

var _lodash10 = _interopRequireDefault(_lodash9);

var _lodash11 = __webpack_require__(592);

var _lodash12 = _interopRequireDefault(_lodash11);

var _lodash13 = __webpack_require__(591);

var _lodash14 = _interopRequireDefault(_lodash13);

var _lodash15 = __webpack_require__(595);

var _lodash16 = _interopRequireDefault(_lodash15);

var _lodash17 = __webpack_require__(608);

var _lodash18 = _interopRequireDefault(_lodash17);

var _lodash19 = __webpack_require__(610);

var _lodash20 = _interopRequireDefault(_lodash19);

var _lodash21 = __webpack_require__(604);

var _lodash22 = _interopRequireDefault(_lodash21);

var _lodash23 = __webpack_require__(587);

var _lodash24 = _interopRequireDefault(_lodash23);

var _lodash25 = __webpack_require__(600);

var _lodash26 = _interopRequireDefault(_lodash25);

var _lodash27 = __webpack_require__(602);

var _lodash28 = _interopRequireDefault(_lodash27);

var _lodash29 = __webpack_require__(596);

var _lodash30 = _interopRequireDefault(_lodash29);

var _lodash31 = __webpack_require__(290);

var _lodash32 = _interopRequireDefault(_lodash31);

var _lodash33 = __webpack_require__(601);

var _lodash34 = _interopRequireDefault(_lodash33);

var _lodash35 = __webpack_require__(597);

var _lodash36 = _interopRequireDefault(_lodash35);

var _lodash37 = __webpack_require__(599);

var _lodash38 = _interopRequireDefault(_lodash37);

var _lodash39 = __webpack_require__(598);

var _lodash40 = _interopRequireDefault(_lodash39);

var _lodash41 = __webpack_require__(603);

var _lodash42 = _interopRequireDefault(_lodash41);

var _lodash43 = __webpack_require__(611);

var _lodash44 = _interopRequireDefault(_lodash43);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// LODASH MODULES  	---------------- //

var now = exports.now = _lodash2.default,
    uniqueId = exports.uniqueId = _lodash4.default,
    debounce = exports.debounce = _lodash6.default,
    range = exports.range = _lodash8.default,
    union = exports.union = _lodash10.default,
    find = exports.find = _lodash14.default,
    findIndex = exports.findIndex = _lodash12.default,
    includes = exports.includes = _lodash16.default,
    keyBy = exports.keyBy = _lodash22.default,
    sortBy = exports.sortBy = _lodash20.default,
    orderBy = exports.orderBy = _lodash18.default,
    contains = exports.contains = _lodash24.default,
    isNumber = exports.isNumber = _lodash26.default,
    isString = exports.isString = _lodash28.default,
    isBoolean = exports.isBoolean = _lodash30.default,
    isArray = exports.isArray = _lodash32.default,
    isObject = exports.isObject = _lodash34.default,
    isFunction = exports.isFunction = _lodash36.default,
    isNull = exports.isNull = _lodash38.default,
    isNaN = exports.isNaN = _lodash40.default,
    isUndefined = exports.isUndefined = _lodash42.default,
    sum = exports.sum = _lodash44.default;
// ------------------- //

/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.WFIState = exports.WFIVisible = exports.WFIEdit = exports.WFIAdd = exports.WFICheck2 = exports.WFICheck = exports.WFIDown = exports.WFIUp = exports.WFINext = exports.WFIPrev = exports.WFIPlay = exports.WFIOpen = exports.WFIClose = exports.WFIcon = undefined;

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ICON ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-icon",
	prefix: "wf-icon-",
	add: "add",
	up: "up",
	down: "down",
	state: {
		active: "active",
		not: "not",
		open: "opened",
		close: "notopen"
	},
	icon: {

		close: "close",
		prev: "prev",
		next: "next",
		edit: "cog",
		play: "play-2-icon",
		stop: "stop-2-icon",
		checked: "checkbox-checked",
		unchecked: "checkbox-unchecked",
		valid: "check",
		visible: "eye2",
		unvisible: "eye-blocked"
	}
};

// ------------------- //

var WFIcon = function (_Component) {
	(0, _inherits3.default)(WFIcon, _Component);

	function WFIcon() {
		(0, _classCallCheck3.default)(this, WFIcon);
		return (0, _possibleConstructorReturn3.default)(this, (WFIcon.__proto__ || (0, _getPrototypeOf2.default)(WFIcon)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIcon, [{
		key: "render",
		value: function render() {
			var _props = this.props,
			    _props$icon = _props.icon,
			    icon = _props$icon === undefined ? "" : _props$icon,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$onClick = _props.onClick,
			    _onClick = _props$onClick === undefined ? null : _props$onClick,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible,
			    _props$style = _props.style,
			    style = _props$style === undefined ? {} : _props$style;

			if (!visible || !icon) return false;
			return _react2.default.createElement(
				"span",
				{
					style: style,
					className: classes.wrapper + " " + className + " alias-" + icon,
					onClick: function onClick() {
						return (0, _Lodash.isFunction)(_onClick) ? _onClick() : "";
					}
				},
				_react2.default.createElement("span", { className: "" + classes.prefix + icon })
			);
		}
	}]);
	return WFIcon;
}(_react.Component);

// ------------------- //

var WFIClose = function (_Component2) {
	(0, _inherits3.default)(WFIClose, _Component2);

	function WFIClose() {
		(0, _classCallCheck3.default)(this, WFIClose);
		return (0, _possibleConstructorReturn3.default)(this, (WFIClose.__proto__ || (0, _getPrototypeOf2.default)(WFIClose)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIClose, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				className: classes.icon.close,
				icon: classes.icon.close
			}, this.props));
		}
	}]);
	return WFIClose;
}(_react.Component);

// ------------------- //

var WFIAdd = function (_Component3) {
	(0, _inherits3.default)(WFIAdd, _Component3);

	function WFIAdd() {
		(0, _classCallCheck3.default)(this, WFIAdd);
		return (0, _possibleConstructorReturn3.default)(this, (WFIAdd.__proto__ || (0, _getPrototypeOf2.default)(WFIAdd)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIAdd, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(WFIClose, (0, _extends3.default)({
				className: classes.add
			}, this.props));
		}
	}]);
	return WFIAdd;
}(_react.Component);

// ------------------- //

var WFIPrev = function (_Component4) {
	(0, _inherits3.default)(WFIPrev, _Component4);

	function WFIPrev() {
		(0, _classCallCheck3.default)(this, WFIPrev);
		return (0, _possibleConstructorReturn3.default)(this, (WFIPrev.__proto__ || (0, _getPrototypeOf2.default)(WFIPrev)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIPrev, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: classes.icon.prev
			}, this.props));
		}
	}]);
	return WFIPrev;
}(_react.Component);

// ------------------- //

var WFINext = function (_Component5) {
	(0, _inherits3.default)(WFINext, _Component5);

	function WFINext() {
		(0, _classCallCheck3.default)(this, WFINext);
		return (0, _possibleConstructorReturn3.default)(this, (WFINext.__proto__ || (0, _getPrototypeOf2.default)(WFINext)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFINext, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: classes.icon.next
			}, this.props));
		}
	}]);
	return WFINext;
}(_react.Component);

// ------------------- //

var WFICheck = function (_Component6) {
	(0, _inherits3.default)(WFICheck, _Component6);

	function WFICheck() {
		(0, _classCallCheck3.default)(this, WFICheck);
		return (0, _possibleConstructorReturn3.default)(this, (WFICheck.__proto__ || (0, _getPrototypeOf2.default)(WFICheck)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFICheck, [{
		key: "render",
		value: function render() {
			var _props$checked = this.props.checked,
			    checked = _props$checked === undefined ? false : _props$checked;

			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: checked ? classes.icon.checked : classes.icon.unchecked
			}, this.props));
		}
	}]);
	return WFICheck;
}(_react.Component);

// ------------------- //

var WFICheck2 = function (_Component7) {
	(0, _inherits3.default)(WFICheck2, _Component7);

	function WFICheck2() {
		(0, _classCallCheck3.default)(this, WFICheck2);
		return (0, _possibleConstructorReturn3.default)(this, (WFICheck2.__proto__ || (0, _getPrototypeOf2.default)(WFICheck2)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFICheck2, [{
		key: "render",
		value: function render() {
			var _props$checked2 = this.props.checked,
			    checked = _props$checked2 === undefined ? false : _props$checked2;

			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: checked ? classes.icon.valid : classes.icon.unchecked
			}, this.props));
		}
	}]);
	return WFICheck2;
}(_react.Component);

// ------------------- //

var WFIUp = function (_Component8) {
	(0, _inherits3.default)(WFIUp, _Component8);

	function WFIUp() {
		(0, _classCallCheck3.default)(this, WFIUp);
		return (0, _possibleConstructorReturn3.default)(this, (WFIUp.__proto__ || (0, _getPrototypeOf2.default)(WFIUp)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIUp, [{
		key: "render",
		value: function render() {
			var _props$active = this.props.active,
			    active = _props$active === undefined ? false : _props$active;

			return _react2.default.createElement(WFIPrev, (0, _extends3.default)({
				className: classes.up
			}, this.props));
		}
	}]);
	return WFIUp;
}(_react.Component);

// ------------------- //

var WFIDown = function (_Component9) {
	(0, _inherits3.default)(WFIDown, _Component9);

	function WFIDown() {
		(0, _classCallCheck3.default)(this, WFIDown);
		return (0, _possibleConstructorReturn3.default)(this, (WFIDown.__proto__ || (0, _getPrototypeOf2.default)(WFIDown)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIDown, [{
		key: "render",
		value: function render() {
			var _props$active2 = this.props.active,
			    active = _props$active2 === undefined ? false : _props$active2;

			return _react2.default.createElement(WFINext, (0, _extends3.default)({
				className: classes.down
			}, this.props));
		}
	}]);
	return WFIDown;
}(_react.Component);

// ------------------- //

var WFIOpen = function (_Component10) {
	(0, _inherits3.default)(WFIOpen, _Component10);

	function WFIOpen() {
		(0, _classCallCheck3.default)(this, WFIOpen);
		return (0, _possibleConstructorReturn3.default)(this, (WFIOpen.__proto__ || (0, _getPrototypeOf2.default)(WFIOpen)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIOpen, [{
		key: "render",
		value: function render() {
			var _props$open = this.props.open,
			    open = _props$open === undefined ? false : _props$open;

			return _react2.default.createElement(WFINext, (0, _extends3.default)({
				className: open ? classes.state.open : classes.state.close
			}, this.props));
		}
	}]);
	return WFIOpen;
}(_react.Component);

// ------------------- //

var WFIEdit = function (_Component11) {
	(0, _inherits3.default)(WFIEdit, _Component11);

	function WFIEdit() {
		(0, _classCallCheck3.default)(this, WFIEdit);
		return (0, _possibleConstructorReturn3.default)(this, (WFIEdit.__proto__ || (0, _getPrototypeOf2.default)(WFIEdit)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIEdit, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: classes.icon.edit
			}, this.props));
		}
	}]);
	return WFIEdit;
}(_react.Component);

// ------------------- //

var WFIVisible = function (_Component12) {
	(0, _inherits3.default)(WFIVisible, _Component12);

	function WFIVisible() {
		(0, _classCallCheck3.default)(this, WFIVisible);
		return (0, _possibleConstructorReturn3.default)(this, (WFIVisible.__proto__ || (0, _getPrototypeOf2.default)(WFIVisible)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIVisible, [{
		key: "render",
		value: function render() {
			var _props$visible2 = this.props.visible,
			    visible = _props$visible2 === undefined ? true : _props$visible2;

			return _react2.default.createElement(WFIcon, (0, _extends3.default)({ icon: visible ? classes.icon.visible : classes.icon.unvisible,
				className: visible ? classes.state.active : classes.state.not
			}, this.props));
		}
	}]);
	return WFIVisible;
}(_react.Component);

// ------------------- //

var WFIState = function (_Component13) {
	(0, _inherits3.default)(WFIState, _Component13);

	function WFIState() {
		(0, _classCallCheck3.default)(this, WFIState);
		return (0, _possibleConstructorReturn3.default)(this, (WFIState.__proto__ || (0, _getPrototypeOf2.default)(WFIState)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIState, [{
		key: "render",
		value: function render() {
			var _props$valid = this.props.valid,
			    valid = _props$valid === undefined ? null : _props$valid;

			if (valid === null) return false;
			var icon = !valid ? classes.icon.close : classes.icon.valid;
			return _react2.default.createElement(
				"wf-state",
				null,
				_react2.default.createElement(WFIcon, (0, _extends3.default)({ icon: icon }, this.props))
			);
		}
	}]);
	return WFIState;
}(_react.Component);

// ------------------- //

var WFIPlay = function (_Component14) {
	(0, _inherits3.default)(WFIPlay, _Component14);

	function WFIPlay() {
		(0, _classCallCheck3.default)(this, WFIPlay);
		return (0, _possibleConstructorReturn3.default)(this, (WFIPlay.__proto__ || (0, _getPrototypeOf2.default)(WFIPlay)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFIPlay, [{
		key: "render",
		value: function render() {
			var _props$playing = this.props.playing,
			    playing = _props$playing === undefined ? false : _props$playing;

			var icon = playing ? classes.icon.play : classes.icon.stop;
			return _react2.default.createElement(WFIcon, (0, _extends3.default)({
				icon: icon
			}, this.props));
		}
	}]);
	return WFIPlay;
}(_react.Component);

// ------------------- //

exports.WFIcon = WFIcon;
exports.WFIClose = WFIClose;
exports.WFIOpen = WFIOpen;
exports.WFIPlay = WFIPlay;
exports.WFIPrev = WFIPrev;
exports.WFINext = WFINext;
exports.WFIUp = WFIUp;
exports.WFIDown = WFIDown;
exports.WFICheck = WFICheck;
exports.WFICheck2 = WFICheck2;
exports.WFIAdd = WFIAdd;
exports.WFIEdit = WFIEdit;
exports.WFIVisible = WFIVisible;
exports.WFIState = WFIState;

// ------------------- //

/*

<WFIcon
	icon={icon}
	className={className}
	onClick={optional}
/>

<WFIClose/>
<WFIAdd/>
<WFIPrev/>
<WFINext/>

*/

/***/ }),
/* 9 */,
/* 10 */,
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _MaxStr = __webpack_require__(123);

var _MaxStr2 = _interopRequireDefault(_MaxStr);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TEXT ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-text"
};

// ------------------- //

var WFText = function (_Component) {
	(0, _inherits3.default)(WFText, _Component);

	function WFText() {
		(0, _classCallCheck3.default)(this, WFText);
		return (0, _possibleConstructorReturn3.default)(this, (WFText.__proto__ || (0, _getPrototypeOf2.default)(WFText)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFText, [{
		key: 'render',


		// ------------------- //

		value: function render() {
			var _props = this.props,
			    _props$children = _props.children,
			    children = _props$children === undefined ? null : _props$children,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$style = _props.style,
			    style = _props$style === undefined ? {} : _props$style;

			if (!children || children === "") return false;
			return _react2.default.createElement(
				'span',
				{ className: classes.wrapper + ' ' + className },
				!this.isHtml() ? this.getContent(children, style) : this.getContentHtml(children, style),
				this.getCounter(),
				this.getPreview(children)
			);
		}

		// ------------------- //

	}, {
		key: 'getContent',
		value: function getContent(content) {
			var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
			var _props2 = this.props,
			    _props2$limit = _props2.limit,
			    limit = _props2$limit === undefined ? 0 : _props2$limit,
			    _props2$limitSufix = _props2.limitSufix,
			    limitSufix = _props2$limitSufix === undefined ? "..." : _props2$limitSufix;

			return _react2.default.createElement(
				'span',
				{ style: style },
				limit < 1 ? content : (0, _MaxStr2.default)(content, limit, limitSufix),
				' '
			);
		}

		// ------------------- //

	}, {
		key: 'getContentHtml',
		value: function getContentHtml(content) {
			var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

			return _react2.default.createElement('span', { style: style, dangerouslySetInnerHTML: { __html: content } });
		}

		// ------------------- //

	}, {
		key: 'getCounter',
		value: function getCounter() {
			var _props3 = this.props,
			    _props3$counter = _props3.counter,
			    counter = _props3$counter === undefined ? 0 : _props3$counter,
			    _props3$counterMax = _props3.counterMax,
			    counterMax = _props3$counterMax === undefined ? 0 : _props3$counterMax,
			    _props3$counterParent = _props3.counterParenthesis,
			    counterParenthesis = _props3$counterParent === undefined ? true : _props3$counterParent;

			if (counter === 0) return false;
			return _react2.default.createElement(_WFCounter2.default, { counter: counter, max: counterMax, parenthesis: counterParenthesis });
		}

		// ------------------- //

	}, {
		key: 'getPreview',
		value: function getPreview(content) {
			var _props4 = this.props,
			    _props4$preview = _props4.preview,
			    preview = _props4$preview === undefined ? false : _props4$preview,
			    _props4$previewDirect = _props4.previewDirection,
			    previewDirection = _props4$previewDirect === undefined ? "bottom" : _props4$previewDirect,
			    _props4$previewSplit = _props4.previewSplit,
			    previewSplit = _props4$previewSplit === undefined ? "" : _props4$previewSplit;

			if (!preview || this.isHtml()) return false;
			if (!this.isLimit(content)) return false;
			if (previewSplit === "") {
				return _react2.default.createElement(
					'span',
					{ className: 'wf-full ' + previewDirection },
					content
				);
			} else {
				var items = content.split(previewSplit);
				return _react2.default.createElement(
					'span',
					{ className: 'wf-full ' + previewDirection },
					_react2.default.createElement(
						'ul',
						null,
						items.map(function (item, i) {
							return _react2.default.createElement(
								'li',
								{ key: i },
								item
							);
						})
					)
				);
			}
		}

		// ------------------- //

	}, {
		key: 'isHtml',
		value: function isHtml() {
			return this.props.html || false;
		}

		// ------------------- //

	}, {
		key: 'isLimit',
		value: function isLimit(content) {
			var _props$limit = this.props.limit,
			    limit = _props$limit === undefined ? 0 : _props$limit;

			return content.length > limit;
		}
	}]);
	return WFText;
}(_react.Component);

// ------------------- //

exports.default = WFText;

// ------------------- //

/*

	<WFText
	html={true}
	className={className}
	><strong>Hello<strong> world...</strong></WFText>

	<WFText
	html={true}
	className={className}
	counter={18}
	counterMax={36}
	><strong>Hello<strong> world...</strong></WFText>

	<WFText
	className={className}
	limit={40}
	limitSufix={"..."}
	limitPreview={true}
	preview={true}
	previewDirection={"bottom"}
	>Est-ce que vous avez des commentaires pour fusionner les documents ?</WFText>

	<WFText
	className={className}
	limit={40}
	limitSufix={"..."}
	preview={true}
	previewSplit={","}
	previewDirection={"bottom"}
	>Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial</WFText>

*/

/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_PRODUCTTYPE_STATUS = exports.WF_PRODUCTTYPE_STATUS = "wf_producttype_status";

// VIEW INFOS                                     // -------------------- //

var HEIGHT = exports.HEIGHT = "height";
var WIDTH = exports.WIDTH = "width";

// WF ENTITIES                                    // -------------------- //

var WF_FORM_CONFIG = exports.WF_FORM_CONFIG = "wf_form-config";
var WF_FIELD_CONFIG = exports.WF_FIELD_CONFIG = "wf_field-config";
var WF_STEP = exports.WF_STEP = "wf_step";
var WF_CONTENT = exports.WF_CONTENT = "wf_content";
var WF_BAOBAB_TREE = exports.WF_BAOBAB_TREE = "tree";
var WF_BAOBAB_BRANCH = exports.WF_BAOBAB_BRANCH = "branch";
var WF_BAOBAB_OPTION = exports.WF_BAOBAB_OPTION = "option";

// VIEW KEYWORDS                                  // -------------------- //

var WF_VIEW_NAME = exports.WF_VIEW_NAME = "view_name";
var WF_VIEW_TABS = exports.WF_VIEW_TABS = "view_tabs";
var WF_VIEW_TAB = exports.WF_VIEW_TAB = "view_tab";
var WF_VIEW_TABS_COUNT = exports.WF_VIEW_TABS_COUNT = "view_tabs_count";
var WF_VIEW_TAB_CURRENT = exports.WF_VIEW_TAB_CURRENT = "view_tab_current";
var WF_VIEW_TAB_VISIBLE = exports.WF_VIEW_TAB_VISIBLE = "view_tab_visible";

// VIEW HELPER                                    // -------------------- //

var WF_LOADER = exports.WF_LOADER = "wf_loader";
var WF_ALERT = exports.WF_ALERT = "wf_alert";
var WF_NOTIFY = exports.WF_NOTIFY = "wf_notify";
var WF_REDIRECT = exports.WF_REDIRECT = "wf_redirect";
var WF_COMFIRM = exports.WF_COMFIRM = "wf_comfirm";
var WF_OVERLAY = exports.WF_OVERLAY = "wf_overlay";
var WF_PLAYER = exports.WF_PLAYER = "wf_player";
var WF_PANEL = exports.WF_PANEL = "wf_panel";
var WF_MODAL = exports.WF_MODAL = "wf_modal";
var WF_TOOLTIP = exports.WF_TOOLTIP = "wf_tooltip";
var WF_LIVEPLAYER = exports.WF_LIVEPLAYER = "wf_live_player";

var WF_PAGE = exports.WF_PAGE = "wf_page";
var WF_PAGE_TITLE = exports.WF_PAGE_TITLE = "wf_page_title";
var WF_PAGE_TITLE_BODY_CLASS = exports.WF_PAGE_TITLE_BODY_CLASS = "wf-page-top";

var WF_PANELS = exports.WF_PANELS = "wf_panels";
var WF_PANELS_CUSTOM = exports.WF_PANELS_CUSTOM = "wf_panels_custom";
var WF_PANELS_CUSTOM_ARGS = exports.WF_PANELS_CUSTOM_ARGS = "wf_panels_custom_args";

var WF_EDITOR = exports.WF_EDITOR = "wf_editor";
var WF_EDITOR_READY = exports.WF_EDITOR_READY = "wf_editor_ready";
var WF_EDITOR_ERROR = exports.WF_EDITOR_ERROR = "wf_editor_error";
var WF_EDITOR_CUSTOM_VIEW = exports.WF_EDITOR_CUSTOM_VIEW = "wf_editor_custom_view";
var WF_EDITOR_CUSTOM_VIEW_ARGS = exports.WF_EDITOR_CUSTOM_VIEW_ARGS = "wf_editor_custom_view_args";

// PAGE HOME                                     // -------------------- //

var PAGE_HOME = exports.PAGE_HOME = "pageHome";

var TAB_MATRICE = exports.TAB_MATRICE = "matrice";
var TAB_HOME = exports.TAB_HOME = "home";
var TAB_EDITOR = exports.TAB_EDITOR = "editor";
var TAB_ANALYTICS = exports.TAB_ANALYTICS = "analytics";

var TAB_HOME_CREATE = exports.TAB_HOME_CREATE = "create";
var TAB_HOME_FORM = exports.TAB_HOME_FORM = "forms";
var TAB_HOME_BAOBAB = exports.TAB_HOME_BAOBAB = "baobab";
var TAB_HOME_SETTING = exports.TAB_HOME_SETTING = "setting";

var TAB_HOME_CREATE_LABEL = exports.TAB_HOME_CREATE_LABEL = "All Forms";
var TAB_HOME_FORM_LABEL = exports.TAB_HOME_FORM_LABEL = "Your Forms";
var TAB_HOME_BAOBAB_LABEL = exports.TAB_HOME_BAOBAB_LABEL = "Baobab";
var TAB_HOME_SETTING_LABEL = exports.TAB_HOME_SETTING_LABEL = "Setting";

// PAGE FORM EDITOR                              // -------------------- //

var PAGE_FORM_EDITOR = exports.PAGE_FORM_EDITOR = "pageFormEditor";

var TAB_EDITOR_STUDIO = exports.TAB_EDITOR_STUDIO = "studio";
var TAB_EDITOR_ACTIONS = exports.TAB_EDITOR_ACTIONS = "actions";
var TAB_EDITOR_ENTRIES = exports.TAB_EDITOR_ENTRIES = "entries";
var TAB_EDITOR_ANALYTICS = exports.TAB_EDITOR_ANALYTICS = "analytics";

var TAB_EDITOR_STUDIO_LABEL = exports.TAB_EDITOR_STUDIO_LABEL = "Studio";
var TAB_EDITOR_ACTIONS_LABEL = exports.TAB_EDITOR_ACTIONS_LABEL = "Actions";
var TAB_EDITOR_ENTRIES_LABEL = exports.TAB_EDITOR_ENTRIES_LABEL = "Entries";
var TAB_EDITOR_ANALYTICS_LABEL = exports.TAB_EDITOR_ANALYTICS_LABEL = "Analytics";

var TAB_ANALYTICS_FORM = exports.TAB_ANALYTICS_FORM = "form";
var TAB_ANALYTICS_FIELDS = exports.TAB_ANALYTICS_FIELDS = "fields";
var TAB_ANALYTICS_FORM_LABEL = exports.TAB_ANALYTICS_FORM_LABEL = "Form Analytics";
var TAB_ANALYTICS_FIELDS_LABEL = exports.TAB_ANALYTICS_FIELDS_LABEL = "Fields Analytics";

// COLOR                                         // -------------------- //

var COLOR_TRANSPARENT = exports.COLOR_TRANSPARENT = "transparent";
var COLOR_DARK = exports.COLOR_DARK = "rgba(60,60,60,0.8)";

// NOTIFICATION TYPE                             // -------------------- //

var NOTIFY_INFO = exports.NOTIFY_INFO = "info";
var NOTIFY_SUCCESS = exports.NOTIFY_SUCCESS = "success";
var NOTIFY_ERROR = exports.NOTIFY_ERROR = "error";
var NOTIFY_WARNING = exports.NOTIFY_WARNING = "warning";

// SELECT BY                                     // -------------------- //

var WF_SELECT_CLASS = exports.WF_SELECT_CLASS = "selected";
var WF_SELECT_BY_ID = exports.WF_SELECT_BY_ID = "id";
var WF_SELECT_BY_NAME = exports.WF_SELECT_BY_NAME = "name";
var WF_SELECT_BY_LABEL = exports.WF_SELECT_BY_LABEL = "label";

// VIEW ACTION                                   // -------------------- //

var WF_VIEW_ACTION_WILL_MOUNT = exports.WF_VIEW_ACTION_WILL_MOUNT = "wf_view_will_mount";
var WF_VIEW_ACTION_DID_MOUNT = exports.WF_VIEW_ACTION_DID_MOUNT = "wf_view_did_mount";
var WF_VIEW_ACTION_WILL_UNMOUNT = exports.WF_VIEW_ACTION_WILL_UNMOUNT = "wf_view_will_unmount";

/***/ }),
/* 13 */,
/* 14 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BTN ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-btn",
	active: "active",
	disable: "wf-btn-disable"
};

// ------------------- //

var WFBtn = function (_Component) {
	(0, _inherits3.default)(WFBtn, _Component);

	function WFBtn() {
		(0, _classCallCheck3.default)(this, WFBtn);
		return (0, _possibleConstructorReturn3.default)(this, (WFBtn.__proto__ || (0, _getPrototypeOf2.default)(WFBtn)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFBtn, [{
		key: "render",


		// ------------------- //

		value: function render() {
			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible,
			    _props$children = _props.children,
			    children = _props$children === undefined ? "" : _props$children,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$icon = _props.icon,
			    icon = _props$icon === undefined ? "" : _props$icon,
			    _props$iconClassName = _props.iconClassName,
			    iconClassName = _props$iconClassName === undefined ? "" : _props$iconClassName,
			    _props$active = _props.active,
			    active = _props$active === undefined ? false : _props$active,
			    _props$disable = _props.disable,
			    disable = _props$disable === undefined ? false : _props$disable,
			    _props$counter = _props.counter,
			    counter = _props$counter === undefined ? 0 : _props$counter,
			    _props$counterMax = _props.counterMax,
			    counterMax = _props$counterMax === undefined ? 0 : _props$counterMax,
			    _props$style = _props.style,
			    style = _props$style === undefined ? {} : _props$style,
			    _onClick = _props.onClick;

			if (!visible) return false;
			if (disable) {
				return _react2.default.createElement(
					"span",
					{
						style: style,
						className: classes.wrapper + " " + className + " " + classes.disable },
					_react2.default.createElement(_WFIcon.WFIcon, { icon: icon, className: iconClassName }),
					_react2.default.createElement(
						_WFText2.default,
						{ counter: counter, counterMax: counterMax },
						children
					)
				);
			} else {
				return _react2.default.createElement(
					"span",
					{
						style: style,
						className: classes.wrapper + " " + className + " " + (active ? classes.active : ""),
						onClick: function onClick() {
							return (0, _Lodash.isFunction)(_onClick) ? _onClick() : "";
						} },
					_react2.default.createElement(_WFIcon.WFIcon, { icon: icon, className: iconClassName }),
					_react2.default.createElement(
						_WFText2.default,
						{ counter: counter, counterMax: counterMax },
						children
					)
				);
			}
		}
	}]);
	return WFBtn;
}(_react.Component);

// ------------------- //

exports.default = WFBtn;

// ------------------- //

/*

	<WFBtn 
	className={classes} 
	onClick={onClick} 
	icon={icon}>
		Save form
	</WFBtn>
*/

/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WF_CONTENT_ITEM_STR = exports.WF_CALENDAR_EVENT_RECURRENCE_STR = exports.WF_CALENDAR_EVENT_REMINDERS_STR = exports.WF_CALENDAR_EVENT_ATTENDEES_STR = exports.WF_CALENDAR_EVENT_STR = exports.WF_SESSION_LOGIN_STR = exports.WF_QUIZ_QUIZZ_STR = exports.WF_PAGEBUILDER_SIMPLE_PAGE_STR = exports.WF_SIGNUP_ACTIVATION_STR = exports.WF_SIGNUP_LOST_PASSWORD_STR = exports.WF_SIGNUP_PROFILE_STR = exports.WF_SHOP_CART_STR = exports.WF_SHOP_PAYMENT_STR = exports.WF_SHOP_ORDER_ITEMS_STR = exports.WF_SHOP_ORDER_STR = exports.WF_CATALOG_PRODUCT_STR = exports.WF_CONTACT_ADVANCED_STR = exports.WF_CONTACT_SIMPLE_STR = exports.WF_CUSTOM_CUSTOM_STR = exports.WF_CORE_CATEGORY_ENTRY_STR = exports.WF_CORE_EVENT_TYPE_STR = exports.WF_CORE_SETTING_STR = exports.WF_CORE_LICENSE_STR = exports.WF_CORE_ACTION_STR = exports.WF_CORE_ACTION_TYPE_STR = exports.WF_CORE_FIELD_CONFIG_STR = exports.WF_CORE_FORM_CONFIG_STR = exports.WF_CORE_OPTION_GROUP_STR = exports.WF_CORE_OPTION_STR = exports.WF_CORE_FIELD_SPEC_STR = exports.WF_CORE_PRODUCT_TYPE_STR = exports.WF_CORE_MODULE_STR = exports.WF_CONTENT_ITEM_ID = exports.WF_CALENDAR_EVENT_RECURRENCE_ID = exports.WF_CALENDAR_EVENT_REMINDERS_ID = exports.WF_CALENDAR_EVENT_ATTENDEES_ID = exports.WF_CALENDAR_EVENT_ID = exports.WF_SESSION_LOGIN_ID = exports.WF_CONTACT_ADVANCED_ID = exports.WF_CONTACT_SIMPLE_ID = exports.WF_PAGEBUILDER_SIMPLE_PAGE_ID = exports.WF_SIGNUP_ACTIVATION_ID = exports.WF_SIGNUP_LOST_PASSWORD_ID = exports.WF_SIGNUP_PROFILE_ID = exports.WF_SHOP_CART_ID = exports.WF_SHOP_PAYMENT_ID = exports.WF_SHOP_ORDER_ITEMS_ID = exports.WF_SHOP_ORDER_ID = exports.WF_CATALOG_PRODUCT_ID = exports.WF_QUIZ_QUIZZ_ID = exports.WF_CUSTOM_CUSTOM_ID = exports.WF_CORE_CATEGORY_ENTRY_ID = exports.WF_CORE_EVENT_TYPE_ID = exports.WF_CORE_SETTING_ID = exports.WF_CORE_LICENSE_ID = exports.WF_CORE_ACTION_ID = exports.WF_CORE_ACTION_TYPE_ID = exports.WF_CORE_FIELD_CONFIG_ID = exports.WF_CORE_FORM_CONFIG_ID = exports.WF_CORE_OPTION_GROUP_ID = exports.WF_CORE_OPTION_ID = exports.WF_CORE_FIELD_SPEC_ID = exports.WF_CORE_PRODUCT_TYPE_ID = exports.WF_CORE_MODULE_ID = exports.WF_CONTENT_STR = exports.WF_CALENDAR_STR = exports.WF_SESSION_STR = exports.WF_CONTACT_STR = exports.WF_PAGEBUILDER_STR = exports.WF_SIGNUP_STR = exports.WF_SHOP_STR = exports.WF_CATALOG_STR = exports.WF_QUIZ_STR = exports.WF_CUSTOM_STR = exports.WF_CORE_STR = exports.WF_MAX_ADDON_ID = exports.WF_CONTENT_ID = exports.WF_CALENDAR_ID = exports.WF_SESSION_ID = exports.WF_CONTACT_ID = exports.WF_PAGEBUILDER_ID = exports.WF_SIGNUP_ID = exports.WF_SHOP_ID = exports.WF_CATALOG_ID = exports.WF_QUIZ_ID = exports.WF_CUSTOM_ID = exports.WF_CORE_ID = undefined;

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Define main producttypes constants
var WF_CORE_ID = exports.WF_CORE_ID = 1;
var WF_CUSTOM_ID = exports.WF_CUSTOM_ID = 2;
var WF_QUIZ_ID = exports.WF_QUIZ_ID = 3;
var WF_CATALOG_ID = exports.WF_CATALOG_ID = 4;
var WF_SHOP_ID = exports.WF_SHOP_ID = 5;
var WF_SIGNUP_ID = exports.WF_SIGNUP_ID = 6;
var WF_PAGEBUILDER_ID = exports.WF_PAGEBUILDER_ID = 7;
var WF_CONTACT_ID = exports.WF_CONTACT_ID = 8;
var WF_SESSION_ID = exports.WF_SESSION_ID = 9;
var WF_CALENDAR_ID = exports.WF_CALENDAR_ID = 10;
var WF_CONTENT_ID = exports.WF_CONTENT_ID = 11;

var WF_MAX_ADDON_ID = exports.WF_MAX_ADDON_ID = 99;

var WF_CORE_STR = exports.WF_CORE_STR = 'core';
var WF_CUSTOM_STR = exports.WF_CUSTOM_STR = 'custom';
var WF_QUIZ_STR = exports.WF_QUIZ_STR = 'quiz';
var WF_CATALOG_STR = exports.WF_CATALOG_STR = 'catalog';
var WF_SHOP_STR = exports.WF_SHOP_STR = 'shop';
var WF_SIGNUP_STR = exports.WF_SIGNUP_STR = 'signup';
var WF_PAGEBUILDER_STR = exports.WF_PAGEBUILDER_STR = 'pagebuilder';
var WF_CONTACT_STR = exports.WF_CONTACT_STR = 'contact';
var WF_SESSION_STR = exports.WF_SESSION_STR = 'session';
var WF_CALENDAR_STR = exports.WF_CALENDAR_STR = 'calendar';
var WF_CONTENT_STR = exports.WF_CONTENT_STR = 'content';

// Define sub producttypes constants
// define core subtypes ids range 100 - 199
var WF_CORE_MODULE_ID = exports.WF_CORE_MODULE_ID = 100;
var WF_CORE_PRODUCT_TYPE_ID = exports.WF_CORE_PRODUCT_TYPE_ID = 101;
var WF_CORE_FIELD_SPEC_ID = exports.WF_CORE_FIELD_SPEC_ID = 102;
var WF_CORE_OPTION_ID = exports.WF_CORE_OPTION_ID = 103;
var WF_CORE_OPTION_GROUP_ID = exports.WF_CORE_OPTION_GROUP_ID = 104;
var WF_CORE_FORM_CONFIG_ID = exports.WF_CORE_FORM_CONFIG_ID = 105;
var WF_CORE_FIELD_CONFIG_ID = exports.WF_CORE_FIELD_CONFIG_ID = 106;
var WF_CORE_ACTION_TYPE_ID = exports.WF_CORE_ACTION_TYPE_ID = 107;
var WF_CORE_ACTION_ID = exports.WF_CORE_ACTION_ID = 108;
var WF_CORE_LICENSE_ID = exports.WF_CORE_LICENSE_ID = 112;
var WF_CORE_SETTING_ID = exports.WF_CORE_SETTING_ID = 113;
var WF_CORE_EVENT_TYPE_ID = exports.WF_CORE_EVENT_TYPE_ID = 114;
var WF_CORE_CATEGORY_ENTRY_ID = exports.WF_CORE_CATEGORY_ENTRY_ID = 115;
// define custom forms ids range 200 - 299
var WF_CUSTOM_CUSTOM_ID = exports.WF_CUSTOM_CUSTOM_ID = 200;
// define quiz subtypes ids range 300 - 399
var WF_QUIZ_QUIZZ_ID = exports.WF_QUIZ_QUIZZ_ID = 300;
// define catalog forms ids range 400 - 499
var WF_CATALOG_PRODUCT_ID = exports.WF_CATALOG_PRODUCT_ID = 400;
// define shop subtypes ids range 500 - 599
var WF_SHOP_ORDER_ID = exports.WF_SHOP_ORDER_ID = 500;
var WF_SHOP_ORDER_ITEMS_ID = exports.WF_SHOP_ORDER_ITEMS_ID = 501;
var WF_SHOP_PAYMENT_ID = exports.WF_SHOP_PAYMENT_ID = 502;
var WF_SHOP_CART_ID = exports.WF_SHOP_CART_ID = 503;
// define signup subtypes ids range 600 - 699
var WF_SIGNUP_PROFILE_ID = exports.WF_SIGNUP_PROFILE_ID = 600;
var WF_SIGNUP_LOST_PASSWORD_ID = exports.WF_SIGNUP_LOST_PASSWORD_ID = 601;
var WF_SIGNUP_ACTIVATION_ID = exports.WF_SIGNUP_ACTIVATION_ID = 602;
// define store subtypes ids range 700 - 799
var WF_PAGEBUILDER_SIMPLE_PAGE_ID = exports.WF_PAGEBUILDER_SIMPLE_PAGE_ID = 700;
// define contact subtypes ids range 800 - 899
var WF_CONTACT_SIMPLE_ID = exports.WF_CONTACT_SIMPLE_ID = 800;
var WF_CONTACT_ADVANCED_ID = exports.WF_CONTACT_ADVANCED_ID = 801;
// define session subtypes ids range 900 - 999
var WF_SESSION_LOGIN_ID = exports.WF_SESSION_LOGIN_ID = 900;
// define calendar subtypes ids range 1000 - 1099
var WF_CALENDAR_EVENT_ID = exports.WF_CALENDAR_EVENT_ID = 1000;
var WF_CALENDAR_EVENT_ATTENDEES_ID = exports.WF_CALENDAR_EVENT_ATTENDEES_ID = 1001;
var WF_CALENDAR_EVENT_REMINDERS_ID = exports.WF_CALENDAR_EVENT_REMINDERS_ID = 1002;
var WF_CALENDAR_EVENT_RECURRENCE_ID = exports.WF_CALENDAR_EVENT_RECURRENCE_ID = 1003;
// define content subtypes ids range 1100 - 1199
var WF_CONTENT_ITEM_ID = exports.WF_CONTENT_ITEM_ID = 1100;

// define producttypes names
var WF_CORE_MODULE_STR = exports.WF_CORE_MODULE_STR = 'core-module';
var WF_CORE_PRODUCT_TYPE_STR = exports.WF_CORE_PRODUCT_TYPE_STR = 'core-product-type';
var WF_CORE_FIELD_SPEC_STR = exports.WF_CORE_FIELD_SPEC_STR = 'core-field-spec';
var WF_CORE_OPTION_STR = exports.WF_CORE_OPTION_STR = 'core-option';
var WF_CORE_OPTION_GROUP_STR = exports.WF_CORE_OPTION_GROUP_STR = 'core-option-group';
var WF_CORE_FORM_CONFIG_STR = exports.WF_CORE_FORM_CONFIG_STR = 'core-form-config';
var WF_CORE_FIELD_CONFIG_STR = exports.WF_CORE_FIELD_CONFIG_STR = 'core-field-config';
var WF_CORE_ACTION_TYPE_STR = exports.WF_CORE_ACTION_TYPE_STR = 'core-action-type';
var WF_CORE_ACTION_STR = exports.WF_CORE_ACTION_STR = 'core-action';
var WF_CORE_LICENSE_STR = exports.WF_CORE_LICENSE_STR = 'core-license';
var WF_CORE_SETTING_STR = exports.WF_CORE_SETTING_STR = 'core-setting';
var WF_CORE_EVENT_TYPE_STR = exports.WF_CORE_EVENT_TYPE_STR = 'core-event-type';
var WF_CORE_CATEGORY_ENTRY_STR = exports.WF_CORE_CATEGORY_ENTRY_STR = 'core-category-entry';
var WF_CUSTOM_CUSTOM_STR = exports.WF_CUSTOM_CUSTOM_STR = 'custom-custom';
var WF_CONTACT_SIMPLE_STR = exports.WF_CONTACT_SIMPLE_STR = 'contact-simple';
var WF_CONTACT_ADVANCED_STR = exports.WF_CONTACT_ADVANCED_STR = 'contact-advanced';
var WF_CATALOG_PRODUCT_STR = exports.WF_CATALOG_PRODUCT_STR = 'catalog-product';
var WF_SHOP_ORDER_STR = exports.WF_SHOP_ORDER_STR = 'shop-order';
var WF_SHOP_ORDER_ITEMS_STR = exports.WF_SHOP_ORDER_ITEMS_STR = 'shop-items';
var WF_SHOP_PAYMENT_STR = exports.WF_SHOP_PAYMENT_STR = 'shop-payment';
var WF_SHOP_CART_STR = exports.WF_SHOP_CART_STR = 'shop-cart';
var WF_SIGNUP_PROFILE_STR = exports.WF_SIGNUP_PROFILE_STR = 'signup-profile';
var WF_SIGNUP_LOST_PASSWORD_STR = exports.WF_SIGNUP_LOST_PASSWORD_STR = 'signup-lost-password';
var WF_SIGNUP_ACTIVATION_STR = exports.WF_SIGNUP_ACTIVATION_STR = 'signup-activation';
var WF_PAGEBUILDER_SIMPLE_PAGE_STR = exports.WF_PAGEBUILDER_SIMPLE_PAGE_STR = 'pagebuilder-simple-page';
var WF_QUIZ_QUIZZ_STR = exports.WF_QUIZ_QUIZZ_STR = 'quiz-quizz';
var WF_SESSION_LOGIN_STR = exports.WF_SESSION_LOGIN_STR = 'session-login';
var WF_CALENDAR_EVENT_STR = exports.WF_CALENDAR_EVENT_STR = 'calendar-event';
var WF_CALENDAR_EVENT_ATTENDEES_STR = exports.WF_CALENDAR_EVENT_ATTENDEES_STR = 'calendar-event-attendees';
var WF_CALENDAR_EVENT_REMINDERS_STR = exports.WF_CALENDAR_EVENT_REMINDERS_STR = 'calendar-event-reminders';
var WF_CALENDAR_EVENT_RECURRENCE_STR = exports.WF_CALENDAR_EVENT_RECURRENCE_STR = 'calendar-event-recurrence';
var WF_CONTENT_ITEM_STR = exports.WF_CONTENT_ITEM_STR = 'content-item';

/**
 * Holds product types
 */

var WFProductType = function () {
  function WFProductType() {
    (0, _classCallCheck3.default)(this, WFProductType);
  }

  (0, _createClass3.default)(WFProductType, null, [{
    key: 'getModuleList',

    /**
     * Get top list of producttypes (modules) as dictionary
     * key is the product name
     * value is the product type
     */
    value: function getModuleList() {
      if (typeof WFProductType.moduleList == 'undefined') {
        WFProductType.moduleList = {
          WF_CORE_STR: WF_CORE_ID,
          WF_CUSTOM_STR: WF_CUSTOM_ID,
          WF_QUIZ_STR: WF_QUIZ_ID,
          WF_CATALOG_STR: WF_CATALOG_ID,
          WF_SHOP_STR: WF_SHOP_ID,
          WF_SIGNUP_STR: WF_SIGNUP_ID,
          WF_PAGEBUILDER_STR: WF_PAGEBUILDER_ID,
          WF_CONTENT_STR: WF_CONTENT_ID,
          WF_CONTACT_STR: WF_CONTACT_ID,
          WF_SESSION_STR: WF_SESSION_ID,
          WF_CALENDAR_STR: WF_CALENDAR_ID
        };
      }
      return WFProductType.moduleList;
    }

    /**
     * Get list of form types that can be created by user as dictionary
     * key is the product name
     * value is the product type
     */

  }, {
    key: 'getFormTypeList',
    value: function getFormTypeList() {
      if (typeof WFProductType.formTypeList == 'undefined') {
        WFProductType.formTypeList = {
          WF_CUSTOM_CUSTOM_STR: WF_CUSTOM_CUSTOM_ID,
          WF_CONTACT_SIMPLE_STR: WF_CONTACT_SIMPLE_ID,
          WF_CONTACT_ADVANCED_STR: WF_CONTACT_ADVANCED_ID,
          WF_QUIZ_QUIZZ_STR: WF_QUIZ_QUIZZ_ID,
          WF_SESSION_LOGIN_STR: WF_SESSION_LOGIN_ID,
          WF_SIGNUP_PROFILE_STR: WF_SIGNUP_PROFILE_ID
        };
      }
      return WFProductType.formTypeList;
    }
  }]);
  return WFProductType;
}();

;

exports.default = WFProductType;

/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_EVENT_ONCUSTOM = exports.WF_EVENT_ONCUSTOM = "custom";
var WF_EVENT_ONINIT = exports.WF_EVENT_ONINIT = "init";
var WF_EVENT_ONCLICK = exports.WF_EVENT_ONCLICK = "click";
var WF_EVENT_ONTOGGLE = exports.WF_EVENT_ONTOGGLE = "toggle";
var WF_EVENT_ONOPEN = exports.WF_EVENT_ONOPEN = "open";
var WF_EVENT_ONCLOSE = exports.WF_EVENT_ONCLOSE = "close";
var WF_EVENT_ONFIND = exports.WF_EVENT_ONFIND = "find";
var WF_EVENT_ONSEARCH = exports.WF_EVENT_ONSEARCH = "search";
var WF_EVENT_ONBLUR = exports.WF_EVENT_ONBLUR = "blur";
var WF_EVENT_ONFOCUS = exports.WF_EVENT_ONFOCUS = "focus";
var WF_EVENT_ONSELECT = exports.WF_EVENT_ONSELECT = "select";
var WF_EVENT_ONFILTER = exports.WF_EVENT_ONFILTER = "filter";
var WF_EVENT_ONCLEAR = exports.WF_EVENT_ONCLEAR = "clear";
var WF_EVENT_ONREFRESH = exports.WF_EVENT_ONREFRESH = "refresh";
var WF_EVENT_ONSTARTUP = exports.WF_EVENT_ONSTARTUP = "startup";
var WF_EVENT_ONCHANGE = exports.WF_EVENT_ONCHANGE = "change";
var WF_EVENT_ONREADY = exports.WF_EVENT_ONREADY = "ready";
var WF_EVENT_ONRESIZE = exports.WF_EVENT_ONRESIZE = "resize";
var WF_EVENT_ONSTART = exports.WF_EVENT_ONSTART = "start";
var WF_EVENT_ONSTOP = exports.WF_EVENT_ONSTOP = "stop";
var WF_EVENT_ONVIEW = exports.WF_EVENT_ONVIEW = "view";
var WF_EVENT_ONLOAD = exports.WF_EVENT_ONLOAD = "load";
var WF_EVENT_ONEDIT = exports.WF_EVENT_ONEDIT = "edit";
var WF_EVENT_ONVALIDATE = exports.WF_EVENT_ONVALIDATE = "validate";
var WF_EVENT_ONSAVE = exports.WF_EVENT_ONSAVE = "save";
var WF_EVENT_ONSUBMIT = exports.WF_EVENT_ONSUBMIT = "submit";
var WF_EVENT_ONPUBLISH = exports.WF_EVENT_ONPUBLISH = "publish";
var WF_EVENT_ONUNPUBLISH = exports.WF_EVENT_ONUNPUBLISH = "unpublish";
var WF_EVENT_ONSUCCESS = exports.WF_EVENT_ONSUCCESS = "success";
var WF_EVENT_ONERROR = exports.WF_EVENT_ONERROR = "error";
var WF_EVENT_ONWILLMOUNT = exports.WF_EVENT_ONWILLMOUNT = "willmount";
var WF_EVENT_ONDIDMOUNT = exports.WF_EVENT_ONDIDMOUNT = "didmount";
var WF_EVENT_ONWILLUNMOUNT = exports.WF_EVENT_ONWILLUNMOUNT = "willunmount";
var WF_EVENT_ONSYNC = exports.WF_EVENT_ONSYNC = "sync";

/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.isJson = exports.parse = exports.stringify = undefined;

var _jsonStableStringify = __webpack_require__(572);

var _jsonStableStringify2 = _interopRequireDefault(_jsonStableStringify);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

var

// ----------------- //

stringify = exports.stringify = _jsonStableStringify2.default,


// ----------------- //

parse = exports.parse = function parse() {
	var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
	var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";

	if (!str || str === "") {
		return result;
	} else {
		//return JSON.parse(str);
		try {
			return JSON.parse(str);
		} catch (e) {
			return result;
		}
	}
},


// ----------------- //

isJson = exports.isJson = function isJson(string) {
	try {
		JSON.parse(str);
	} catch (e) {
		return false;
	}
	return true;
};
// JSON ---------------- //

/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SetState = exports.Sub = exports.Pub = undefined;

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _WFMasterView = __webpack_require__(448);

var _WFMasterView2 = _interopRequireDefault(_WFMasterView);

var _WFAdminState = __webpack_require__(452);

var _WFAdminState2 = _interopRequireDefault(_WFAdminState);

var _WFLayout = __webpack_require__(457);

var _WFLayout2 = _interopRequireDefault(_WFLayout);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ADMIN VIEW ------------------- //

// ------------------- //

var WFAdminView = new _WFMasterView2.default({
  id: _Constants.APP_ADMIN_NAME,
  DOMNode: _Constants.APP_ADMIN_DOM_NODE,
  initialState: _WFAdminState2.default,
  masterComponentClass: _WFLayout2.default
});

// CONSOLE ACCESS ------------------- //

if (_Constants.APP_DEV) {
  _WFConsole2.default.info(_Constants.APP_ADMIN_NAME, _Constants.APP_ADMIN_VERSION);
  window.WFAdminView = WFAdminView;
}

// ------------------- //
exports.default = WFAdminView;
var Pub = exports.Pub = WFAdminView.pub;
var Sub = exports.Sub = WFAdminView.sub;
var SetState = exports.SetState = WFAdminView.setState;
// ------------------- //

/***/ }),
/* 19 */,
/* 20 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
    wrapper: "row wf-section-boxed"
};

// ------------------- //

var WFSection = function (_Component) {
    (0, _inherits3.default)(WFSection, _Component);

    function WFSection() {
        (0, _classCallCheck3.default)(this, WFSection);
        return (0, _possibleConstructorReturn3.default)(this, (WFSection.__proto__ || (0, _getPrototypeOf2.default)(WFSection)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFSection, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$boxed = _props.boxed,
                boxed = _props$boxed === undefined ? false : _props$boxed,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style;

            if (!visible) return false;
            if (!boxed) {
                return _react2.default.createElement(
                    "wf-section",
                    { style: style },
                    this.props.children
                );
            } else {
                return _react2.default.createElement(
                    "div",
                    { className: classes.wrapper, style: style },
                    this.props.children
                );
            }
        }
    }]);
    return WFSection;
}(_react.Component);

// ------------------- //

exports.default = WFSection;

// ------------------- //

/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFValueTypes = __webpack_require__(22);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FIND_BY_INDEX = "index";

// ------------------- //

// CLASS ARRAY ------------------- // 

// ------------------- //

var WFArray = function (_WFType) {
  (0, _inherits3.default)(WFArray, _WFType);

  /**
   * Constructor
   * this.arrayValue is array contain children value
   * this.findBy is string for get obj by key
   * this.isCollection is boolean for active collection options
   * @param config
   */
  function WFArray() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFArray);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFArray.__proto__ || (0, _getPrototypeOf2.default)(WFArray)).call(this, _WFValueTypes.WF_ARRAY_VALUE));

    var _config$value = config.value,
        value = _config$value === undefined ? [] : _config$value,
        _config$findBy = config.findBy,
        findBy = _config$findBy === undefined ? FIND_BY_INDEX : _config$findBy,
        _config$isCollection = config.isCollection,
        isCollection = _config$isCollection === undefined ? false : _config$isCollection,
        _config$storedValueTy = config.storedValueType,
        storedValueType = _config$storedValueTy === undefined ? null : _config$storedValueTy;

    _this.arrayValue = [];
    _this.findBy = findBy;
    _this.isCollection = isCollection;
    _this.storedValueType = storedValueType;
    // Set value
    _this.set(value);
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFArray, [{
    key: 'on',


    /**
     * Forward call
     * @param evenType string 
     * @param args object params
     */
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      return;
    }

    /**
     * Set arrayValue
     * @return array
     */

  }, {
    key: 'set',
    value: function set() {
      var arrValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(arrValue)) {
        this.clear();
        this.insert(arrValue, next);
      }
    }
    /**
     * Alias of set
     */

  }, {
    key: 'setValue',
    value: function setValue() {
      var arrValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      this.set(arrValue);
    }

    /**
     * Get by index value
     * @param arg string || number
     * @param defaultValue 
     * @return value ?: defaultValue
     */

  }, {
    key: 'get',
    value: function get() {
      var arg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isNull)(arg)) {
        return defaultValue;
      } else {
        if (this.isCollection && this.findBy === FIND_BY_INDEX || this.findBy === FIND_BY_INDEX) {
          return this.getByIndex(arg, defaultValue);
        } else {
          return this.getBy(this.findBy, arg, defaultValue);
        }
      }
    }

    /**
     * Get prev value 
     * @param current value 
     * @return prev value
     */

  }, {
    key: 'getPrev',
    value: function getPrev(arg) {
      var index = this.indexOf(arg);
      var prevIndex = this.prevIndex(index);
      return this.getByIndex(prevIndex);
    }

    /**
     * Get next value 
     * @param current value 
     * @return next value
     */

  }, {
    key: 'getNext',
    value: function getNext(arg) {
      var index = this.indexOf(arg);
      var nextIndex = this.nextIndex(index);
      return this.getByIndex(nextIndex);
    }

    /**
     * Find value by index
     * @param defaultValue 
     * @return value ?: defaultValue
     */

  }, {
    key: 'getByIndex',
    value: function getByIndex(index) {
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var i = parseInt(index);
      var value = this.arrayValue[i];
      if (value) {
        return value;
      } else {
        return defaultValue;
      }
    }

    /**
     * Find object value by key value
     * @param key string
     * @param val value
     * @param defaultValue 
     * @return value ?: defaultValue
     */

  }, {
    key: 'getBy',
    value: function getBy(key, val) {
      var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      var value = this.filter(function (obj) {
        return obj[key] === val;
      });
      if (value.length > 0) {
        return value[0];
      } else {
        return defaultValue;
      }
    }

    /**
     * Get this.arrayValue
     * is Collection return Obj with our index
     * @return array
     */

  }, {
    key: 'getValue',
    value: function getValue() {
      return this.arrayValue;
    }

    /**
     * Get first value
     * @return value ?: null
     */

  }, {
    key: 'getFirst',
    value: function getFirst() {
      if (this.isEmpty()) {
        return null;
      } else {
        return this.arrayValue[0];
      }
    }

    /**
     * Get last value
     * @return value ?: null
     */

  }, {
    key: 'getLast',
    value: function getLast() {
      if (this.isEmpty()) {
        return null;
      } else {
        var index = this.getLastIndex();
        return this.get(index);
      }
    }

    /**
     * Add value in data and apply callback
     * @param values array value or value
     * @param next callback 
     */

  }, {
    key: 'insert',
    value: function insert(values) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(values)) {
        for (var i = 0, l = values.length; i < l; i++) {
          this.arrayValue.push(values[i]);
          if (i === l - 1) {
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          }
        }
      } else {
        if (!this.isCollection) {
          this.arrayValue.push(values);
          if ((0, _Lodash.isFunction)(next)) {
            next();
          }
        } else {
          if (this.has(values[this.findBy])) {
            var key = this.findBy;
            var value = values[this.findBy];
            var index = this.findIndex(value, key);
            this.update(index, values, next);
          } else {
            this.arrayValue.push(values);
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          }
        }
      }
    }

    /**
     * Add value in data first position and apply callback
     * @param values array value or value
     * @param next callback 
     */

  }, {
    key: 'insertFirst',
    value: function insertFirst(values) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(values)) {
        for (var i = 0, l = values.length; i < l; i++) {
          this.arrayValue.unshift(values[i]);
          if (i === l - 1) {
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          }
        }
      } else {
        this.arrayValue.unshift(values);
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      }
    }

    /**
     * Add value at index in data
     * @param index
     * @param value
     */

  }, {
    key: 'insertAt',
    value: function insertAt(index, value) {
      if ((0, _Lodash.isNumber)(index)) {
        this.arrayValue.splice(index, 0, value);
      }
    }

    /**
     * Mouve value at index in data
     * @param from integer
     * @param to integer
     */

  }, {
    key: 'fromTo',
    value: function fromTo(from, to) {}

    /**
     * Update value by index
     * @param index integer
     * @param value next state value 
     */

  }, {
    key: 'update',
    value: function update(index, value) {
      var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      if ((0, _Lodash.isNumber)(index)) {
        this.arrayValue[index] = value;
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      }
    }

    /**
     * Delete value by index
     * @param values array of values || single value
     * @param next callback 
     */

  }, {
    key: 'delete',
    value: function _delete(values) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(values)) {
        for (var i = 0, l = values.length; i < l; i++) {
          if (this.isCollection && this.findBy === FIND_BY_INDEX || this.findBy === FIND_BY_INDEX) {
            var index = this.indexOf(values[i]);
            this.deleteByIndex(index);
          } else {
            this.deleteBy(this.findBy, values);
          }
          if (i === l - 1) {
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          }
        }
      } else {
        if (this.isCollection && this.findBy === FIND_BY_INDEX || this.findBy === FIND_BY_INDEX) {
          var _index = this.indexOf(values);
          this.deleteByIndex(_index);
        } else {
          this.deleteBy(this.findBy, values);
        }
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      }
    }

    /**
     * Delete value by index
     * @param index
     */

  }, {
    key: 'deleteByIndex',
    value: function deleteByIndex(index) {
      if (index < 0) {
        return false;
      } else {
        this.arrayValue.splice(index, 1);
      }
    }

    /**
     * Delete object value by key value
     * @param key string
     * @param val value {string,number,boolean}
     */

  }, {
    key: 'deleteBy',
    value: function deleteBy(key, val) {
      if (key && val) {
        var index = this.findIndex(key, val);
        var nextArrayValue = this.filter(function (obj) {
          return obj[key] !== val;
        });
        this.set(nextArrayValue);
      } else {
        return false;
      }
    }

    /**
     * Delete target and after by index
     * @param args.index 
     * @param args.next callback
     */

  }, {
    key: 'deleteIndexAndAfter',
    value: function deleteIndexAndAfter(_ref) {
      var index = _ref.index,
          next = _ref.next;

      if (index < 0) {
        // console.error("Index Error :", index)
        return false;
      }
      if (index === 0) {
        this.set([]);
      } else {
        var prevArray = this.getValue();
        this.arrayValue = prevArray.filter(function (el, i) {
          return i < index;
        });
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Delete target and before by index
     * @param args.index 
     * @param args.next callback
     */

  }, {
    key: 'deleteIndexAndBefore',
    value: function deleteIndexAndBefore(_ref2) {
      var index = _ref2.index,
          next = _ref2.next;

      if (index < 0) {
        // console.error("Index Error :", index)
        return false;
      }
      if (index === 0) {
        this.set([]);
      } else {
        var prevArray = this.getValue();
        this.arrayValue = prevArray.filter(function (el, i) {
          return i > index;
        });
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Filter data 
     * @param fn ex : filter((value,index) => i!==index)
     * @return array data filtered
     */

  }, {
    key: 'filter',
    value: function filter(fn) {
      if (this.isEmpty()) {
        return [];
      } else {
        return this.arrayValue.filter(fn);
      }
    }

    /**
     * Map data'object 
     * @param fn ex : map((value,index) => { return {...}})
     * @return array with object mapped
     */

  }, {
    key: 'map',
    value: function map(fn) {
      if (this.isEmpty()) {
        return [];
      } else {
        return this.arrayValue.map(fn);
      }
    }

    /**
     * Get and delete first value
     * @return value
     */

  }, {
    key: 'shift',
    value: function shift() {
      if (!this.isEmpty()) {
        return this.arrayValue.shift();
      } else {
        return null;
      }
    }

    /**
     * Get and delete last value
     * @return value
     */

  }, {
    key: 'pop',
    value: function pop() {
      if (!this.isEmpty()) {
        return this.arrayValue.pop();
      } else {
        return null;
      }
    }

    /**
     * Get and delete last value
     * @return value
     */

  }, {
    key: 'toJSON',
    value: function toJSON() {
      return (0, _JSON.stringify)(this.getValue());
    }

    /**
     * Get and delete last value
     * @return value
     */

  }, {
    key: 'toString',
    value: function toString() {
      if (this.isEmpty()) {
        return this.string = "";
      } else {
        var data = this.getValue();
        return data.join("; ");
      }
    }

    /**
     * Concat number value
     * @return number
     */

  }, {
    key: 'sum',
    value: function sum() {
      return (0, _Lodash.sum)(this.filter(function (n) {
        return (0, _Lodash.isNumber)(n);
      }));
    }

    /**
     * Count value in data
     * @return integer;
     */

  }, {
    key: 'getCounter',
    value: function getCounter() {
      return this.arrayValue.length;
    }

    /**
     * Empty Array
     */

  }, {
    key: 'clear',
    value: function clear() {
      this.arrayValue = [];
      if (this.input) {
        this.input.setState((0, _defineProperty3.default)({}, this.getKey(), []));
      }
    }

    /**
     * Check if value exist by index
     * @return value ?: defaultValue
     */

  }, {
    key: 'has',
    value: function has(arg) {
      var _this2 = this;

      if (!this.isCollection) {
        return this.indexOf(arg) !== -1;
      } else {
        var test = this.filter(function (obj) {
          return obj[_this2.findBy] === arg;
        });
        return test.length > 0;
      }
    }

    /**
     * Check if data is empty
     * @return boolean
     */

  }, {
    key: 'isEmpty',
    value: function isEmpty() {
      return this.getCounter() === 0;
    }

    /**
     * Get index of value
     * @return integer ?: negative
     */

  }, {
    key: 'indexOf',
    value: function indexOf(val) {
      return this.arrayValue.indexOf(val);
    }

    /**
     * Find prev index by current index
     * @param current number 
     * @return number
     */

  }, {
    key: 'prevIndex',
    value: function prevIndex(current) {
      var total = this.getCounter();
      return current === 0 && total === 1 ? 0 : current === 0 ? --total : --current % total;
    }

    /**
     * Find next index by current index
     * @param current number 
     * @return number
     */

  }, {
    key: 'nextIndex',
    value: function nextIndex(current) {
      var total = this.getCounter();
      return ++current % total;
    }

    /**
     * Find index of value by key => val
     * param val object val
     * param key object key
     * @return integer ?: negative
     */

  }, {
    key: 'findIndex',
    value: function findIndex() {
      var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_id";

      return (0, _Lodash.findIndex)(this.arrayValue, [key, val]);
    }

    /**
     * Get last index value
     * @return integer
     */

  }, {
    key: 'getLastIndex',
    value: function getLastIndex() {
      return this.getCounter() - 1;
    }

    /**
     * Show current value to string
     */

  }, {
    key: 'toString',
    value: function toString() {
      return this.arrayValue.toString();
    }

    /**
     * Show current value in console
     */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFArray');
      console.log('counter =>', this.getCounter());
      console.log('value =>', (0, _JSON.stringify)(this.getValue()));
      console.dir('WFArray', this.getValue());
      console.log("");
    }
  }], [{
    key: 'instanceOf',
    value: function instanceOf(obj) {
      return obj instanceof WFArray;
    }
  }]);
  return WFArray;
}(_WFType3.default);
// ------------------- //


exports.default = WFArray;
// ------------------- //

/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_VALUE_KEY = exports.WF_VALUE_KEY = "valueKey";
var WF_STRING_VALUE = exports.WF_STRING_VALUE = "stringValue";
var WF_NUMBER_VALUE = exports.WF_NUMBER_VALUE = "numberValue";
var WF_BOOLEAN_VALUE = exports.WF_BOOLEAN_VALUE = "booleanValue";
var WF_OBJECT_VALUE = exports.WF_OBJECT_VALUE = "objectValue";
var WF_ARRAY_VALUE = exports.WF_ARRAY_VALUE = "arrayValue";
var WF_SELECT_VALUE = exports.WF_SELECT_VALUE = "selectValue";
var WF_EVENT_FILE_VALUE = exports.WF_EVENT_FILE_VALUE = "eventFileValue";
var WF_DATE_VALUE = exports.WF_DATE_VALUE = "dateValue";

/***/ }),
/* 23 */,
/* 24 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {

    xs: "col-xs-",
    sm: " col-sm-",
    md: " col-md-",
    lg: " col-lg-",

    hidden: " hidden-",
    visible: " visible-",

    dev: " dv",

    reset: " reset",
    reset_left: " reset-left",
    reset_right: " reset-right"
};

// ------------------- //

var WFCol = function (_Component) {
    (0, _inherits3.default)(WFCol, _Component);

    function WFCol() {
        (0, _classCallCheck3.default)(this, WFCol);
        return (0, _possibleConstructorReturn3.default)(this, (WFCol.__proto__ || (0, _getPrototypeOf2.default)(WFCol)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCol, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$xs = _props.xs,
                xs = _props$xs === undefined ? 12 : _props$xs,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style;

            if (!visible || xs === 0) {
                return false;
            } else {
                return _react2.default.createElement(
                    "div",
                    { style: style, className: "" + this.getClasses() },
                    this.getChildren()
                );
            }
        }

        // ------------------- //

    }, {
        key: "getChildren",
        value: function getChildren() {
            var _props2 = this.props,
                _props2$dev = _props2.dev,
                dev = _props2$dev === undefined ? false : _props2$dev,
                _props2$children = _props2.children,
                children = _props2$children === undefined ? "" : _props2$children;

            return dev ? _react2.default.createElement(
                "div",
                { className: classes.dev },
                children
            ) : children;
            ;
        }

        // ------------------- //

    }, {
        key: "getClasses",
        value: function getClasses() {
            var _props3 = this.props,
                _props3$xs = _props3.xs,
                xs = _props3$xs === undefined ? 12 : _props3$xs,
                _props3$sm = _props3.sm,
                sm = _props3$sm === undefined ? null : _props3$sm,
                _props3$md = _props3.md,
                md = _props3$md === undefined ? null : _props3$md,
                _props3$lg = _props3.lg,
                lg = _props3$lg === undefined ? null : _props3$lg,
                _props3$hidden = _props3.hidden,
                hidden = _props3$hidden === undefined ? [] : _props3$hidden,
                _props3$visible = _props3.visible,
                visible = _props3$visible === undefined ? [] : _props3$visible,
                _props3$className = _props3.className,
                className = _props3$className === undefined ? "" : _props3$className,
                _props3$reset = _props3.reset,
                reset = _props3$reset === undefined ? false : _props3$reset,
                _props3$resetLeft = _props3.resetLeft,
                resetLeft = _props3$resetLeft === undefined ? false : _props3$resetLeft,
                _props3$resetRight = _props3.resetRight,
                resetRight = _props3$resetRight === undefined ? false : _props3$resetRight;


            var clss = classes.xs + xs;
            clss += sm ? classes.sm + sm : "";
            clss += md ? classes.md + md : "";
            clss += lg ? classes.lg + lg : "";
            clss += reset ? classes.reset : "";
            clss += resetLeft ? classes.reset_left : "";
            clss += resetRight ? classes.reset_right : "";
            clss += hidden.length > 0 ? hidden.map(function (s) {
                return classes[s] + s;
            }) : "";
            clss += visible.length > 0 ? visible.map(function (s) {
                return classes[s] + s;
            }) : "";
            clss += className ? " " + className : "";

            return clss;
        }
    }]);
    return WFCol;
}(_react.Component);

// ------------------- //

exports.default = WFCol;

// ------------------- //

/*

	<WFCol xs={12} sm={12} md={6} lg={6}></WFCol>
	<WFCol visible={['md','sm']}></WFCol>
	<WFCol hidden={['xs','lg']}></WFCol>
*/

/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _normalizeWheel = __webpack_require__(615);

var _normalizeWheel2 = _interopRequireDefault(_normalizeWheel);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

var _WFInputTypes = __webpack_require__(34);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF INPUT COMPONENT ------------------- //

// ------------------- //

var WFInputComponent = function (_Component) {
  (0, _inherits3.default)(WFInputComponent, _Component);

  function WFInputComponent() {
    (0, _classCallCheck3.default)(this, WFInputComponent);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputComponent.__proto__ || (0, _getPrototypeOf2.default)(WFInputComponent)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputComponent, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          _props$refId = _props.refId,
          refId = _props$refId === undefined ? null : _props$refId,
          _props$view = _props.view,
          view = _props$view === undefined ? null : _props$view;

      if (!view) {
        return false;
      } else {
        return _react2.default.createElement(
          'wf-input',
          { ref: refId },
          view(this)
        );
      }
    }
    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: 'componentWillMount',
    value: function componentWillMount() {
      var _props$willMount = this.props.willMount,
          willMount = _props$willMount === undefined ? null : _props$willMount;

      if ((0, _Lodash.isFunction)(willMount)) {
        this.props.willMount(this);
      }
    }
    // ------------------- //

  }, {
    key: 'componentDidMount',
    value: function componentDidMount() {
      var _props$didMount = this.props.didMount,
          didMount = _props$didMount === undefined ? null : _props$didMount;

      if ((0, _Lodash.isFunction)(didMount)) {
        this.props.didMount(this);
      }
    }
    // ------------------- //

  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      var _props$willUnmount = this.props.willUnmount,
          willUnmount = _props$willUnmount === undefined ? null : _props$willUnmount;

      if ((0, _Lodash.isFunction)(willUnmount)) {
        this.props.willUnmount(this);
      }
    }

    // ------------------- //

    // COMPONENT HELPERS ------------------- //

    // ------------------- //

  }], [{
    key: 'isNumber',
    value: function isNumber(type) {
      return type === _WFInputTypes.INPUT_NUMBER;
    }
  }, {
    key: 'isRange',
    value: function isRange(type) {
      return type === _WFInputTypes.INPUT_RANGE;
    }
  }, {
    key: 'isDate',
    value: function isDate(type) {
      return type === _WFInputTypes.INPUT_DATE;
    }
  }, {
    key: 'getStrCfg',
    value: function getStrCfg(props) {
      var _props$stringValue = props.stringValue,
          stringValue = _props$stringValue === undefined ? "" : _props$stringValue,
          _props$numberValue = props.numberValue,
          numberValue = _props$numberValue === undefined ? 0 : _props$numberValue,
          _props$type = props.type,
          type = _props$type === undefined ? "" : _props$type;


      var key = _WFValueTypes.WF_STRING_VALUE;
      var value = stringValue;

      if (WFInputComponent.isNumber(type) || WFInputComponent.isRange(type)) {
        key = _WFValueTypes.WF_NUMBER_VALUE;
        value = numberValue;
      } else if (WFInputComponent.isDate()) {
        key = _WFValueTypes.WF_DATE_VALUE;
        value = dateValue;
      }
      return {
        key: key,
        value: value
      };
    }
  }]);
  return WFInputComponent;
}(_react.Component);

// ------------------- //


exports.default = WFInputComponent;
// ------------------- //


/*
  horizontalScrollObserver(evt) {
    const normalized = normalizeWheel(evt);
    const { name } = this.props;
    console.error("HORIZONTAL SCROLL...")
    console.log(normalized.pixelX, normalized.pixelY);

    console.log(name)
    console.log(this.refs)

    const ref = this.refs[name];
    const area = ReactDOM.findDOMNode(ref);
    if (area && !area.contains(evt.target)) {
      console.error("HORIZONTAL SCROLL...")
    }
  }
*/
/*

_onMouseWheel: function(evt) { 
  if (this.props.direction === 'horizontal') { 
    var list = evt.currentTarget.firstChild; 
    var delta = (evt.deltaX == 0 ? evt.deltaY : evt.deltaX); 
    list.scrollLeft += delta; 
    evt.preventDefault(); 
  }
}

*/

/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFRequestParams = __webpack_require__(153);

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- // 

// CLASS WF URL ------------------- //

// ------------------- // 
var WFUrl = function () {
  function WFUrl() {
    (0, _classCallCheck3.default)(this, WFUrl);
  }

  (0, _createClass3.default)(WFUrl, null, [{
    key: "getHost",

    /**
     * Get Host
     */
    value: function getHost() {
      return window.location.host;
    }

    /**
     * Get Host name
     */

  }, {
    key: "getHostName",
    value: function getHostName() {
      return window.location.hostname;
    }

    /**
     * Check is local host
     */

  }, {
    key: "isLocalHost",
    value: function isLocalHost() {
      var test = WFUrl.getHostName();
      return test === "localhost" || test === "127.0.0.1" || test === "";
    }

    /**
     * Get WornderForm.net 
     * ex : getWFDomain("join")
     */

  }, {
    key: "getWFDomain",
    value: function getWFDomain() {
      var $path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      return _WFRequestParams.WF_DOMAIN_URL + "/" + $path;
    }

    /**
     * Get Base url
     */

  }, {
    key: "getBaseUrl",
    value: function getBaseUrl() {
      if (typeof __WF__ === 'undefined') {
        return '';
      } else {
        return (__WF__ && __WF__.hasOwnProperty("BASE_URL") ? __WF__.BASE_URL : window.location.origin) + "/index.php";
      }
    }

    /**
     * Get Player url
     */

  }, {
    key: "getPlayerUrl",
    value: function getPlayerUrl() {
      if (typeof __WF__ === 'undefined') {
        return '';
      } else {
        return "" + (__WF__ && __WF__.hasOwnProperty("PLAYER") ? __WF__.PLAYER : '');
      }
    }

    /**
     * Get Module Path
     * @param isAppAdmin boolean
     * @param formType
     */

  }, {
    key: "getModule",
    value: function getModule() {
      var isAppAdmin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var formType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      switch (formType) {
        case _WFProductType.WF_SESSION_LOGIN_ID:
        case _WFProductType.WF_SIGNUP_PROFILE_ID:
          return _WFRequestParams.WF_CUSTOM_MODULE_NAME;

        default:
          if (isAppAdmin) {
            return _WFRequestParams.WF_ADMIN_MODULE_NAME;
          } else {
            return _WFRequestParams.WF_CUSTOM_MODULE_NAME;
          }
      }
    }

    /**
     * Build request url
     * @param args is object config
     * return string
     */

  }, {
    key: "buildUrl",
    value: function buildUrl(args) {
      var _args$apiBaseUrl = args.apiBaseUrl,
          apiBaseUrl = _args$apiBaseUrl === undefined ? WFUrl.getBaseUrl() : _args$apiBaseUrl,
          _args$prefix = args.prefix,
          prefix = _args$prefix === undefined ? _WFRequestParams.WF_PREFIX : _args$prefix,
          _args$module = args.module,
          module = _args$module === undefined ? _WFRequestParams.WF_CUSTOM_MODULE_NAME : _args$module,
          _args$query = args.query,
          query = _args$query === undefined ? '' : _args$query,
          _args$uri = args.uri,
          uri = _args$uri === undefined ? '' : _args$uri;


      return apiBaseUrl + "/" + prefix + "/" + module + uri + query;
    }

    /**
     * Create new query params
     * return instance
     */

  }, {
    key: "createQuery",
    value: function createQuery() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      return new _WFQueryParams2.default(args);
    }

    /**
     * Redirect to new url
     * @param url
     */

  }, {
    key: "redirect",
    value: function redirect(url) {
      if (url) {
        var ua = navigator.userAgent.toLowerCase();
        var isIE = ua.indexOf('msie') !== -1;
        var version = parseInt(ua.substr(4, 2), 10);
        // Internet Explorer 8 and lower
        if (isIE && version < 9) {
          var link = document.createElement('a');
          link.href = url;
          document.body.appendChild(link);
          link.click();
        }
        // All other browsers can use the standard window.location.href 
        // (they don't lose HTTP_REFERER like Internet Explorer 8 & lower does)
        else {
            window.location.replace(url);
          }
      }
    }

    /**
     * Download file use iframe method 
     * @param url
     */

  }, {
    key: "download",
    value: function download(fileURL) {
      if (fileURL) {
        var ua = navigator.userAgent.toLowerCase();
        var isIE = ua.indexOf('msie') !== -1;
        var version = parseInt(ua.substr(4, 2), 10);
        // Internet Explorer 8 and lower
        if (isIE && version < 9) {
          var link = document.createElement('a');
          link.href = fileURL;
          document.body.appendChild(link);
          link.click();
        }
        // All other browsers can use the standard window.location.href 
        // (they don't lose HTTP_REFERER like Internet Explorer 8 & lower does)
        else {
            window.open(fileURL, '_blank');
          }
      }
    }

    /**
     * Redirect to licenses page
     */

  }, {
    key: "purchase",
    value: function purchase() {
      WFUrl.download(WFUrl.getWFDomain("join"));
    }
  }]);
  return WFUrl;
}();

// ------------------- //


exports.default = WFUrl;
// ------------------- //

/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFValueTypes = __webpack_require__(22);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS OBJECT ------------------- //

// ------------------- //

var WFObject = function (_WFType) {
  (0, _inherits3.default)(WFObject, _WFType);

  /**
   * Constructor
   */
  function WFObject() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFObject);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFObject.__proto__ || (0, _getPrototypeOf2.default)(WFObject)).call(this, _WFValueTypes.WF_OBJECT_VALUE));

    var _config$value = config.value,
        value = _config$value === undefined ? {} : _config$value;

    _this.objectValue = {};
    // Set value
    _this.set(value);
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFObject, [{
    key: 'getValue',


    /**
     * Get object
     * @return object if exist else return null
     */
    value: function getValue() {
      return this.objectValue;
    }

    /**
     * Set object
     * @return object if exist else return null
     */

  }, {
    key: 'setValue',
    value: function setValue(obj) {
      this.clear();
      this.set(obj);
    }

    /**
     * Get object's attribute(s)
     * @return value ?: defaultValue
     */

  }, {
    key: 'get',
    value: function get(key) {
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!key) {
        return defaultValue;
      } else {
        if (this.has(key)) {
          return this.objectValue[key];
        } else {
          return defaultValue;
        }
      }
    }

    /**
     * Loop object's attribute(s)
     * @param fn
     */

  }, {
    key: 'each',
    value: function each(fn) {
      if ((0, _Lodash.isFunction)(fn)) {
        var i = 0;
        var l = this.getCounter();
        for (var key in this.objectValue) {
          i++;
          fn(key, this.objectValue[key], i, l);
        }
      }
    }

    /**
     * Set object's attribute(s)
     * @param objVal object 
     */

  }, {
    key: 'set',
    value: function set() {
      var objVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if ((0, _Lodash.isObject)(objVal)) {
        var l = (0, _keys2.default)(objVal).length;
        if (l === 0) {
          return;
        } else {
          for (var key in objVal) {
            this.objectValue[key] = objVal[key];
          }
        }
      }
    }

    /**
     * Delete object's attribute(s) by key(s)
     * @param objKeys is array || string || number 
     */

  }, {
    key: 'unset',
    value: function unset() {
      var _this2 = this;

      var objKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if ((0, _Lodash.isString)(objKeys) || (0, _Lodash.isNumber)(objKeys)) {
        this.unsetByKey(objKeys);
      } else if ((0, _Lodash.isArray)(objKeys)) {
        objKeys.forEach(function (k) {
          return _this2.unsetByKey(k);
        });
      }
    }

    /**
     * Delete object's attribute by key
     * @param objKeys string
     */

  }, {
    key: 'unsetByKey',
    value: function unsetByKey(k) {
      var key = this.toKey(k);
      if (this.has(key)) {
        delete this.objectValue[key];
      }
    }

    /**
     * if object's attribute is object merge with new object value
     * @param objVal object 
     */

  }, {
    key: 'assign',
    value: function assign(k) {
      var objVal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var key = this.toKey(k);
      var prevObjVal = this.objectValue[key];
      if (!prevObjVal) {
        prevObjVal = {};
      }
      if (key && (0, _Lodash.isObject)(objVal) && (0, _Lodash.isObject)(prevObjVal)) {
        this.objectValue[key] = (0, _assign2.default)(prevObjVal, objVal);
      }
    }

    /**
     * Empty object
     */

  }, {
    key: 'clear',
    value: function clear() {
      this.objectValue = {};
    }

    /**
     * Get keys in object
     * @return array;
     */

  }, {
    key: 'getKeys',
    value: function getKeys() {
      return (0, _keys2.default)(this.objectValue);
    }

    /**
     * Count prop in object
     * @return integer;
     */

  }, {
    key: 'getCounter',
    value: function getCounter() {
      return this.getKeys().length;
    }

    /**
     * Check if prop exist
     * @return value ?: defaultValue
     */

  }, {
    key: 'has',
    value: function has() {
      var objKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (!objKeys) {
        return false;
      } else {
        var key = this.toKey(objKeys);
        return this.objectValue.hasOwnProperty(key);
      }
    }

    /**
     * Check if is counter === 0
     * @return boolean
     */

  }, {
    key: 'isEmpty',
    value: function isEmpty() {
      return this.getCounter() === 0;
    }

    /**
     * Format objKey to string
     * @param objKeys string || number
     * @return string
     */

  }, {
    key: 'toKey',
    value: function toKey(objKey) {
      return objKey.toString();
    }

    /**
     * Serialize this.objectValue
     * @return json
     */

  }, {
    key: 'toJSON',
    value: function toJSON() {
      return (0, _JSON.stringify)(this.objectValue);
    }

    /**
     * Parse json to object
     * Set this.objectValue
     * @param json string
     * @param next callback 
     */

  }, {
    key: 'fromJSON',
    value: function fromJSON(json) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (json && (0, _Lodash.isObject)(json)) {
        this.setValue(json);
      } else if (json && (0, _Lodash.isString)(json)) {
        var data = (0, _JSON.parse)(json);
        if (data !== "" || (0, _Lodash.isObject)(data) && (0, _keys2.default)(data).length > 0) {
          this.setValue(data);
          if ((0, _Lodash.isFunction)(next)) {
            next();
          }
        }
      }
    }

    /**w
     * Show current value in console
     */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFObject');
      console.log('counter =>', this.getCounter());
      console.log('keys =>', (0, _JSON.stringify)(this.getKeys()));
      console.log('value =>', (0, _JSON.stringify)(this.objectValue));
      console.dir('WFObject', this.objectValue);
      console.log("");
    }
  }], [{
    key: 'instanceOf',
    value: function instanceOf(obj) {
      return obj instanceof WFObject;
    }
  }]);
  return WFObject;
}(_WFType3.default);
// ------------------- //


exports.default = WFObject;
// ------------------- //

/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _wfc = __webpack_require__(498);

var _wfc2 = _interopRequireDefault(_wfc);

var _baobab = __webpack_require__(264);

var _baobab2 = _interopRequireDefault(_baobab);

var _setting = __webpack_require__(265);

var _setting2 = _interopRequireDefault(_setting);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var WFUi = {
  wfc: _wfc2.default,
  baobab: _baobab2.default,
  setting: _setting2.default
};
// ------------------- //
exports.default = WFUi;
// ------------------- //

window.WFUi = WFUi;

/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
    wrapper: "row"
};

// ------------------- //

var WFRow = function (_Component) {
    (0, _inherits3.default)(WFRow, _Component);

    function WFRow() {
        (0, _classCallCheck3.default)(this, WFRow);
        return (0, _possibleConstructorReturn3.default)(this, (WFRow.__proto__ || (0, _getPrototypeOf2.default)(WFRow)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFRow, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$onClick = _props.onClick,
                _onClick = _props$onClick === undefined ? null : _props$onClick,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className,
                children = _props.children,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style;

            return _react2.default.createElement(
                "div",
                {
                    style: style,
                    onClick: function onClick() {
                        return (0, _Lodash.isFunction)(_onClick) ? _onClick() : "";
                    },
                    className: classes.wrapper + " " + className
                },
                children
            );
        }
    }]);
    return WFRow;
}(_react.Component);
// ------------------- //

exports.default = WFRow;

// ------------------- //

/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.formEditorMgr = exports.formEntryMgr = exports.formConfigMgr = undefined;

var _WFormMgr = __webpack_require__(427);

var _WFormMgr2 = _interopRequireDefault(_WFormMgr);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF GLOBAL FORM ------------------- //

// ------------------- //

var formConfigMgr = new _WFormMgr2.default();
var formEntryMgr = new _WFormMgr2.default();
var formEditorMgr = new _WFormMgr2.default();

// ------------------- //

exports.formConfigMgr = formConfigMgr;
exports.formEntryMgr = formEntryMgr;
exports.formEditorMgr = formEditorMgr;


if (_Constants.APP_DEV) {
  window.formConfigMgr = formConfigMgr;
  window.formEntryMgr = formEntryMgr;
  window.formEditorMgr = formEditorMgr;
}

/***/ }),
/* 31 */,
/* 32 */,
/* 33 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactCustomScrollbars = __webpack_require__(767);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SCROLLBAR ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf-scrollbar"
};

// ------------------- //

var WFScrollBars = function (_Component) {
    (0, _inherits3.default)(WFScrollBars, _Component);

    function WFScrollBars() {
        (0, _classCallCheck3.default)(this, WFScrollBars);
        return (0, _possibleConstructorReturn3.default)(this, (WFScrollBars.__proto__ || (0, _getPrototypeOf2.default)(WFScrollBars)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFScrollBars, [{
        key: 'render',
        value: function render() {
            return _react2.default.createElement(_reactCustomScrollbars.Scrollbars, (0, _extends3.default)({
                className: classes.wrapper,
                onScroll: this.handleScroll,
                onScrollFrame: this.handleScrollFrame,
                onScrollStart: this.handleScrollStart,
                onScrollStop: this.handleScrollStop,
                onUpdate: this.handleUpdate,
                renderView: this.renderView,
                renderTrackHorizontal: this.renderTrackHorizontal,
                renderTrackVertical: this.renderTrackVertical,
                renderThumbHorizontal: this.renderThumbHorizontal,
                renderThumbVertical: this.renderThumbVertical,
                autoHide: true,
                autoHideTimeout: 1000,
                autoHideDuration: 200,
                thumbMinSize: 30,
                universal: true
            }, this.props));
        }
    }]);
    return WFScrollBars;
}(_react.Component);

// ------------------- //

exports.default = WFScrollBars;

// ------------------- //

/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var INPUT_HIDDEN = exports.INPUT_HIDDEN = "hidden";
var INPUT_TEXT = exports.INPUT_TEXT = "text";
var INPUT_DATE = exports.INPUT_DATE = "date";
var INPUT_EMAIL = exports.INPUT_EMAIL = "email";
var INPUT_MAILER = exports.INPUT_MAILER = "mailer";
var INPUT_NUMBER = exports.INPUT_NUMBER = "number";
var INPUT_TEL = exports.INPUT_TEL = "tel";
var INPUT_URL = exports.INPUT_URL = "url";
var INPUT_TEXTAREA = exports.INPUT_TEXTAREA = "textarea";
var INPUT_SELECT = exports.INPUT_SELECT = "select";
var INPUT_CHECKBOX = exports.INPUT_CHECKBOX = "checkbox";
var INPUT_RADIO_BUTTON = exports.INPUT_RADIO_BUTTON = "radioButton";
var INPUT_FILE = exports.INPUT_FILE = "file";
var INPUT_RANGE = exports.INPUT_RANGE = "range";
var INPUT_COLOR = exports.INPUT_COLOR = "color";
var INPUT_MEDIA = exports.INPUT_MEDIA = "media";
var INPUT_GRID = exports.INPUT_GRID = "grid";
var INPUT_PANEL = exports.INPUT_PANEL = "panel";
var INPUT_PASSWORD = exports.INPUT_PASSWORD = "password";
var INPUT_SELECT2 = exports.INPUT_SELECT2 = "select2";
var INPUT_SELECT2_BAOBAB = exports.INPUT_SELECT2_BAOBAB = "select2baobab";
var INPUT_SELECT2_MONKEY = exports.INPUT_SELECT2_MONKEY = "select2monkey";

var INPUT_SELECT_WORD = exports.INPUT_SELECT_WORD = "WFieldSelectWord";
var INPUT_SELECT_NUMBER = exports.INPUT_SELECT_NUMBER = "WFieldSelectNum";
var INPUT_SELECT_LINE = exports.INPUT_SELECT_LINE = "WFieldSelectLine";
var INPUT_SELECT_IMAGE = exports.INPUT_SELECT_IMAGE = "WFieldSelectImage";

/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactSortable = __webpack_require__(315);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF LIST ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-items",
	item: "item",
	active: "item-active",
	dragging: "item-dragging",
	sortable: "item item-sortable"
};

// ------------------- //

var WFListItem = function (_Component) {
	(0, _inherits3.default)(WFListItem, _Component);

	function WFListItem(props) {
		(0, _classCallCheck3.default)(this, WFListItem);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFListItem.__proto__ || (0, _getPrototypeOf2.default)(WFListItem)).call(this, props));

		_this.displayName = 'SortableListItem';
		return _this;
	}

	(0, _createClass3.default)(WFListItem, [{
		key: 'render',
		value: function render() {
			return _react2.default.createElement(
				'div',
				(0, _extends3.default)({
					id: 'wf-item-' + this.props.sortId,
					className: 'wf-item-sortable'
				}, this.props),
				this.props.children
			);
		}
	}]);
	return WFListItem;
}(_react.Component);

// ------------------- //

var WFSortableListItem = (0, _reactSortable.sortable)(WFListItem);

// ------------------- //

var WFList = function (_Component2) {
	(0, _inherits3.default)(WFList, _Component2);

	function WFList(props) {
		(0, _classCallCheck3.default)(this, WFList);

		var _this2 = (0, _possibleConstructorReturn3.default)(this, (WFList.__proto__ || (0, _getPrototypeOf2.default)(WFList)).call(this, props));

		_this2.state = {
			data: props.data,
			draggingIndex: null
		};
		return _this2;
	}

	// ------------------- //

	(0, _createClass3.default)(WFList, [{
		key: 'render',
		value: function render() {
			var _this3 = this;

			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible,
			    _props$sortable = _props.sortable,
			    sortable = _props$sortable === undefined ? false : _props$sortable,
			    _props$view = _props.view,
			    view = _props$view === undefined ? null : _props$view,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    onSelect = _props.onSelect,
			    onClick = _props.onClick,
			    onReOrder = _props.onReOrder,
			    _props$selected = _props.selected,
			    selected = _props$selected === undefined ? [] : _props$selected,
			    _props$active = _props.active,
			    active = _props$active === undefined ? [] : _props$active,
			    _props$hiddenNotSelec = _props.hiddenNotSelected,
			    hiddenNotSelected = _props$hiddenNotSelec === undefined ? false : _props$hiddenNotSelec,
			    _props$rows = _props.rows,
			    rows = _props$rows === undefined ? [] : _props$rows;
			var _state = this.state,
			    data = _state.data,
			    draggingIndex = _state.draggingIndex;

			if (!visible || rows.length === 0 || !view) {
				return false;
			} else if (sortable) {
				var childProps = { className: 'myClass1DeTest' };
				return _react2.default.createElement(
					'wf-list',
					null,
					_react2.default.createElement(
						'div',
						{ className: className },
						data.items.map(function (item, i) {
							var isSelected = _this3.isSelected(item);
							var isActive = _this3.isActive(item);
							if (hiddenNotSelected && selected.length > 0 && !isSelected) {
								return false;
							}
							var childProps = {
								className: classes.sortable + ' ' + (i === draggingIndex ? classes.dragging : '') + ' ' + _this3.getRowState(item) + ' ' + (isActive ? classes.active : "")
							};
							return _react2.default.createElement(
								WFSortableListItem,
								{
									key: i,
									items: data.items,
									draggingIndex: draggingIndex,
									sortId: i,
									outline: 'list',
									childProps: childProps,
									updateState: function updateState(obj) {
										_this3.setState(obj);
										if (obj.hasOwnProperty("items")) {
											onReOrder(obj.items);
										}
									}
								},
								view(item, i, isSelected)
							);
						})
					)
				);
			} else {
				return _react2.default.createElement(
					'wf-list',
					null,
					_react2.default.createElement(
						'ul',
						{ className: className },
						rows.map(function (row, i) {
							var isSelected = _this3.isSelected(row);
							var isActive = _this3.isActive(row);
							if (hiddenNotSelected && selected.length > 0 && !isSelected) {
								return false;
							}
							return _react2.default.createElement(
								'li',
								{ key: i,
									onClick: function onClick() {
										return onSelect ? onSelect(row, i) : "";
									},
									className: classes.item + ' ' + _this3.getRowState(row) + ' ' + (isActive ? classes.active : "")
								},
								view(row, i, isSelected)
							);
						})
					)
				);
			}
		}

		// ------------------- //

	}, {
		key: 'isSelectable',
		value: function isSelectable(row) {
			var _props2 = this.props,
			    _props2$selectable = _props2.selectable,
			    selectable = _props2$selectable === undefined ? true : _props2$selectable,
			    _props2$selectableRow = _props2.selectableRows,
			    selectableRows = _props2$selectableRow === undefined ? [] : _props2$selectableRow,
			    _props2$selectedBy = _props2.selectedBy,
			    selectedBy = _props2$selectedBy === undefined ? "id" : _props2$selectedBy;

			if (!selectable) return true;
			return selectableRows.includes(row[selectedBy]);
		}

		// ------------------- //

	}, {
		key: 'isSelected',
		value: function isSelected(row) {
			var _props3 = this.props,
			    _props3$selected = _props3.selected,
			    selected = _props3$selected === undefined ? [] : _props3$selected,
			    _props3$selectedBy = _props3.selectedBy,
			    selectedBy = _props3$selectedBy === undefined ? "id" : _props3$selectedBy;

			return selected.includes(row[selectedBy]);
		}

		// ------------------- //

	}, {
		key: 'isActive',
		value: function isActive(row) {
			var _props4 = this.props,
			    _props4$active = _props4.active,
			    active = _props4$active === undefined ? [] : _props4$active,
			    _props4$activeBy = _props4.activeBy,
			    activeBy = _props4$activeBy === undefined ? "id" : _props4$activeBy;

			return active.includes(row[activeBy]);
		}

		// ------------------- //

	}, {
		key: 'getRowState',
		value: function getRowState(row) {
			var _row$className = row.className,
			    className = _row$className === undefined ? "" : _row$className;
			var _props5 = this.props,
			    _props5$selectedBy = _props5.selectedBy,
			    selectedBy = _props5$selectedBy === undefined ? "id" : _props5$selectedBy,
			    _props5$selectedClass = _props5.selectedClassName,
			    selectedClassName = _props5$selectedClass === undefined ? "selected" : _props5$selectedClass,
			    _props5$selectableCla = _props5.selectableClassName,
			    selectableClassName = _props5$selectableCla === undefined ? "selectable" : _props5$selectableCla,
			    _props5$rowsClassName = _props5.rowsClassName,
			    rowsClassName = _props5$rowsClassName === undefined ? "" : _props5$rowsClassName;

			return className + ' ' + rowsClassName + ' ' + (this.isSelectable(row) ? selectableClassName : "") + ' ' + (this.isSelected(row) ? selectedClassName : "");
		}

		// ------------------- //


		// COMPONENT LIFECYCLE ------------------- //


		// ------------------- //

	}, {
		key: 'componentWillReceiveProps',
		value: function componentWillReceiveProps(nextProps) {
			var _nextProps$data = nextProps.data,
			    data = _nextProps$data === undefined ? false : _nextProps$data;
			var draggingIndex = this.state.draggingIndex;

			if (data && draggingIndex === null) {
				this.setState({
					data: data
				});
			}
		}
	}]);
	return WFList;
}(_react.Component);

// ------------------- //

exports.default = WFList;

// ------------------- //

/*
	<WFList
		view={(item,i) => {
			const { label="" } = item;
			return (
				<span className="item-content">
					<span className="item-marker"><span/></span>
					<span className="item-text">{label}</span>
				</span>
			)
		}}
		rows={[
			{ label:"View by Visitor", className:"wf-legend wf-legend-visitor" },
			{ label:"Form completed", className:"wf-legend wf-legend-completed" },
			{ label:"Form uncompleted", className:"wf-legend wf-legend-uncompleted" },
		]}
	/>

	<WFList
		className={"list-date list-years"}
		
		selected={[2016]}
		selectedBy={"label"}
		selectedClassName={"selected"}

		selectable={true}
		selectableRows={[2015,2016]}
		selectableClassName={"selectable"}
		
		view={(item,i) => {
			const { label="" } = item;
			return <span className="item-text">{label}</span>
		}}
		onSelect={(item) => {  
			console.log("hello world", item )
		}}
		rows={[
			{ label:2015 },
			{ label:2016 },
			{ label:2017 },
			{ label:2018 }
		]}
	/>

*/

/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SEP ------------------- //

// ------------------- //

var classes = {
	wrapper: "sep"
};

// ------------------- //

var WFSep = function (_Component) {
	(0, _inherits3.default)(WFSep, _Component);

	function WFSep() {
		(0, _classCallCheck3.default)(this, WFSep);
		return (0, _possibleConstructorReturn3.default)(this, (WFSep.__proto__ || (0, _getPrototypeOf2.default)(WFSep)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFSep, [{
		key: "render",


		// ------------------- //

		value: function render() {
			var _props = this.props,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$type = _props.type,
			    type = _props$type === undefined ? "" : _props$type,
			    _props$style = _props.style,
			    style = _props$style === undefined ? {} : _props$style;

			return _react2.default.createElement(
				"wf-sep",
				null,
				_react2.default.createElement("span", { style: style, className: classes.wrapper + " " + (type ? "sep-" + type : "") }),
				_react2.default.createElement("div", { className: "clearfix" })
			);
		}
	}]);
	return WFSep;
}(_react.Component);

// ------------------- //

exports.default = WFSep;

// ------------------- //

/*

	<WFSep type={0}/>
*/

/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var classes = {
  input: "wf-input-",
  text: "wf-input-text",
  textarea: "wf-input-textarea",
  checkbox: "wf-input-checkbox",
  multiliner: "wf-multiliner",
  disabled: "wf-disabled",
  checked: "wf-checked",
  unchecked: "wf-unchecked",
  isValid: "wf--valid",
  hasError: "wf--error"
};

exports.default = classes;

/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFRequest = __webpack_require__(409);

var _WFRequest2 = _interopRequireDefault(_WFRequest);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFParam = __webpack_require__(227);

var _WFParam2 = _interopRequireDefault(_WFParam);

var _WFRequestParams = __webpack_require__(153);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ERR_NEXT_MSG = "next callback is undefined.";

// ------------------- //

// CLASS WF CLIENT ------------------- //

// ------------------- //
var WFClient = function () {
  function WFClient() {
    (0, _classCallCheck3.default)(this, WFClient);
  }

  (0, _createClass3.default)(WFClient, null, [{
    key: "get",

    /**
     * Get 
     *
     * @param urlArgs object containing elements to build the request url
     * @return {Promise}
     *
     * @code
        WFClient.get(urlArgs)
          .then(( results={} ) => {
            const {
              res,
              resultset,
              internal_error
            } = results;
            // do stuff...
          })
          .catch((error) => {
            console.error(error);
          });
     * @endcode
     */
    value: function get(urlArgs) {
      var url = _WFUrl2.default.buildUrl(urlArgs);
      if ((0, _Lodash.isString)(url)) {
        return _WFRequest2.default.get(url).promise();
      }
    }

    /**
     * Post 
     *
     * @param urlArgs object containing elements to build the request url
     * @param data array
     * @param headerAccept string html || json ...
     * @return {Promise}
     *
     * @code
        WFClient.post(urlArgs, data)
          .then(( results={} ) => {
            const {
              res,
              resultset,
              internal_error
            } = results;
            // do stuff...
          })
          .catch((error) => {
            console.error(error);
          });
     * @endcode
     */

  }, {
    key: "post",
    value: function post(urlArgs) {
      var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var headerAccept = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _WFRequestParams.HEADER_ACCEPT_JSON;

      var url = _WFUrl2.default.buildUrl(urlArgs);
      if ((0, _Lodash.isString)(url)) {
        return _WFRequest2.default.post(url).send(data).set('Accept', headerAccept).promise();
      }
    }

    /**
     * Get license info
     * Valid actions are edd_action = [activate_license, deactivate_license, get_version, check_license]
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "getLicenseInfo",
    value: function getLicenseInfo(urlArgs) {
      var _urlArgs$edd_action = urlArgs.edd_action,
          edd_action = _urlArgs$edd_action === undefined ? 'check_license' : _urlArgs$edd_action,
          _urlArgs$item_name = urlArgs.item_name,
          item_name = _urlArgs$item_name === undefined ? '' : _urlArgs$item_name,
          _urlArgs$license = urlArgs.license,
          license = _urlArgs$license === undefined ? '' : _urlArgs$license;


      var wf_server_url = _WFUrl2.default.getWFDomain();
      var url = _WFUrl2.default.getBaseUrl(); //WFUrl.getHost();
      var data = {
        edd_action: edd_action,
        item_name: item_name,
        license: license,
        url: url
      };

      var queryParams = '';
      for (var key in data) {
        queryParams += _WFParam2.default.format(key, data[key]) + ';';
      }

      var postUrl = wf_server_url + ("?wflmq=" + queryParams);

      // todo charly remove...
      //console.error("LICENCE", postUrl)

      return _WFRequest2.default.get(postUrl).promise();
    }

    /**
     * Save or Update a form state|field in db
     * @param urlArgs object containing elements to build the request url
     * @param data array the data to save
     */

  }, {
    key: "save",
    value: function save(urlArgs, data) {
      var files = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      var _urlArgs$formName = urlArgs.formName,
          formName = _urlArgs$formName === undefined ? '' : _urlArgs$formName,
          _urlArgs$formType = urlArgs.formType,
          formType = _urlArgs$formType === undefined ? 0 : _urlArgs$formType,
          _urlArgs$isAppAdmin = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin === undefined ? false : _urlArgs$isAppAdmin;


      urlArgs['uri'] = "/" + formName + "/new";

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin, formType);

      // todo save
      /*
      console.warn("SAVE")
      console.log(`
        isAppAdmin => ${isAppAdmin}
        formName => ${formName}
        formType => ${formType}
      `)
      console.log(urlArgs);
      */

      var postData = {};
      postData[formName] = data;

      // If files provided then ==> make a FormData Post
      // change urlArgs.module; files are handled by custom module
      if ((0, _Lodash.isObject)(files) && (0, _keys2.default)(files).length > 0) {
        urlArgs['module'] = _WFUrl2.default.getModule(false, formType);
        postData = new FormData();

        // add files
        for (var key in files) {
          var file = files[key];
          postData.append(key, file, file.name);
          // remove key from data
          if (data.hasOwnProperty(key)) {
            delete data[key];
          }
        }

        // add values
        for (var _key in data[0]) {
          postData.append(_key, data[0][_key]);
        }
      }
      return WFClient.post(urlArgs, postData);
    }

    /**
     * Delete a form state|field from db
     * @param urlArgs object containing elements to build the request url
     * @param id the identifier of the db entry to delete
     */

  }, {
    key: "del",
    value: function del(urlArgs, id) {
      var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
      var _urlArgs$formName2 = urlArgs.formName,
          formName = _urlArgs$formName2 === undefined ? '' : _urlArgs$formName2,
          _urlArgs$formType2 = urlArgs.formType,
          formType = _urlArgs$formType2 === undefined ? 0 : _urlArgs$formType2,
          _urlArgs$isAppAdmin2 = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin2 === undefined ? false : _urlArgs$isAppAdmin2;


      urlArgs['uri'] = "/" + formName + "/delete/" + id;

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin, formType);

      if (data) {
        var postData = {};
        postData[formName] = data;
        return WFClient.post(urlArgs, postData);
      } else {
        return WFClient.post(urlArgs);
      }
    }

    /**
     * Find all form state in db
     * @param urlArgs object containing elements to build the request url
     * @param id the identifier of the db entry to find
     */

  }, {
    key: "find",
    value: function find(urlArgs, params) {
      var _urlArgs$formName3 = urlArgs.formName,
          formName = _urlArgs$formName3 === undefined ? '' : _urlArgs$formName3,
          _urlArgs$isAppAdmin3 = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin3 === undefined ? false : _urlArgs$isAppAdmin3;


      urlArgs['uri'] = "/" + formName + "/search";

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin);

      return WFClient.get(urlArgs);
    }

    /**
     * Find a form state|field in db by its identifier
     * @param urlArgs object containing elements to build the request url
     * @param id the identifier of the db entry to find
     */

  }, {
    key: "findById",
    value: function findById(urlArgs, id) {
      var _urlArgs$formName4 = urlArgs.formName,
          formName = _urlArgs$formName4 === undefined ? '' : _urlArgs$formName4,
          _urlArgs$isAppAdmin4 = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin4 === undefined ? false : _urlArgs$isAppAdmin4;


      urlArgs['uri'] = "/" + formName + "/view/id/" + id;

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin);

      return WFClient.get(urlArgs);
    }

    /**
     * Find a custom form config by its identifier
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "findFormById",
    value: function findFormById(urlArgs) {
      var _urlArgs$formId = urlArgs.formId,
          formId = _urlArgs$formId === undefined ? 0 : _urlArgs$formId,
          _urlArgs$isAppAdmin5 = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin5 === undefined ? false : _urlArgs$isAppAdmin5;


      urlArgs['uri'] = "/id/" + formId;

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin);

      return WFClient.get(urlArgs);
    }

    /**
     * Find a custom form config by its name
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "findFormByName",
    value: function findFormByName(urlArgs) {
      var _urlArgs$formName5 = urlArgs.formName,
          formName = _urlArgs$formName5 === undefined ? '' : _urlArgs$formName5,
          _urlArgs$isAppAdmin6 = urlArgs.isAppAdmin,
          isAppAdmin = _urlArgs$isAppAdmin6 === undefined ? false : _urlArgs$isAppAdmin6;


      urlArgs['uri'] = "/name/" + formName;

      urlArgs['module'] = _WFUrl2.default.getModule(isAppAdmin);

      return WFClient.get(urlArgs);
    }

    /**
     * Publish a form config
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "publish",
    value: function publish(urlArgs) {
      var _urlArgs$formName6 = urlArgs.formName,
          formName = _urlArgs$formName6 === undefined ? '' : _urlArgs$formName6;


      urlArgs['uri'] = "/" + formName + "/publish";
      urlArgs['module'] = _WFUrl2.default.getModule(true);
      return WFClient.post(urlArgs);
    }

    /**
     * UnPublish a form config
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "unpublish",
    value: function unpublish(urlArgs) {
      var _urlArgs$formName7 = urlArgs.formName,
          formName = _urlArgs$formName7 === undefined ? '' : _urlArgs$formName7;


      urlArgs['uri'] = "/" + formName + "/unpublish";
      urlArgs['module'] = _WFUrl2.default.getModule(true);
      return WFClient.post(urlArgs);
    }

    /**
     * Export CSV
     * @param urlArgs object containing elements to build the request url
     * @param formName the form config name (slug)
     */
    /*static exportCsv(urlArgs, formName) {
      urlArgs['uri'] = `/${formName}/export-csv`;
      urlArgs['module'] = WFUrl.getModule(true);
      return WFClient.post(url);
    }*/

    /**
     * Export CSV
     * @param urlArgs object containing elements to build the request url
     * @param formName the form config name (slug)
     */

  }, {
    key: "findAllCustomForms",
    value: function findAllCustomForms(urlArgs) {
      urlArgs['uri'] = "/form";
      // TODO(lybaba) append params to uri as ?p1=v1&p2=v2....
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.get(urlArgs);
    }

    /**
     * Find option entries
     * @param urlArgs object containing elements to build the request url
     * @param integer formEntryId
     */

  }, {
    key: "findOptionEntries",
    value: function findOptionEntries() {
      var urlArgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var formEntryId = arguments[1];
      var _urlArgs$formName8 = urlArgs.formName,
          formName = _urlArgs$formName8 === undefined ? '' : _urlArgs$formName8;


      urlArgs['uri'] = "/" + formName + "/opt/form-entry/" + formEntryId;
      urlArgs['module'] = _WFUrl2.default.getModule(true);
      return WFClient.get(urlArgs);
    }

    /**
     * Count option entries
     * @param urlArgs object containing elements to build the request url
     * @param integer formEntryId
     */

  }, {
    key: "countOptionEntries",
    value: function countOptionEntries() {
      var urlArgs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _urlArgs$formName9 = urlArgs.formName,
          formName = _urlArgs$formName9 === undefined ? '' : _urlArgs$formName9;


      urlArgs['uri'] = "/" + formName + "/opt/count";
      urlArgs['module'] = _WFUrl2.default.getModule(true);
      return WFClient.get(urlArgs);
    }

    /**
     * Find form stats by date
     * @param urlArgs object containing elements to build the request url
     * @param integer dateId
     */

  }, {
    key: "findFormStatsByDate",
    value: function findFormStatsByDate(urlArgs, dateId) {
      var _urlArgs$formName10 = urlArgs.formName,
          formName = _urlArgs$formName10 === undefined ? '' : _urlArgs$formName10;


      urlArgs['uri'] = "/" + formName + "/stats/date/" + dateId;
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.get(urlArgs);
    }

    /**
     * Find form stats by year groupby month
     * @param urlArgs object containing elements to build the request url
     * @param integer year
     */

  }, {
    key: "findFormStatsByYear",
    value: function findFormStatsByYear(urlArgs, year) {
      var _urlArgs$formName11 = urlArgs.formName,
          formName = _urlArgs$formName11 === undefined ? '' : _urlArgs$formName11;


      urlArgs['uri'] = "/" + formName + "/stats/year/" + year;
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.get(urlArgs);
    }

    /**
     * Find form stats by year and month groupby week
     * @param urlArgs object containing elements to build the request url
     * @param integer year
     * @param integer month
     */

  }, {
    key: "findFormStatsByYearMonth",
    value: function findFormStatsByYearMonth(urlArgs, year, month) {
      var _urlArgs$formName12 = urlArgs.formName,
          formName = _urlArgs$formName12 === undefined ? '' : _urlArgs$formName12;


      urlArgs['uri'] = "/" + formName + "/stats/year/" + year + "/month/" + month;
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.get(urlArgs);
    }

    /**
     * Find form stats by year and week
     * @param urlArgs object containing elements to build the request url
     * @param integer year
     * @param integer week
     */

  }, {
    key: "findFormStatsByYearWeek",
    value: function findFormStatsByYearWeek(urlArgs, year, week) {
      var _urlArgs$formName13 = urlArgs.formName,
          formName = _urlArgs$formName13 === undefined ? '' : _urlArgs$formName13;


      urlArgs['uri'] = "/" + formName + "/stats/year/" + year + "/week/" + week;
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.get(urlArgs);
    }

    /**
     * Increment view count of form
     * @param urlArgs object containing elements to build the request url
     * @param integer incr
     */

  }, {
    key: "incrViewCount",
    value: function incrViewCount(urlArgs) {
      var _urlArgs$formName14 = urlArgs.formName,
          formName = _urlArgs$formName14 === undefined ? '' : _urlArgs$formName14;


      urlArgs['uri'] = "/" + formName + "/stats/incr-view/1";
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.post(urlArgs);
    }

    /**
     * Increment completed count of form
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "incrCompletedCount",
    value: function incrCompletedCount(urlArgs) {
      var _urlArgs$formName15 = urlArgs.formName,
          formName = _urlArgs$formName15 === undefined ? '' : _urlArgs$formName15;


      urlArgs['uri'] = "/" + formName + "/stats/incr-completed/1";
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.post(urlArgs);
    }

    /**
     * Increment uncompleted count of form
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "incrUncompletedCount",
    value: function incrUncompletedCount(urlArgs) {
      var _urlArgs$formName16 = urlArgs.formName,
          formName = _urlArgs$formName16 === undefined ? '' : _urlArgs$formName16;


      urlArgs['uri'] = "/" + formName + "/stats/incr-uncompleted/1";
      urlArgs['module'] = _WFUrl2.default.getModule(false);
      return WFClient.post(urlArgs);
    }

    /*
     * TODO(lybaba) implement methods below
     /{prefix}/wfc/{formName}/export-cs
    exportCsv
     /{prefix}/wfc/{formName}/import-csv
    importCsv
     /{prefix}/wfc/{formName}/category-group
    categoryGroup
     /{prefix}/wfc/{formName}/category-group/leafs
    categoryGroupLeafs
     /{prefix}/wfc/{formName}/check-license
    checkLicense
     */

  }]);
  return WFClient;
}();

// ------------------- //


exports.default = WFClient;

/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Holds processed request response infos
 */
var WFResponse = function () {
  /**
   * Constructor
   * @param hasRequestErrors
   * @param hasLogicErrors
   * @param resultset
   */
  function WFResponse(hasRequestErrors, hasLogicErrors, resultset) {
    (0, _classCallCheck3.default)(this, WFResponse);

    this.hasRequestErrors = hasRequestErrors;
    this.hasLogicErrors = hasLogicErrors;
    this.resultset = resultset;
  }

  /**
   * Get the response data
   */


  (0, _createClass3.default)(WFResponse, [{
    key: 'getResultset',
    value: function getResultset() {
      return this.resultset;
    }

    /**
     * Check if response has request errors
     */

  }, {
    key: 'getHasRequestErrors',
    value: function getHasRequestErrors() {
      return this.hasRequestErrors;
    }

    /**
     * Check if response has logic errors
     */

  }, {
    key: 'getHasLogicErrors',
    value: function getHasLogicErrors() {
      return this.hasLogicErrors;
    }

    /**
     * Get the response errors
     */

  }, {
    key: 'getLogicErrors',
    value: function getLogicErrors() {
      var errors = {};
      if ((0, _Lodash.isArray)(this.resultset) && this.resultset.length > 0) {
        var result = this.resultset[0];
        var _result$succeeded = result.succeeded,
            succeeded = _result$succeeded === undefined ? false : _result$succeeded,
            _result$messages = result.messages,
            messages = _result$messages === undefined ? [] : _result$messages;

        errors = {
          succeeded: succeeded,
          messages: messages
        };
      } else if ((0, _Lodash.isObject)(this.resultset)) {}
      return errors;
    }

    /**
     * Get response
     * @param res the response
     */

  }], [{
    key: 'getResponse',
    value: function getResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get find form by name or id response
     * @param res the response
     */

  }, {
    key: 'getFindResponse',
    value: function getFindResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.hasOwnProperty('count') && resultset.hasOwnProperty('rows')) {
          return new WFResponse(false, false, {
            count: parseInt(resultset.count),
            rows: resultset.rows
          });
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get find form by name or id response
     * @param res the response
     */

  }, {
    key: 'getFindFormResponse',
    value: function getFindFormResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.hasOwnProperty('wfc')) {
          return new WFResponse(false, false, resultset.wfc);
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get save entry response
     * @param res the response
     */

  }, {
    key: 'getSaveResponse',
    value: function getSaveResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.length > 0) {
          var hasLogicErrors = false;
          if (resultset.length == 1) {
            if (resultset[0].hasOwnProperty('succeeded')) {
              hasLogicErrors = !_WFValue2.default.toBoolean(resultset[0].succeeded);
            }
          }
          return new WFResponse(false, hasLogicErrors, resultset);
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get publish response
     * @param res the response
     */

  }, {
    key: 'getPublishResponse',
    value: function getPublishResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;

      //console.error('RES________')
      //console.dir(resultset)

      if (!request_errors) {
        if (resultset.hasOwnProperty("published") && _WFValue2.default.toBoolean(resultset["published"])) {
          return new WFResponse(false, false, resultset);
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get unpublish response
     * @param res the response
     */

  }, {
    key: 'getUnPublishResponse',
    value: function getUnPublishResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.hasOwnProperty("published") && !_WFValue2.default.toBoolean(resultset["published"])) {
          return new WFResponse(false, false, resultset);
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get delete entry response
     * @param res the response
     */

  }, {
    key: 'getDelResponse',
    value: function getDelResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.hasOwnProperty('deleted_entries')) {
          var deletedEntries = resultset['deleted_entries'];
          if (!(typeof deletedEntries[0] === 'undefined')) {
            return new WFResponse(false, false, deletedEntries);
          } else {
            return new WFResponse(false, true, deletedEntries);
          }
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get find form by name or id response
     * @param res the response
     */

  }, {
    key: 'getFindFormStatsResponse',
    value: function getFindFormStatsResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        return new WFResponse(false, false, resultset);
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }

    /**
     * Get incr counter response
     * @param res the response
     */

  }, {
    key: 'getIncrCountResponse',
    value: function getIncrCountResponse(res) {
      var resultset = res.resultset,
          request_errors = res.request_errors;


      if (!request_errors) {
        if (resultset.hasOwnProperty('id')) {
          return new WFResponse(false, false, resultset);
        } else {
          return new WFResponse(false, true, resultset);
        }
      }

      return new WFResponse(request_errors, request_errors, resultset);
    }
  }]);
  return WFResponse;
}();

;

exports.default = WFResponse;

/*
todo charly deplace in wf utils
resultset.rows.map((row) => {
  let numbers = [
    "id",
    "parent_id",
    "wf_module_id",
    "wf_optiongroup_id",
    "wf_producttype_id"
  ];
  numbers.forEach(k => {
    if(row.hasOwnProperty(k)) {
      let n = parseInt(row[k]);
      row[k] = isNaN(n) ? row[k] : n;
    }
  })
  return row;
  */

/***/ }),
/* 40 */,
/* 41 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
var APP_DEV = exports.APP_DEV = true,
    APP_DEBUG = exports.APP_DEBUG = false,

/*
APP_BASE_URL			= `${__WF__.BASE_URL || window.location.origin}/index.php`, //"http://localhost:9000/index.php",
*/
// -------------------- //

APP_ROOT_NAME = exports.APP_ROOT_NAME = "WFRoot",
    APP_ROOT_VERSION = exports.APP_ROOT_VERSION = "1.0.0",


// -------------------- //

APP_ADMIN_NAME = exports.APP_ADMIN_NAME = "WFAdmin",
    APP_ADMIN_VERSION = exports.APP_ADMIN_VERSION = "2.0.0-dev-2",
    APP_ADMIN_DOM_NODE = exports.APP_ADMIN_DOM_NODE = "#wf-admin",


// -------------------- //

TYPE_HIDDEN = exports.TYPE_HIDDEN = "hidden",
    TYPE_ADMIN = exports.TYPE_ADMIN = "admin",
    TYPE_STRING = exports.TYPE_STRING = "string",
    TYPE_TEXT = exports.TYPE_TEXT = "text",
    TYPE_DATE = exports.TYPE_DATE = "date",
    TYPE_JSON = exports.TYPE_JSON = "json",
    TYPE_NUMBER = exports.TYPE_NUMBER = "number",
    TYPE_BOOLEAN = exports.TYPE_BOOLEAN = "boolean",
    TYPE_OBJECT = exports.TYPE_OBJECT = "object",
    TYPE_ARRAY = exports.TYPE_ARRAY = "array",
    TYPE_SELECT_SINGLE = exports.TYPE_SELECT_SINGLE = "select-single",
    TYPE_SELECT_MULITPLE = exports.TYPE_SELECT_MULITPLE = "select-multiple",
    TYPE_COLLECTION = exports.TYPE_COLLECTION = "collection",
    TYPE_PRODUCT = exports.TYPE_PRODUCT = "product",
    TYPE_MP4 = exports.TYPE_MP4 = "video/mp4",
    TYPE_WEBM = exports.TYPE_WEBM = "video/webm",
    TYPE_OGV = exports.TYPE_OGV = "video/ogv",


// -------------------- //

INPUT_TEXT = exports.INPUT_TEXT = "text",
    INPUT_DATE = exports.INPUT_DATE = "date",
    INPUT_EMAIL = exports.INPUT_EMAIL = "email",
    INPUT_NUMBER = exports.INPUT_NUMBER = "number",
    INPUT_TEL = exports.INPUT_TEL = "tel",
    INPUT_URL = exports.INPUT_URL = "url",
    INPUT_TEXTAREA = exports.INPUT_TEXTAREA = "textarea",
    INPUT_SELECT = exports.INPUT_SELECT = "select",
    INPUT_CHECKBOX = exports.INPUT_CHECKBOX = "checkbox",
    INPUT_RADIO_BUTTON = exports.INPUT_RADIO_BUTTON = "radio-button",
    INPUT_FILE = exports.INPUT_FILE = "file",
    INPUT_RANGE = exports.INPUT_RANGE = "range",
    INPUT_COLOR = exports.INPUT_COLOR = "color",
    INPUT_MEDIA = exports.INPUT_MEDIA = "media",
    INPUT_GRID = exports.INPUT_GRID = "grid",
    INPUT_PANEL = exports.INPUT_PANEL = "panel",


// -------------------- //

ACTION_DELETE = exports.ACTION_DELETE = "delete",
    ACTION_CANCEL = exports.ACTION_CANCEL = "cancel",
    ACTION_SAVE = exports.ACTION_SAVE = "save",
    ACTION_PUBLISH = exports.ACTION_PUBLISH = "publish",
    ACTION_UNPUBLISH = exports.ACTION_UNPUBLISH = "unpubish",


// -------------------- //

HEADER = exports.HEADER = "header",
    MAIN = exports.MAIN = "main",
    FOOTER = exports.FOOTER = "footer",
    BODY = exports.BODY = "body",
    SIDEBAR = exports.SIDEBAR = "sidebar",
    CURRENT = exports.CURRENT = "current",
    TAB = exports.TAB = "tab",
    TABS = exports.TABS = "tabs",
    TABS_CUSTOM = exports.TABS_CUSTOM = "tabs_custom",


// -------------------- //

SELECT_CLASS = exports.SELECT_CLASS = "selected",
    SELECT_BY_ID = exports.SELECT_BY_ID = "id",
    SELECT_BY_NAME = exports.SELECT_BY_NAME = "name",
    SELECT_BY_LABEL = exports.SELECT_BY_LABEL = "label",
    BODY_H = exports.BODY_H = 101,
    BODY_AND_TABS_H = exports.BODY_AND_TABS_H = 134,
    MODAL_BODY_H = exports.MODAL_BODY_H = 450,
    //490,//590,
PANEL_BODY_H = exports.PANEL_BODY_H = 175,


// -------------------- //

TRUE = exports.TRUE = true,
    FALSE = exports.FALSE = false,
    NULL = exports.NULL = null,


// -------------------- //

VALIDATOR_BOOLEAN = exports.VALIDATOR_BOOLEAN = "boolean",
    VALIDATOR_POINT = exports.VALIDATOR_POINT = "point",
    VALIDATOR_PRICE = exports.VALIDATOR_PRICE = "price",


// -------------------- //

OVERLAY_TRANSPARENT = exports.OVERLAY_TRANSPARENT = "transparent",
    OVERLAY_DARK = exports.OVERLAY_DARK = "rgba(60,60,60,0.8)",


// -------------------- //

CELL_DATE = exports.CELL_DATE = "date",
    CELL_FILE = exports.CELL_FILE = "file",
    CELL_NUMBER = exports.CELL_NUMBER = "number",
    CELL_STRING = exports.CELL_STRING = "string",
    CELL_TEXT = exports.CELL_TEXT = "text",
    CELL_SELECT = exports.CELL_SELECT = "select",
    CELL_SHORTCODE = exports.CELL_SHORTCODE = "shortcode",
    CELL_ACTION = exports.CELL_ACTION = "action",
    CELL_ACTION_CHECK = exports.CELL_ACTION_CHECK = "check",
    CELL_ACTION_DELETE = exports.CELL_ACTION_DELETE = "delete",
    CELL_ACTION_ADD = exports.CELL_ACTION_ADD = "add",
    CELL_ACTION_OPEN = exports.CELL_ACTION_OPEN = "open",
    CELL_ACTION_EDIT = exports.CELL_ACTION_EDIT = "edit",
    CELL_ACTION_CUSTOM = exports.CELL_ACTION_CUSTOM = "custom",
    CELL_ACTION_EMPTY = exports.CELL_ACTION_EMPTY = "empty",
    CELL_ACTION_NULL = exports.CELL_ACTION_NULL = "null",


// -------------------- //

PAGES_ADMIN = exports.PAGES_ADMIN = "pages",


// -------------------- //
/*
PAGE_MATRICE 				= "matrice",
PAGE_HOME 					= "home",
PAGE_EDITOR 				= "editor",
*/
// -------------------- //
/*
TAB_MATRICE 				= "matrice",
TAB_HOME 					= "home",
TAB_EDITOR 					= "editor",
TAB_ANALYTICS 				= "analytics",

TAB_HOME_FORM 				= "forms",
TAB_HOME_BAOBAB 			= "baobab",
TAB_HOME_SETTING 			= "setting",
TAB_HOME_FORM_LABEL			= "All Forms",
TAB_HOME_BAOBAB_LABEL		= "Baobab",
TAB_HOME_SETTING_LABEL		= "Setting",

TAB_EDITOR_STUDIO  			= "studio",
TAB_EDITOR_ACTIONS  		= "actions",
TAB_EDITOR_ENTRIES  		= "entries",
TAB_EDITOR_ANALYTICS 		= "analytics",
TAB_EDITOR_STUDIO_LABEL 	= "Studio",
TAB_EDITOR_ACTIONS_LABEL 	= "Actions",
TAB_EDITOR_ENTRIES_LABEL 	= "Entries",
TAB_EDITOR_ANALYTICS_LABEL 	= "Analytics",

TAB_ANALYTICS_FORM 			= "form",
TAB_ANALYTICS_FIELDS 		= "fields",
TAB_ANALYTICS_FORM_LABEL 	= "Form Analytics",
TAB_ANALYTICS_FIELDS_LABEL 	= "Fields Analytics",
*/
// -------------------- //

PANEL_ADMIN = exports.PANEL_ADMIN = "panels",
    PANEL_ADMIN_BAOBAB = exports.PANEL_ADMIN_BAOBAB = "baobab",
    PANEL_ADMIN_BAOBAB_LABEL = exports.PANEL_ADMIN_BAOBAB_LABEL = "Baobab Explorer",
    PANEL_ADMIN_BAOBAB_OPTION = exports.PANEL_ADMIN_BAOBAB_OPTION = "baobab_option",
    PANEL_ADMIN_BAOBAB_OPTION_LABEL = exports.PANEL_ADMIN_BAOBAB_OPTION_LABEL = "Option Archive",


// -------------------- //
// -------------------- //
// -------------------- //

WF_SLOGAN = exports.WF_SLOGAN = "WordPress Forms Creative Suite",
    WF_VERSION_LITE = exports.WF_VERSION_LITE = "Version Lite 1.5.0",
    WF_VERSION_PREMIUM = exports.WF_VERSION_PREMIUM = "Version Premium 1.5.0",


// -------------------- //

CLASSIC_FIELD = exports.CLASSIC_FIELD = "classic-field",
    CLASSIC_CONTENT = exports.CLASSIC_CONTENT = "classic-content",
    EXTRA_FIELD = exports.EXTRA_FIELD = "extra-field",
    EXTRA_CONTENT = exports.EXTRA_CONTENT = "extra-content",


// -------------------- //

DEFAULT_COL_CONFIG = exports.DEFAULT_COL_CONFIG = {
	lg: 12,
	md: 12,
	sm: 12,
	xs: 12
},


// -------------------- //

PAGINATION_TITLE = exports.PAGINATION_TITLE = {
	first: 'First',
	prev: "\xAB",
	prevSet: '...',
	nextSet: '...',
	next: "\xBB",
	last: 'Last'
};

// -------------------- //

/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
   value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFLoader = __webpack_require__(99);

var _WFLoader2 = _interopRequireDefault(_WFLoader);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
   icon: "wf-section-title-icon",
   text: "wf-section-title-text",
   loader: "wf-section-title-loader",
   search: "search2"
};

// ------------------- //

var WFSectionTitle = function (_Component) {
   (0, _inherits3.default)(WFSectionTitle, _Component);

   function WFSectionTitle() {
      (0, _classCallCheck3.default)(this, WFSectionTitle);
      return (0, _possibleConstructorReturn3.default)(this, (WFSectionTitle.__proto__ || (0, _getPrototypeOf2.default)(WFSectionTitle)).apply(this, arguments));
   }

   (0, _createClass3.default)(WFSectionTitle, [{
      key: "render",
      value: function render() {
         return _react2.default.createElement(
            "wf-section-title",
            null,
            this.isLoading() ? this.getLoader() : this.getIcon(),
            this.getText(),
            _react2.default.createElement(
               "span",
               { className: "wf--extra" },
               this.props.children
            )
         );
      }

      // ------------------- //

   }, {
      key: "getIcon",
      value: function getIcon() {
         var _props = this.props,
             icon = _props.icon,
             _props$iconClassName = _props.iconClassName,
             iconClassName = _props$iconClassName === undefined ? "" : _props$iconClassName;

         var _icon = this.isSearch() ? classes.search : icon;
         return _react2.default.createElement(_WFIcon.WFIcon, { icon: _icon, className: classes.icon + " " + iconClassName });
      }

      // ------------------- //

   }, {
      key: "getText",
      value: function getText() {
         var _props2 = this.props,
             _props2$text = _props2.text,
             text = _props2$text === undefined ? "" : _props2$text,
             _props2$textClassName = _props2.textClassName,
             textClassName = _props2$textClassName === undefined ? "" : _props2$textClassName,
             _props2$counter = _props2.counter,
             counter = _props2$counter === undefined ? 0 : _props2$counter,
             _props2$counterMax = _props2.counterMax,
             counterMax = _props2$counterMax === undefined ? 0 : _props2$counterMax,
             _props2$loader = _props2.loader,
             loader = _props2$loader === undefined ? false : _props2$loader,
             _props2$loaderText = _props2.loaderText,
             loaderText = _props2$loaderText === undefined ? "loading..." : _props2$loaderText,
             _props2$searchText = _props2.searchText,
             searchText = _props2$searchText === undefined ? "result(s) found" : _props2$searchText;

         return _react2.default.createElement(
            _WFText2.default
            //html={true}
            ,
            { limit: 0,
               counter: this.isLoading() ? 0 : counter,
               counterMax: counterMax,
               counterParenthesis: false,
               className: classes.text + " " + textClassName },
            this.isLoading() ? loaderText : this.isSearch() ? searchText : text
         );
      }

      // ------------------- //

   }, {
      key: "getLoader",
      value: function getLoader() {
         return _react2.default.createElement(_WFLoader2.default, { className: classes.loader });
      }

      // ------------------- //

   }, {
      key: "isLoading",
      value: function isLoading() {
         return this.props.loader || false;
      }

      // ------------------- //

   }, {
      key: "isSearch",
      value: function isSearch() {
         return this.props.search || false;
      }
   }]);
   return WFSectionTitle;
}(_react.Component);

// ------------------- //

exports.default = WFSectionTitle;

// ------------------- //

/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _Constants = __webpack_require__(72);

var _Lodash = __webpack_require__(6);

var _WFInputTypes = __webpack_require__(34);

var _WFDataTypes = __webpack_require__(74);

var _WFValueTypes = __webpack_require__(22);

var _WFEventTypes = __webpack_require__(16);

var _WFProductType = __webpack_require__(15);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WF_VALUES_CHANGE = "wf_values_change";

/**
 * Store form field infos setOptionGroup
 */

var WFormField = function () {
  /**
   * Constructor
   * Create a new field
   * @param config the schema field config
   */
  function WFormField(config) {
    (0, _classCallCheck3.default)(this, WFormField);

    this.entryId = new _WFormProp2.default("entry_id", _WFDataTypes.WF_TYPE_INTEGER, 0);
    this.name = new _WFormProp2.default("name", _WFDataTypes.WF_TYPE_STRING, "");
    this.type = new _WFormProp2.default("type", _WFDataTypes.WF_TYPE_STRING, "");
    this.label = new _WFormProp2.default("label", _WFDataTypes.WF_TYPE_STRING, "");
    this.len = new _WFormProp2.default("len", _WFDataTypes.WF_TYPE_INTEGER, 0);
    this.legend = new _WFormProp2.default("legend", _WFDataTypes.WF_TYPE_TEXT, "");
    this.inputType = new _WFormProp2.default("input_type", _WFDataTypes.WF_TYPE_STRING, "");
    this.validationSchema = new _WFormProp2.default("validation_schema", _WFDataTypes.WF_TYPE_OBJECT);
    this.required = new _WFormProp2.default("required", _WFDataTypes.WF_TYPE_BOOLEAN, false);
    this.editable = new _WFormProp2.default("editable", _WFDataTypes.WF_TYPE_BOOLEAN, true);
    this.isCategory = new _WFormProp2.default("is_category", _WFDataTypes.WF_TYPE_BOOLEAN, false);
    this.visible = new _WFormProp2.default("visible", _WFDataTypes.WF_TYPE_BOOLEAN, true);
    this.searchable = new _WFormProp2.default("searchable", _WFDataTypes.WF_TYPE_BOOLEAN, false);
    this.formConfigId = new _WFormProp2.default("wf_formconfig_id", _WFDataTypes.WF_TYPE_INTEGER, 0);
    this.optionGroupId = new _WFormProp2.default("wf_optiongroup_id", _WFDataTypes.WF_TYPE_INTEGER, 0);
    this.optionGroup = new _WFormProp2.default("wf_optiongroup", _WFDataTypes.WF_TYPE_OBJECT);
    this.canCreateColumn = new _WFormProp2.default("create_column", _WFDataTypes.WF_TYPE_BOOLEAN, true);
    this.isAddon = new _WFormProp2.default("is_addon", _WFDataTypes.WF_TYPE_BOOLEAN, false);
    this.fieldSpecId = new _WFormProp2.default("wf_fieldspec_id", _WFDataTypes.WF_TYPE_INTEGER, 0);
    // the field settings that are stored in column attributes of table
    // wf_field
    this.settings = new _WFormProp2.default("attributes", _WFDataTypes.WF_TYPE_OBJECT);
    // the field value that is stored in form entries table
    this.value = null;
    // the value attributes that are stored in column attributes of table
    // wf_post
    this.attributes = new _WFormProp2.default("attributes", _WFDataTypes.WF_TYPE_OBJECT);
    // holds the selected file in case of file field
    this.file = null;
    // holds the preview url of image in case of file field
    this.imagePreviewUrl = null;
    // the field is branch
    this.branchMgr = null;
    // set field schema
    // NB the line below should be at the last instruction
    this.setSchema(config);
  }

  /**
   * Set prop value
   * @param val the new value to set {string || number || object}
   */


  (0, _createClass3.default)(WFormField, [{
    key: "setValue",
    value: function setValue(val) {
      // Debug...
      // WFormField.debugValue(this, val);
      // console.log(val)
      if (this.getType()) {
        if (this.value) {
          var isObjectField = WFormField.isObjectField(this);
          var isSelectField = WFormField.isSelectField(this);
          var attributesMgr = this.getAttributesMgr();
          if (isObjectField) {
            this.value.setValue(val);
          } else {
            if ((0, _Lodash.isObject)(val)) {
              var key = this.getValueMgr().getKey();
              var value = val[key];
              if (!isSelectField) {
                this.value.setValue(value);
              }
              if (!this.getCanCreateColumn() && !isSelectField) {
                attributesMgr.setValue((0, _defineProperty3.default)({}, this.getName(), val));
              } else {
                if (!isSelectField) {
                  delete val[key];
                  attributesMgr.setValue((0, _defineProperty3.default)({}, this.getName(), val));
                } else {
                  this.value.setValue(val);
                  attributesMgr.setValue((0, _defineProperty3.default)({}, this.getName(), val));
                }
              }
            } else {
              this.value.setValue(val);
              if (!this.getCanCreateColumn()) {
                this.getAttributesMgr().setValue((0, _defineProperty3.default)({}, this.getName(), val));
              }
            }
          }
        }
      }
    }

    /**
     * Clear value
     */

  }, {
    key: "clearValue",
    value: function clearValue() {

      //console.error("CLEAR FLD", this.getName() )

      if (this.value) {
        this.value.clearValue();
        this.attributes.clearValue();
      }
    }

    /**
     * Check if value exist
     */

  }, {
    key: "hasValue",
    value: function hasValue() {
      var value = this.getValue();
      if ((0, _Lodash.isNull)(value) || value === "" || value === false) {
        return false;
      } else {
        return true;
      }
    }

    /**
     * Get prop value
     */

  }, {
    key: "getValue",
    value: function getValue() {
      if (this.value) {
        return this.value.getValue();
      } else {
        return null;
      }
    }

    /**
     * Get value prop 
     */

  }, {
    key: "getValueMgr",
    value: function getValueMgr() {
      if (this.value) {
        return this.value.getValueMgr();
      } else {
        return null;
      }
    }

    /**
     * Get input manager
     */

  }, {
    key: "getInputMgr",
    value: function getInputMgr() {
      if (this.value) {
        return this.value.getValueMgr().input;
      } else {
        return null;
      }
    }

    /**
     * Set input manager
     */

  }, {
    key: "setInputMgr",
    value: function setInputMgr(mgr) {
      if (this.value && mgr && !this.getInputMgr()) {
        return this.value.getValueMgr().setInput(mgr);
      }
    }

    /**
     * Set prop entryId - entryId will only set if it was empty
     * @param val the new value to set
     */

  }, {
    key: "setEntryId",
    value: function setEntryId(val) {
      if (val) {
        this.entryId.setValue(val);
      }
    }

    /**
     * Get prop entryId
     */

  }, {
    key: "getEntryId",
    value: function getEntryId() {
      return this.entryId.getValue();
    }

    /**
     * Set prop name - name will only set if entryId was empty
     * @param val the new value to set
     */

  }, {
    key: "setName",
    value: function setName(val) {
      this.name.setValue(val);
    }

    /**
     * Get prop name
     */

  }, {
    key: "getName",
    value: function getName() {
      return this.name.getValue();
    }

    /**
     * Set prop type - type will only set if entryId was empty
     * if type is set ==> the value will be reset
     * @param val the new value to set
     */

  }, {
    key: "setType",
    value: function setType(val) {
      this.type.setValue(val);
      this.value = new _WFormProp2.default("value", this.type.getValue());
    }

    /**
     * Get prop type
     */

  }, {
    key: "getType",
    value: function getType() {
      return this.type.getValue();
    }

    /**
     * Set prop len - len will only set if entryId was empty
     * @param val the new value to set
     */

  }, {
    key: "setLen",
    value: function setLen(val) {
      this.len.setValue(val);
    }

    /**
     * Get prop len
     */

  }, {
    key: "getLen",
    value: function getLen() {
      return this.len.getValue();
    }

    /**
     * Set prop label
     * @param val the new value to set
     */

  }, {
    key: "setLabel",
    value: function setLabel(val) {
      this.label.setValue(val);
    }

    /**
     * Get prop label
     */

  }, {
    key: "getLabel",
    value: function getLabel() {
      return this.label.getValue();
    }

    /**
     * Set prop legend
     * @param val the new value to set
     */

  }, {
    key: "setLegend",
    value: function setLegend(val) {
      this.legend.setValue(val);
    }

    /**
     * Get prop legend
     */

  }, {
    key: "getLegend",
    value: function getLegend() {
      return this.legend.getValue();
    }

    /**
     * Set prop inputType
     * @param val the new value to set
     */

  }, {
    key: "setInputType",
    value: function setInputType(val) {
      this.inputType.setValue(val);
    }

    /**
     * Get prop inputType
     */

  }, {
    key: "getInputType",
    value: function getInputType() {
      return this.inputType.getValue();
    }

    /**
     * Set prop validationSchema
     * @param val the new value to set
     */

  }, {
    key: "setValidationSchema",
    value: function setValidationSchema(val) {
      this.validationSchema.setValue(val);
    }

    /**
     * Get prop validationSchema
     */

  }, {
    key: "getValidationSchema",
    value: function getValidationSchema() {
      return this.validationSchema.getValue();
    }

    /**
     * Set prop formConfigId
     * @param val the new value to set
     */

  }, {
    key: "setFormConfigId",
    value: function setFormConfigId(val) {
      this.formConfigId.setValue(val);
    }

    /**
     * Get prop formConfigId
     */

  }, {
    key: "getFormConfigId",
    value: function getFormConfigId() {
      return this.formConfigId.getValue();
    }

    /**
     * Set prop optionGroupId
     * @param val the new value to set
     */

  }, {
    key: "setOptionGroupId",
    value: function setOptionGroupId(val) {
      this.optionGroupId.setValue(val);
    }

    /**
     * Get prop optionGroupId
     */

  }, {
    key: "getOptionGroupId",
    value: function getOptionGroupId() {
      return this.optionGroupId.getValue();
    }

    /**
     * Set prop optionGroup
     * @param val the new value to set
     */

  }, {
    key: "setOptionGroup",
    value: function setOptionGroup(val) {
      this.optionGroup.setValue(val);
    }

    /**
     * Get prop optionGroup
     */

  }, {
    key: "getOptionGroup",
    value: function getOptionGroup() {
      return this.optionGroup.getValue();
    }

    /**
     * Set prop fieldSpecId
     * @param val the new value to set
     */

  }, {
    key: "setFieldSpecId",
    value: function setFieldSpecId(val) {
      this.fieldSpecId.setValue(val);
    }

    /**
     * Get prop fieldSpecId
     */

  }, {
    key: "getFieldSpecId",
    value: function getFieldSpecId() {
      return this.fieldSpecId.getValue();
    }

    /**
     * Set prop required
     * @param val the new value to set
     */

  }, {
    key: "setRequired",
    value: function setRequired(val) {
      this.required.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop required
     */

  }, {
    key: "getRequired",
    value: function getRequired() {
      return this.required.getValue();
    }

    /**
     * Set prop editable
     * @param val the new value to set
     */

  }, {
    key: "setEditable",
    value: function setEditable(val) {
      this.editable.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop editable
     */

  }, {
    key: "getEditable",
    value: function getEditable() {
      return this.editable.getValue();
    }

    /**
     * Set prop isCategory
     * @param val the new value to set
     */

  }, {
    key: "setIsCategory",
    value: function setIsCategory(val) {
      this.isCategory.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop isCategory
     */

  }, {
    key: "getIsCategory",
    value: function getIsCategory() {
      return this.isCategory.getValue();
    }

    /**
     * Set prop visible
     * @param val the new value to set
     */

  }, {
    key: "setVisible",
    value: function setVisible(val) {
      this.visible.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop visible
     */

  }, {
    key: "getVisible",
    value: function getVisible() {
      return this.visible.getValue();
    }

    /**
     * Set prop searchable
     * @param val the new value to set
     */

  }, {
    key: "setSearchable",
    value: function setSearchable(val) {
      this.searchable.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop searchable
     */

  }, {
    key: "getSearchable",
    value: function getSearchable() {
      return this.searchable.getValue();
    }

    /**
     * Set prop canCreateColumn
     * @param val the new value to set
     */

  }, {
    key: "setCanCreateColumn",
    value: function setCanCreateColumn(val) {
      this.canCreateColumn.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop canCreateColumn
     */

  }, {
    key: "getCanCreateColumn",
    value: function getCanCreateColumn() {
      return this.canCreateColumn.getValue();
    }

    /**
     * Set prop isAddon
     * @param val the new value to set
     */

  }, {
    key: "setIsAddon",
    value: function setIsAddon(val) {
      this.isAddon.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Get prop isAddon
     */

  }, {
    key: "getIsAddon",
    value: function getIsAddon() {
      return this.isAddon.getValue();
    }

    /**
     * Set from a given schema
     * @param config the schema field config
     */

  }, {
    key: "setSchema",
    value: function setSchema(config) {
      // TODO(lybaba) remove me
      //console.error("SET_FIELD_SCHEMA")
      //console.dir(config)

      var _config$entry_id = config.entry_id,
          entry_id = _config$entry_id === undefined ? 0 : _config$entry_id,
          _config$id = config.id,
          id = _config$id === undefined ? 0 : _config$id,
          _config$name = config.name,
          name = _config$name === undefined ? "" : _config$name,
          _config$label = config.label,
          label = _config$label === undefined ? "" : _config$label,
          _config$type = config.type,
          type = _config$type === undefined ? _WFDataTypes.WF_TYPE_STRING : _config$type,
          _config$legend = config.legend,
          legend = _config$legend === undefined ? "" : _config$legend,
          _config$input_type = config.input_type,
          input_type = _config$input_type === undefined ? "" : _config$input_type,
          _config$validation_sc = config.validation_schema,
          validation_schema = _config$validation_sc === undefined ? "" : _config$validation_sc,
          _config$required = config.required,
          required = _config$required === undefined ? false : _config$required,
          _config$editable = config.editable,
          editable = _config$editable === undefined ? true : _config$editable,
          _config$is_category = config.is_category,
          is_category = _config$is_category === undefined ? false : _config$is_category,
          _config$searchable = config.searchable,
          searchable = _config$searchable === undefined ? false : _config$searchable,
          _config$len = config.len,
          len = _config$len === undefined ? 64 : _config$len,
          _config$wf_formconfig = config.wf_formconfig_id,
          wf_formconfig_id = _config$wf_formconfig === undefined ? 0 : _config$wf_formconfig,
          _config$wf_optiongrou = config.wf_optiongroup_id,
          wf_optiongroup_id = _config$wf_optiongrou === undefined ? 0 : _config$wf_optiongrou,
          _config$wf_optiongrou2 = config.wf_optiongroup,
          wf_optiongroup = _config$wf_optiongrou2 === undefined ? null : _config$wf_optiongrou2,
          _config$wf_fieldspec_ = config.wf_fieldspec_id,
          wf_fieldspec_id = _config$wf_fieldspec_ === undefined ? 0 : _config$wf_fieldspec_,
          _config$visible = config.visible,
          visible = _config$visible === undefined ? true : _config$visible,
          _config$create_column = config.create_column,
          create_column = _config$create_column === undefined ? true : _config$create_column,
          _config$is_addon = config.is_addon,
          is_addon = _config$is_addon === undefined ? false : _config$is_addon,
          _config$attributes = config.attributes,
          attributes = _config$attributes === undefined ? "" : _config$attributes;


      if (entry_id) {
        this.setEntryId(entry_id);
      } else {
        this.setEntryId(id);
      }

      this.setName(name);
      this.setType(type);
      this.setLen(len);
      this.setLabel(label);
      this.setLegend(legend);
      this.setInputType(input_type);
      this.setRequired(required);
      this.setEditable(editable);
      this.setIsCategory(is_category);
      this.setVisible(visible);
      this.setSearchable(searchable);
      this.setFormConfigId(wf_formconfig_id);
      this.setOptionGroupId(wf_optiongroup_id);
      this.setFieldSpecId(wf_fieldspec_id);
      this.setCanCreateColumn(create_column);
      this.setIsAddon(is_addon);
      this.getSettingsMgr().fromJSON(attributes);
      this.setValidationSchema(validation_schema);
      if (wf_optiongroup_id && !wf_optiongroup) {
        this.setOptionGroup({
          id: wf_optiongroup_id
        });
      } else if ((0, _Lodash.isObject)(wf_optiongroup)) {
        this.setOptionGroup(wf_optiongroup);
      }
    }

    /**
     * Get the field config as json plain object
     */

  }, {
    key: "getSchema",
    value: function getSchema() {
      var settings = this.getSettingsMgr().getValue();
      var schema = (0, _assign2.default)({
        wf_formconfig_id: this.getFormConfigId(),
        entry_id: this.getEntryId(),
        name: this.getName(),
        type: this.getType(),
        label: this.getLabel(),
        len: this.getLen(),
        legend: this.getLegend(),
        input_type: this.getInputType(),
        validation_schema: this.getValidationSchema(),
        required: this.getRequired(),
        editable: this.getEditable(),
        is_addon: this.getIsAddon(),
        is_category: this.getIsCategory(),
        visible: this.getVisible(),
        searchable: this.getSearchable(),
        wf_optiongroup_id: this.getOptionGroupId(),
        wf_optiongroup: this.getOptionGroup(),
        wf_fieldspec_id: this.getFieldSpecId(),
        create_column: this.getCanCreateColumn()
      }, settings);
      return schema;
    }

    /**
     * Set this.file and this.imagePreviewUrl
     * @param args
     */

  }, {
    key: "setFileAndImagePreviewUrl",
    value: function setFileAndImagePreviewUrl(args) {
      var _args$file = args.file,
          file = _args$file === undefined ? null : _args$file,
          _args$imagePreviewUrl = args.imagePreviewUrl,
          imagePreviewUrl = _args$imagePreviewUrl === undefined ? null : _args$imagePreviewUrl;


      this.file = file;
      this.imagePreviewUrl = imagePreviewUrl;
    }

    /**
     * Get this.file
     */

  }, {
    key: "getFile",
    value: function getFile() {
      return this.file;
    }

    /**
     * Get this.imagePreviewUrl
     */

  }, {
    key: "getImagePreviewUrl",
    value: function getImagePreviewUrl() {
      return this.imagePreviewUrl;
    }

    /**
     * Get prop attributes value
     * @return this.attributes.getValue()
     */

  }, {
    key: "getAttributes",
    value: function getAttributes() {
      return this.attributes.getValue();
    }

    /**
     * Get prop attributes value manager
     * @return this.attributes.getValueMgr()
     */

  }, {
    key: "getAttributesMgr",
    value: function getAttributesMgr() {
      return this.attributes.getValueMgr();
    }

    /**
     * Get prop settings value
     * @return this.settings.getValue()
     */

  }, {
    key: "getSettings",
    value: function getSettings() {
      return this.settings.getValue();
    }

    /**
     * Get prop settings value manager
     * @return this.settings.getValueMgr()
     */

  }, {
    key: "getSettingsMgr",
    value: function getSettingsMgr() {
      return this.settings.getValueMgr();
    }

    /**
     * Called each time an event occrured in the field
     * main entry point for components
     * Use this.on(WF_EVENT_ONREFRESH) to sync shema with component's state
     * @param eventType the event type
     * @param eventArgs the event args
     */

  }, {
    key: "on",
    value: function on(eventType) {
      var _this = this;

      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      if (this.value) {
        // Special case file input handling
        if (eventArgs.hasOwnProperty(_WFValueTypes.WF_EVENT_FILE_VALUE)) {
          var e = eventArgs[_WFValueTypes.WF_EVENT_FILE_VALUE];
          e.preventDefault();
          var reader = new FileReader();
          var file = e.target.files[0];

          reader.onloadend = function () {
            _this.setFileAndImagePreviewUrl({
              file: file,
              imagePreviewUrl: reader.result
            });
          };

          reader.readAsDataURL(file);

          // remove from eventArgs to make normal behavior works
          // TODO(lybaba) FIXME
          delete eventArgs[_WFValueTypes.WF_EVENT_FILE_VALUE];
        }

        // Normal behavior
        if (eventType === _WFEventTypes.WF_EVENT_ONREFRESH) {
          this.value.on(eventType, {
            schema: this.getSchema()
          }, ctx);
        } else {
          this.value.on(eventType, {
            field: this,
            eventArgs: eventArgs,
            name: this.getName(),
            schema: this.getSchema(),
            attributes: this.getAttributesMgr()
          }, ctx);
        }
      }
    }

    /**
     * Check type equal string
     * @return boolean
     */

  }], [{
    key: "isStringField",
    value: function isStringField(handler) {
      var type = handler.getType();
      return type === _WFDataTypes.WF_TYPE_STRING || type === _WFDataTypes.WF_TYPE_TEXT || type === _WFDataTypes.WF_TYPE_HTML;
    }

    /**
     * Check type equal string
     * @return boolean
     */

  }, {
    key: "isObjectField",
    value: function isObjectField(handler) {
      var type = handler.getType();
      return type === _WFDataTypes.WF_TYPE_OBJECT;
    }

    /**
     * Check type equal select
     * @return boolean
     */

  }, {
    key: "isSelectField",
    value: function isSelectField(handler) {
      var type = handler.getType();
      return type === _WFDataTypes.WF_TYPE_SELECT || type === _WFDataTypes.WF_TYPE_SELECT_SINGLE || type === _WFDataTypes.WF_TYPE_SELECT_MULTIPLE;
    }

    /**
     * Debug value 
     */

  }, {
    key: "debugValue",
    value: function debugValue(fld) {
      var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      console.warn("SET_VALUES_______________________________");
      var name = fld.getName();
      var type = fld.getType();
      var key = fld.getValueMgr().getKey();
      var isObj = (0, _Lodash.isObject)(val);
      console.log("\n        name : " + name + "\n        type : " + fld.getType() + "\n        isObjectValue : " + isObj + "\n        objValue has name : " + (isObj ? fld.hasOwnProperty(name) : null) + "\n      ");
      console.log(val);
      console.warn("___________________________________________");
    }
  }]);
  return WFormField;
}();

exports.default = WFormField;

/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFieldConfigFactory = __webpack_require__(255);

var _WFieldConfigFactory2 = _interopRequireDefault(_WFieldConfigFactory);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFProductType = __webpack_require__(15);

var _WFDataTypes = __webpack_require__(74);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ATTRIBUTES = "attributes";

/**
 * Private store  
 */
var licenseStatus = {};
//window.licenseStatus = {};

/**
 * Holds form state 
 */

var WFormState = function () {
  /**
   * Constructor
   * @param config the form config
   */
  function WFormState() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFormState);
    var _config$type = config.type,
        type = _config$type === undefined ? _WFProductType.WF_CUSTOM_CUSTOM_ID : _config$type,
        _config$name = config.name,
        name = _config$name === undefined ? "" : _config$name,
        _config$form_id = config.form_id,
        form_id = _config$form_id === undefined ? 0 : _config$form_id,
        _config$entry_id = config.entry_id,
        entry_id = _config$entry_id === undefined ? 0 : _config$entry_id,
        _config$created_tms = config.created_tms,
        created_tms = _config$created_tms === undefined ? "" : _config$created_tms,
        _config$published = config.published,
        published = _config$published === undefined ? false : _config$published,
        _config$attributes = config.attributes,
        attributes = _config$attributes === undefined ? "" : _config$attributes,
        _config$display_field = config.display_fields,
        display_fields = _config$display_field === undefined ? [] : _config$display_field,
        _config$wf_categorygr = config.wf_categorygroup_id,
        wf_categorygroup_id = _config$wf_categorygr === undefined ? 0 : _config$wf_categorygr,
        _config$wf_optiongrou = config.wf_optiongroup_id,
        wf_optiongroup_id = _config$wf_optiongrou === undefined ? 0 : _config$wf_optiongrou,
        _config$fields = config.fields,
        fields = _config$fields === undefined ? [] : _config$fields,
        _config$actions = config.actions,
        actions = _config$actions === undefined ? [] : _config$actions;

    this.type = new _WFormProp2.default("form_type", _WFDataTypes.WF_TYPE_INTEGER, type);
    this.name = new _WFormProp2.default("form_name", _WFDataTypes.WF_TYPE_STRING, name);
    this.createdTms = new _WFormProp2.default("created_tms", _WFDataTypes.WF_TYPE_STRING, created_tms);
    this.formId = new _WFormProp2.default("form_id", _WFDataTypes.WF_TYPE_INTEGER, form_id);
    this.entryId = new _WFormProp2.default("entry_id", _WFDataTypes.WF_TYPE_INTEGER, entry_id);
    this.settings = new _WFormProp2.default("settings", _WFDataTypes.WF_TYPE_STRING, attributes);
    this.published = new _WFormProp2.default("published", _WFDataTypes.WF_TYPE_BOOLEAN, _WFValue2.default.toBoolean(published));
    // volatile id is used when updating a form state. it can change between
    // two updates.
    this.volatileId = new _WFormProp2.default("_id", _WFDataTypes.WF_TYPE_INTEGER, 0);
    this.submitHandler = new _WFormProp2.default("submit_handler", _WFDataTypes.WF_TYPE_STRING, name);
    this.optionGroupId = new _WFormProp2.default("wf_optiongroup_id", _WFDataTypes.WF_TYPE_INTEGER, wf_optiongroup_id);
    this.categoryGroupId = new _WFormProp2.default("wf_categorygroup_id", _WFDataTypes.WF_TYPE_INTEGER, wf_categorygroup_id);
    this.actions = actions;
    // fields
    this.fields = {};
    this.displayFields = display_fields;
    this.addFields(fields);
    WFormState.setLicenseStatus(this);
  }

  /**
   * Get all fields values mapped by name
   * @return object
   */


  (0, _createClass3.default)(WFormState, [{
    key: "getValues",
    value: function getValues() {
      var values = {};
      var attributes = {};

      values[this.name.getName()] = this.name.getValue();
      values[this.formId.getName()] = this.formId.getValue();
      values[this.entryId.getName()] = this.entryId.getValue();
      values[this.volatileId.getName()] = this.volatileId.getValue();
      values[this.submitHandler.getName()] = this.submitHandler.getValue();

      for (var key in this.fields) {
        var fld = this.fields[key];
        var fldName = fld.getName();
        var fldAttrs = fld.getAttributes();

        if (fld.getEditable()) {
          values[fldName] = fld.getValue();
        } else if (!this.entryId.getValue()) {
          if (fld.getName() === ATTRIBUTES) {
            if (this.getName() === 'form-config') {
              values[fldName] = fld.getValue();
            }
          } else {
            values[fldName] = fld.getValue();
          }
        } else {
          if (fld.getName() === ATTRIBUTES && this.getName() === 'form-config') {
            values[fldName] = fld.getValue();
          }
        }

        if (fldAttrs.hasOwnProperty(fldName)) {
          attributes[fldName] = fldAttrs[fldName];
        }
      }

      if (!values.hasOwnProperty(ATTRIBUTES)) {
        values[ATTRIBUTES] = (0, _JSON.stringify)(attributes);
      }

      return values;
    }

    /**
     * Set fields values
     * @path !CanCreateColumn && isSelect set value with attrValue l196
     * @param values object 
     * ex 
     * values = {
     * subject: "contact for devise",
     * message: "hello world...",
     * }
     * 
     */

  }, {
    key: "setValues",
    value: function setValues(values) {
      if ((0, _Lodash.isObject)(values)) {

        // todo charly dev only...
        //console.error("FORMSTATE SET_VALUE ==> ", this.getName())
        //console.dir(values)

        var attributes = {};

        if (values.hasOwnProperty("entry_id")) {
          this.setEntryId(values.entry_id);
        } else if (values.hasOwnProperty("id")) {
          this.setEntryId(values.id);
        }
        if (values.hasOwnProperty(ATTRIBUTES) && values[ATTRIBUTES]) {
          attributes = (0, _JSON.parse)(values[ATTRIBUTES]);
          var fld = this.fields[ATTRIBUTES];
          if (fld) {
            fld.setValue(values[ATTRIBUTES]);
          }
        }
        for (var key in this.fields) {
          var _fld = this.fields[key];
          if (key !== ATTRIBUTES) {
            var attrValue = null;
            if ((0, _Lodash.isObject)(attributes) && attributes.hasOwnProperty(key)) {
              attrValue = attributes[key];
            }
            if (_fld.getCanCreateColumn()) {
              if (values.hasOwnProperty(key)) {
                var value = values[key];
                if ((0, _Lodash.isObject)(attrValue)) {
                  var subKey = _fld.getValueMgr().getKey();
                  _fld.setValue((0, _assign2.default)((0, _defineProperty3.default)({}, subKey, value), attrValue));
                } else {
                  _fld.setValue(value);
                }
              }
            } else {
              if (values.hasOwnProperty(key) && !_WFormField2.default.isSelectField(_fld)) {
                var _value = values[key];
                _fld.setValue(_value);
              } else if (attrValue) {
                _fld.setValue(attrValue);
              }
            }
          }
        }
      }
      /*
      else {
        console.error("SET_VALUES WITH NULL OBJECT...");
      }
      */
    }

    /*
    
    WFormState.js:187 FORM STATE SET SELECT2 AAA {"545":"Dinde"}setValues @ WFormState.js:187onEdit @ entry.js:184(anonymous function) @ entry.js:306onClick @ WFTableCell.js:145../node_modules/react-dom/lib/ReactErrorUtils.js.ReactErrorUtils.invokeGuardedCallback @ ReactErrorUtils.js:70executeDispatch @ EventPluginUtils.js:85executeDispatchesInOrder @ EventPluginUtils.js:108executeDispatchesAndRelease @ EventPluginHub.js:43executeDispatchesAndReleaseTopLevel @ EventPluginHub.js:54forEachAccumulated @ forEachAccumulated.js:24processEventQueue @ EventPluginHub.js:257runEventQueueInBatch @ ReactEventEmitterMixin.js:17handleTopLevel @ ReactEventEmitterMixin.js:28handleTopLevelImpl @ ReactEventListener.js:72perform @ Transaction.js:140batchedUpdates @ ReactDefaultBatchingStrategy.js:62batchedUpdates @ ReactUpdates.js:97dispatchEvent @ ReactEventListener.js:147
    WFormState.js:188 Object {arrayValue: Array[1], objectValue: Object, selectValue: Array[1], valueKey: "selectValue"}arrayValue: Array[1]0: Objectattributes: "{}"id: "545"is_private: "0"label: "Dinde"name: "dinde-545"options_count: "0"parent_id: "542"subgroups_count: "0"tree_id: "530"value: nullwf_optiongroup_id: "530"__proto__: Objectlength: 1__proto__: Array[0]objectValue: Object545: "Dinde"__proto__: ObjectselectValue: Array[1]0: "545"length: 1__proto__: Array[0]valueKey: "selectValue"__proto__: Object
    
    
    */

    /**
     * Clear fields values
     */

  }, {
    key: "clearValues",
    value: function clearValues() {
      for (var key in this.fields) {
        var fld = this.fields[key];
        if (fld) {
          fld.clearValue();
        }
      }
    }

    /**
     * Get the form type
     */

  }, {
    key: "getType",
    value: function getType() {
      return this.type.getValue();
    }

    /**
     * Set the form type
     * @param val the new value to set
     */

  }, {
    key: "setType",
    value: function setType(val) {
      this.type.setValue(val);
    }

    /**
     * Set the form name
     * @param val the new value to set
     */

  }, {
    key: "setName",
    value: function setName(val) {
      this.name.setValue(val);
    }

    /**
     * Get the form name
     */

  }, {
    key: "getName",
    value: function getName() {
      return this.name.getValue();
    }

    /**
     * Get the form create
     */

  }, {
    key: "getCreatedTms",
    value: function getCreatedTms() {
      return this.createdTms.getValue();
    }

    /**
     * Set the form submitHandler
     * @param val the new value to set
     */

  }, {
    key: "setSubmitHandler",
    value: function setSubmitHandler(val) {
      this.submitHandler.setValue(val);
    }

    /**
     * Get the form submitHandler
     */

  }, {
    key: "getSubmitHandler",
    value: function getSubmitHandler() {
      return this.submitHandler.getValue();
    }

    /**
     * Set entryId
     * @param val the new value to set
     */

  }, {
    key: "setEntryId",
    value: function setEntryId(val) {
      this.entryId.setValue(val);
    }

    /**
     * Get entryId
     */

  }, {
    key: "getEntryId",
    value: function getEntryId() {
      return this.entryId.getValue();
    }

    /**
     * Set formId
     * @param val the new value to set
     */

  }, {
    key: "setFormId",
    value: function setFormId(val) {
      this.formId.setValue(val);
    }

    /**
     * Get formId
     */

  }, {
    key: "getFormId",
    value: function getFormId() {
      return this.formId.getValue();
    }

    /**
     * Get published
     */

  }, {
    key: "getPublished",
    value: function getPublished() {
      return this.published.getValue();
    }

    /**
     * Set published
     * @param val the new value to set
     */

  }, {
    key: "setPublished",
    value: function setPublished(val) {
      this.published.setValue(_WFValue2.default.toBoolean(val));
    }

    /**
     * Set settings
     * @param val the new value to set
     */

  }, {
    key: "setSettings",
    value: function setSettings(val) {
      if ((0, _Lodash.isObject)(val)) {
        this.settings.setValue((0, _JSON.stringify)(val));
      }
    }

    /**
     * Get settings
     */

  }, {
    key: "getSettings",
    value: function getSettings() {
      var val = this.settings.getValue();
      if (val) {
        return (0, _JSON.parse)(val);
      } else {
        return {};
      }
    }

    /**
     * Set volatileId
     * @param val the new value to set
     */

  }, {
    key: "setVolatileId",
    value: function setVolatileId(val) {
      this.volatileId.setValue(val);
    }

    /**
     * Get volatileId
     */

  }, {
    key: "getVolatileId",
    value: function getVolatileId() {
      return this.volatileId.getValue();
    }

    /**
     * Get all fields mapped by name
     */

  }, {
    key: "getFields",
    value: function getFields() {
      return this.fields;
    }

    /**
     * Get all fieldConfig mapped by name
     * @return object
     */

  }, {
    key: "getFieldSchema",
    value: function getFieldSchema() {
      var schema = {};
      for (var fldName in this.fields) {
        var fld = this.getField(fldName);
        schema[fldName] = fld.getSchema();
      }
      return schema;
    }

    /**
     * Get display fields
     */

  }, {
    key: "getDisplayFields",
    value: function getDisplayFields() {
      if ((0, _Lodash.isArray)(this.displayFields)) {
        return this.displayFields;
      } else {
        return [];
      }
    }

    /**
     * Set display fields
     * @param displayFields the ordered list of fields to display in views
     */

  }, {
    key: "setDisplayFields",
    value: function setDisplayFields(displayFields) {
      if ((0, _Lodash.isArray)(displayFields)) {
        this.displayFields = displayFields;
      }
    }

    /**
     * Get actions
     */

  }, {
    key: "getActions",
    value: function getActions() {
      return this.actions;
    }

    /**
     * Set actions
     * @param actions
     */

  }, {
    key: "setActions",
    value: function setActions(actions) {
      if ((0, _Lodash.isArray)(actions)) {
        this.actions = actions;
      }
    }

    /**
     * Get categoryGroupId (readonly)
     */

  }, {
    key: "getCategoryGroupId",
    value: function getCategoryGroupId() {
      return this.categoryGroupId.getValue();
    }

    /**
     * Get OptionGroupId (readonly)
     */

  }, {
    key: "getOptionGroupId",
    value: function getOptionGroupId() {
      return this.optionGroupId.getValue();
    }

    /**
     * Get Tree Id
     */

  }, {
    key: "getTreeSchema",
    value: function getTreeSchema() {
      return {
        id: this.getOptionGroupId(),
        name: this.getName(),
        is_private: true
      };
    }

    /**
     * Get all Files
     * @return array
     */

  }, {
    key: "getFiles",
    value: function getFiles() {
      var files = {};

      for (var key in this.fields) {
        var fld = this.fields[key];
        if (fld.getFile()) {
          files[fld.getName()] = fld.getFile();
        }
      }

      return files;
    }

    /**
     * @return form state as a db row
     */

  }, {
    key: "getAsDbRow",
    value: function getAsDbRow() {
      return this.getValues();
      /*
      return Object.assign(this.getValues(),{
        display_fields : this.getDisplayFields()
      });
      */
    }

    /**
     * Get all fields manager mapped by name
     * ignore fields.attributes
     * @return object
     */

  }, {
    key: "getValuesMgr",
    value: function getValuesMgr() {
      var valuesMgr = {};
      for (var key in this.fields) {
        if (key !== ATTRIBUTES) {
          var fld = this.fields[key];
          valuesMgr[fld.getName()] = fld.getValueMgr();
        }
      }
      return valuesMgr;
    }

    /**
     * Create or update form field
     * config should contains a valid name, label, type and
     * len when creating new field
     * @param config the field schema
     * @return the created/updated field or null
     */

  }, {
    key: "createOrUpdateField",
    value: function createOrUpdateField(config) {
      var _config$name2 = config.name,
          name = _config$name2 === undefined ? "" : _config$name2,
          _config$label = config.label,
          label = _config$label === undefined ? "" : _config$label,
          _config$type2 = config.type,
          type = _config$type2 === undefined ? _WFDataTypes.WF_TYPE_STRING : _config$type2,
          _config$len = config.len,
          len = _config$len === undefined ? 64 : _config$len;

      var fld = null;
      if (name && typeof name === 'string') {
        fld = this.getField(name);
        if (!fld) {
          // field not exists
          if (typeof label === 'string' && type && typeof type === 'string') {
            fld = new _WFormField2.default(config);
            fld.setFormConfigId(this.getEntryId());
            this.fields[name] = fld;
          }
        } else {
          fld.setSchema(config);
          fld.setFormConfigId(this.getEntryId());
        }
      }
      return fld;
    }

    /**
     * Add fields
     * @param fields the array of fields to add
     * ex 
     * fields = [{
     * "name": "subject",
     * "type": "string",
     * "input_type": "",
     * "len": 32,
     * "label": "Name",
     * "required": true,
     * "searchable": true,
     * "create_column": true
     * },{
     *  "name": "message",
     *  "type": "text",
     *  "input_type": "",
     *  "len": 65555,
     *  "label": "Attributes",
     *  "required": false,
     *  "searchable": false,
     *  "create_column": true
     * }]
     * 
     */

  }, {
    key: "addFields",
    value: function addFields(fields) {
      if ((0, _Lodash.isArray)(fields)) {
        var l = fields.length;
        for (var i = 0; i < l; i++) {
          this.createOrUpdateField(fields[i]);
        }
      }
    }

    /**
     * Delete field
     * @param name the field name
     */

  }, {
    key: "deleteField",
    value: function deleteField(name) {
      var callBack = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var fld = this.getField(name);
      if (fld) {
        var fldName = fld.getName();
        delete this.fields[name];
        if ((0, _Lodash.isFunction)(callBack)) {
          callBack(fldName);
        }
      }
    }

    /**
     * Set field value by name
     * @param name the field name
     * @param val the value to set
     */

  }, {
    key: "setFieldValue",
    value: function setFieldValue(name, val) {
      var fld = this.getField(name);
      if (fld) {
        fld.setValue(val);
      }
    }

    /**
     * Get field by name
     * @param name the field name
     * @return WFormField if found else return null
     */

  }, {
    key: "getField",
    value: function getField(name) {
      var fld = null;

      if (this.fields.hasOwnProperty(name)) {
        fld = this.fields[name];
      }
      return fld;
    }

    /**
     * Get field 's value
     * @param name the field name
     * @return the field value found or defaultValue
     */

  }, {
    key: "getFieldValue",
    value: function getFieldValue(name) {
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var fld = this.getField(name);
      if (fld) {
        return fld.getValue();
      } else {
        return defaultValue;
      }
    }

    /**
     * Create a new form state for field config edition
     * @param name the field name
     * @return WFormState if field found else null
     */

  }, {
    key: "createFieldState",
    value: function createFieldState(name) {
      var formState = null;
      var fld = this.getField(name);

      if (fld) {
        formState = _WFieldConfigFactory2.default.create();
        formState.setValues(fld.getSchema());
      }

      return formState;
    }

    /**
     * Save or Update the form state in db
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "save",
    value: function save(urlArgs) {
      urlArgs['formName'] = this.getName();
      urlArgs['formType'] = this.getType();

      return _WFClient2.default.save(urlArgs, [this.getAsDbRow()], this.getFiles());
    }

    /**
     * Delete the form state from db
     * @param urlArgs object containing elements to build the request url
     */

  }, {
    key: "del",
    value: function del(urlArgs) {
      urlArgs['formName'] = this.getName();
      urlArgs['formType'] = this.getType();

      return _WFClient2.default.del(urlArgs, this.getEntryId());
    }

    /**
     * Get all searchable fields
     * @return collection 
     */

  }, {
    key: "getAllFieldSearchable",
    value: function getAllFieldSearchable() {
      var fields = [];
      for (var key in this.fields) {
        var fld = this.fields[key];
        if (fld.getSearchable()) {
          fields.push(fld.getSchema());
        }
      }
      return fields;
    }

    /**
     * Get all select fields
     * @return collection 
     */

  }, {
    key: "getAllFieldSelect",
    value: function getAllFieldSelect() {
      var fields = [];
      for (var key in this.fields) {
        var fld = this.fields[key];
        if (_WFormField2.default.isSelectField(fld)) {
          fields.push(fld.getSchema());
        }
      }
      return fields;
    }

    /**
     * Check this form has entry_id
     * @param return boolean
     */

  }, {
    key: "hasEntryId",
    value: function hasEntryId() {
      return this.getEntryId() !== "";
    }

    /**
     * Get attributes object value
     * @return object
     */

  }, {
    key: "getAttributes",
    value: function getAttributes() {
      var values = this.getValues();
      if (values.hasOwnProperty(ATTRIBUTES) && values[ATTRIBUTES]) {
        return (0, _JSON.parse)(values[ATTRIBUTES]);
      } else {
        return {};
      }
    }

    /**
     * Get all fields values without {_id, entry_id, form_name}
     * @return object values
     */

  }, {
    key: "getCleanValues",
    value: function getCleanValues() {
      var values = this.getValues();
      delete values._id;
      delete values.entry_id;
      delete values.form_name;
      delete values.form_id;
      return values;
    }

    /**
     * Caching license status in priv store
     * @param formState
     */

  }], [{
    key: "setLicenseStatus",
    value: function setLicenseStatus(formState) {
      var _formState$getSetting = formState.getSettings(),
          _formState$getSetting2 = _formState$getSetting.canCreateEntry,
          canCreateEntry = _formState$getSetting2 === undefined ? false : _formState$getSetting2;

      var id = formState.getFormId();
      if (id) {
        licenseStatus[id] = canCreateEntry;
      }
    }

    /**
     * Check license status
     * @param formState
     * @return boolean
     */

  }, {
    key: "hasLicense",
    value: function hasLicense(formState) {
      var id = formState.getFormId();
      if (id && licenseStatus.hasOwnProperty(id)) {
        return licenseStatus[id];
      } else {
        return false;
      }
    }
  }]);
  return WFormState;
}();

;

exports.default = WFormState;

/***/ }),
/* 45 */,
/* 46 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var WFTitle = function (_Component) {
    (0, _inherits3.default)(WFTitle, _Component);

    function WFTitle() {
        (0, _classCallCheck3.default)(this, WFTitle);
        return (0, _possibleConstructorReturn3.default)(this, (WFTitle.__proto__ || (0, _getPrototypeOf2.default)(WFTitle)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFTitle, [{
        key: 'render',
        value: function render() {
            return _react2.default.createElement(
                'wf-title',
                { style: this.getStyle()
                },
                this.props.children
            );
        }

        // ------------------- //

    }, {
        key: 'getStyle',
        value: function getStyle() {
            var _props = this.props,
                _props$top = _props.top,
                top = _props$top === undefined ? 0 : _props$top,
                _props$bottom = _props.bottom,
                bottom = _props$bottom === undefined ? 0 : _props$bottom;

            var style = {};
            if (top > 0) {
                style['marginTop'] = top;
            }
            if (bottom > 0) {
                style['marginBottom'] = bottom;
            }
            return style;
        }
    }]);
    return WFTitle;
}(_react.Component);

// ------------------- //

exports.default = WFTitle;

// ------------------- //

/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFDataTypes = __webpack_require__(74);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFNumber = __webpack_require__(103);

var _WFNumber2 = _interopRequireDefault(_WFNumber);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFSelect = __webpack_require__(259);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFBoolean = __webpack_require__(167);

var _WFBoolean2 = _interopRequireDefault(_WFBoolean);

var _WFDate = __webpack_require__(444);

var _WFDate2 = _interopRequireDefault(_WFDate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Describes a wonder form property
 */
var WFormProp = function () {
  /**
   * Constructor
   * Create a new prop
   * @param name the prop name
   * @param type the prop type
   * @param value the prop initial value
   */
  function WFormProp(name, type) {
    var initialValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    (0, _classCallCheck3.default)(this, WFormProp);

    this.name = new _WFString2.default({ value: name });
    this.type = new _WFString2.default({ value: type });

    var config = {};
    if (initialValue) {
      config['value'] = initialValue;
    }

    switch (type) {
      case _WFDataTypes.WF_TYPE_NUMBER:
        this.value = new _WFNumber2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_INTEGER:
        config['isFloat'] = false;
        this.value = new _WFNumber2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_FLOAT:
        config['isFloat'] = true;
        this.value = new _WFNumber2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_BOOLEAN:
        this.value = new _WFBoolean2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_SELECT:
      case _WFDataTypes.WF_TYPE_SELECT_SINGLE:
      case _WFDataTypes.WF_TYPE_SELECT_MULTIPLE:
        this.value = new _WFSelect2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_ARRAY:
        this.value = new _WFArray2.default(config);
        break;

      case _WFDataTypes.WF_TYPE_OBJECT:
        this.value = new _WFObject2.default(config);
        if ((0, _Lodash.isString)(initialValue)) {
          this.value.fromJSON(initialValue);
        }
        break;
      /*
      case WF_TYPE_DATE:
        this.value          = new WFDate(config);
        break;
      */
      default:
        this.value = new _WFString2.default(config);
        break;
    }
  }

  /**
   * Get the object manager of the prop value
   */


  (0, _createClass3.default)(WFormProp, [{
    key: 'getValueMgr',
    value: function getValueMgr() {
      return this.value;
    }

    /**
     * Get prop name
     */

  }, {
    key: 'getName',
    value: function getName() {
      return this.name.get();
    }

    /**
     * Get prop type
     */

  }, {
    key: 'getType',
    value: function getType() {
      return this.type.get();
    }

    /**
     * Set prop value
     * @param val the new value to set
     */

  }, {
    key: 'setValue',
    value: function setValue(val) {
      var type = this.getType();
      switch (type) {

        case _WFDataTypes.WF_TYPE_SELECT:
        case _WFDataTypes.WF_TYPE_SELECT_SINGLE:
        case _WFDataTypes.WF_TYPE_SELECT_MULTIPLE:
          this.value.setValues(val);
          break;

        case _WFDataTypes.WF_TYPE_OBJECT:
          if ((0, _Lodash.isString)(val)) {
            this.value.fromJSON(val);
          } else {
            this.value.setValue(val);
          }
          break;

        case _WFDataTypes.WF_TYPE_HTML:
          this.value.fromHtml(val);
          break;

        default:
          this.value.set(val);
      }
    }

    /**
     * Get the value of the prop value
     */

  }, {
    key: 'getValue',
    value: function getValue() {
      var type = this.getType();
      switch (type) {

        case _WFDataTypes.WF_TYPE_SELECT:
        case _WFDataTypes.WF_TYPE_SELECT_SINGLE:
        case _WFDataTypes.WF_TYPE_SELECT_MULTIPLE:
          return this.value.getObjectValue(true);

        case _WFDataTypes.WF_TYPE_OBJECT:
          return this.value.getValue();

        case _WFDataTypes.WF_TYPE_HTML:
          return this.value.toHtml();

        default:
          return this.value.get();
      }
    }

    /**
     * Clear value
     */

  }, {
    key: 'clearValue',
    value: function clearValue() {
      this.value.clear();
    }

    /**
     * Forward call
     * @param evenType string 
     * @param args object params
     */

  }, {
    key: 'on',
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      this.value.on(evenType, eventArgs, ctx);
    }
  }]);
  return WFormProp;
}();

exports.default = WFormProp;

/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
//import moment from "moment";

if (moment.locales().length > 1 && __WF__.hasOwnProperty('MOMENT_LOCAL') && __WF__['MOMENT_LOCAL']) {
  moment.locale(__WF__['MOMENT_LOCAL']);
}

exports.default = moment;

/*
 * Get ISO weeks
 * @param year
 * @return iSOWeeks is integer
 */

var getISOWeeks = exports.getISOWeeks = function getISOWeeks(year) {
  var date = void 0,
      isLeap = void 0,
      iSOWeeks = void 0;
  date = new Date(year, 0, 1);
  isLeap = new Date(year, 1, 29).getMonth() === 1;
  if (date.getDay() === 4 || isLeap && date.getDay() === 3) {
    iSOWeeks = 53;
  } else {
    iSOWeeks = 52;
  }
  return iSOWeeks;
};

/*
 * Get ISO weeks rows
 * @param year
 * @return weeks is array
 */
var getISOWeekRows = exports.getISOWeekRows = function getISOWeekRows(year) {
  var weeks = [];
  var ISOWeeks = getISOWeeks(year);
  for (var i = 1; i <= ISOWeeks; i++) {
    weeks.push(i);
  }
  return weeks;
};

/*
 * Count how many week in month
 * @param momentObj
 * @return integer {4/5}
 */
var countWeeksInMonth = exports.countWeeksInMonth = function countWeeksInMonth(momentObj) {
  return moment.duration(moment(momentObj).endOf('month') - moment(momentObj).startOf('month')).weeks() + 1;
};

/*
 * Get weeks in month
 * @param month
 * @return weeks is array
 */
var getWeeksInMonth = exports.getWeeksInMonth = function getWeeksInMonth(month, year) {
  var m = moment(month + '/' + year, "M/YYYY");
  var c = countWeeksInMonth(m);
  var weeks = [];
  for (var i = 1; i <= c; i++) {
    weeks.push(i);
  }
  return weeks;
};

/***/ }),
/* 49 */,
/* 50 */,
/* 51 */
/***/ (function(module, exports) {

module.exports = ReactDOM;

/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF IMG ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-img",
	responsive: "img-responsive"
};

// ------------------- //

var Group = {};

var WFImg = function (_Component) {
	(0, _inherits3.default)(WFImg, _Component);

	function WFImg(props) {
		(0, _classCallCheck3.default)(this, WFImg);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFImg.__proto__ || (0, _getPrototypeOf2.default)(WFImg)).call(this, props));

		_this.id = (0, _Lodash.uniqueId)();
		_this.state = {
			ready: false
		};
		return _this;
	}

	(0, _createClass3.default)(WFImg, [{
		key: "render",
		value: function render() {
			var _props = this.props,
			    _props$src = _props.src,
			    src = _props$src === undefined ? "" : _props$src,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$height = _props.height,
			    height = _props$height === undefined ? "" : _props$height,
			    _props$style = _props.style,
			    style = _props$style === undefined ? {} : _props$style;
			var ready = this.state.ready;

			if (!src) {
				return false;
			} else {
				var h = height;
				if (style.hasOwnProperty('maxHeight')) {
					h = style.maxHeight;
				}
				return _react2.default.createElement("img", {
					src: src,
					style: style,
					onLoad: this.handleImageLoaded.bind(this)
					//onError={this.handleImageErrored.bind(this)}
					, className: classes.wrapper + " " + classes.responsive + " " + className + " fade " + (ready ? "in" : ""),
					height: ready ? h : 100
				});
			}
		}
	}, {
		key: "handleImageLoaded",
		value: function handleImageLoaded() {
			var _props2 = this.props,
			    _props2$groupId = _props2.groupId,
			    groupId = _props2$groupId === undefined ? null : _props2$groupId,
			    _props2$onReady = _props2.onReady,
			    onReady = _props2$onReady === undefined ? null : _props2$onReady;

			this.setState({
				ready: true
			});
			if (groupId) {
				delete Group[groupId][this.id];
				if ((0, _keys2.default)(Group[groupId]).length === 0) {
					if ((0, _Lodash.isFunction)(onReady)) {
						setTimeout(function () {
							return onReady();
						}, 200);
					}
				}
			}
		}

		// COMPONENT LIFECYCLE ------------------- //

	}, {
		key: "componentWillMount",
		value: function componentWillMount() {
			var _props$groupId = this.props.groupId,
			    groupId = _props$groupId === undefined ? null : _props$groupId;

			if (groupId) {
				if (!Group.hasOwnProperty(groupId)) {
					Group[groupId] = {};
				}
				Group[groupId][this.id] = "loading";
			}
		}
	}]);
	return WFImg;
}(_react.Component);

// ------------------- //

exports.default = WFImg;

// ------------------- //


// <WFImg src={logo} className={classe} />

/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFConfigMgr = __webpack_require__(411);

var _WFConfigMgr2 = _interopRequireDefault(_WFConfigMgr);

var _WFConfigViewMgr = __webpack_require__(234);

var _WFConfigViewMgr2 = _interopRequireDefault(_WFConfigViewMgr);

var _WFConfigClientMgr = __webpack_require__(229);

var _WFConfigClientMgr2 = _interopRequireDefault(_WFConfigClientMgr);

var _WFConfigQueryMgr = __webpack_require__(155);

var _WFConfigQueryMgr2 = _interopRequireDefault(_WFConfigQueryMgr);

var _WFConfigSelectMgr = __webpack_require__(232);

var _WFConfigSelectMgr2 = _interopRequireDefault(_WFConfigSelectMgr);

var _WFConfigFormStateMgr = __webpack_require__(231);

var _WFConfigFormStateMgr2 = _interopRequireDefault(_WFConfigFormStateMgr);

var _WFConfigCollectionMgr = __webpack_require__(154);

var _WFConfigCollectionMgr2 = _interopRequireDefault(_WFConfigCollectionMgr);

var _WFConfigResources = __webpack_require__(413);

var _WFConfigResources2 = _interopRequireDefault(_WFConfigResources);

var _WFConfigProducts = __webpack_require__(412);

var _WFConfigProducts2 = _interopRequireDefault(_WFConfigProducts);

var _WFConfigThemes = __webpack_require__(233);

var _WFConfigThemes2 = _interopRequireDefault(_WFConfigThemes);

var _WFConfigBaobabMgr = __webpack_require__(228);

var _WFConfigBaobabMgr2 = _interopRequireDefault(_WFConfigBaobabMgr);

var _WFConfigEditorMgr = __webpack_require__(410);

var _WFConfigEditorMgr2 = _interopRequireDefault(_WFConfigEditorMgr);

var _WFConfigEditorViewMgr = __webpack_require__(230);

var _WFConfigEditorViewMgr2 = _interopRequireDefault(_WFConfigEditorViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFConfig = {
  key: "WFConfig",
  mgr: _WFConfigMgr2.default,
  viewMgr: _WFConfigViewMgr2.default,
  clientMgr: _WFConfigClientMgr2.default,
  queryMrg: _WFConfigQueryMgr2.default,
  selectMgr: _WFConfigSelectMgr2.default,
  formStateMgr: _WFConfigFormStateMgr2.default,
  collectionMgr: _WFConfigCollectionMgr2.default,
  resources: _WFConfigResources2.default,
  products: _WFConfigProducts2.default,
  themes: _WFConfigThemes2.default,
  baobabMgr: _WFConfigBaobabMgr2.default,
  editor: {
    mgr: _WFConfigEditorMgr2.default,
    viewMgr: _WFConfigEditorViewMgr2.default
  }
};
// ------------------- //
exports.default = WFConfig;
// ------------------- //

window.WFConfig = WFConfig;

/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var VALUE_KEY = "valueKey";
var ATTRIBUTES = "attributes";

var WFValue = function () {
  function WFValue() {
    (0, _classCallCheck3.default)(this, WFValue);
  }

  (0, _createClass3.default)(WFValue, null, [{
    key: "toBoolean",

    /*
     * Format extern boolean to js boolean
     * @param val 
     * @return boolean
     */
    value: function toBoolean(val) {
      if (!val || val == '0' || val == 'false' || val == false || val == 0) {
        return false;
      } else {
        return true;
      }
    }

    /*
     * Find attributes and extract clean values
     * @param values is object contains json attributes 
     * @return object attributes 
     */

  }, {
    key: "getValues",
    value: function getValues(values) {
      var attributes = WFValue.getAttributesValues(values);
      return (0, _assign2.default)(values, attributes);
    }

    /*
     * Get value in object values 
     * @param value 
     * @return value[key] if key exist
     */

  }, {
    key: "get",
    value: function get(value) {
      if ((0, _Lodash.isObject)(value) && value.hasOwnProperty(VALUE_KEY)) {
        var key = value[VALUE_KEY];
        return value[key];
      } else {
        return value;
      }
    }

    /*
     * Find in values object the data attributes
     * @param values is object contains json attributes 
     * @return object attributes 
     */

  }, {
    key: "getAttributes",
    value: function getAttributes(values) {
      if ((0, _Lodash.isObject)(values) && values.hasOwnProperty(ATTRIBUTES)) {
        var attributes = values[ATTRIBUTES];
        return (0, _JSON.parse)(attributes, {});
      } else {
        return {};
      }
    }

    /*
     * Find attributes and extract clean values
     * @param values is object contains json attributes 
     * @return object attributes 
     */

  }, {
    key: "getAttributesValues",
    value: function getAttributesValues(values) {
      var attributes = {};
      var attrs = WFValue.getAttributes(values);
      for (var key in attrs) {
        attributes[key] = WFValue.get(attrs[key]);
      }
      return attributes;
    }
  }]);
  return WFValue;
}();

exports.default = WFValue;

/***/ }),
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

// WF SETTING                                   // -------------------- //

var HEIGHT = exports.HEIGHT = "height";
var WIDTH = exports.WIDTH = "width";

// WF STATUS                                    // -------------------- //

var WF_STATUS = exports.WF_STATUS = "wf_status";
var WF_RESULTS = exports.WF_RESULTS = "wf_results";
var WF_CUSTOM_RESULTS = exports.WF_CUSTOM_RESULTS = "wf_custom_results";
var WF_STATUS_ERROR = exports.WF_STATUS_ERROR = 10;
var WF_STATUS_LOADING = exports.WF_STATUS_LOADING = 20;
var WF_STATUS_EDITING = exports.WF_STATUS_EDITING = 30;
var WF_STATUS_SUCCESS = exports.WF_STATUS_SUCCESS = 40;
var WF_STATUS_CUSTOM = exports.WF_STATUS_CUSTOM = 50;

// WF FIELD                                     // -------------------- //

var WF_FIELDS = exports.WF_FIELDS = "fields";
var WF_DISPLAY_FIELDS = exports.WF_DISPLAY_FIELDS = "display_fields";

// WF VALUES                                    // -------------------- //    

var WF_VALUES_CHANGE = exports.WF_VALUES_CHANGE = "wf_values_change";
var WF_FIELD_CONDITION = exports.WF_FIELD_CONDITION = "wf_field_condition";
var WF_FIELD_WILLREFRESH = exports.WF_FIELD_WILLREFRESH = "wf_field_willrefresh";

/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFViewMgr = function () {
  function WFViewMgr() {
    var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFViewMgr);

    // todo remove 
    //this.isInit = false;
    this.components = {};
    this.observer = null;
    this.initialState = initialState;
    this.state = new _WFObject2.default();
    this.setState(initialState);
  }

  // STATE ------------ //

  /**
   * Check key in state
   */


  (0, _createClass3.default)(WFViewMgr, [{
    key: "has",
    value: function has(key) {
      return this.state.has(key);
    }

    /**
     * Get state
     */

  }, {
    key: "getState",
    value: function getState() {
      return this.state.getValue();
    }

    /**
     * Set state
     * set global state
     * update all components'state
     */

  }, {
    key: "setState",
    value: function setState(obj) {
      if ((0, _Lodash.isObject)(obj)) {
        this.state.set(obj);
        for (var x in this.components) {
          this.components[x].setState(obj);
        }
      }
    }

    /**
     * Restore initial state
     */

  }, {
    key: "resetState",
    value: function resetState() {
      var prevState = this.getState();
      for (var x in prevState) {
        if (this.initialState.hasOwnProperty(x)) {
          prevState[x] = this.initialState[x];
        } else {
          delete prevState[x];
        }
      }
      this.setState(prevState);
    }

    // OBSERVER ------------ //

    /**
     * Notify when state change
     */

  }, {
    key: "init",
    value: function init() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.call("init", args);
    }

    /**
     * Notify when state change
     */

  }, {
    key: "change",
    value: function change() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.call("change", args);
    }

    /**
     * Notify when state is ready
     */

  }, {
    key: "ready",
    value: function ready() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.call("ready", args);
    }

    /**
     * Set callback {change, ready}
     */

  }, {
    key: "setObserver",
    value: function setObserver(callbacks) {
      this.observer = callbacks;
    }

    /**
     * Do callback by name
     */

  }, {
    key: "call",
    value: function call(action) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (this.observer && this.observer.hasOwnProperty(action) && (0, _Lodash.isFunction)(this.observer[action])) {
        var call = this.observer[action];
        call(args);
      }
    }

    // LIFE CYCLE ------------ //

    /**
     * When the component mount set
     * set global state in component state
     */

  }, {
    key: "willMount",
    value: function willMount(c) {
      var id = c.displayName;
      if (!this.components.hasOwnProperty(id)) {
        c.setState(this.getState());
        this.components[id] = c;
      }
    }
    /**
     * When the component unmount unset
     */

  }, {
    key: "willUnMount",
    value: function willUnMount(c) {
      var id = c.displayName;
      if (this.components.hasOwnProperty(id)) {
        delete this.components[id];
      }
    }
    // ...

  }, {
    key: "didMount",
    value: function didMount() {}
  }]);
  return WFViewMgr;
}();

exports.default = WFViewMgr;

/***/ }),
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFRequestParams = __webpack_require__(153);

var _WFParam = __webpack_require__(227);

var _WFParam2 = _interopRequireDefault(_WFParam);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFNumber = __webpack_require__(103);

var _WFNumber2 = _interopRequireDefault(_WFNumber);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS WF QUERY PARAMS ------------------- //

// ------------------- // 

var initial = {
  page: 1,
  start: 0,
  limit: 15,
  filters: [],
  orderby: null,
  orderbyDirection: null
};

var WFQueryParams = function () {
  /**
   * Constructor
   */
  function WFQueryParams() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFQueryParams);
    var _config$page = config.page,
        page = _config$page === undefined ? initial.page : _config$page,
        _config$limit = config.limit,
        limit = _config$limit === undefined ? initial.limit : _config$limit,
        _config$filters = config.filters,
        filters = _config$filters === undefined ? initial.filters : _config$filters,
        _config$orderby = config.orderby,
        orderby = _config$orderby === undefined ? initial.orderby : _config$orderby,
        _config$orderbyDirect = config.orderbyDirection,
        orderbyDirection = _config$orderbyDirect === undefined ? initial.orderbyDirection : _config$orderbyDirect;


    this.page = new _WFNumber2.default({ value: page });
    this.start = new _WFParam2.default(_WFRequestParams.QUERY_PARAM_START, initial.start);
    this.limit = new _WFParam2.default(_WFRequestParams.QUERY_PARAM_LIMIT, limit);
    this.orderby = new _WFParam2.default(_WFRequestParams.QUERY_PARAM_ORDER_BY, orderby);
    this.orderbyDirection = new _WFParam2.default(_WFRequestParams.QUERY_PARAM_ORDER_BY_DIRECTION, orderbyDirection);
    this.filters = new _WFArray2.default({ value: filters, isCollection: true, findBy: "k" });
    this.reqFilters = [];
    this.pagerState = {};
    this.pagination = {};

    this.refresh();
  }

  /**
   * Get query string params
   * return string
   */


  (0, _createClass3.default)(WFQueryParams, [{
    key: "get",
    value: function get() {
      this.compute();
      this.setReqFilters();

      var query = "";
      var limit = this.limit.get();
      var start = this.start.get();
      var orderby = this.orderby.get();
      var orderbyDirection = this.orderbyDirection.get();
      var filters = this.getFilters();

      query += _WFRequestParams.QUERY_SEARCH;
      query += limit ? limit : "";
      query += start ? "&" + start : "";
      query += orderby ? "&" + orderby : "";
      query += orderbyDirection ? "&" + orderbyDirection : "";
      query += filters ? "&" + filters : "";

      return query;
    }

    /**
     * Reset Query
     */

  }, {
    key: "reset",
    value: function reset() {
      this.setPage(initial.page);
      this.start.setValue(initial.start);
      this.limit.setValue(initial.limit);
      this.clearFilters();
      this.clearOrderbyDirection();
      this.clearOrderBy();
      this.refresh();
    }

    /**
     * Set current page
     */

  }, {
    key: "setPage",
    value: function setPage() {
      var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;

      this.page.set(page);
    }

    /**
     * Calculate this start and set it
     */

  }, {
    key: "compute",
    value: function compute() {
      var page = this.page.get();
      var limit = this.limit.getValue();
      var index = parseInt(limit) * parseInt(page);
      var start = page == 0 || page == 1 ? 0 : Math.round(index - parseInt(limit));
      start = (0, _Lodash.isNaN)(start) ? 0 : start;
      this.start.setValue(start);
    }

    /**
     * Refresh this pager and this pagination
     */

  }, {
    key: "refresh",
    value: function refresh() {
      var countElems = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var totalElems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      var current = this.page.get();
      var counter = parseInt(countElems);
      var total = parseInt(totalElems);
      var pages = Math.ceil(total / this.limit.getValue());
      var next = current - 1 < 1 ? pages : current - 1;
      var prev = current + 1 > pages ? 1 : current + 1;
      this.setPagination(current, pages, counter, total);
      // caching result
      this.pagerState = {
        counter: counter,
        total: total,
        pages: pages,
        next: next,
        prev: prev
      };
    }

    // FILTERS ------------------- //

    /**
     * Has filters
     */

  }, {
    key: "hasFilters",
    value: function hasFilters() {
      return this.filters.getCounter() > 0;
    }

    /**
     * Clear filters
     */

  }, {
    key: "clearFilters",
    value: function clearFilters() {
      this.filters.clear();
    }

    /**
     * Get filters params
     * return string
     */

  }, {
    key: "getFilters",
    value: function getFilters() {
      if (this.hasFilters()) {
        return this.filters.map(function (f) {
          return f.v;
        }).join('&');
      } else {
        return null;
      }
    }

    /**
     * Set new filter 
     * @param key is a string
     * @param value string || number
     * @param isReqFilter is a boolean is true the filter is not removable
     */

  }, {
    key: "setFilter",
    value: function setFilter(key, value) {
      var isReqFilter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

      if ((0, _Lodash.isString)(key) && !(0, _Lodash.isNull)(value) || value !== "") {
        if (isReqFilter) {
          this.reqFilters.push((0, _defineProperty3.default)({}, key, value));
        } else {
          this.filters.insert({
            k: key,
            v: _WFParam2.default.format(key, value)
          });
        }
      }
    }

    /**
     * Delete filter by key
     * @param key is a string
     */

  }, {
    key: "unsetFilter",
    value: function unsetFilter(key) {
      if ((0, _Lodash.isString)(key)) {
        this.filters.delete(key);
      }
    }

    /**
     * Check and Set if reqFilters
     * @param key is a string
     */

  }, {
    key: "setReqFilters",
    value: function setReqFilters() {
      var _this = this;

      var filters = this.reqFilters;
      if (filters.length > 0) {
        filters.forEach(function (filter) {
          var key = (0, _keys2.default)(filter)[0];
          if (!_this.filters.has(key)) {
            _this.setFilter(key, filter[key]);
          }
        });
      }
    }

    /**
     * Clear reqFilters
     */

  }, {
    key: "clearReqFilters",
    value: function clearReqFilters() {
      this.reqFilters = [];
    }

    // PAGINATION ------------------- //

    /**
     * Get pagination for view
     */

  }, {
    key: "getPagination",
    value: function getPagination() {
      return this.pagination;
    }

    /**
     * Set pagination for view
     */

  }, {
    key: "setPagination",
    value: function setPagination(page, pages, c, t) {
      var current = page - 1;
      var total = pages;
      var countRow = c;
      var totalRow = t;
      var countCursor = c;
      if (current < 0) {
        current = 0;
      }
      if (current > 0) {
        countCursor = current * this.limit.getValue() + c;
      }
      this.pagination = {
        current: current,
        total: total,
        countRow: countRow,
        totalRow: totalRow,
        countCursor: countCursor
      };
    }

    // PAGER ------------------- //

    /**
     * Get pager
     */

  }, {
    key: "getPager",
    value: function getPager() {
      return (0, _assign2.default)({
        page: this.page.get(),
        limit: this.limit.getValue()
      }, this.pagerState);
    }

    /**
     * Set pager
     */

  }, {
    key: "setPager",
    value: function setPager() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _args$page = args.page,
          page = _args$page === undefined ? null : _args$page,
          _args$limit = args.limit,
          limit = _args$limit === undefined ? null : _args$limit;


      if (page) {
        this.setPage(page);
      }
      if ((0, _Lodash.isNumber)(limit)) {
        this.limit.setValue(limit);
      }
    }

    // ORDER ------------------- //

    /**
     * Set orderbyDirection to ASC
     */

  }, {
    key: "toAsc",
    value: function toAsc() {
      this.setOrderByDirection(_WFRequestParams.QUERY_ORDER_ASC);
    }

    /**
     * Set orderbyDirection to DESC
     */

  }, {
    key: "toDesc",
    value: function toDesc() {
      this.setOrderByDirection(_WFRequestParams.QUERY_ORDER_DESC);
    }

    /**
     * Clear orderbyDirection
     */

  }, {
    key: "clearOrderbyDirection",
    value: function clearOrderbyDirection() {
      this.setOrderByDirection(initial.orderbyDirection);
    }

    /**
     * Clear orderby
     */

  }, {
    key: "clearOrderBy",
    value: function clearOrderBy() {
      this.setOrderBy(initial.orderby);
    }

    /**
     * Set orderbyDirection
     */

  }, {
    key: "setOrderByDirection",
    value: function setOrderByDirection() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "asc";

      this.orderbyDirection.setValue(value);
    }

    /**
     * Get orderby
     */

  }, {
    key: "setOrderBy",
    value: function setOrderBy() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "name";

      this.orderby.setValue(value);
    }

    // LIMIT ------------------- //

  }, {
    key: "setLimit",
    value: function setLimit() {
      var limitElem = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 15;

      this.limit.setValue(limitElem);
    }
  }]);
  return WFQueryParams;
}();

// ------------------- // 


exports.default = WFQueryParams;
// ------------------- // 


/*

Exemple : /form?wf_start=0&wf_limit=15

  var q = new WFQueryParams();

  q.get()
  q.setPager({page:4})
  q.get()
  q.setPager({page:3})

  q.toDesc()
  q.get()

  q.toAsc()
  q.get()

  q.setOrderBy('label')
  q.get()

  q.clearOrderBy()
  q.clearOrderbyDirection()
  q.get()

  q.setFilter("country","France")
  q.setFilter("city","paris")
  q.setFilter("zipcode","75011")
  q.setFilter("lat","15486200")
  q.getFilters()
  q.get()

  q.unsetFilter("country")
  q.getFilters()
  q.get()

  q.reset()
  q.get()

*/

/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _WFEvents = __webpack_require__(263);

var _WFEvents2 = _interopRequireDefault(_WFEvents);

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

var _WFNumber = __webpack_require__(103);

var _WFNumber2 = _interopRequireDefault(_WFNumber);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormViewClient = __webpack_require__(435);

var _WFormViewClient2 = _interopRequireDefault(_WFormViewClient);

var _WFormViewAction = __webpack_require__(434);

var _WFormViewAction2 = _interopRequireDefault(_WFormViewAction);

var _WFormViewHelpers = __webpack_require__(164);

var _WFormViewHelpers2 = _interopRequireDefault(_WFormViewHelpers);

var _Lodash = __webpack_require__(6);

var _WFInitialState = __webpack_require__(428);

var _WFInitialState2 = _interopRequireDefault(_WFInitialState);

var _WFEventTypes = __webpack_require__(16);

var _WFConstants = __webpack_require__(58);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var isDemo = false;
if (__WF__.hasOwnProperty("DEMO")) {
  isDemo = __WF__.DEMO;
}

/**
 * Holds form view 
 */

var WFormView = function () {
  /**
   * Constructor
   * this.formState instance of WFormState
   * this.events is the mediator events
   * this.viewMgr manage state and components
   * this.currentFields contain all display field state
   * this.defaultConfig contains {settingConfig, stepConfig, contentConfig}
   * this.isValid check if values is valid
   * this.isInit when this instance is init is true
   * this.isAdmin if env is wfadmin
   * this.isDemo if env is demo
   */
  function WFormView(formState) {
    var _context;

    var isAdmin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    var defaultConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    (0, _classCallCheck3.default)(this, WFormView);

    this.name = formState.getName();
    this.formState = formState;
    this.events = new _WFEvents2.default('formView');
    this.viewMrg = new _WFViewMgr2.default(_WFInitialState2.default);
    this.defaultConfig = defaultConfig;
    // CONDITION
    this.isValid = true;
    this.isInit = false;
    this.isAdmin = isAdmin;
    this.isDemo = isDemo;
    this.ignoreValidator = false;
    // Fields
    this.currentFields = new _WFObject2.default();
    this.fieldsHidden = new _WFArray2.default();
    this.fieldsDisable = new _WFArray2.default();
    this.fieldsValid = new _WFObject2.default();
    this.fieldsCondition = {};
    this.fieldsMonkey = {};
    // Status
    this.status = new _WFNumber2.default({
      value: _WFConstants.WF_STATUS_LOADING
    });
    // Actions
    this.actions = new _WFormViewAction2.default(formState.getActions());
    // Settings Managers
    this.settings = null;
    this.steps = null;
    this.contents = null;
    this.analytics = null;
    /**
     * Subscribe to an evenType (Listner)
     * Set callback in evenType's queue
     * exemple : this.sub("say_msg",(msg) => alert(msg)) 
     * @param evenType string 
     * @param fn callback
     */
    this.sub = (_context = this.events).sub.bind(_context);
    /**
     * Publish an evenType (Emiter)
     * exemple : this.pub("say_msg","Hello world...") 
     * @param evenType string 
     */
    this.pub = (_context = this.events).pub.bind(_context);
    // Use by editor
    this.editorObserver = null;
    // Init formView
    _WFormViewHelpers2.default.init(this);
  }

  // ACTION ------------- //

  /**
   * Change status to loading
   */


  (0, _createClass3.default)(WFormView, [{
    key: 'onLoad',
    value: function onLoad() {
      this.setStatus(_WFConstants.WF_STATUS_LOADING);
    }

    /**
     * Change status to loading then to edit
     * @param delay
     * @param step
     */

  }, {
    key: 'onReload',
    value: function onReload() {
      var _this = this;

      var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var stepIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      if (delay > 0) {
        this.onLoad();
      }
      this.fieldsValid.clear();
      this.changeResults();
      _WFormViewHelpers2.default.createFieldMonkey(this);
      setTimeout(function () {
        _this.onSelectByIndex(stepIndex);
        _this.onEdit();
      }, delay);
    }

    /**
     * Select prev step
     */

  }, {
    key: 'onPrev',
    value: function onPrev() {
      this.getStepMgr().prev();
      this.validatorClear();
      this.changeStepStatus();
    }

    /**
     * Select next step
     */

  }, {
    key: 'onNext',
    value: function onNext() {
      this.getStepMgr().next();
      this.validatorClear();
      this.changeStepStatus();
    }

    /**
     * Select step by id
     * @param id
     */

  }, {
    key: 'onSelect',
    value: function onSelect(id) {
      this.getStepMgr().select(id);
      this.validatorClear();
      this.changeStepStatus();
    }

    /**
     * Select step by index
     * @param id
     */

  }, {
    key: 'onSelectByIndex',
    value: function onSelectByIndex(index) {
      if ((0, _Lodash.isNumber)(index)) {
        this.getStepMgr().selectByIndex(index);
        this.validatorClear();
        this.changeStepStatus();
      }
    }

    /**
     * Change status to edit
     */

  }, {
    key: 'onEdit',
    value: function onEdit() {
      this.changeResults();
      this.setStatus(_WFConstants.WF_STATUS_EDITING);
      this.pub(_WFEventTypes.WF_EVENT_ONEDIT);
    }

    /**
     * Submit values
     * @param next callback {onError, onSuccess} is optional for external manager
     */

  }, {
    key: 'onSubmit',
    value: function onSubmit() {
      var _this2 = this;

      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (this.formState.getPublished()) {
        if (next) {
          _WFormViewClient2.default.save(this.formState, this.isAdmin, next);
        } else {
          if (!this.isAdmin && !_WFormState2.default.hasLicense(this.getFormState())) {
            this.onError(this.getActionMgr().getMessage("error403"));
          } else if (this.isDemo) {
            this.onLoad();
            setTimeout(function () {
              _this2.onPublish({ id: 9999 }, _this2.getValues());
            }, 1000);
          } else {
            var values = this.getValues();
            this.onLoad();
            this.pub(_WFEventTypes.WF_EVENT_ONSUBMIT, values);
            _WFormViewClient2.default.save(this.formState, this.isAdmin, {
              onError: function onError(error) {
                return _this2.onPublish(null, null, error);
              },
              onSuccess: function onSuccess(entry) {
                return _this2.onPublish(entry, values);
              }
            });
          }
        }
      } else {
        console.error("Published your form before...");
        this.onNext();
      }
    }

    /**
     * Execute actions and dispatch results 
     * @param entry
     * @param values
     */

  }, {
    key: 'onPublish',
    value: function onPublish(entry, values) {
      var _this3 = this;

      var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      this.pub(_WFEventTypes.WF_EVENT_ONPUBLISH, entry);
      this.actions.execute(this, entry, values, error, {
        onError: function onError(errorRes) {
          return _this3.onError(errorRes);
        },
        onSuccess: function onSuccess(successRes) {
          return _this3.onSuccess(successRes);
        }
      });
    }

    /**
     * Change status to error and manage error
     * @param error
     */

  }, {
    key: 'onSuccess',
    value: function onSuccess(successRes) {
      this.changeResults(successRes);
      this.setStatus(_WFConstants.WF_STATUS_SUCCESS);
      this.pub(_WFEventTypes.WF_EVENT_ONSUCCESS, successRes);
    }

    /**
     * Change status to error and manage error
     * @param errorRes 
     */

  }, {
    key: 'onError',
    value: function onError(errorRes) {
      this.changeResults(errorRes);
      this.setStatus(_WFConstants.WF_STATUS_ERROR);
      this.pub(_WFEventTypes.WF_EVENT_ONERROR, errorRes);
    }

    /**
     * Reset formState values and status
     */

  }, {
    key: 'onClear',
    value: function onClear() {
      this.formState.clearValues();
      this.formState.setEntryId(0);
      this.onReload(0);
    }

    // COMPONENTS EVENTS ------------- //


    /**
     * Called each time an event occrured in the form component
     * main entry point for components
     * @param evenType the event type
     * @param eventArgs the event args
     */

  }, {
    key: 'on',
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};


      // todo remove
      // WFConsole.valDir(`${this.name}`, `on.${evenType}`, eventArgs);

      if (evenType) {
        switch (evenType) {

          case _WFEventTypes.WF_EVENT_ONCHANGE:
            this.change(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONREADY:
            this.ready();
            break;

          case _WFEventTypes.WF_EVENT_ONLOAD:
            this.onLoad();
            break;

          case _WFEventTypes.WF_EVENT_ONWILLMOUNT:
            this.viewMrg.willMount(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONDIDMOUNT:
            this.setStatus(_WFConstants.WF_STATUS_EDITING);
            break;

          case _WFEventTypes.WF_EVENT_ONWILLUNMOUNT:
            this.viewMrg.willUnMount(eventArgs);
            break;

          default:
            this.pub(evenType, eventArgs);
        }
      }
    }

    /**
     * Called each time an event occrured in the field component
     * main entry point for field components
     * @param fieldName
     * @param evenType the event type
     * @param eventArgs the event args
     */

  }, {
    key: 'onField',
    value: function onField(fieldName, evenType, eventArgs) {
      var ctx = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};


      // todo remove
      // WFConsole.valDir(`${fieldName}`, `on.${evenType}`, eventArgs);

      var fld = this.getField(fieldName);
      if (fld) {
        fld.on(evenType, eventArgs, ctx);
      }
    }

    // MANAGER ------------- //


  }, {
    key: 'getSettingMgr',
    value: function getSettingMgr() {
      return this.settings;
    }
  }, {
    key: 'getStepMgr',
    value: function getStepMgr() {
      return this.steps;
    }
  }, {
    key: 'getContentMgr',
    value: function getContentMgr() {
      return this.contents;
    }
  }, {
    key: 'getActionMgr',
    value: function getActionMgr() {
      return this.actions;
    }

    // MANAGE STATE ------------- //


    /**
     * Call Change to set value in state
     * @param newVal object
     */

  }, {
    key: 'change',
    value: function change() {
      var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.viewMrg.change(newVal);
    }

    /**
     * Call Ready to force update state if in form editor
     */

  }, {
    key: 'ready',
    value: function ready() {
      this.viewMrg.ready();
    }

    /**
     * load/Change Setting in state
     */

  }, {
    key: 'changeSetting',
    value: function changeSetting() {
      this.change(this.getSettingMgr().get());
    }

    /**
     * load/Change current status in state
     */

  }, {
    key: 'changeStatus',
    value: function changeStatus() {
      this.change({
        status: this.getStatus()
      });
    }

    /**
     * load/Change current results in state
     */

  }, {
    key: 'changeResults',
    value: function changeResults() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.change((0, _defineProperty3.default)({}, _WFConstants.WF_RESULTS, context));
    }

    /**
     * load/Change current results in state
     */

  }, {
    key: 'changeCustomResults',
    value: function changeCustomResults() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.change((0, _defineProperty3.default)({}, _WFConstants.WF_CUSTOM_RESULTS, context));
    }

    /**
     * load/Change current validator status in state
     */

  }, {
    key: 'changeIsValid',
    value: function changeIsValid() {
      this.change({
        isValid: this.isValid
      });
      this.pub(_WFEventTypes.WF_EVENT_ONVALIDATE, this.isValid);
    }

    /**
     * Change current step in state
     */

  }, {
    key: 'changeStepStatus',
    value: function changeStepStatus() {
      this.change({
        stepOrder: this.getStepMgr().getOrder(),
        currentStep: this.getStepMgr().getCurrent(),
        currentStepValue: this.getStepMgr().get(),
        currentStepIndex: this.getStepMgr().getCurrentIndex()
      });
    }

    /**
     * Change Steps details in state
     */

  }, {
    key: 'changeSteps',
    value: function changeSteps() {
      this.change({
        steps: this.getStepMgr().getSchema()
      });
    }

    /**
     * Change Contents in state
     */

  }, {
    key: 'changeContent',
    value: function changeContent() {
      this.change({
        contents: this.getContentMgr().getValue()
      });
    }

    /**
     * Change Fields details in state
     */

  }, {
    key: 'changeFields',
    value: function changeFields() {
      this.change({
        fieldSchema: this.getFormState().getFieldSchema(),
        display_fields: this.getDisplayFields()
      });
    }

    /**
     * Change Fields status in state
     */

  }, {
    key: 'changeFieldStatus',
    value: function changeFieldStatus() {
      this.change({
        fieldsHidden: this.getFieldsHidden(),
        fieldsDisable: this.getFieldsDisable()
      });
    }

    /**
     * Set the state 
     * @param args object
     */

  }, {
    key: 'setState',
    value: function setState(args) {
      this.viewMrg.setState(args);
    }

    // MANAGE THEME ------------- //


    /**
     * Set current theme 
     */

  }, {
    key: 'setTheme',
    value: function setTheme(theme, setting) {
      this.getSettingMgr().select(theme, setting);
      this.changeSetting();
    }

    // MANAGE STATUS ------------- //


    /**
     * Set current status 
     * @param status string
     */

  }, {
    key: 'setStatus',
    value: function setStatus(status) {
      if ((0, _Lodash.isNumber)(status) && [_WFConstants.WF_STATUS_ERROR, _WFConstants.WF_STATUS_LOADING, _WFConstants.WF_STATUS_EDITING, _WFConstants.WF_STATUS_SUCCESS, _WFConstants.WF_STATUS_CUSTOM].includes(status)) {
        this.status.set(status);
        this.changeStatus();
      }
    }

    /**
     * Get current status 
     */

  }, {
    key: 'getStatus',
    value: function getStatus() {
      return this.status.get();
    }

    // MANAGE VALIDITON ------------- //


    /**
     * Get the form status (valid || not)
     * @param next callback
     * return boolean in callback(status)
     */

  }, {
    key: 'validate',
    value: function validate() {
      var _this4 = this;

      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (this.ignoreValidator) {
        this.isValid = true;
        this.changeIsValid();
      } else {
        var count = 0;
        this.fieldsValid.each(function (k, v, i, l) {
          if (v === true) {
            count++;
          }
          if (i === l) {
            _this4.isValid = count === l;
            _this4.changeIsValid();
          }
        });
      }
    }

    /**
     * Reset valid status by default
     */

  }, {
    key: 'validatorClear',
    value: function validatorClear() {
      this.isValid = true;
      this.changeIsValid();
    }

    // MANAGE FIELDS ------------- //


    /**
     * Check field is valid by name
     * @param fieldName string
     * @return boolean
     */

  }, {
    key: 'fieldIsValid',
    value: function fieldIsValid(fieldName) {
      return this.fieldsValid.get(fieldName);
    }

    /**
     * Check field is hidden by name
     * @param fieldName string
     * @return boolean
     */

  }, {
    key: 'fieldIsHidden',
    value: function fieldIsHidden(fieldName) {
      return this.fieldsHidden.has(fieldName);
    }

    /**
     * Check field is disable by name
     * @param fieldName string
     * @return boolean
     */

  }, {
    key: 'fieldIsDisable',
    value: function fieldIsDisable(fieldName) {
      return this.fieldsDisable.has(fieldName);
    }

    /**
     * Get current field by name
     * @param fieldName string
     * @return fieldInput object
     */

  }, {
    key: 'hasCurrentField',
    value: function hasCurrentField(fieldName) {
      return this.currentFields.has(fieldName);
    }

    /**
     * Get current field by name
     * @param fieldName string
     * @return fieldInput object
     */

  }, {
    key: 'getCurrentField',
    value: function getCurrentField(fieldName) {
      if (this.hasCurrentField(fieldName)) {
        return this.currentFields.get(fieldName);
      }
    }

    /**
     * Get hidden fields
     * @return object
     */

  }, {
    key: 'getCurrentFields',
    value: function getCurrentFields() {
      return this.currentFields.getValue();
    }

    /**
     * Get hidden fields
     * @return array
     */

  }, {
    key: 'getFieldsHidden',
    value: function getFieldsHidden() {
      return this.fieldsHidden.getValue();
    }

    /**
     * Get disable fields
     * @return array
     */

  }, {
    key: 'getFieldsDisable',
    value: function getFieldsDisable() {
      return this.fieldsDisable.getValue();
    }

    /**
     * Set fieldInput
     * @param fieldName string
     * @param fieldState object
     */

  }, {
    key: 'setCurrentField',
    value: function setCurrentField(fieldName, fieldInput) {
      this.currentFields.set((0, _defineProperty3.default)({}, fieldName, fieldInput));
    }

    /**
     * Unset fieldInput by fieldName
     * @param fieldName string
     */

  }, {
    key: 'unsetCurrentField',
    value: function unsetCurrentField(fieldName) {
      this.currentFields.unset(fieldName);
    }

    /**
     * Active field disable by name
     * @param fieldName string
     */

  }, {
    key: 'fieldActive',
    value: function fieldActive(fieldNames) {
      var _this5 = this;

      this.fieldsDisable.delete(fieldNames, function () {
        return _this5.changeFieldStatus();
      });
    }

    /**
     * Disable field active by name
     * @param fieldName string
     */

  }, {
    key: 'fieldDisable',
    value: function fieldDisable(fieldNames) {
      var _this6 = this;

      this.fieldsDisable.insert(fieldNames, function () {
        return _this6.changeFieldStatus();
      });
    }

    /**
     * Display field hidden by name
     * @param fieldName string
     */

  }, {
    key: 'fieldDisplay',
    value: function fieldDisplay(fieldNames) {
      var _this7 = this;

      this.fieldsHidden.delete(fieldNames, function () {
        return _this7.changeFieldStatus();
      });
    }

    /**
     * Hidden field display by name
     * @param fieldName string
     */

  }, {
    key: 'fieldHidden',
    value: function fieldHidden(fieldNames) {
      var _this8 = this;

      this.fieldsHidden.insert(fieldNames, function () {
        return _this8.changeFieldStatus();
      });
    }

    // FIELD VALIDATION ------------- //


    /**
     * Set field status (valid || not)
     * @param fieldName string
     * @param fieldInput object
     */

  }, {
    key: 'setValidField',
    value: function setValidField(fieldName) {
      var isValid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var onChecked = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

      if ((0, _Lodash.isBoolean)(isValid)) {
        this.fieldsValid.set((0, _defineProperty3.default)({}, fieldName, isValid));
      } else {
        this.fieldsValid.set((0, _defineProperty3.default)({}, fieldName, false));
      }
      if (onChecked) {
        this.validate();
      }
    }
  }, {
    key: 'unsetValidField',
    value: function unsetValidField(fieldName) {
      this.fieldsValid.unset(fieldName);
    }

    // FIELD CONDITION ------------- //


    /**
     * Set field condition if exist
     * @param fieldName string
     * @param fieldInput 
     */

  }, {
    key: 'setFieldCondition',
    value: function setFieldCondition(fieldName, fieldInput) {
      var _this9 = this;

      if (fieldInput.condition && !this.fieldsCondition.hasOwnProperty(fieldName)) {
        this.fieldsCondition[fieldName] = true;
        this.sub(_WFConstants.WF_VALUES_CHANGE, function (values) {
          fieldInput.condition.watch(values, function (action, args) {
            _this9.pub(_WFConstants.WF_FIELD_CONDITION, { fieldName: fieldName, action: action, args: args });
            var event = _WFormViewHelpers2.default.getFieldAction({
              fieldName: fieldName,
              fieldInput: fieldInput,
              action: action,
              values: values,
              args: args
            });
            if (event) {
              event(_this9);
            }
          });
        });
        this.pub(_WFConstants.WF_VALUES_CHANGE);
      }
    }

    // VALUES NOTIFICATION ------------- //


    /**
     * Publish all fields values mapped by name
     * @notify object values
     */

  }, {
    key: 'valuesChange',
    value: function valuesChange() {
      var values = {};
      var fields = this.formState.getFields();
      for (var key in fields) {
        var fld = fields[key];
        var fldName = fld.getName();
        values[fldName] = fld.getValue();
      }
      this.pub(_WFConstants.WF_VALUES_CHANGE, values);
    }

    // FORM STATE ------------- //


    /**
     * Get the form state
     */

  }, {
    key: 'getFormState',
    value: function getFormState() {
      return this.formState;
    }

    /**
     * Set all fields values
     */

  }, {
    key: 'setValues',
    value: function setValues(val) {
      this.getFormState().setValues(val);
    }

    /**
     * Get all fields values
     */

  }, {
    key: 'getValues',
    value: function getValues() {
      return this.getFormState().getValues();
    }

    /**
     * Get all fields mapped by name
     */

  }, {
    key: 'getFields',
    value: function getFields() {
      return this.getFormState().getFields();
    }

    /**
     * Get field by name
     * @param name the field name
     * @return WFormField if found else return null
     */

  }, {
    key: 'getField',
    value: function getField(fieldName) {
      return this.getFormState().getField(fieldName);
    }

    /**
     * Add fields
     * @param fields the array of fields to add
     * ex 
     * fields = [{
     * "name": "subject",
     * "type": "string",
     * "input_type": "",
     * "len": 32,
     * "label": "Name",
     * "required": true,
     * "searchable": true,
     * "create_column": true
     * },{
     *  "name": "message",
     *  "type": "text",
     *  "input_type": "",
     *  "len": 65555,
     *  "label": "Attributes",
     *  "required": false,
     *  "searchable": false,
     *  "create_column": true
     * }]
     * 
     */

  }, {
    key: 'addFields',
    value: function addFields(fields) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(fields)) {
        var l = fields.length;
        for (var i = 0; i < l; i++) {
          this.createOrUpdateField(fields[i]);
          if (i === l - 1) {
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          }
        }
      }
    }

    /**
     * Delete field
     * @param name the field name
     */

  }, {
    key: 'deleteField',
    value: function deleteField(name) {
      this.getFormState().deleteField(name);
    }

    /**
     * Delete field
     * @param name the field name
     */

  }, {
    key: 'clearField',
    value: function clearField(name) {
      var fld = this.getFormState().getField(name);
      if (fld) {
        fld.clearValue();
      }
    }

    /**
     * Create or update form field
     * config should contains a valid name, label, type and
     * len when creating new field
     * @param config the field schema
     * @return the created/updated field or null
     */

  }, {
    key: 'createOrUpdateField',
    value: function createOrUpdateField(config) {
      var isNewFld = false;
      var fld = this.getFormState().createOrUpdateField(config);
      if (!this.getFormState().getField()) {
        isNewFld = true;
      }
      if (isNewFld) {
        _WFormViewHelpers2.default.observeField(this, fld);
      }
    }

    /**
     * Get display fields
     */

  }, {
    key: 'getDisplayFields',
    value: function getDisplayFields() {
      return this.getFormState().getDisplayFields();
    }

    /**
     * Create displayfield by step.schema
     */

  }, {
    key: 'generateDisplayFields',
    value: function generateDisplayFields() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var schema = this.getStepMgr().getSchema();
      var displayFields = schema.reduce(function (memo, step) {
        var _step$order = step.order,
            order = _step$order === undefined ? [] : _step$order;

        return (0, _concat2.default)(memo, order.filter(function (c) {
          return !parseInt(c);
        }));
      }, []);
      this.setDisplayFields(displayFields);
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Set display fields
     * @param displayFields the ordered list of fields to display in views
     */

  }, {
    key: 'setDisplayFields',
    value: function setDisplayFields(displayFields) {
      if ((0, _Lodash.isArray)(displayFields)) {
        this.getFormState().setDisplayFields(displayFields);
        this.displayFieldsChange();
      }
    }

    /**
     * Set display fields
     * @param displayFields the ordered list of fields to display in views
     */

  }, {
    key: 'displayFieldsChange',
    value: function displayFieldsChange() {
      this.change((0, _defineProperty3.default)({}, _WFConstants.WF_DISPLAY_FIELDS, this.getDisplayFields()));
      this.changeFields();
    }

    /**
     * Set Editor observer whend the state is ready
     * @param callback(state)
     */

  }, {
    key: 'setEditorObserver',
    value: function setEditorObserver(callback) {
      this.editorObserver = callback;
    }
  }]);
  return WFormView;
}();

exports.default = WFormView;

/***/ }),
/* 66 */,
/* 67 */,
/* 68 */,
/* 69 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF COUNTER ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-counter",
	counter: "wf--counter",
	max: "wf--max",
	text: "wf--text"
};

// ------------------- //

var WFCounter = function (_Component) {
	(0, _inherits3.default)(WFCounter, _Component);

	function WFCounter() {
		(0, _classCallCheck3.default)(this, WFCounter);
		return (0, _possibleConstructorReturn3.default)(this, (WFCounter.__proto__ || (0, _getPrototypeOf2.default)(WFCounter)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFCounter, [{
		key: "render",


		// ------------------- //

		value: function render() {
			if (this.isHidden()) return false;
			return _react2.default.createElement(
				"wf-counter",
				null,
				this.getView()
			);
		}

		// ------------------- //

	}, {
		key: "getView",
		value: function getView() {
			var _props = this.props,
			    _props$counter = _props.counter,
			    counter = _props$counter === undefined ? 0 : _props$counter,
			    _props$max = _props.max,
			    max = _props$max === undefined ? 0 : _props$max,
			    _props$all = _props.all,
			    all = _props$all === undefined ? false : _props$all;

			if (all) return this.getViewComplete();
			return counter === max || max === 0 ? this.getViewSingle() : this.getViewComplete();
		}

		// ------------------- //

	}, {
		key: "getViewSingle",
		value: function getViewSingle() {
			var _props2 = this.props,
			    _props2$sep = _props2.sep,
			    sep = _props2$sep === undefined ? "/" : _props2$sep,
			    _props2$parenthesis = _props2.parenthesis,
			    parenthesis = _props2$parenthesis === undefined ? true : _props2$parenthesis,
			    _props2$prefix = _props2.prefix,
			    prefix = _props2$prefix === undefined ? "" : _props2$prefix,
			    _props2$sufix = _props2.sufix,
			    sufix = _props2$sufix === undefined ? "" : _props2$sufix;

			return _react2.default.createElement(
				"span",
				null,
				!prefix ? "" : this.getText(prefix),
				!parenthesis ? "" : this.getText("("),
				this.getCounter(),
				!parenthesis ? "" : this.getText(")"),
				!sufix ? "" : this.getText(sufix)
			);
		}

		// ------------------- //

	}, {
		key: "getViewComplete",
		value: function getViewComplete() {
			var _props3 = this.props,
			    _props3$sep = _props3.sep,
			    sep = _props3$sep === undefined ? "/" : _props3$sep,
			    _props3$parenthesis = _props3.parenthesis,
			    parenthesis = _props3$parenthesis === undefined ? true : _props3$parenthesis;

			return _react2.default.createElement(
				"span",
				null,
				!parenthesis ? "" : this.getText("("),
				this.getCounter(),
				this.getText(sep),
				this.getMax(),
				!parenthesis ? "" : this.getText(")")
			);
		}

		// ------------------- //

	}, {
		key: "getCounter",
		value: function getCounter() {
			var _props$counter2 = this.props.counter,
			    counter = _props$counter2 === undefined ? 0 : _props$counter2;

			return _react2.default.createElement(
				"span",
				{ className: "" + classes.counter },
				counter
			);
		}

		// ------------------- //

	}, {
		key: "getMax",
		value: function getMax() {
			var _props$max2 = this.props.max,
			    max = _props$max2 === undefined ? 0 : _props$max2;

			return _react2.default.createElement(
				"span",
				{ className: "" + classes.max },
				max
			);
		}

		// ------------------- //

	}, {
		key: "getText",
		value: function getText(str) {
			return _react2.default.createElement(
				"span",
				{ className: "" + classes.text },
				str
			);
		}

		// ------------------- //

	}, {
		key: "isHidden",
		value: function isHidden() {
			var _props4 = this.props,
			    _props4$counter = _props4.counter,
			    counter = _props4$counter === undefined ? 0 : _props4$counter,
			    _props4$visible = _props4.visible,
			    visible = _props4$visible === undefined ? true : _props4$visible,
			    _props4$visibleAtZero = _props4.visibleAtZero,
			    visibleAtZero = _props4$visibleAtZero === undefined ? false : _props4$visibleAtZero;

			return !visible || !visibleAtZero && parseFloat(counter) === 0;
		}
	}]);
	return WFCounter;
}(_react.Component);

// ------------------- //

exports.default = WFCounter;

// ------------------- //

/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFTableRow = __webpack_require__(361);

var _WFTableCell = __webpack_require__(216);

var _WFTableCell2 = _interopRequireDefault(_WFTableCell);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TABLE V2 ------------------- //

// ------------------- //

// CHILDS ------------------- //

var classes = {
	level: "wf-level",
	open: "wf-open"
};

// ------------------- //

var WFTable = function (_Component) {
	(0, _inherits3.default)(WFTable, _Component);

	function WFTable() {
		(0, _classCallCheck3.default)(this, WFTable);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFTable.__proto__ || (0, _getPrototypeOf2.default)(WFTable)).call(this));

		_this.scrollbar;
		return _this;
	}

	(0, _createClass3.default)(WFTable, [{
		key: 'render',
		value: function render() {
			var _this2 = this;

			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? false : _props$visible,
			    _props$scrollheightMi = _props.scrollheightMin,
			    scrollheightMin = _props$scrollheightMi === undefined ? 0 : _props$scrollheightMi,
			    _props$scrollheightMa = _props.scrollheightMax,
			    scrollheightMax = _props$scrollheightMa === undefined ? 685 : _props$scrollheightMa,
			    _props$scrollAutoHide = _props.scrollAutoHide,
			    scrollAutoHide = _props$scrollAutoHide === undefined ? false : _props$scrollAutoHide;

			if (!visible) return false;
			return _react2.default.createElement(
				'wf-table',
				{ style: this.getTableStyle() },
				_react2.default.createElement(
					_WFScrollBars2.default,
					{
						ref: function ref(c) {
							return _this2.scrollbar = c;
						},
						autoHide: scrollAutoHide,
						autoHeight: true,
						autoHeightMin: scrollheightMin,
						autoHeightMax: scrollheightMax
						//style={{ width: "100%", height:this.calHeight() }}
						, className: this.getTableClasses(),
						renderTrackHorizontal: function renderTrackHorizontal(props) {
							return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'track-horizontal' }));
						},
						renderThumbHorizontal: function renderThumbHorizontal(props) {
							return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'thumb-horizontal' }));
						}
					},
					this.getTableHead(),
					this.getTableBody()
				),
				_react2.default.createElement(
					'wf-table-foot',
					null,
					this.getTableFoot()
				)
			);
		}

		// ------------------- //

	}, {
		key: 'getTableClasses',
		value: function getTableClasses() {
			var _props$level = this.props.level,
			    level = _props$level === undefined ? 0 : _props$level;

			var classOpen = this.hasRowOpened() ? classes.open : "";
			var classLevel = level > 0 ? classes.level + ' ' + classes.level + '-' + level : '';
			return classLevel + ' ' + classOpen;
		}

		// ------------------- //

	}, {
		key: 'getTableStyle',
		value: function getTableStyle() {
			var _props$level2 = this.props.level,
			    level = _props$level2 === undefined ? 0 : _props$level2;

			var style = {},
			    p = "paddingLeft";
			if (level > 0) {
				style[p] = 50;
			}
			if (level > 2) {
				style[p] += level * 42;
				style[p] -= 84;
			}
			return style;
		}

		// ------------------- //

	}, {
		key: 'getTableHead',
		value: function getTableHead() {
			var _props$head = this.props.head,
			    head = _props$head === undefined ? true : _props$head;

			if (!head) return false;
			return _react2.default.createElement(
				'wf-table-head',
				null,
				_react2.default.createElement(_WFTableRow.WFRowHead, this.props)
			);
		}

		// ------------------- //

	}, {
		key: 'getTableBody',
		value: function getTableBody() {
			var _this3 = this;

			var _props$rows = this.props.rows,
			    rows = _props$rows === undefined ? [] : _props$rows;

			if (!(0, _Lodash.isArray)(rows)) {
				return false;
			}
			return _react2.default.createElement(
				'wf-table-body',
				null,
				rows.map(function (row, i) {
					var isOpened = _this3.isOpened(row);
					var isVisble = _this3.hasRowOpened() && !isOpened ? false : true;
					var attributes = _WFValue2.default.getAttributes(row);
					return _react2.default.createElement(_WFTableRow.WFRow, (0, _extends3.default)({
						key: i,
						row: row,
						attributes: attributes,
						isVisble: isVisble,
						isOpened: isOpened,
						isChecked: _this3.isSelected(row)
					}, _this3.props));
				})
			);
		}

		// ------------------- //

	}, {
		key: 'getTableFoot',
		value: function getTableFoot() {
			if (this.hasRowOpened()) return false;
			return this.props.children;
		}

		// ------------------- //

	}, {
		key: 'countRows',
		value: function countRows() {
			var _props$rows2 = this.props.rows,
			    rows = _props$rows2 === undefined ? [] : _props$rows2;

			return rows.length;
		}

		// ------------------- //

	}, {
		key: 'countRowsSelected',
		value: function countRowsSelected() {
			var _props$selected = this.props.selected,
			    selected = _props$selected === undefined ? [] : _props$selected;

			return selected.length;
		}

		// ------------------- //

	}, {
		key: 'countRowsOpened',
		value: function countRowsOpened() {
			var _props$opened = this.props.opened,
			    opened = _props$opened === undefined ? [] : _props$opened;

			return opened.length;
		}

		// ------------------- //

	}, {
		key: 'hasRowSelected',
		value: function hasRowSelected() {
			return this.countRowsSelected() > 0;
		}

		// ------------------- //

	}, {
		key: 'hasRowOpened',
		value: function hasRowOpened() {
			return this.countRowsOpened() > 0;
		}

		// ------------------- //

	}, {
		key: 'isSelected',
		value: function isSelected(row) {
			var _props2 = this.props,
			    _props2$selectBy = _props2.selectBy,
			    selectBy = _props2$selectBy === undefined ? "id" : _props2$selectBy,
			    _props2$selected = _props2.selected,
			    selected = _props2$selected === undefined ? [] : _props2$selected;

			if (!this.hasRowSelected() || !row.hasOwnProperty(selectBy)) return false;
			return selected.includes(row[selectBy]);
		}

		// ------------------- //

	}, {
		key: 'isOpened',
		value: function isOpened(row) {
			var _props3 = this.props,
			    _props3$openBy = _props3.openBy,
			    openBy = _props3$openBy === undefined ? "id" : _props3$openBy,
			    _props3$opened = _props3.opened,
			    opened = _props3$opened === undefined ? [] : _props3$opened;

			if (!this.hasRowOpened() || !row.hasOwnProperty(openBy)) return false;
			if (openBy === "id") {
				return opened.includes(parseInt(row[openBy]));
			} else {
				return opened.includes(row[openBy]);
			}
		}
	}]);
	return WFTable;
}(_react.Component);

// ------------------- //

exports.default = WFTable;

// ------------------- //

/*

	<WFTable
		// Config Table -- //
		level={0}
		visible={true}
		head={true}

		// Config ScrollBar -- //
		scrollAutoHide={false}
		scrollheightMax={685}
		scrollheightMin={0}

		// Capabilities -- //
		canAdd={true}
		canEdit={true}
		canOpen={true}
		canSelect={true}
		canDelete={true}
		hasShortcode={true}

		// Capabilities Hook -- //
		onAdd={ row => console.log("onAdd", row )}
		onEdit={ row => console.log("onEdit", row )}
		onOpen={ row => console.log("onOpen", row )}
		onSelect={ row => console.log("onSelect", row )}
		onDelete={ row => console.log("onDelete", row )}

		// Capabilities Custom -- //
		customAction={[
			{ name:"entries", icon:"layers", callback: row => console.log("entries", row )},
			{ name:"analytics", icon:"piechart", callback: row => console.log("analytics", row ),
		}]}
		
		// Config Shortode -- //
		shortcodeConfig={{
			prefix:"wonderform id=",
			sufix:"",
			prop:"id",
		}}

		// Config Filters -- //
		colFilter={["wf_firstName","up"]}
		colFilters={{
			wf_firstName: {
				up: (col) => console.log('Up Filter : ', col),
				down: (col) => console.log('Down Filter : ', col)
			},
			wf_email: {
				up: (col) => console.log('Up Filter : ', col),
				down: (col) => console.log('Down Filter : ', col)
			},
		}}

		// Config Cell -- //
		cellConfig={{								
    		preview:true, 
    		previewSplit:",",
    		limit:{
				string: 20,
				text: 40,
				select: 40,
    		}
		}}
		cellCallbacks={false||{}}

		// Config Row -- //
		rowConfig={{
			values: ["id","modified","wf_firstName","wf_lastName","wf_email","wf_suject","wf_message"],
			types: ["number","date","string","string","string","select","text"]
		}}

		// Select Hook -- //
		selectBy={"id"}
		selected={[72,73]}

		// Open Hook -- //
		openBy={"id"}
		opened={[]}	

		// Rows Hook -- //
		rows={[
			{ id:50, modified:"2016-08-13 21:10:45", wf_firstName: "Judith", wf_lastName: "Judith",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:51, modified:"2016-08-13 21:10:45", wf_firstName: "Charles", wf_lastName: "Romney",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:52, modified:"2016-08-13 21:10:45", wf_firstName: "Babaly", wf_lastName: "Ly",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:53, modified:"2016-08-13 21:10:45", wf_firstName: "Ghislain", wf_lastName: "Yeboua",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:54, modified:"2016-08-13 21:10:45", wf_firstName: "David", wf_lastName: "Radjavong",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:56, modified:"2016-08-13 21:10:45", wf_firstName: "Stephani", wf_lastName: "De la cours",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:57, modified:"2016-08-13 21:10:45", wf_firstName: "Mario", wf_lastName: "Bros",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:58, modified:"2016-08-13 21:10:45", wf_firstName: "Sonic", wf_lastName: "The Hedgehog",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:70, modified:"2016-08-13 21:10:45", wf_firstName: "Frank", wf_lastName: "Laloupo di Conacri du Congo",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:71, modified:"2016-08-13 21:10:45", wf_firstName: "William cesar palace", wf_lastName: "Du Chauveni",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:72, modified:"2016-08-13 21:10:45", wf_firstName: "Emmanuel", wf_lastName: "Elard",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
			{ id:73, modified:"2016-08-13 21:10:45", wf_firstName: "Robert", wf_lastName: "Miles",  wf_email: "juju@jiji.fr", wf_suject: "Demande de Financement, Proposition Commercial, Réglement du litige, Offre et Partenariat Commercial", wf_message: "Est-ce que vous avez des commentaires pour fusionner les documents ?" },
		]}
	>
		<WFPagination
			visible={true}
			total={20}
			current={19}
			visiblePages={8}
			onPageChanged={(newPage) => console.log('onPageChanged:', newPage+1)}
			titles={{
				first:   'First',
				prev:    '\u00AB',
				prevSet: '...',
				nextSet: '...',
				next:    '\u00BB',
				last:    'Last'
			}}
		/>
	</WFTable>


*/

/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _ressources = __webpack_require__(451);

var _ressources2 = _interopRequireDefault(_ressources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFieldHelper = function () {
  function WFieldHelper() {
    (0, _classCallCheck3.default)(this, WFieldHelper);
  }

  (0, _createClass3.default)(WFieldHelper, null, [{
    key: "setSample",
    value: function setSample(input, name) {
      var _input$props = input.props,
          _input$props$data = _input$props.data,
          data = _input$props$data === undefined ? [] : _input$props$data,
          _input$props$isBaobab = _input$props.isBaobab,
          isBaobab = _input$props$isBaobab === undefined ? false : _input$props$isBaobab;

      if (!isBaobab && data.length === 0) {
        _ressources2.default.getFields().then(function (module) {
          input.setState({
            sampleData: module.fields[name]
          });
        }).catch(function (err) {
          console.error(err.message);
        });
      }
    }
  }]);
  return WFieldHelper;
}();

exports.default = WFieldHelper;

/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_OPTION_GROUP = exports.WF_OPTION_GROUP = "option-group";
var WF_OPTION = exports.WF_OPTION = "option";
var WF_BAOBAB_TREE = exports.WF_BAOBAB_TREE = "tree";
var WF_BAOBAB_BRANCH = exports.WF_BAOBAB_BRANCH = "branch";
var WF_BAOBAB_OPTION = exports.WF_BAOBAB_OPTION = "option";
var WF_BAOBAB_PRIV_OPTION = exports.WF_BAOBAB_PRIV_OPTION = "is_private";

var WF_BAOBAB_PARENT_ID = exports.WF_BAOBAB_PARENT_ID = "parent_id";
var WF_BAOBAB_OPTIONGROUP_ID = exports.WF_BAOBAB_OPTIONGROUP_ID = "wf_optiongroup_id";

/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFieldConfigFactory = __webpack_require__(255);

var _WFieldConfigFactory2 = _interopRequireDefault(_WFieldConfigFactory);

var _WFormConfigFactory = __webpack_require__(426);

var _WFormConfigFactory2 = _interopRequireDefault(_WFormConfigFactory);

var _WFOptionFactory = __webpack_require__(422);

var _WFOptionFactory2 = _interopRequireDefault(_WFOptionFactory);

var _WFOptionGroupFactory = __webpack_require__(423);

var _WFOptionGroupFactory2 = _interopRequireDefault(_WFOptionGroupFactory);

var _WFormActionFactory = __webpack_require__(425);

var _WFormActionFactory2 = _interopRequireDefault(_WFormActionFactory);

var _WFSettingFactory = __webpack_require__(424);

var _WFSettingFactory2 = _interopRequireDefault(_WFSettingFactory);

var _WFLicenseFactory = __webpack_require__(421);

var _WFLicenseFactory2 = _interopRequireDefault(_WFLicenseFactory);

var _WFormConfigParser = __webpack_require__(163);

var _WFormConfigParser2 = _interopRequireDefault(_WFormConfigParser);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFDataTypes = __webpack_require__(74);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Factory to create new form state
 */
var WFormStateFactory = function () {
  function WFormStateFactory() {
    (0, _classCallCheck3.default)(this, WFormStateFactory);
  }

  (0, _createClass3.default)(WFormStateFactory, null, [{
    key: "create",

    /**
     * Create a new form state
     * @param type the form type
     * @return instanceof WFormState
     */
    value: function create() {
      var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _WFProductType.WF_CUSTOM_CUSTOM_ID;

      var formState = null;

      switch (type) {
        case _WFProductType.WF_CORE_FORM_CONFIG_ID:
          formState = _WFormConfigFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_FIELD_CONFIG_ID:
          formState = _WFieldConfigFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_OPTION_ID:
          formState = _WFOptionFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_OPTION_GROUP_ID:
          formState = _WFOptionGroupFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_ACTION_ID:
          formState = _WFormActionFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_SETTING_ID:
          formState = _WFSettingFactory2.default.create();
          break;

        case _WFProductType.WF_CORE_LICENSE_ID:
          formState = _WFLicenseFactory2.default.create();
          break;

        default:
          formState = new _WFormState2.default({ type: type });
          break;
      }

      return formState;
    }

    /**
     * Create a new form state for form entry edition
     * @param formConfig a given form config
     * @param isAlreadyMerged
     * @return WFormState
     */

  }, {
    key: "createFormEntryState",
    value: function createFormEntryState(formConfig) {
      var isAlreadyMerged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      if (!isAlreadyMerged) {
        formConfig = WFormStateFactory.getMergedFormConfig(formConfig);
      }
      // entry_id should be set to zero. not exists yet for entry creation.
      formConfig.entry_id = 0;
      var formState = new _WFormState2.default(formConfig);
      return formState;
    }

    /**
     * Create a new form state for form config edition
     * @param formConfig a given form config
     * @param isAlreadyMerged
     * @return WFormState
     */

  }, {
    key: "createFormConfigState",
    value: function createFormConfigState(formConfig) {
      var isAlreadyMerged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      var formState = WFormStateFactory.create(_WFProductType.WF_CORE_FORM_CONFIG_ID);
      if (!isAlreadyMerged) {
        formConfig = WFormStateFactory.getMergedFormConfig(formConfig);
      }
      var displayFields = formConfig.display_fields; // array display fields
      formState.setDisplayFields(formConfig.display_fields);
      formConfig.display_fields = displayFields.join();
      formState.setValues(formConfig);
      formState.setPublished(formConfig.published);

      return formState;
    }

    /**
     * Create a temporary form state
     * @return WFormState
     */

  }, {
    key: "createTempFormState",
    value: function createTempFormState() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _args$fields = args.fields,
          fields = _args$fields === undefined ? [] : _args$fields,
          _args$displayFields = args.displayFields,
          displayFields = _args$displayFields === undefined ? [] : _args$displayFields,
          _args$defaultValues = args.defaultValues,
          defaultValues = _args$defaultValues === undefined ? {} : _args$defaultValues;

      var formState = new _WFormState2.default();
      formState.setEntryId(0);
      formState.addFields(fields);
      formState.setDisplayFields(displayFields);
      formState.setValues(defaultValues);
      return formState;
    }

    /**
     * Get the merged form config
     * @param formConfig a given form config to parse
     * @return Object containing the new form config
     */

  }, {
    key: "getMergedFormConfig",
    value: function getMergedFormConfig(formConfig) {
      var mergedConfig = _WFormConfigParser2.default.parse(formConfig);
      return mergedConfig;
    }

    /**
     * Get the default form config
     * @param productTypeId a given product type identifier
     */

  }, {
    key: "getDefaultFormConfig",
    value: function getDefaultFormConfig(productTypeId) {
      return {
        fields: [],
        display_fields: [],
        attributes: ''
      };
    }
  }]);
  return WFormStateFactory;
}();

;

exports.default = WFormStateFactory;

/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_TYPE_STRING = exports.WF_TYPE_STRING = "string";
var WF_TYPE_TEXT = exports.WF_TYPE_TEXT = "text";
var WF_TYPE_HTML = exports.WF_TYPE_HTML = "html";
var WF_TYPE_MAILER = exports.WF_TYPE_MAILER = "mailer";
var WF_TYPE_TEXTAREA = exports.WF_TYPE_TEXTAREA = "textarea";
var WF_TYPE_PASSWORD = exports.WF_TYPE_PASSWORD = "password";
var WF_TYPE_NUMBER = exports.WF_TYPE_NUMBER = "number";
var WF_TYPE_EMAIL = exports.WF_TYPE_EMAIL = "email";
var WF_TYPE_TEL = exports.WF_TYPE_TEL = "tel";
var WF_TYPE_URL = exports.WF_TYPE_URL = "url";
var WF_TYPE_FLOAT = exports.WF_TYPE_FLOAT = "float";
var WF_TYPE_INTEGER = exports.WF_TYPE_INTEGER = "integer";
var WF_TYPE_BOOLEAN = exports.WF_TYPE_BOOLEAN = "boolean";
var WF_TYPE_OBJECT = exports.WF_TYPE_OBJECT = "object";
var WF_TYPE_ARRAY = exports.WF_TYPE_ARRAY = "array";
var WF_TYPE_SELECT = exports.WF_TYPE_SELECT = "select";
var WF_TYPE_SELECT_SINGLE = exports.WF_TYPE_SELECT_SINGLE = "select_single";
var WF_TYPE_SELECT_MULTIPLE = exports.WF_TYPE_SELECT_MULTIPLE = "select_multiple";
var WF_TYPE_COLLECTION = exports.WF_TYPE_COLLECTION = "collection";
var WF_TYPE_DOCUMENT = exports.WF_TYPE_DOCUMENT = "document";
var WF_TYPE_FILE = exports.WF_TYPE_FILE = "file";
var WF_TYPE_DATE = exports.WF_TYPE_DATE = "date";

/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS CONSOLE  ------------------- //

// ------------------- //

var WFConsole = function () {
  function WFConsole() {
    (0, _classCallCheck3.default)(this, WFConsole);
  }

  (0, _createClass3.default)(WFConsole, null, [{
    key: 'log',
    value: function log(arg) {
      var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var val = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      if (key && val) {
        WFConsole.val(key, val);
      }
      console.log('' + WFConsole.stringify(arg));
    }
  }, {
    key: 'val',
    value: function val(key, _val) {
      console.log('%c' + key + ('%c' + " => ") + ('%c' + WFConsole.stringify(_val)), 'color:#0076d3;', 'color:#b0b4b7;', 'color:#E91E63;');
    }
  }, {
    key: 'info',
    value: function info(key, val) {
      console.log("");
      WFConsole.val(key, val);
      console.log("");
    }
  }, {
    key: 'dir',
    value: function dir(el) {
      if ((0, _Lodash.isObject)(el)) {
        var count = (0, _keys2.default)(el).length;
        if (count === 0) {
          return;
        } else if (count < 5) {
          console.table({ el: el });
        } else {
          console.dir(el);
        }
      } else if ((0, _Lodash.isArray)(el)) {
        if (el.length > 0) {
          console.table(el);
        }
      }
    }
  }, {
    key: 'valDir',
    value: function valDir(key, val, el) {
      var count = 0;
      if ((0, _Lodash.isObject)(el) && !el.hasOwnProperty("props")) {
        count = (0, _keys2.default)(el).length;
      } else if ((0, _Lodash.isArray)(el)) {
        count = el.length;
      }
      if (count === 0) {
        WFConsole.val(key, val);
      } else {
        console.log("");
        WFConsole.val(key, val);
        WFConsole.dir(el);
      }
    }
  }, {
    key: 'wrap',
    value: function wrap(logs) {
      if (!(0, _Lodash.isFunction)(logs)) {
        return;
      }
      console.log("");
      console.log('%c>>>>>>>>> ------------------- >', 'color:#AAAAAA;');
      console.log("");
      logs();
      console.log("");
      console.log('%c>>>>>>>>> ------------------- >', 'color:#AAAAAA;');
      console.log("");
    }
  }, {
    key: 'stringify',
    value: function stringify(arg) {
      if ((0, _Lodash.isArray)(arg) || (0, _Lodash.isObject)(arg) || (0, _JSON.isJson)(arg)) {
        return (0, _JSON.stringify)(arg, 0, 2);
      } else {
        return arg;
      }
    }
  }]);
  return WFConsole;
}();

exports.default = WFConsole;

/***/ }),
/* 76 */,
/* 77 */,
/* 78 */,
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */,
/* 83 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _Lodash = __webpack_require__(6);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFSearchInput = __webpack_require__(402);

var _WFSearchInput2 = _interopRequireDefault(_WFSearchInput);

var _WFButtonToggle = __webpack_require__(401);

var _WFButtonToggle2 = _interopRequireDefault(_WFButtonToggle);

var _WFArchiveOption = __webpack_require__(399);

var _WFArchiveOption2 = _interopRequireDefault(_WFArchiveOption);

var _WFArchiveSelection = __webpack_require__(400);

var _WFArchiveSelection2 = _interopRequireDefault(_WFArchiveSelection);

var _WFCss = __webpack_require__(101);

var _WFCss2 = _interopRequireDefault(_WFCss);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT 2 ------------------- //  searchValue
// ------------------- //

var WFSelect2 = function (_Component) {
  (0, _inherits3.default)(WFSelect2, _Component);

  function WFSelect2(props) {
    (0, _classCallCheck3.default)(this, WFSelect2);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect2.__proto__ || (0, _getPrototypeOf2.default)(WFSelect2)).call(this, props));

    _this.focusObserver = function (evt) {
      var isOpen = _this.props.isOpen;

      if (isOpen) {
        var ref = _this.wrapper.refs[_this.name];
        var area = _reactDom2.default.findDOMNode(ref);
        if (_this.elemIsClicked) {
          _this.elemIsClicked = false;
          return;
        }
        if (area && !area.contains(evt.target)) {
          _this.onClose();
        }
      }
    };

    var name = props.name;

    _this.name = name || 'Select2';
    _this.wrapper = null;
    _this.state = {
      isInit: false,
      sampleData: []
    };

    _this.elemIsClicked = false;
    return _this;
  }

  // ACTION ------------------- //
  /*
    onSelect(id) {
      this.props.on(WF_EVENT_ONSELECT, id)
    }
  */


  (0, _createClass3.default)(WFSelect2, [{
    key: 'onToggle',
    value: function onToggle() {
      var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "up";

      if (!this.props.disabled) {
        this.props.on(_WFEventTypes.WF_EVENT_ONTOGGLE, focus);
      }
    }
  }, {
    key: 'onOpen',
    value: function onOpen() {
      var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      if (!this.props.disabled) {
        this.props.on(_WFEventTypes.WF_EVENT_ONOPEN, focus);
      }
    }
  }, {
    key: 'onClose',
    value: function onClose() {
      if (!this.props.disabled) {
        this.props.on(_WFEventTypes.WF_EVENT_ONCLOSE);
      }
    }
  }, {
    key: 'onFind',
    value: function onFind() {
      if (!this.props.disabled) {
        this.props.on(_WFEventTypes.WF_EVENT_ONFIND);
      }
    }
  }, {
    key: 'onSearch',
    value: function onSearch(val) {
      if (!this.props.disabled) {
        this.props.on(_WFEventTypes.WF_EVENT_ONSEARCH, val);
      }
    }
  }, {
    key: 'render',


    // RENDER ------------------- //

    value: function render() {
      var _this2 = this;

      var _props = this.props,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          isOpen = _props.isOpen,
          valueBy = _props.valueBy,
          labelBy = _props.labelBy,
          _props$data = _props.data,
          data = _props$data === undefined ? [] : _props$data;

      var btnOpen = isOpen;
      if (disabled) {
        btnOpen = true;
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        refId: this.name
        /*
        willMount={() => {
          WFSelect2.setIntialValue(this.props)
        }}
        */
        , didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "select2");
          window.addEventListener('click', _this2.focusObserver);
        },
        willUnmount: function willUnmount() {
          window.removeEventListener('click', _this2.focusObserver);
        },
        view: function view(wrapper) {
          _this2.wrapper = wrapper;
          var counter = data.length;
          return _react2.default.createElement(
            'wf-select2',
            null,
            _react2.default.createElement(
              'div',
              { className: _this2.getWrapperClass() },
              _react2.default.createElement(
                'div',
                { className: '' + _WFCss2.default.wrapper.top },
                _this2.getContentTop(),
                _react2.default.createElement(_WFButtonToggle2.default, {
                  checked: btnOpen,
                  onClick: function onClick() {
                    _this2.elemIsClicked = true;
                    _this2.onToggle();
                  }
                })
              ),
              _this2.getContentBottom()
            )
          );
        }
      }));
    }

    // TOP CONTENT ------------------- //

  }, {
    key: 'getContentTop',
    value: function getContentTop() {
      var _this3 = this;

      var _props2 = this.props,
          isUnfold = _props2.isUnfold,
          canSearch = _props2.canSearch,
          _props2$arrayValue = _props2.arrayValue,
          arrayValue = _props2$arrayValue === undefined ? [] : _props2$arrayValue,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled;

      if (this.isFocused()) {
        return this.getSearchInput("up");
      } else {
        if (!canSearch || isUnfold || arrayValue.length > 0 || this.isOpen()) {
          return _react2.default.createElement(_WFArchiveSelection2.default, {
            data: arrayValue,
            onRemove: function onRemove(id) {
              return WFSelect2.onSelect(_this3, id);
            },
            onToggle: function onToggle() {
              _this3.elemIsClicked = true;
              _this3.onToggle("");
            }
          });
        } else {
          return this.getSearchInput("up");
        }
      }
    }

    // BOTTOM CONTENT ------------------- //

  }, {
    key: 'getContentBottom',
    value: function getContentBottom() {
      var _this4 = this;

      var _props3 = this.props,
          isMax = _props3.isMax,
          isLoading = _props3.isLoading,
          canSearch = _props3.canSearch,
          isMultiple = _props3.isMultiple,
          _props3$searchValue = _props3.searchValue,
          searchValue = _props3$searchValue === undefined ? "" : _props3$searchValue;

      var isOpen = this.isOpen();
      var style = {
        opacity: 0,
        visibility: "hidden"
      };
      if (isOpen) {
        style = {
          opacity: 1,
          visibility: "visible"
        };
      }
      return _react2.default.createElement(
        'div',
        {
          style: style,
          className: '' + _WFCss2.default.wrapper.down },
        !this.isFocused() && canSearch ? this.getSearchInput() : "",
        _react2.default.createElement(_WFArchiveOption2.default, {
          data: WFSelect2.getOptions(this),
          isMax: isMax,
          isLoading: isLoading,
          isMultiple: isMultiple,
          isSelected: function isSelected(id) {
            return WFSelect2.has(_this4, id);
          },
          searchValue: searchValue,
          onSelect: function onSelect(id) {
            WFSelect2.onSelect(_this4, id);
            if (!isMultiple) {
              _this4.onClose();
            }
          }
        })
      );
    }

    // SEARCH INPUT ------------------- //

  }, {
    key: 'getSearchInput',
    value: function getSearchInput() {
      var _this5 = this;

      var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var _props4 = this.props,
          disabled = _props4.disabled,
          _props4$placeholder = _props4.placeholder,
          placeholder = _props4$placeholder === undefined ? "Search..." : _props4$placeholder,
          searchValue = _props4.searchValue,
          isLoading = _props4.isLoading;
      /*
      if (disabled) {
        return false;
      } else {
        */

      return _react2.default.createElement(_WFSearchInput2.default, {
        readOnly: !disabled
        //disabled={disabled}
        , value: searchValue,
        isLoading: isLoading,
        placeholder: placeholder,
        onChange: function onChange(e) {
          return _this5.onSearch(e.target.value);
        },
        onFocus: function onFocus() {
          _this5.onOpen(focus);
          _this5.onFind();
        }
      });
      // }
    }

    // CONDITION ------------------- //

  }, {
    key: 'isFocused',
    value: function isFocused() {
      var _props$focus = this.props.focus,
          focus = _props$focus === undefined ? "" : _props$focus;

      return focus === "up";
    }
  }, {
    key: 'isOpen',
    value: function isOpen() {
      var _props5 = this.props,
          isOpen = _props5.isOpen,
          isUnfold = _props5.isUnfold;

      if (isUnfold) {
        return true;
      } else {
        return isOpen;
      }
    }

    // UTILS ------------------- //

  }, {
    key: 'getWrapperClass',


    // ------------------- //

    //static setIntialValue (props) {} 
    value: function getWrapperClass() {
      var _props6 = this.props,
          isOpen = _props6.isOpen,
          disabled = _props6.disabled,
          isUnfold = _props6.isUnfold;

      var clss = "";
      if (disabled) {
        clss += '' + _WFCss2.default.disabled;
      } else {
        clss += '' + (isUnfold ? _WFCss2.default.state.unfold : "");
        clss += ' ' + (isOpen ? _WFCss2.default.state.open : _WFCss2.default.state.close);
      }
      return clss;
    }

    // FOCUS SUPPORT ------------------- //

  }], [{
    key: 'onSelect',
    value: function onSelect(select, id) {
      select.props.on(_WFEventTypes.WF_EVENT_ONSELECT, id);
    }
  }, {
    key: 'has',
    value: function has(select, id) {
      var _select$props = select.props,
          _select$props$valueBy = _select$props.valueBy,
          valueBy = _select$props$valueBy === undefined ? "id" : _select$props$valueBy,
          _select$props$arrayVa = _select$props.arrayValue,
          arrayValue = _select$props$arrayVa === undefined ? [] : _select$props$arrayVa;

      if ((0, _Lodash.isArray)(arrayValue)) {
        var selectValue = arrayValue.map(function (o) {
          return o[valueBy];
        });
        return selectValue.includes(id);
      } else {
        return false;
      }
    }
  }, {
    key: 'getOptions',
    value: function getOptions(select) {
      var _select$state$sampleD = select.state.sampleData,
          sampleData = _select$state$sampleD === undefined ? [] : _select$state$sampleD;
      var _select$props2 = select.props,
          _select$props2$data = _select$props2.data,
          data = _select$props2$data === undefined ? [] : _select$props2$data,
          _select$props2$result = _select$props2.resultData,
          resultData = _select$props2$result === undefined ? [] : _select$props2$result,
          _select$props2$search = _select$props2.searchValue,
          searchValue = _select$props2$search === undefined ? "" : _select$props2$search,
          _select$props2$isBaob = _select$props2.isBaobab,
          isBaobab = _select$props2$isBaob === undefined ? false : _select$props2$isBaob;

      var countData = data.length;
      var countResultData = resultData.length;
      if (isBaobab && searchValue.length === 1) {
        if (countResultData > 0) {
          return resultData;
        } else {
          return data;
        }
      } else if (searchValue !== "" && countResultData === 0) {
        return [];
      } else if (countResultData > 0) {
        return resultData;
      } else {
        if (countData === 0) {
          return sampleData;
        } else {
          return data;
        }
      }
    }
  }]);
  return WFSelect2;
}(_react.Component);

// ------------------- //


exports.default = WFSelect2;
// ------------------- //

/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _WFormConfigParser = __webpack_require__(163);

var _WFormConfigParser2 = _interopRequireDefault(_WFormConfigParser);

var _WFMassUpdater = __webpack_require__(254);

var _WFMassUpdater2 = _interopRequireDefault(_WFMassUpdater);

var _Lodash = __webpack_require__(6);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormStateMgr = function () {
  function WFormStateMgr(config) {
    (0, _classCallCheck3.default)(this, WFormStateMgr);
    var formName = config.formName,
        formType = config.formType,
        objKey = config.objKey,
        _config$hasVolatileId = config.hasVolatileId,
        hasVolatileId = _config$hasVolatileId === undefined ? false : _config$hasVolatileId;

    this.formName = formName;
    this.formType = formType;
    this.formStateList = new _WFObject2.default();
    this.hasVolatileId = hasVolatileId;
    if (this.formType >= _WFProductType.WF_CUSTOM_CUSTOM_ID) {
      this.formConfig = _WFormConfigParser2.default.parse(config);
    } else {
      this.formConfig = null;
    }

    if (hasVolatileId) {
      this.objKey = "_id";
    } else {
      this.objKey = objKey;
    }
  }

  (0, _createClass3.default)(WFormStateMgr, [{
    key: "init",
    value: function init(rows) {
      var _this = this;

      var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      this.clear();
      if ((0, _Lodash.isObject)(config)) {
        var form_name = config.form_name;

        this.formName = form_name;
      }
      rows.forEach(function (row) {
        return _this.getOrCreate(row);
      });
    }
  }, {
    key: "getOrCreate",
    value: function getOrCreate(row) {
      var formState = null;
      if (row.hasOwnProperty(this.objKey)) {
        var key = row[this.objKey];
        if (this.formStateList.has(key)) {
          formState = this.formStateList.get(key);
        } else {
          if (this.formType < _WFProductType.WF_CUSTOM_CUSTOM_ID) {
            formState = _WFormStateFactory2.default.create(this.formType);
          } else {
            formState = _WFormStateFactory2.default.createFormEntryState(this.formConfig);
          }
          if (this.hasVolatileId && row.hasOwnProperty('_id')) {
            formState.setVolatileId(row._id);
          }
          this.formStateList.set((0, _defineProperty3.default)({}, key, formState));
        }
        if (formState) {
          formState.setValues(row);
        }
      }
      return formState;
    }
  }, {
    key: "update",
    value: function update(row) {
      if (row.hasOwnProperty(this.objKey)) {
        var _id = row[this.objKey];
        if (this.formStateList.has(_id)) {
          var formState = this.formStateList.get(_id);
          formState.setValues(row);
        }
      }
    }
  }, {
    key: "unset",
    value: function unset(key) {
      this.formStateList.unset(key);
    }
  }, {
    key: "setFieldValue",
    value: function setFieldValue(key, fieldName, val) {
      if (this.formStateList.has(key)) {
        var formState = this.formStateList.get(key);
        return formState.setFieldValue(fieldName, val);
      }
    }
  }, {
    key: "setAllFieldValue",
    value: function setAllFieldValue(fieldName, val) {
      var _this2 = this;

      this.formStateList.getKeys().forEach(function (key) {
        _this2.setFieldValue(key, fieldName, val);
      });
    }
  }, {
    key: "getFieldValue",
    value: function getFieldValue(key, fieldName) {
      var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      if (this.formStateList.has(key)) {
        var formState = this.formStateList.get(key);
        return formState.getFieldValue(fieldName, defaultValue);
      } else {
        return defaultValue;
      }
    }
  }, {
    key: "getAllFieldsValues",
    value: function getAllFieldsValues(fieldName) {
      var _this3 = this;

      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var values = {};
      this.formStateList.getKeys().forEach(function (key) {
        values[key] = _this3.getFieldValue(key, fieldName, defaultValue);
      });
      return values;
    }
  }, {
    key: "getValues",
    value: function getValues(key) {
      var fs = this.formStateList.get(key);
      if (fs) {
        return fs.getValues();
      } else {
        return null;
      }
    }
  }, {
    key: "getAllValues",
    value: function getAllValues() {
      var _this4 = this;

      var arr = [];
      this.formStateList.getKeys().forEach(function (key) {
        arr.push(_this4.getValues(key));
      });
      return arr;
    }
  }, {
    key: "clear",
    value: function clear() {
      this.formStateList.clear();
    }
  }, {
    key: "save",
    value: function save(urlArgs) {
      return this.execute(urlArgs, true);
    }
  }, {
    key: "del",
    value: function del(urlArgs) {
      return this.execute(urlArgs, false);
    }
  }, {
    key: "getCounter",
    value: function getCounter() {
      return this.formStateList.getCounter();
    }
  }, {
    key: "execute",
    value: function execute(urlArgs) {
      var isAddOrModify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

      var massUpdater = new _WFMassUpdater2.default({
        name: this.formName,
        type: this.formType
      });
      massUpdater.pushFormStateMgr(this);
      return massUpdater.execute(urlArgs, isAddOrModify);
    }
  }]);
  return WFormStateMgr;
}();

exports.default = WFormStateMgr;

/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

var _Namify = __webpack_require__(446);

var _Namify2 = _interopRequireDefault(_Namify);

var _Slugify = __webpack_require__(169);

var _Slugify2 = _interopRequireDefault(_Slugify);

var _MaxStr = __webpack_require__(123);

var _MaxStr2 = _interopRequireDefault(_MaxStr);

var _StrToArr = __webpack_require__(262);

var _StrToArr2 = _interopRequireDefault(_StrToArr);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFValueTypes = __webpack_require__(22);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS STRING ------------------- // 

// ------------------- //

var WFString = function (_WFType) {
  (0, _inherits3.default)(WFString, _WFType);

  /**
   * Constructor
   */
  function WFString() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFString);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFString.__proto__ || (0, _getPrototypeOf2.default)(WFString)).call(this, _WFValueTypes.WF_STRING_VALUE));

    var _config$value = config.value,
        value = _config$value === undefined ? "" : _config$value;

    _this.stringValue = value;
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFString, [{
    key: "get",


    /**
     * Get value
     * @return string
     */
    value: function get() {
      return this.stringValue;
    }

    /**
     * Set value
     * @param val the new value to set 
     */

  }, {
    key: "set",
    value: function set(val) {
      if ((0, _Lodash.isString)(val)) {
        if (val === "") {
          this.stringValue = val;
        } else {
          this.stringValue = val.replace(/^\s+|\s+$/g, '');
        }
      }
    }

    /**
     * clear value
     */

  }, {
    key: "clear",
    value: function clear() {
      this.stringValue = "";
      if (this.input) {
        this.input.setState((0, _defineProperty3.default)({}, this.getKey(), ""));
      }
    }
    /**
     * Count value's character 
     * Update counter 
     */

  }, {
    key: "getCounter",
    value: function getCounter() {
      return this.stringValue.length;
    }

    /**
     * Check if value is empty
     * @return boolean
     */

  }, {
    key: "isEmpty",
    value: function isEmpty() {
      return this.stringValue === "";
    }

    /**
     * Check if string is includes in value
     * @return boolean
     */

  }, {
    key: "has",
    value: function has(str) {
      if ((0, _Lodash.isString)(val) && !this.isEmpty()) {
        return this.stringValue.includes(str);
      } else {
        return false;
      }
    }

    /**
     * Transform value to LowerCase
     */

  }, {
    key: "toLower",
    value: function toLower() {
      if (!this.isEmpty()) {
        this.stringValue = this.stringValue.toLowerCase();
      }
    }

    /**
     * Transform value to LowerCase
     */

  }, {
    key: "toUpper",
    value: function toUpper() {
      if (!this.isEmpty()) {
        this.stringValue = this.stringValue.toUpperCase();
      }
    }

    /**
     * Transform value to Uppercase
     */

  }, {
    key: "toCapital",
    value: function toCapital() {
      if (!this.isEmpty()) {
        var str = this.stringValue;
        this.stringValue = "" + str.charAt(0).toUpperCase() + str.slice(1);
      }
    }

    /**
     * Transform value to Slug
     */

  }, {
    key: "toSlug",
    value: function toSlug() {
      var sep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "-";

      this.stringValue = (0, _Slugify2.default)(this.stringValue, sep);
    }

    /**
     * Transform value to WFApiName
     */

  }, {
    key: "toName",
    value: function toName() {
      this.stringValue = (0, _Namify2.default)(this.stringValue);
    }

    /**
     * Transform to HTML
     */

  }, {
    key: "toHtml",
    value: function toHtml() {
      return this.stringValue.replace(/\n/g, "<br/>");
    }

    /**
     * Transform to HTML
     */

  }, {
    key: "fromHtml",
    value: function fromHtml(htmlVal) {
      if (htmlVal) {
        var _val = htmlVal.replace(/\<br\>/g, '\n');
        _val = _val.replace(/\<br\/\>/g, '\n');
        this.set(_val);
      }
    }

    /**
     * Limit value's character
     */

  }, {
    key: "toMax",
    value: function toMax() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _args$limit = args.limit,
          limit = _args$limit === undefined ? 20 : _args$limit,
          _args$sufix = args.sufix,
          sufix = _args$sufix === undefined ? "" : _args$sufix;

      this.stringValue = (0, _MaxStr2.default)(this.stringValue, limit, sufix);
      /*
      if (limit > 1) {
        this.stringValue = maxStr(this.stringValue, limit, sufix); 
      }
      */
    }

    /**
     * Call transform method
     * Apply transform method
     * return value in next param
     */

  }, {
    key: "transform",
    value: function transform(methodName) {
      var _this2 = this;

      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var callBacks = {
        "toCapital": function toCapital() {
          return _this2.toCapital();
        },
        "toLower": function toLower() {
          return _this2.toLower();
        },
        "toUpper": function toUpper() {
          return _this2.toUpper();
        },
        "toSlug": function toSlug() {
          return _this2.toSlug();
        },
        "toName": function toName() {
          return _this2.toName();
        },
        "toHtml": function toHtml() {
          return _this2.toHtml();
        }
      };
      if (!this.isEmpty() && callBacks.hasOwnProperty(methodName)) {
        var callBack = callBacks[methodName];
        callBack();
        if ((0, _Lodash.isFunction)(next)) {
          next(this.stringValue, this.htmlValue);
        }
      }
    }

    /**
     * Show current value in console
     */

  }, {
    key: "toConsole",
    value: function toConsole() {
      console.log("");
      console.warn("WFString");
      console.log("counter =>", this.counter.get());
      console.log("value =>", this.stringValue);
      console.log("");
    }
  }], [{
    key: "instanceOf",
    value: function instanceOf(obj) {
      return obj instanceof WFString;
    }
  }]);
  return WFString;
}(_WFType3.default);
// ------------------- //


exports.default = WFString;
// ------------------- //

/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS TYPE MANAGER ------------------- //

// ------------------- //

var WFType = function () {
  function WFType(valueKey) {
    (0, _classCallCheck3.default)(this, WFType);

    this.key = valueKey;
    this.input = null;
  }

  /**
   * Get this.key
   * @return string
   */


  (0, _createClass3.default)(WFType, [{
    key: "getKey",
    value: function getKey() {
      return this.key;
    }

    /**
     * Forward call
     * @param evenType string 
     * @param args object params
     */

  }, {
    key: "on",
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      if (this.input) {
        this.input.on(evenType, eventArgs, ctx);
      }
    }

    /**
     * Set Input 
     * @param input
     */

  }, {
    key: "setInput",
    value: function setInput(input) {
      if (!this.input) {
        this.input = input;
      }
    }
  }]);
  return WFType;
}();

// ------------------- //


exports.default = WFType;
// ------------------- //

/***/ }),
/* 87 */,
/* 88 */,
/* 89 */,
/* 90 */,
/* 91 */,
/* 92 */,
/* 93 */,
/* 94 */,
/* 95 */,
/* 96 */,
/* 97 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BTN GROUP ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-btn-group"
};

// ------------------- //

var WFBtnGroup = function (_Component) {
	(0, _inherits3.default)(WFBtnGroup, _Component);

	function WFBtnGroup() {
		(0, _classCallCheck3.default)(this, WFBtnGroup);
		return (0, _possibleConstructorReturn3.default)(this, (WFBtnGroup.__proto__ || (0, _getPrototypeOf2.default)(WFBtnGroup)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFBtnGroup, [{
		key: "render",


		// ------------------- //

		value: function render() {
			var _props = this.props,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    _props$schema = _props.schema,
			    schema = _props$schema === undefined ? [] : _props$schema,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? false : _props$visible;

			if (!visible || schema.length === 0) return false;
			return _react2.default.createElement(
				"span",
				{ className: classes.wrapper + " " + className },
				this.getBtns(schema)
			);
		}

		// ------------------- //

	}, {
		key: "getBtns",
		value: function getBtns(buttons) {
			var _this2 = this;

			return buttons.map(function (button, i) {
				var _button$icon = button.icon,
				    icon = _button$icon === undefined ? "" : _button$icon,
				    _button$label = button.label,
				    label = _button$label === undefined ? "" : _button$label,
				    _button$className = button.className,
				    className = _button$className === undefined ? "" : _button$className,
				    _button$onClick = button.onClick,
				    onClick = _button$onClick === undefined ? null : _button$onClick;
				var _props2 = _this2.props,
				    _props2$counter = _props2.counter,
				    counter = _props2$counter === undefined ? 0 : _props2$counter,
				    _props2$counterMax = _props2.counterMax,
				    counterMax = _props2$counterMax === undefined ? 0 : _props2$counterMax;

				return _react2.default.createElement(
					_WFBtn2.default,
					{
						key: i,
						visible: !_this2.isHidden(button),
						className: className + " " + _this2.getBtnState(button),
						onClick: onClick,
						icon: icon,
						counter: counter,
						counterMax: counterMax
					},
					label
				);
			});
		}

		// ------------------- //

	}, {
		key: "getBtnState",
		value: function getBtnState(btn) {
			var _props3 = this.props,
			    _props3$selected = _props3.selected,
			    selected = _props3$selected === undefined ? [] : _props3$selected,
			    _props3$selectedBy = _props3.selectedBy,
			    selectedBy = _props3$selectedBy === undefined ? "id" : _props3$selectedBy,
			    _props3$selectedClass = _props3.selectedClassName,
			    selectedClassName = _props3$selectedClass === undefined ? "selected" : _props3$selectedClass;

			return selected.includes(btn[selectedBy]) ? selectedClassName : "";
		}

		// ------------------- //

	}, {
		key: "isHidden",
		value: function isHidden(btn) {
			var _props4 = this.props,
			    _props4$hidden = _props4.hidden,
			    hidden = _props4$hidden === undefined ? [] : _props4$hidden,
			    _props4$hiddenBy = _props4.hiddenBy,
			    hiddenBy = _props4$hiddenBy === undefined ? "id" : _props4$hiddenBy;

			return hidden.includes(btn[hiddenBy]);
		}
	}]);
	return WFBtnGroup;
}(_react.Component);

// ------------------- //

exports.default = WFBtnGroup;

// ------------------- //

/*

	<WFBtnGroup
		visible={true}
		selected={["Studio"]}
		selectedBy={"label"}
		selectedClassName={"selected"}
		schema={[
			{label:"Setting", icon:"adjustments", onClick:null },
			{label:"Studio", icon:"tools", onClick:null },
			{label:"Save", icon:"global",onClick:null },
		]}
	/>


	<WFBtnGroup
		visible={true}
		hidden={[]}
		hiddenBy={"label"}
		schema={[
			{label:"Delete", icon:"close", onClick:null, className:`wf-btn-red` },
			{label:"Cancel", icon:"close", onClick:null, className:`wf-btn-orange` },
			{label:"Save", icon:"check",onClick:null, className:`wf-btn-green` },
			{label:"Publish", icon:"loop",onClick:null, className:`wf-btn-blue` },
		]}
	/>

*/

/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classe = "clearfix";

// ------------------- //

var WFClear = function (_Component) {
    (0, _inherits3.default)(WFClear, _Component);

    function WFClear() {
        (0, _classCallCheck3.default)(this, WFClear);
        return (0, _possibleConstructorReturn3.default)(this, (WFClear.__proto__ || (0, _getPrototypeOf2.default)(WFClear)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFClear, [{
        key: "render",
        value: function render() {
            return _react2.default.createElement("div", { className: classe });
        }
    }]);
    return WFClear;
}(_react.Component);

// ------------------- //

exports.default = WFClear;

// ------------------- //

/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _ClipLoader = __webpack_require__(571);

var _ClipLoader2 = _interopRequireDefault(_ClipLoader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF LOADER ------------------- //

// ------------------- //

var WFLoader = function (_Component) {
    (0, _inherits3.default)(WFLoader, _Component);

    function WFLoader() {
        (0, _classCallCheck3.default)(this, WFLoader);
        return (0, _possibleConstructorReturn3.default)(this, (WFLoader.__proto__ || (0, _getPrototypeOf2.default)(WFLoader)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFLoader, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                _props$active = _props.active,
                active = _props$active === undefined ? true : _props$active,
                _props$color = _props.color,
                color = _props$color === undefined ? "#9AFF68" : _props$color,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className,
                _props$children = _props.children,
                children = _props$children === undefined ? null : _props$children;

            if (!active && children) return children;
            return _react2.default.createElement(
                'wf-loader',
                null,
                _react2.default.createElement(_ClipLoader2.default, { color: color, className: className })
            );
        }
    }]);
    return WFLoader;
}(_react.Component);

// ------------------- //

exports.default = WFLoader;

// ------------------- //

/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactPager = __webpack_require__(780);

var _reactPager2 = _interopRequireDefault(_reactPager);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF PAGINATION ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-pager"
};

// ------------------- //

var WFPagination = function (_Component) {
	(0, _inherits3.default)(WFPagination, _Component);

	function WFPagination() {
		(0, _classCallCheck3.default)(this, WFPagination);
		return (0, _possibleConstructorReturn3.default)(this, (WFPagination.__proto__ || (0, _getPrototypeOf2.default)(WFPagination)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFPagination, [{
		key: "render",
		value: function render() {
			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible,
			    _props$className = _props.className,
			    className = _props$className === undefined ? "" : _props$className,
			    onClick = _props.onClick;

			if (!visible) return false;
			return _react2.default.createElement(
				"wf-pagination",
				null,
				_react2.default.createElement(
					"div",
					{ className: classes.wrapper + " " + className },
					_react2.default.createElement(_reactPager2.default, (0, _extends3.default)({
						total: 11,
						current: 7,
						visiblePages: 8,
						titles: {
							first: 'First',
							prev: "\xAB",
							prevSet: '...',
							nextSet: '...',
							next: "\xBB",
							last: 'Last'
						},
						onPageChanged: function onPageChanged(newPage) {
							return onClick(newPage + 1);
						}
					}, this.props))
				)
			);
		}
	}]);
	return WFPagination;
}(_react.Component);

// ------------------- //

exports.default = WFPagination;

// ------------------- //

/*

	<WFPagination
		visible={true}
		total={20}
		current={1}
		visiblePages={8}
		onPageChanged={(newPage) => console.log('onPageChanged:', newPage)}
		titles={{
			first:   'First',
			prev:    '\u00AB',
			prevSet: '...',
			nextSet: '...',
			next:    '\u00BB',
			last:    'Last'
		}}
	/>

*/

/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var classes = {

  disabled: "wf-disabled",

  wrapper: {

    top: "wf-top",
    down: "wf-down",
    toggle: "wf-toggle-btn",
    search: "wf-search",

    selectionArchive: "wf-selection-archive",
    selectionOption: "wf-selection-option",

    optionArchive: "wf-option-archive",
    optionOption: "wf-option-option",
    optionNotFound: "wf-option-not-found"
  },

  scrollbar: {

    selectionArchive: "wf-selection-archive-scrollbar",
    optionArchive: "wf-option-archive-scrollbar"
  },

  state: {
    active: "wf-active",
    open: "wf-is-open",
    close: "wf-is-close",
    unfold: "wf-is-unfold",
    checked: "wf-checked",
    unchecked: "wf-unchecked"
  }
};

exports.default = classes;

/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFSchemaValidator = __webpack_require__(440);

var _WFSchemaValidator2 = _interopRequireDefault(_WFSchemaValidator);

var _WFSchemaCondition = __webpack_require__(439);

var _WFSchemaCondition2 = _interopRequireDefault(_WFSchemaCondition);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS FIELD VIEW ------------------- //

// ------------------- //

var defaultState = {
  valid: null,
  errors: [],
  labelBy: "label", // for select/select2
  hasCounter: false
};

var WFieldView = function () {
  /**
   * Constructor
   * this.field given formField should only use to set the field value
   * this.name is the fieldName
   * this.component is the react component input
   * this.isInit true if the component is ready
   * this.initialState is the component initial state 
   * this.schema is instance of WFSchemaValidator
   * this.condition is instance of WFSchemaValidator
   * this.observer is set by the WFSchemaCondition
   * @param value instance of WFString
   */
  function WFieldView(value) {
    var _this = this;

    (0, _classCallCheck3.default)(this, WFieldView);

    this.name = null;
    this.field = null;
    this.value = value;

    this.initialState = {};
    this.observer = {};
    this.format = null;
    this.schema = null;
    this.condition = null;
    this.isInit = false;
    this.isFocused = false;
    this.viewMrg = new _WFViewMgr2.default();

    // debouce event change method is focused
    this.itReady = (0, _Lodash.debounce)(function () {
      _this.ready(_WFEventTypes.WF_EVENT_ONCHANGE);
    }, 200);
    // debouce validate method is focused
    this.itValidated = (0, _Lodash.debounce)(function () {
      _this.validate();
    }, 500);
  }

  /**
   * Call method by Eventype
   * @param evenType string 
   * @param args object params
   */


  (0, _createClass3.default)(WFieldView, [{
    key: 'on',
    value: function on(evenType) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      var eventArgs = args.eventArgs;


      switch (evenType) {

        case _WFEventTypes.WF_EVENT_ONCUSTOM:
          if ((0, _Lodash.isFunction)(eventArgs)) {
            eventArgs(this);
          }
          break;

        case _WFEventTypes.WF_EVENT_ONINIT:
          this.init(args);
          break;

        case _WFEventTypes.WF_EVENT_ONCHANGE:
          this.change(args);
          break;

        case _WFEventTypes.WF_EVENT_ONREADY:
          this.ready(args);
          break;

        case _WFEventTypes.WF_EVENT_ONVALIDATE:
          this.validate(args);
          break;

        case _WFEventTypes.WF_EVENT_ONBLUR:
          this.blur();
          break;

        case _WFEventTypes.WF_EVENT_ONFOCUS:
          this.focus();
          break;

        case _WFEventTypes.WF_EVENT_ONCLEAR:
          this.clear();
          break;

        case _WFEventTypes.WF_EVENT_ONREFRESH:
          this.setState(args);
          break;

        case _WFEventTypes.WF_EVENT_ONWILLMOUNT:
          this.viewMrg.willMount(eventArgs);
          this.ready(_WFEventTypes.WF_EVENT_ONWILLMOUNT);
          break;

        case _WFEventTypes.WF_EVENT_ONDIDMOUNT:
          if (this.isInit && this.field.hasValue()) {
            var prevValue = this.value.get();
            if (!(0, _Lodash.isNull)(prevValue)) {
              this.change({ eventArgs: (0, _defineProperty3.default)({}, this.value.getKey(), prevValue) });
            }
          }
          this.ready(_WFEventTypes.WF_EVENT_ONDIDMOUNT);
          break;

        case _WFEventTypes.WF_EVENT_ONWILLUNMOUNT:
          this.viewMrg.willUnMount(eventArgs);
          //this.isInit = false;
          this.ready(_WFEventTypes.WF_EVENT_ONWILLUNMOUNT);
          break;
      }
    }

    // MANAGE INSTANCE ---------------- //

    /**
     * When the component initialize
     * Set it in this.component
     * @param component React Component 
     */

  }, {
    key: 'init',
    value: function init(args) {
      var field = args.field,
          name = args.name,
          _args$schema = args.schema,
          schema = _args$schema === undefined ? {} : _args$schema,
          _args$eventArgs = args.eventArgs,
          eventArgs = _args$eventArgs === undefined ? {} : _args$eventArgs;
      var _schema$data = schema.data,
          data = _schema$data === undefined ? [] : _schema$data,
          _schema$required = schema.required,
          required = _schema$required === undefined ? false : _schema$required,
          _schema$condition = schema.condition,
          condition = _schema$condition === undefined ? false : _schema$condition,
          _schema$transformable = schema.transformable,
          transformable = _schema$transformable === undefined ? false : _schema$transformable,
          _schema$transform = schema.transform,
          transform = _schema$transform === undefined ? "" : _schema$transform;

      this.setState((0, _assign2.default)(this.initialState, defaultState));
      if (!this.isInit) {
        this.name = name;
        this.field = field;
        var validationSchema = field.getValidationSchema();
        if ((0, _keys2.default)(validationSchema).length > 0) {
          this.setSchema(validationSchema);
        } else {
          var dfSchema = _WFSchemaValidator2.default.getDefaultSchema(this.value.getKey(), null, schema);
          this.setSchema(dfSchema);
        }
        if (condition) {
          this.setCondition(condition);
        }
        if (transformable && transform) {
          this.format = transform;
        }
        this.isInit = true;
      }
    }

    /**
     * Set this observer
     */

  }, {
    key: 'setObserver',
    value: function setObserver(observer) {
      this.observer = observer;
    }

    /**
     * Call ready when the event is completed
     * if is observed share this state
     */

  }, {
    key: 'ready',
    value: function ready(eventType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      //WFConsole.val(`${this.name} is ready`, eventType);
      if (this.observer) {
        var args = eventArgs;
        if (args === null) {
          args = this;
        }
        this.observer.call(eventType, args);
      }
    }

    /**
     * When the component'value change
     * Update the component state and the model
     */

  }, {
    key: 'change',
    value: function change(args) {
      var _args$eventArgs2 = args.eventArgs,
          eventArgs = _args$eventArgs2 === undefined ? {} : _args$eventArgs2;

      //WFConsole.val(`change(${this.name})`, eventArgs);

      if (this.field) {
        var key = this.value.getKey();
        var val = eventArgs[key];
        var hasAttrs = (0, _keys2.default)(eventArgs).length > 1;
        this.setState((0, _defineProperty3.default)({}, key, val));
        if (!hasAttrs) {
          this.fieldChange(val);
        } else {
          this.fieldChange((0, _assign2.default)((0, _defineProperty3.default)({}, _WFValueTypes.WF_VALUE_KEY, key), eventArgs));
        }
        this.setCounter(true);
        // fixe select2 validator
        if (key === _WFValueTypes.WF_SELECT_VALUE && !val) {
          if (this.field.getRequired()) {
            var _viewMrg$getState = this.viewMrg.getState(),
                _viewMrg$getState$arr = _viewMrg$getState.arrayValue,
                arrayValue = _viewMrg$getState$arr === undefined ? [] : _viewMrg$getState$arr;

            if (arrayValue.length > 0 && (0, _Lodash.isUndefined)(val)) {
              this.validate(true, true);
            }
          }
          return;
        }
        if (this.isFocused) {
          this.itReady();
          this.itValidated();
        } else {
          this.ready(_WFEventTypes.WF_EVENT_ONCHANGE);
          this.validate();
        }
      }
    }

    /**
     * Set this field value
     */

  }, {
    key: 'fieldChange',
    value: function fieldChange(args) {
      if (this.field) {
        this.field.setValue(args);
      }
    }

    // MANAGE STATE ---------------- //

    /**
     * Update the state
     * @param args object
     */

  }, {
    key: 'setState',
    value: function setState(args) {
      this.viewMrg.setState(args);
    }

    /**
     * Get the state
     * @param args object
     */

  }, {
    key: 'getState',
    value: function getState() {
      var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var state = this.viewMrg.getState();
      if (key) {
        if (state.hasOwnProperty(key)) {
          return state[key];
        } else {
          return defaultValue;
        }
      } else {
        return state;
      }
    }

    // MANAGE VALUE ---------------- //

    /**
     * Clear field value
     */

  }, {
    key: 'clear',
    value: function clear() {
      if (this.field) {
        this.field.clearValue();
      }
    }

    /**
     * Validate this value
     */

  }, {
    key: 'validate',
    value: function validate() {
      var displayErr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
      var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;


      // WFConsole.val(`validate`, this.name);
      // WFConsole.val(`force`, force);
      // WFConsole.val(`isRequired`, this.field.getRequired());

      if (force) {
        this.ready(_WFEventTypes.WF_EVENT_ONVALIDATE, true);
      } else if (this.schema && this.isInit) {
        var value = null;
        var valid = false;
        var errors = [];
        if (this.value.getKey() === _WFValueTypes.WF_SELECT_VALUE) {
          value = this.value.getValue();
        } else {
          value = this.value.get();
        }
        var res = this.schema.validate(value);
        if (!res.hasErr()) {
          valid = true;
        } else {
          valid = false;
          if (displayErr) {
            errors = res.getErrMsg();
          }
        }
        if (this.field.getRequired()) {
          this.setState({
            valid: valid,
            errors: errors
          });
          this.ready(_WFEventTypes.WF_EVENT_ONVALIDATE, valid);
        } else {
          var isValid = valid;
          if (!valid) {
            if ((0, _Lodash.isArray)(value) && value.length === 0 || (0, _Lodash.isObject)(value) && (0, _keys2.default)(value).length === 0 || (0, _Lodash.isNumber)(value) && value === 0 || (0, _Lodash.isBoolean)(value) && value === false || (0, _Lodash.isString)(value) && value === "" || !value) {
              isValid = null;
              errors = [];
            }
          }
          this.setState({
            valid: isValid === null ? null : isValid,
            errors: errors
          });
          this.ready(_WFEventTypes.WF_EVENT_ONVALIDATE, isValid === null ? true : isValid);
        }
      }
    }

    // MANAGE COMPONENT ---------------- //

    /**
     * When the component is focused
     */

  }, {
    key: 'focus',
    value: function focus() {

      //WFConsole.info(this.name, `focus isEditing`)

      this.isFocused = true;
      this.setState({
        errors: [],
        focused: true
      });
    }

    /**
     * When the component is not focused
     */

  }, {
    key: 'blur',
    value: function blur() {
      var _this2 = this;

      //WFConsole.info(this.name, `blur isPublished`)

      this.isFocused = false;
      var key = this.value.getKey();
      this.setState({
        focused: false
      });
      if (this.schema) {
        var maxLength = this.schema.get('maxLength');
        if (maxLength) {
          this.value.toMax({
            limit: maxLength
          });
        }
      }
      if (!this.format) {
        this.change({
          eventArgs: (0, _defineProperty3.default)({}, key, this.value.get())
        });
      } else {
        this.value.transform(this.format, function () {
          _this2.change({
            eventArgs: (0, _defineProperty3.default)({}, _this2.value.getKey(), _this2.value.get())
          });
        });
      }
      this.setState({
        errors: []
      });
    }

    /**
     * Create Condition
     */

  }, {
    key: 'setCondition',
    value: function setCondition(condition) {
      this.condition = new _WFSchemaCondition2.default(condition);
      window.condition = this.condition;
    }

    /**
     * Create Schema Validator 
     */

  }, {
    key: 'setSchema',
    value: function setSchema(validationSchema) {
      this.schema = new _WFSchemaValidator2.default(validationSchema);
      this.setCounter(validationSchema);
    }

    /**
     * Set the data
     */

  }, {
    key: 'setData',
    value: function setData() {
      var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      this.setState({ data: data });
    }

    /**
     * Set the component counter
     */

  }, {
    key: 'setCounter',
    value: function setCounter() {
      var validationSchema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var counter = 0;
      if (this.value && (0, _Lodash.isFunction)(this.value.getCounter)) {
        counter = this.value.getCounter();
      }
      if (this.isInit) {
        this.setState({ counter: counter });
      } else {
        var _validationSchema$max = validationSchema.maxLength,
            maxLength = _validationSchema$max === undefined ? 0 : _validationSchema$max,
            _validationSchema$min = validationSchema.minLength,
            minLength = _validationSchema$min === undefined ? 0 : _validationSchema$min,
            _validationSchema$max2 = validationSchema.maxItems,
            maxItems = _validationSchema$max2 === undefined ? null : _validationSchema$max2,
            _validationSchema$min2 = validationSchema.minItems,
            minItems = _validationSchema$min2 === undefined ? null : _validationSchema$min2;

        var max = maxLength;
        var min = minLength;
        if (maxItems) {
          max = maxItems;
        }
        if (minItems) {
          min = minItems;
        }
        this.setState({
          hasCounter: true,
          maxLength: max,
          minLength: min,
          counter: counter
        });
      }
    }

    /**
     * Check if field is valid
     * @return boolean || null
     */

  }, {
    key: 'isValid',
    value: function isValid() {
      return this.getState('valid');
    }
  }]);
  return WFieldView;
}();

// ------------------- //


exports.default = WFieldView;
// ------------------- //

/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS NUMBER ------------------- //

// ------------------- //

var WFNumber = function (_WFType) {
  (0, _inherits3.default)(WFNumber, _WFType);

  /**
   * Constructor
   */
  function WFNumber() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFNumber);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFNumber.__proto__ || (0, _getPrototypeOf2.default)(WFNumber)).call(this, _WFValueTypes.WF_NUMBER_VALUE));

    var _config$isFloat = config.isFloat,
        isFloat = _config$isFloat === undefined ? false : _config$isFloat,
        _config$value = config.value,
        value = _config$value === undefined ? null : _config$value;

    _this.isFloat = isFloat;
    _this.numberValue = null;
    _this.stringValue = "";
    if (value) {
      _this.set(value);
    }
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFNumber, [{
    key: 'get',


    /**
     * Get value
     * @return number if !null else return ""
     */
    value: function get() {
      return this.toHumanFormat(this.numberValue);
    }

    /**
     * Set value 
     * if decimal call setFloat(value)
     * else integer call setInt(value)
     * @param val is number || string
     */

  }, {
    key: 'set',
    value: function set(val) {
      if (this.isFloat) {
        this.setFloat(val);
      } else {
        this.setInt(val);
      }
    }

    /**
     * clear value
     */

  }, {
    key: 'clear',
    value: function clear() {
      this.numberValue = null;
      if (this.input) {
        this.input.setState((0, _defineProperty3.default)({}, this.getKey(), this.get()));
      }
    }

    /**
     * Format and Set value to integer
     * @param val is number || string
     */

  }, {
    key: 'setInt',
    value: function setInt(val) {
      var n = null;
      if ((0, _Lodash.isString)(val) && val !== "") {
        n = val.replace(/[^\d]/g, '');
        //n = parseInt(val.match(/\d+/)[0]);
      } else {
        n = val;
      }
      this.numberValue = parseInt(n);
    }

    /**
     * Format and Set value to float
     * @param val is number || string
     */

  }, {
    key: 'setFloat',
    value: function setFloat(val) {
      var regex = /[+-]?\d+(\.\d+)?/g;
      var num = val === "" ? '' : val.toString().replace(",", ".").match(regex).map(function (v) {
        return parseFloat(v);
      });
      this.numberValue = num.length > 0 ? num[0] : 0;
    }
    // .toFixed(6).replace(/\.?0*$/,'')
    // .replace(",", ".")

    /**
     * Increment n and can return new value
     * @param val is number
     * @param getResult is boolean
     * @return value
     */

  }, {
    key: 'incr',
    value: function incr() {
      var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
      var getResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      var val = this.get();
      val = parseFloat(val + n);
      this.set(val);
      if (getResult) {
        return this.get();
      }
    }

    /**
     * Decrement n and can return new value
     * @param val is number
     * @param getResult is boolean
     * @return value
     */

  }, {
    key: 'decr',
    value: function decr() {
      var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
      var getResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      var val = this.get();
      if (n) {
        if (n > 0) {
          val = parseFloat(val > 0 ? val - n : 0);
        } else {
          val = parseFloat(val > 0 ? val + n : 0);
        }
      } else {
        val = parseFloat(val > 0 ? --val : 0);
      }
      this.set(val);
      if (getResult) {
        return this.get();
      }
    }

    /**
     * Check if n is null
     * @return boolean
     */

  }, {
    key: 'isNull',
    value: function isNull() {
      return this.get() === "";
    }

    /**
     * Check if n === value
     * @param n is number || string
     * @return boolean
     */

  }, {
    key: 'isEqal',
    value: function isEqal(n) {
      var val = this.get();
      return val === parseFloat(n) || val === 0;
    }

    /**
     * Create UniqId value
     * @return value
     */

  }, {
    key: 'toUniqId',
    value: function toUniqId() {
      return this.numberValue = (0, _Lodash.now)();
    }

    /**
     * Clean current value 
     * @param n is number || null
     * @return number or ""
     */

  }, {
    key: 'toHumanFormat',
    value: function toHumanFormat(n) {
      if (n === 0) {
        return 0;
      } else if (!n || n === null) {
        return "";
      } else if (this.isFloat) {
        return n.toFixed(2);
      } else {
        return n;
      }
    }

    /**
     * Create Devise Format and cache in string value
     * @param config is Optional {devise="€",position="after"}
     */

  }, {
    key: 'toDevise',
    value: function toDevise() {
      var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _config$devise = config.devise,
          devise = _config$devise === undefined ? "$" : _config$devise,
          _config$position = config.position,
          position = _config$position === undefined ? "before" : _config$position;

      var currentValue = this.get();
      var nextValue = position === "before" ? '' + devise + currentValue.toFixed(2) : '' + currentValue.toFixed(2) + devise;
      this.stringValue = nextValue;
    }

    /**
     * Create String Value before text ans value
     * @param before => string before value
     * @param after => string after value
     */

  }, {
    key: 'toWrap',
    value: function toWrap() {
      var before = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var after = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
      var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      this.stringValue = before + ' ' + (value ? value : this.get()) + ' ' + after;
    }

    /**
     * Show current value in console
     */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFNumber');
      console.log('value =>', this.numberValue);
      if (this.stringValue !== "") {
        console.log('string =>', this.stringValue);
      }
      console.log("");
    }
  }], [{
    key: 'instanceOf',
    value: function instanceOf(obj) {
      return obj instanceof WFNumber;
    }
  }]);
  return WFNumber;
}(_WFType3.default);
// ------------------- //


exports.default = WFNumber;
// ------------------- //

/***/ }),
/* 104 */,
/* 105 */,
/* 106 */,
/* 107 */,
/* 108 */,
/* 109 */,
/* 110 */,
/* 111 */,
/* 112 */,
/* 113 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BODY ------------------- //

// ------------------- //

var WFBody = function (_Component) {
  (0, _inherits3.default)(WFBody, _Component);

  function WFBody() {
    (0, _classCallCheck3.default)(this, WFBody);
    return (0, _possibleConstructorReturn3.default)(this, (WFBody.__proto__ || (0, _getPrototypeOf2.default)(WFBody)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFBody, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          _props$height = _props.height,
          height = _props$height === undefined ? 0 : _props$height,
          _props$visible = _props.visible,
          visible = _props$visible === undefined ? false : _props$visible,
          _props$autoHeight = _props.autoHeight,
          autoHeight = _props$autoHeight === undefined ? false : _props$autoHeight;

      if (!visible) {
        return false;
      } else {
        if (autoHeight) {
          return _react2.default.createElement(
            "wf-body",
            null,
            _react2.default.createElement(
              _WFScrollBars2.default,
              {
                autoHeight: true,
                style: {
                  width: "100%"
                } },
              this.props.children
            )
          );
        } else {
          return _react2.default.createElement(
            "wf-body",
            null,
            _react2.default.createElement(
              _WFScrollBars2.default,
              {
                style: {
                  width: "100%",
                  height: height
                } },
              this.props.children
            )
          );
        }
      }
    }
  }]);
  return WFBody;
}(_react.Component);

// ------------------- //

exports.default = WFBody;

// ------------------- //

/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFIcon = __webpack_require__(8);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
	text: "wf-section-title-text",
	iconInput: "wf-input-icon",
	icon: {
		active: "search2",
		unactive: "close",
		open: "menu"
	}
};

var textSearchBy = "search by";

// ------------------- //

var WFSectionSearch = function (_Component) {
	(0, _inherits3.default)(WFSectionSearch, _Component);

	function WFSectionSearch(props) {
		(0, _classCallCheck3.default)(this, WFSectionSearch);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFSectionSearch.__proto__ || (0, _getPrototypeOf2.default)(WFSectionSearch)).call(this, props));

		_this.state = {
			active: false,
			open: false,
			value: "",
			selected: "",
			current: 0
		};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(WFSectionSearch, [{
		key: "render",
		value: function render() {
			var _props = this.props,
			    _props$placeholder = _props.placeholder,
			    placeholder = _props$placeholder === undefined ? "search" : _props$placeholder,
			    _props$filters = _props.filters,
			    filters = _props$filters === undefined ? [] : _props$filters,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible;
			var _state = this.state,
			    value = _state.value,
			    selected = _state.selected,
			    current = _state.current;


			if (!visible) return false;

			var isActive = this.isActive();
			var isOpen = this.isOpen();
			var hasFilters = this.hasFilters();

			return _react2.default.createElement(
				"wf-search",
				null,
				_react2.default.createElement(
					"span",
					{ className: "wf--input " + (hasFilters ? "toggle" : "") + " " + (!isActive ? "not" : "active") },
					_react2.default.createElement(_WFIcon.WFIcon, {
						className: classes.iconInput,
						icon: !isActive ? classes.icon.active : classes.icon.unactive,
						onClick: this.toggle.bind(this) }),
					_react2.default.createElement("input", {
						type: "text",
						value: this.state.value,
						placeholder: selected === "" ? placeholder : textSearchBy + " " + filters[current],
						onChange: this.onChange.bind(this),
						className: "wf-input" }),
					hasFilters ? this.getFiltersButton(isOpen) : ""
				),
				isOpen && hasFilters ? this.getFilters(isOpen, filters, selected) : ""
			);
		}

		// ------------------- //

	}, {
		key: "getFiltersButton",
		value: function getFiltersButton(isOpen) {
			return _react2.default.createElement(
				"span",
				{ className: "wf--toggle" },
				_react2.default.createElement(_WFBtn2.default, {
					className: "wf-btn-dark-yellow " + (isOpen ? "active" : ""),
					icon: !isOpen ? classes.icon.open : classes.icon.unactive,
					onClick: this.toggleFilters.bind(this) })
			);
		}

		// ------------------- //

	}, {
		key: "getFilters",
		value: function getFilters(isOpen, filters, selected) {
			var _this2 = this;

			return _react2.default.createElement(
				"span",
				{ className: "wf--filters" },
				_react2.default.createElement(
					"wf-list",
					null,
					_react2.default.createElement(
						"ul",
						{ className: "search-filters" },
						filters.map(function (filter, i) {
							return _react2.default.createElement(
								"li",
								{ key: i,
									className: "item " + (_this2.isSelected(i) ? "selected" : ""),
									onClick: _this2.selectFilter.bind(_this2, filter, i)
								},
								_react2.default.createElement(
									"span",
									{ className: "item-text" },
									filter
								)
							);
						})
					)
				)
			);
		}

		// ------------------- //

	}, {
		key: "hasFilters",
		value: function hasFilters() {
			var _props$filters2 = this.props.filters,
			    filters = _props$filters2 === undefined ? [] : _props$filters2;

			return filters.length > 0;
		}

		// ------------------- //

	}, {
		key: "isActive",
		value: function isActive() {
			return this.state.active;
		}

		// ------------------- //

	}, {
		key: "isOpen",
		value: function isOpen() {
			return this.state.open;
		}

		// ------------------- //

	}, {
		key: "isSelected",
		value: function isSelected(index) {
			return this.state.current === index;
		}

		// ------------------- //

	}, {
		key: "onChange",
		value: function onChange(e) {
			var _props$filters3 = this.props.filters,
			    filters = _props$filters3 === undefined ? [] : _props$filters3;
			var current = this.state.current;

			var nVal = e.target.value || "";
			this.setState({
				value: nVal
			});
			this.props.onSearch(nVal, filters[current]);
		}

		// ------------------- //

	}, {
		key: "toggle",
		value: function toggle() {
			var _state2 = this.state,
			    active = _state2.active,
			    open = _state2.open;

			if (open) {
				this.toggleFilters();
			}
			if (active) {
				this.setState({
					value: ""
				});
				this.props.onSearch("");
			}
			this.setState({
				active: !this.state.active
			});
		}

		// ------------------- //

	}, {
		key: "toggleFilters",
		value: function toggleFilters() {
			this.setState({
				open: !this.state.open
			});
		}

		// ------------------- //

	}, {
		key: "selectFilter",
		value: function selectFilter(filter, index) {
			if (this.isSelected(index)) {
				this.setState({
					selected: "",
					current: null
				});
				this.props.onFilter(null);
			} else {
				this.setState({
					selected: filter,
					current: index
				});
				this.props.onFilter(filter);
			}
			this.toggleFilters();
		}
	}]);
	return WFSectionSearch;
}(_react.Component);

// ------------------- //

exports.default = WFSectionSearch;

// ------------------- //

/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SIDEBAR ------------------- //

// ------------------- //

var WFSidebar = function (_Component) {
  (0, _inherits3.default)(WFSidebar, _Component);

  function WFSidebar() {
    (0, _classCallCheck3.default)(this, WFSidebar);
    return (0, _possibleConstructorReturn3.default)(this, (WFSidebar.__proto__ || (0, _getPrototypeOf2.default)(WFSidebar)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFSidebar, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          _props$visible = _props.visible,
          visible = _props$visible === undefined ? false : _props$visible,
          _props$height = _props.height,
          height = _props$height === undefined ? null : _props$height;

      if (!visible) {
        return false;
      } else {
        if (height) {
          return _react2.default.createElement(
            "wf-sidebar",
            null,
            _react2.default.createElement(
              _WFScrollBars2.default,
              {
                style: {
                  width: "100%",
                  height: height
                } },
              this.props.children
            )
          );
        } else {
          return _react2.default.createElement(
            "wf-sidebar",
            null,
            _react2.default.createElement(
              _WFScrollBars2.default,
              null,
              this.props.children
            )
          );
        }
      }
    }
  }]);
  return WFSidebar;
}(_react.Component);

// ------------------- //

exports.default = WFSidebar;

// ------------------- //

/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactSortable = __webpack_require__(315);

var _Lodash = __webpack_require__(6);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFTab = __webpack_require__(151);

var _WFTab2 = _interopRequireDefault(_WFTab);

var _WFIcon = __webpack_require__(8);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TABS ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-items",
	nav: "wf-tab",
	navContent: "wf--content",
	navCreate: "add",
	navDelete: "delete",
	navSortable: "sortable",
	navLarge: "lg",
	navEdit: "edit",
	navConfig: "config"
};

// ------------------- //

// ------------------- //

var WFListItem = function (_Component) {
	(0, _inherits3.default)(WFListItem, _Component);

	function WFListItem(props) {
		(0, _classCallCheck3.default)(this, WFListItem);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFListItem.__proto__ || (0, _getPrototypeOf2.default)(WFListItem)).call(this, props));

		_this.displayName = 'SortableListItem';
		return _this;
	}

	(0, _createClass3.default)(WFListItem, [{
		key: 'render',
		value: function render() {
			return _react2.default.createElement(
				'div',
				(0, _extends3.default)({
					id: 'wf-item-' + this.props.sortId,
					className: 'wf-item-sortable'
				}, this.props),
				this.props.children
			);
		}
	}]);
	return WFListItem;
}(_react.Component);
// ------------------- //

var WFSortableListItem = (0, _reactSortable.sortable)(WFListItem);

// ------------------- //

var WFTabs = function (_Component2) {
	(0, _inherits3.default)(WFTabs, _Component2);

	function WFTabs(props) {
		(0, _classCallCheck3.default)(this, WFTabs);

		var _this2 = (0, _possibleConstructorReturn3.default)(this, (WFTabs.__proto__ || (0, _getPrototypeOf2.default)(WFTabs)).call(this, props));

		var _props$data = props.data,
		    data = _props$data === undefined ? [] : _props$data,
		    _props$selected = props.selected,
		    selected = _props$selected === undefined ? [] : _props$selected,
		    _props$schema = props.schema,
		    schema = _props$schema === undefined ? [] : _props$schema,
		    _props$tabId = props.tabId,
		    tabId = _props$tabId === undefined ? null : _props$tabId;

		_this2.state = {
			tabId: tabId,
			selected: selected,
			schema: schema,
			data: data,
			draggingIndex: null
		};
		return _this2;
	}

	// ------------------- //

	(0, _createClass3.default)(WFTabs, [{
		key: 'render',
		value: function render() {
			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? false : _props$visible,
			    _props$edit = _props.edit,
			    edit = _props$edit === undefined ? false : _props$edit;
			var _state$schema = this.state.schema,
			    schema = _state$schema === undefined ? [] : _state$schema;

			if (!visible || !edit && schema.length < 2) {
				return false;
			}
			return _react2.default.createElement(
				'wf-tabs',
				null,
				_react2.default.createElement(
					'div',
					{ className: classes.wrapper + ' ' + (edit ? "add control" : "") },
					_react2.default.createElement(
						_WFScrollBars2.default,
						{
							style: { width: "100%", height: 48 },
							renderTrackHorizontal: function renderTrackHorizontal(props) {
								return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'track-horizontal' }));
							},
							renderThumbHorizontal: function renderThumbHorizontal(props) {
								return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'thumb-horizontal' }));
							},
							renderTrackVertical: function renderTrackVertical(props) {
								return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'track-vertical' }));
							},
							renderThumbVertical: function renderThumbVertical(props) {
								return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'thumb-vertical' }));
							}
						},
						this.getNavs(schema),
						this.getCreateButton()
					)
				),
				this.getControl(),
				this.getSortableTabs(schema)
			);
		}
	}, {
		key: 'getSortableTabs',
		value: function getSortableTabs(tabs) {
			var _this3 = this;

			var _props2 = this.props,
			    onReOrder = _props2.onReOrder,
			    _props2$sortable = _props2.sortable,
			    sortable = _props2$sortable === undefined ? false : _props2$sortable;

			if (!sortable) {
				return false;
			} else {
				var _state = this.state,
				    data = _state.data,
				    draggingIndex = _state.draggingIndex;

				return _react2.default.createElement(
					'div',
					{ className: 'wf--sortable-list' },
					tabs.map(function (tab, i) {
						var className = "wf--sortable";
						if (_this3.isSelected(tab)) {
							className += " wf--active";
						}
						return _react2.default.createElement(
							WFSortableListItem,
							{
								key: tab.id,
								sortId: i,
								outline: 'list',
								items: data.items,
								childProps: { className: className },
								draggingIndex: draggingIndex,
								updateState: function updateState(obj) {
									_this3.setState(obj);
									console.error("SORTABLE");
									console.dir(obj);

									if (obj.hasOwnProperty("items")) {
										onReOrder(obj.items);
									}
								} },
							i + 1
						);
					})
				);
			}
		}

		// ------------------- //

	}, {
		key: 'getNavs',
		value: function getNavs(tabs) {
			var _this4 = this;

			var _props3 = this.props,
			    _props3$edit = _props3.edit,
			    edit = _props3$edit === undefined ? false : _props3$edit,
			    _props3$editLabel = _props3.editLabel,
			    editLabel = _props3$editLabel === undefined ? "" : _props3$editLabel;

			return edit ? tabs.map(function (tab, i) {
				return _this4.getNavEditable(tab, i);
			}) : tabs.map(function (tab, i) {
				return _this4.getNav(tab, i);
			});
		}

		// ------------------- //

	}, {
		key: 'getNav',
		value: function getNav(tab, i) {
			var _this5 = this;

			var _props4 = this.props,
			    onSelect = _props4.onSelect,
			    _props4$labelBy = _props4.labelBy,
			    labelBy = _props4$labelBy === undefined ? "label" : _props4$labelBy;
			var _tab$label = tab.label,
			    label = _tab$label === undefined ? "" : _tab$label,
			    _tab$id = tab.id,
			    id = _tab$id === undefined ? "" : _tab$id;

			return _react2.default.createElement(
				'div',
				{
					key: i,
					className: classes.nav,
					onClick: function onClick() {
						return onSelect(tab, _this5);
					} },
				_react2.default.createElement(
					'span',
					{
						className: classes.navContent + ' ' + classes.navLarge + ' ' + this.getTabState(tab)
					},
					tab[labelBy]
				)
			);
		}

		// ------------------- //

	}, {
		key: 'getNavEditable',
		value: function getNavEditable(tab, i) {
			var _this6 = this;

			var _state$schema2 = this.state.schema,
			    schema = _state$schema2 === undefined ? [] : _state$schema2;
			var _props5 = this.props,
			    _props5$editLabel = _props5.editLabel,
			    editLabel = _props5$editLabel === undefined ? "" : _props5$editLabel,
			    onSelect = _props5.onSelect,
			    onDelete = _props5.onDelete,
			    _props5$sortable = _props5.sortable,
			    sortable = _props5$sortable === undefined ? false : _props5$sortable;
			var _tab$label2 = tab.label,
			    label = _tab$label2 === undefined ? "" : _tab$label2,
			    _tab$id2 = tab.id,
			    id = _tab$id2 === undefined ? "" : _tab$id2;

			var isSelected = this.isSelected(tab);
			var config = {};
			if (!isSelected) {
				config.onClick = function () {
					return onSelect(tab, _this6);
				};
			}
			if (tab.hasOwnProperty("id")) {
				config.key = tab.id;
			} else {
				config.key = i;
			}
			return _react2.default.createElement(
				'div',
				(0, _extends3.default)({
					className: classes.nav
				}, config),
				_react2.default.createElement(
					'span',
					{ className: '\n\t\t\t\t\t' + classes.navContent + ' \n\t\t\t\t\t' + classes.navContent + '-' + i + ' \n\t\t\t\t\t' + classes.navEdit + ' \n\t\t\t\t\t' + this.getTabState(tab) + '\n\t\t\t\t' },
					i > 0 && schema.length > 9 && !isSelected ? "" : editLabel || label,
					' ',
					_react2.default.createElement(
						'strong',
						null,
						i + 1
					),
					_react2.default.createElement(_WFIcon.WFIcon, {
						icon: i !== 0 ? "close" : "",
						className: classes.navDelete,
						onClick: function onClick() {
							return onDelete(tab);
						}
					})
				)
			);

			if (!sortable) {} else {
				// todo charly just test sortable dont use...
				var _state2 = this.state,
				    data = _state2.data,
				    draggingIndex = _state2.draggingIndex;
				var onReOrder = this.props.onReOrder;

				var childProps = { className: classes.nav };
				config.key = tab.id;
				return _react2.default.createElement(
					WFSortableListItem,
					(0, _extends3.default)({
						items: data.items,
						sortId: i,
						outline: 'list',
						childProps: childProps,
						draggingIndex: draggingIndex,
						updateState: function updateState(obj) {
							_this6.setState(obj);

							console.error("SORTABLE");
							console.dir(obj);

							if (obj.hasOwnProperty("items")) {
								onReOrder(obj.items);
							}
						} }, config),
					_react2.default.createElement(
						'span',
						{ className: classes.navContent + ' ' + classes.navContent + '-' + i + ' ' + classes.navEdit + ' ' + this.getTabState(tab) },
						_react2.default.createElement(_WFIcon.WFIcon, {
							icon: i !== 0 ? "cog" : "",
							className: classes.navSortable,
							onClick: function onClick() {
								return console.error("navSortable ready...");
							}
						}),
						i > 0 && schema.length > 9 && !isSelected ? "" : editLabel || label,
						' ',
						_react2.default.createElement(
							'strong',
							null,
							i + 1
						),
						_react2.default.createElement(_WFIcon.WFIcon, {
							icon: i !== 0 ? "close" : "",
							className: classes.navDelete,
							onClick: function onClick() {
								return onDelete(tab);
							}
						})
					)
				);
			}
		}

		// ------------------- //
		/*
  getRowState (row) {
  	const { className="" } = row;
  	const { 
  		selectedBy="id", 
  		selectedClassName="selected", 
  		selectableClassName="selectable",
  		rowsClassName=""
  	} = this.props;
  	return `${className} ${rowsClassName} ${this.isSelectable(row) 
  		? selectableClassName :""} ${this.isSelected(row) 
  			? selectedClassName :"" }`;
  }
  */

		// ------------------- //

	}, {
		key: 'getControl',
		value: function getControl() {
			var _state$schema3 = this.state.schema,
			    schema = _state$schema3 === undefined ? [] : _state$schema3;
			var _props6 = this.props,
			    _props6$control = _props6.control,
			    control = _props6$control === undefined ? false : _props6$control,
			    onPrev = _props6.onPrev,
			    onNext = _props6.onNext;

			if (!control || schema.length < 2) {
				return false;
			} else {
				return _react2.default.createElement(
					'wf-control-tabs',
					null,
					_react2.default.createElement(
						'wf-prev-tab',
						{
							onClick: function onClick() {
								return onPrev();
							}
						},
						_react2.default.createElement(_WFIcon.WFIPrev, null)
					),
					_react2.default.createElement(
						'wf-next-tab',
						{
							onClick: function onClick() {
								return onNext();
							}
						},
						_react2.default.createElement(_WFIcon.WFINext, null)
					)
				);
			}
		}

		// ------------------- //

	}, {
		key: 'getCreateButton',
		value: function getCreateButton() {
			var _props7 = this.props,
			    _props7$edit = _props7.edit,
			    edit = _props7$edit === undefined ? false : _props7$edit,
			    onCreate = _props7.onCreate;

			if (!edit) return false;
			return _react2.default.createElement(
				'div',
				{
					onClick: function onClick() {
						return onCreate();
					},
					className: 'wf-add-tab', key: 9 },
				_react2.default.createElement(
					'span',
					null,
					'A'
				),
				_react2.default.createElement(_WFIcon.WFIAdd, { className: classes.navCreate })
			);
		}

		// ------------------- //

	}, {
		key: 'isSelected',
		value: function isSelected(tab) {
			var selected = this.state.selected;
			var _props$selectedBy = this.props.selectedBy,
			    selectedBy = _props$selectedBy === undefined ? _Constants.SELECT_BY_ID : _props$selectedBy;

			return selected.includes(tab[selectedBy]);
		}

		// ------------------- //

	}, {
		key: 'getTabState',
		value: function getTabState(tab) {
			var _props$selectedClassN = this.props.selectedClassName,
			    selectedClassName = _props$selectedClassN === undefined ? _Constants.SELECT_CLASS : _props$selectedClassN;

			return this.isSelected(tab) ? selectedClassName : "";
		}

		// ------------------- //


		// COMPONENT LIFECYCLE ------------------- //


		// ------------------- //

	}, {
		key: 'componentWillReceiveProps',
		value: function componentWillReceiveProps(nextProps) {
			if (nextProps.tabId !== this.state.tabId) {
				this.setState(nextProps);
			}
		}
	}]);
	return WFTabs;
}(_react.Component);

// ------------------- //

exports.default = WFTabs;

// ------------------- //

/*
	<WFTabs
		ref={(c) => this.tabs = c}
		visible={true}
		view={true}
		labelBy={"label"}
		editable={false}
		selected={[0]}
		selectedBy={"id"}
		selectedClassName={"selected"}
		onSelect={(item) => {  
			console.log("hello world", item )
		}}
		schema={[
			{id:0,label:"All Forms"},
			{id:1,label:"Create Form"},
			{id:2,label:"Baobab" },
			{id:3,label:"Setting" },
			{id:4,label:"License"}
		]}
	/>

	<WFTabs
		ref={(c) => this.tabs = c}
		visible={true}
		view={true}
		edit={true}
		control={true}
		editLabel={"Step"}
		selected={[0]}
		selectedBy={"id"}
		selectedClassName={"selected"}
		onPrev={() => {
			console.log("onPrev..." )
		}}
		onNext={() => {
			console.log("onNext..." )
		}}
		onSelect={(item) => {  
			console.log("onSelect : ", item )
		}}
		onCreate={() => {
			console.log("onCreate..." )
		}}
		onDelete={(item) => {
			console.log("onDelete : ", item )
		}}
		schema={[
			{id:0,label:"All Forms"},
			{id:1,label:"Create Form"},
			{id:2,label:"Baobab" },
			{id:3,label:"Setting" },
			{id:4,label:"License"},
		]}
	/>

*/

/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WFInputUrl = exports.WFInputTel = exports.WFInputEmail = exports.WFInputPassword = exports.WFInputText = undefined;

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- // 
// WF INPUT STRING ------------------- //
// ------------------- //

var WFInputString = function (_Component) {
  (0, _inherits3.default)(WFInputString, _Component);

  function WFInputString() {
    (0, _classCallCheck3.default)(this, WFInputString);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputString.__proto__ || (0, _getPrototypeOf2.default)(WFInputString)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputString, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$type = _props.type,
          type = _props$type === undefined ? _WFInputTypes.INPUT_TEXT : _props$type,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "" : _props$placeholder,
          _props$inputClass = _props.inputClass,
          inputClass = _props$inputClass === undefined ? "" : _props$inputClass,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? null : _props$valid,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$displayStateCp = _props.displayStateCpt,
          displayStateCpt = _props$displayStateCp === undefined ? true : _props$displayStateCp;

      var t = type;
      if (t === "string" || !t) {
        t = _WFInputTypes.INPUT_TEXT;
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            "span",
            { className: _WFCss2.default.text + " " + WFInputString.getStatus(_this2, value) },
            _react2.default.createElement("input", {
              type: t,
              readOnly: disabled,
              className: _this2.getWrapperClass(t),
              placeholder: placeholder,
              onFocus: function onFocus() {
                return on(_WFEventTypes.WF_EVENT_ONFOCUS);
              },
              onBlur: function onBlur() {
                return on(_WFEventTypes.WF_EVENT_ONBLUR);
              },
              onChange: function onChange(e) {
                return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, e.target.value));
              },
              value: !disabled ? value : ""
            }),
            _react2.default.createElement(_WFIcon.WFIState, {
              visible: displayStateCpt,
              valid: valid
            })
          );
        }
      }));
    }
  }, {
    key: "getWrapperClass",
    value: function getWrapperClass(type) {
      var _props2 = this.props,
          name = _props2.name,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$valid = _props2.valid,
          valid = _props2$valid === undefined ? null : _props2$valid,
          _props2$inputClass = _props2.inputClass,
          inputClass = _props2$inputClass === undefined ? "" : _props2$inputClass;

      var clss = "" + _WFCss2.default.input + type;
      if (inputClass) {
        clss += " " + inputClass;
      }
      if (disabled) {
        clss += " " + _WFCss2.default.disabled;
      }
      clss += " input_" + name;
      return clss;
    }
  }], [{
    key: "getStatus",
    value: function getStatus(input) {
      var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
      var valid = input.props.valid;

      if (valid === false) {
        return _WFCss2.default.hasError;
      } else if (valid === true || value !== "") {
        return _WFCss2.default.isValid;
      }
    }
  }]);
  return WFInputString;
}(_react.Component);

// ------------------- //
// WF INPUT TEXT ------------------- //
// ------------------- //


var WFInputText = function (_Component2) {
  (0, _inherits3.default)(WFInputText, _Component2);

  function WFInputText() {
    (0, _classCallCheck3.default)(this, WFInputText);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputText.__proto__ || (0, _getPrototypeOf2.default)(WFInputText)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputText, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(WFInputString, (0, _extends3.default)({}, this.props, {
        type: _WFInputTypes.INPUT_TEXT
      }));
    }
  }]);
  return WFInputText;
}(_react.Component);

// ------------------- //
// WF INPUT PASSWORD ------------------- //
// ------------------- //


var WFInputPassword = function (_Component3) {
  (0, _inherits3.default)(WFInputPassword, _Component3);

  function WFInputPassword() {
    (0, _classCallCheck3.default)(this, WFInputPassword);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputPassword.__proto__ || (0, _getPrototypeOf2.default)(WFInputPassword)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputPassword, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(WFInputString, (0, _extends3.default)({}, this.props, {
        type: _WFInputTypes.INPUT_PASSWORD
      }));
    }
  }]);
  return WFInputPassword;
}(_react.Component);

// ------------------- //
// WF INPUT EMAIL ------------------- //
// ------------------- //


var WFInputEmail = function (_Component4) {
  (0, _inherits3.default)(WFInputEmail, _Component4);

  function WFInputEmail() {
    (0, _classCallCheck3.default)(this, WFInputEmail);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputEmail.__proto__ || (0, _getPrototypeOf2.default)(WFInputEmail)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputEmail, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(WFInputString, (0, _extends3.default)({}, this.props, {
        type: _WFInputTypes.INPUT_EMAIL
      }));
    }
  }]);
  return WFInputEmail;
}(_react.Component);

// ------------------- //
// WF INPUT TEL ------------------- //
// ------------------- //


var WFInputTel = function (_Component5) {
  (0, _inherits3.default)(WFInputTel, _Component5);

  function WFInputTel() {
    (0, _classCallCheck3.default)(this, WFInputTel);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputTel.__proto__ || (0, _getPrototypeOf2.default)(WFInputTel)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputTel, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(WFInputString, (0, _extends3.default)({}, this.props, {
        type: _WFInputTypes.INPUT_TEL
      }));
    }
  }]);
  return WFInputTel;
}(_react.Component);

// ------------------- //
// WF INPUT URL ------------------- //
// ------------------- //


var WFInputUrl = function (_Component6) {
  (0, _inherits3.default)(WFInputUrl, _Component6);

  function WFInputUrl() {
    (0, _classCallCheck3.default)(this, WFInputUrl);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputUrl.__proto__ || (0, _getPrototypeOf2.default)(WFInputUrl)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputUrl, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(WFInputString, (0, _extends3.default)({}, this.props, {
        type: _WFInputTypes.INPUT_URL
      }));
    }
  }]);
  return WFInputUrl;
}(_react.Component);

// ------------------- //


exports.default = WFInputString;
exports.WFInputText = WFInputText;
exports.WFInputPassword = WFInputPassword;
exports.WFInputEmail = WFInputEmail;
exports.WFInputTel = WFInputTel;
exports.WFInputUrl = WFInputUrl;
// ------------------- //

/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isSameDay = isSameDay;
exports.isSameUtcOffset = isSameUtcOffset;
exports.isDayInRange = isDayInRange;
exports.isDayDisabled = isDayDisabled;
exports.allDaysDisabledBefore = allDaysDisabledBefore;
exports.allDaysDisabledAfter = allDaysDisabledAfter;
exports.getEffectiveMinDate = getEffectiveMinDate;
exports.getEffectiveMaxDate = getEffectiveMaxDate;

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function isSameDay(moment1, moment2) {
  if (moment1 && moment2) {
    return moment1.isSame(moment2, 'day');
  } else {
    return !moment1 && !moment2;
  }
}

function isSameUtcOffset(moment1, moment2) {
  if (moment1 && moment2) {
    return moment1.utcOffset() === moment2.utcOffset();
  } else {
    return !moment1 && !moment2;
  }
}

function isDayInRange(day, startDate, endDate) {
  var before = startDate.clone().startOf('day').subtract(1, 'seconds');
  var after = endDate.clone().startOf('day').add(1, 'seconds');
  return day.clone().startOf('day').isBetween(before, after);
}

function isDayDisabled(day) {
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
      minDate = _ref.minDate,
      maxDate = _ref.maxDate,
      excludeDates = _ref.excludeDates,
      includeDates = _ref.includeDates,
      filterDate = _ref.filterDate;

  return minDate && day.isBefore(minDate, 'day') || maxDate && day.isAfter(maxDate, 'day') || excludeDates && excludeDates.some(function (excludeDate) {
    return isSameDay(day, excludeDate);
  }) || includeDates && !includeDates.some(function (includeDate) {
    return isSameDay(day, includeDate);
  }) || filterDate && !filterDate(day.clone()) || false;
}

function allDaysDisabledBefore(day, unit) {
  var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
      minDate = _ref2.minDate,
      includeDates = _ref2.includeDates;

  var dateBefore = day.clone().subtract(1, unit);
  return minDate && dateBefore.isBefore(minDate, unit) || includeDates && includeDates.every(function (includeDate) {
    return dateBefore.isBefore(includeDate, unit);
  }) || false;
}

function allDaysDisabledAfter(day, unit) {
  var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
      maxDate = _ref3.maxDate,
      includeDates = _ref3.includeDates;

  var dateAfter = day.clone().add(1, unit);
  return maxDate && dateAfter.isAfter(maxDate, unit) || includeDates && includeDates.every(function (includeDate) {
    return dateAfter.isAfter(includeDate, unit);
  }) || false;
}

function getEffectiveMinDate(_ref4) {
  var minDate = _ref4.minDate,
      includeDates = _ref4.includeDates;

  if (includeDates && minDate) {
    return _WFMoment2.default.min(includeDates.filter(function (includeDate) {
      return minDate.isSameOrBefore(includeDate, 'day');
    }));
  } else if (includeDates) {
    return _WFMoment2.default.min(includeDates);
  } else {
    return minDate;
  }
}

function getEffectiveMaxDate(_ref5) {
  var maxDate = _ref5.maxDate,
      includeDates = _ref5.includeDates;

  if (includeDates && maxDate) {
    return _WFMoment2.default.max(includeDates.filter(function (includeDate) {
      return maxDate.isSameOrAfter(includeDate, 'day');
    }));
  } else if (includeDates) {
    return _WFMoment2.default.max(includeDates);
  } else {
    return maxDate;
  }
}

/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _WFMassUpdater = __webpack_require__(254);

var _WFMassUpdater2 = _interopRequireDefault(_WFMassUpdater);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _WFProductType = __webpack_require__(15);

var _StrToArr = __webpack_require__(262);

var _StrToArr2 = _interopRequireDefault(_StrToArr);

var _Slugify = __webpack_require__(169);

var _Slugify2 = _interopRequireDefault(_Slugify);

var _MaxStr = __webpack_require__(123);

var _MaxStr2 = _interopRequireDefault(_MaxStr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF BAOBAB CLIENT ------------------- //
// ------------------- //
var WFBaobabClient = function () {
  function WFBaobabClient() {
    (0, _classCallCheck3.default)(this, WFBaobabClient);
  }

  (0, _createClass3.default)(WFBaobabClient, null, [{
    key: "createFormView",

    /**
     * Create formView
     * @param formState
     * @return formView
     **/
    value: function createFormView(formState) {
      var formView = new _WFormView2.default(formState, true);
      return formView;
    }

    /**
     * Create optionGroupState
     * @return WFormState
     **/

  }, {
    key: "createOptionGroup",
    value: function createOptionGroup() {
      var optionGroupConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var optionGroupState = _WFormStateFactory2.default.create(_WFProductType.WF_CORE_OPTION_GROUP_ID);
      optionGroupState.setValues(optionGroupConfig);
      return optionGroupState;
    }

    /**
     * Create optionState
     * @return WFormState
     **/

  }, {
    key: "createOption",
    value: function createOption(optionConfig) {
      var optionState = _WFormStateFactory2.default.create(_WFProductType.WF_CORE_OPTION_ID);
      optionState.setValues(optionConfig);
      return optionState;
    }

    /**
     * Create mass options/optiongroups updater
     * @return WFMassUpdater
     **/

  }, {
    key: "createOptionMassUpdater",
    value: function createOptionMassUpdater() {
      var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'option';

      if (type === 'option-group') {
        var massUpdater = new _WFMassUpdater2.default({
          name: 'option-group',
          type: _WFProductType.WF_CORE_OPTION_GROUP_ID
        });
        return massUpdater;
      } else {
        var _massUpdater = new _WFMassUpdater2.default({
          name: 'option',
          type: _WFProductType.WF_CORE_OPTION_ID
        });
        return _massUpdater;
      }
    }

    // OPTION GROUP --------------- //

    /**
     * Before save
     * set fieldName
     * @return WFormState
     **/

  }, {
    key: "beforeSaveOptionGroup",
    value: function beforeSaveOptionGroup(optionGroupState) {
      var flds = optionGroupState.getFields();
      flds.name.setValue(flds.label.getValue());
      flds.name.getValueMgr().toSlug();
    }

    /**
     * Create optionGroupState
     * @return WFormState
     **/

  }, {
    key: "saveOptionGroup",
    value: function saveOptionGroup(optionGroupState, next) {
      var urlArgs = {
        isAppAdmin: true,
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };
      optionGroupState.save(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getSaveResponse(res);
        if (wfRes.getHasLogicErrors()) {
          next.onError(wfRes.getLogicErrors());
        } else {
          optionGroupState.setValues(wfRes.getResultset());
          next.onSuccess(wfRes.getResultset()[0]);
        }
      }).catch(function (error) {
        console.error(error);
      });
    }

    /**
     * Delete OptionGroup
     **/

  }, {
    key: "delOptionGroup",
    value: function delOptionGroup(optionGroupState, next) {

      var urlArgs = {
        isAppAdmin: true,
        formName: optionGroupState.getName(),
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };

      optionGroupState.del(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getDelResponse(res);
        if (wfRes.getHasLogicErrors()) {
          next.onError(wfRes.getLogicErrors());
        } else {
          next.onSuccess(wfRes.getResultset());
        }
      }).catch(function (error) {
        console.error(error);
      });
    }

    // OPTION --------------- //

    /**
     * Before save
     * @return WFormState
     **/

  }, {
    key: "beforeMassOptionSave",
    value: function beforeMassOptionSave(args) {
      var optionState = args.optionState,
          _args$type = args.type,
          type = _args$type === undefined ? "option" : _args$type,
          _args$map = args.map,
          map = _args$map === undefined ? null : _args$map,
          next = args.next;

      var flds = optionState.getFields();
      var str = flds.options.getValue();
      if (str !== "") {
        var opts = (0, _StrToArr2.default)(str);
        var optConfigs = opts.map(function (o) {
          return {
            label: o,
            name: (0, _Slugify2.default)((0, _MaxStr2.default)(o, 32))
          };
        });
        if (map) {
          optConfigs = optConfigs.map(map);
        }
        var massUpdater = WFBaobabClient.createOptionMassUpdater(type);
        optConfigs.forEach(function (o) {
          return massUpdater.push(o);
        });
        next(massUpdater);
      }
    }

    /**   
    * Save option in db. Create it if not exists
    * @param optionState
    * @param next
    **/

  }, {
    key: "saveOption",
    value: function saveOption(optionState, next) {
      var urlArgs = {
        isAppAdmin: true,
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };

      optionState.save(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getSaveResponse(res);
        if (wfRes.getHasLogicErrors()) {
          next.onError(wfRes.getLogicErrors());
        } else {
          optionState.setValues(wfRes.getResultset());
          next.onSuccess(wfRes.getResultset()[0]);
        }
      }).catch(function (error) {
        console.error(error);
      });
    }

    /**
     * Delete option
     **/

  }, {
    key: "delOption",
    value: function delOption(optionState, next) {

      var urlArgs = {
        isAppAdmin: true,
        formName: optionState.getName(),
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };

      optionState.del(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getDelResponse(res);
        if (wfRes.getHasLogicErrors()) {
          next.onError(wfRes.getLogicErrors());
        } else {
          next.onSuccess(wfRes.getResultset());
        }
      }).catch(function (error) {
        console.error(error);
      });
    }

    /**
     * Mass options save
     * @param massUpdater a given mass updater
     **/

  }, {
    key: "massOptionSave",
    value: function massOptionSave(massUpdater, next) {
      var urlArgs = {
        isAppAdmin: true,
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };

      massUpdater.execute(urlArgs, true).then(function (res) {
        //console.log('_____MASS_OPTIONS_SAVE______________');
        //console.error(res.resultset);
        var wfRes = _WFResponse2.default.getSaveResponse(res);
        next(wfRes.getResultset());
      }).catch(function (error) {
        console.error(error);
      });
    }

    /**
     * Mass options delete
     * @param massUpdater a given mass updater
     **/

  }, {
    key: "massOptionDel",
    value: function massOptionDel(massUpdater, next) {
      var urlArgs = {
        isAppAdmin: true,
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };

      massUpdater.execute(urlArgs, false).then(function (res) {
        //console.log('_____MASS_OPTIONS_DEL______________');
        //console.error(res.resultset);
        var wfRes = _WFResponse2.default.getDelResponse(res);
        next(wfRes.getResultset());
      }).catch(function (error) {
        console.error(error);
      });
    }
  }]);
  return WFBaobabClient;
}();

// ------------------- //


exports.default = WFBaobabClient;
// ------------------- //

/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFAnalyticsMgr = __webpack_require__(414);

var _WFAnalyticsMgr2 = _interopRequireDefault(_WFAnalyticsMgr);

var _WFAnalyticsViewMgr = __webpack_require__(241);

var _WFAnalyticsViewMgr2 = _interopRequireDefault(_WFAnalyticsViewMgr);

var _WFAnalyticsClientMgr = __webpack_require__(240);

var _WFAnalyticsClientMgr2 = _interopRequireDefault(_WFAnalyticsClientMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFAnalytics = {
  key: "WFAnalytics",
  mgr: _WFAnalyticsMgr2.default,
  viewMgr: _WFAnalyticsViewMgr2.default,
  clientMgr: _WFAnalyticsClientMgr2.default
};
// ------------------- //
exports.default = WFAnalytics;
// ------------------- //

window.WFAnalytics = WFAnalytics;

/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFSettingMgr = __webpack_require__(442);

var _WFSettingMgr2 = _interopRequireDefault(_WFSettingMgr);

var _WFSettingViewMgr = __webpack_require__(258);

var _WFSettingViewMgr2 = _interopRequireDefault(_WFSettingViewMgr);

var _WFSettingQueryMgr = __webpack_require__(166);

var _WFSettingQueryMgr2 = _interopRequireDefault(_WFSettingQueryMgr);

var _WFSettingClientMgr = __webpack_require__(257);

var _WFSettingClientMgr2 = _interopRequireDefault(_WFSettingClientMgr);

var _WFSettingFormStateMgr = __webpack_require__(165);

var _WFSettingFormStateMgr2 = _interopRequireDefault(_WFSettingFormStateMgr);

var _WFSettingResources = __webpack_require__(443);

var _WFSettingResources2 = _interopRequireDefault(_WFSettingResources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var WFSetting = {
  key: "WFSetting",
  mgr: _WFSettingMgr2.default,
  viewMgr: _WFSettingViewMgr2.default,
  queryMrg: _WFSettingQueryMgr2.default,
  clientMgr: _WFSettingClientMgr2.default,
  formStateMgr: _WFSettingFormStateMgr2.default,
  resources: _WFSettingResources2.default
};
// ------------------- //
exports.default = WFSetting;
// ------------------- //

/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var body = document.querySelector('body');

// BODY ---------------- //

// ------------------- //

var BodyToggleClass = exports.BodyToggleClass = function BodyToggleClass(clss) {
	body.classList.contains(clss) ? body.classList.remove(clss) : body.classList.add(clss);
},
    BodyAddClass = exports.BodyAddClass = function BodyAddClass(clss) {
	body.classList.add(clss);
},
    BodyRemoveClass = exports.BodyRemoveClass = function BodyRemoveClass(clss) {
	body.classList.remove(clss);
};
// ------------------- //

/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// SLUGIFY ---------------- //

exports.default = function () {
	var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
	var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
	var sufix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";

	return value && value.length > limit ? "" + value.toString().substring(0, limit) + sufix : value;
};

/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFTabs = __webpack_require__(116);

var _WFTabs2 = _interopRequireDefault(_WFTabs);

var _WFTab = __webpack_require__(151);

var _WFTab2 = _interopRequireDefault(_WFTab);

var _WFBody = __webpack_require__(113);

var _WFBody2 = _interopRequireDefault(_WFBody);

var _WFSidebar = __webpack_require__(115);

var _WFSidebar2 = _interopRequireDefault(_WFSidebar);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF MAILER FORM ------------------- //

// ------------------- //

var classes = {
  wrapper: "wf-custom-view",
  tabs: "wf-custom-view-tabs",
  sidebar: "wf-custom-view-sidebar"
};

// WFCOMPONENT

var WFCustomView = function (_Component) {
  (0, _inherits3.default)(WFCustomView, _Component);

  function WFCustomView(props) {
    (0, _classCallCheck3.default)(this, WFCustomView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFCustomView.__proto__ || (0, _getPrototypeOf2.default)(WFCustomView)).call(this, props));

    _this.displayName = "WFCustomView";
    var _props$defaultTab = props.defaultTab,
        defaultTab = _props$defaultTab === undefined ? 0 : _props$defaultTab;
    // State

    _this.state = {
      curentTab: defaultTab
    };
    return _this;
  }

  (0, _createClass3.default)(WFCustomView, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          _props$tabs = _props.tabs,
          tabs = _props$tabs === undefined ? [] : _props$tabs,
          _props$bodyView = _props.bodyView,
          bodyView = _props$bodyView === undefined ? null : _props$bodyView,
          _props$sidebarView = _props.sidebarView,
          sidebarView = _props$sidebarView === undefined ? null : _props$sidebarView,
          _props$sidebarVisible = _props.sidebarVisible,
          sidebarVisible = _props$sidebarVisible === undefined ? false : _props$sidebarVisible,
          _props$sidebarPositio = _props.sidebarPosition,
          sidebarPosition = _props$sidebarPositio === undefined ? "left" : _props$sidebarPositio;

      if (tabs.length === 0) {
        return this.getContent({
          bodyView: bodyView,
          sidebarView: sidebarView,
          sidebarVisible: sidebarVisible,
          sidebarPosition: sidebarPosition
        });
      } else {
        var curentTab = this.state.curentTab;

        return _react2.default.createElement(
          "div",
          { className: "" + classes.tabs },
          _react2.default.createElement(_WFTabs2.default, {
            ref: function ref(c) {
              return _this2.tabs = c;
            },
            visible: true,
            view: true,
            schema: tabs,
            labelBy: "label",
            editable: false,
            selected: [curentTab],
            selectedBy: "id",
            selectedClassName: "selected",
            onSelect: function onSelect(item) {
              _this2.setState({
                curentTab: item.id
              });
            }
          }),
          this.getTabContent()
        );
      }
    }
  }, {
    key: "getTabContent",
    value: function getTabContent() {
      var _this3 = this;

      var _props$tabs2 = this.props.tabs,
          tabs = _props$tabs2 === undefined ? [] : _props$tabs2;
      var curentTab = this.state.curentTab;

      return tabs.map(function (tab, i) {
        var visible = false;
        var _tab$viewConfig = tab.viewConfig,
            viewConfig = _tab$viewConfig === undefined ? {} : _tab$viewConfig;

        if ((0, _keys2.default)(viewConfig).length > 0 && curentTab === i) {
          visible = true;

          console.dir(viewConfig);
        }
        return _react2.default.createElement(
          _WFTab2.default,
          { key: i, visible: visible },
          _this3.getContent(viewConfig)
        );
      });
    }
  }, {
    key: "getContent",
    value: function getContent(config) {
      var _config$className = config.className,
          className = _config$className === undefined ? "" : _config$className,
          _config$bodyView = config.bodyView,
          bodyView = _config$bodyView === undefined ? null : _config$bodyView,
          _config$sidebarView = config.sidebarView,
          sidebarView = _config$sidebarView === undefined ? null : _config$sidebarView,
          _config$sidebarVisibl = config.sidebarVisible,
          sidebarVisible = _config$sidebarVisibl === undefined ? false : _config$sidebarVisibl,
          _config$sidebarPositi = config.sidebarPosition,
          sidebarPosition = _config$sidebarPositi === undefined ? "left" : _config$sidebarPositi;

      if (!sidebarVisible) {
        return _react2.default.createElement(
          "div",
          { className: classes.wrapper + " " + this.props.className + " " + className },
          _react2.default.createElement(
            _WFRow2.default,
            null,
            this.getBody(bodyView)
          )
        );
      } else {
        if (sidebarPosition === "left") {
          return _react2.default.createElement(
            "div",
            { className: classes.wrapper + " " + classes.sidebar + " " + this.props.className + " " + className },
            _react2.default.createElement(
              _WFRow2.default,
              null,
              this.getSidebar(sidebarView),
              this.getBody(bodyView)
            )
          );
        } else {
          return _react2.default.createElement(
            "div",
            { className: classes.wrapper + " " + classes.sidebar + " " + this.props.className + " " + className },
            _react2.default.createElement(
              _WFRow2.default,
              null,
              this.getBody(bodyView),
              this.getSidebar(sidebarView)
            )
          );
        }
      }
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var bodyView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      return _react2.default.createElement(
        _WFBody2.default,
        {
          visible: true,
          height: this.props.height
        },
        (0, _Lodash.isFunction)(bodyView) ? bodyView() : false
      );
    }
  }, {
    key: "getSidebar",
    value: function getSidebar() {
      var sidebarView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      return _react2.default.createElement(
        _WFSidebar2.default,
        {
          visible: true,
          height: this.props.height
        },
        (0, _Lodash.isFunction)(sidebarView) ? sidebarView() : false
      );
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {}
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {}
  }]);
  return WFCustomView;
}(_react.Component);

// ------------------- //


exports.default = WFCustomView;
// ------------------- //

/***/ }),
/* 125 */,
/* 126 */,
/* 127 */,
/* 128 */,
/* 129 */,
/* 130 */,
/* 131 */,
/* 132 */,
/* 133 */,
/* 134 */,
/* 135 */,
/* 136 */,
/* 137 */,
/* 138 */,
/* 139 */,
/* 140 */,
/* 141 */,
/* 142 */,
/* 143 */,
/* 144 */,
/* 145 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var isDev = false;
if (window.hasOwnProperty("__WF_DEV_ENVIRONMENT__")) {
  isDev = window.__WF_DEV_ENVIRONMENT__;
}

exports.default = isDev;

/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF CELL ICON ------------------- //

// ------------------- //

var WFCellColor = function (_Component) {
    (0, _inherits3.default)(WFCellColor, _Component);

    function WFCellColor() {
        (0, _classCallCheck3.default)(this, WFCellColor);
        return (0, _possibleConstructorReturn3.default)(this, (WFCellColor.__proto__ || (0, _getPrototypeOf2.default)(WFCellColor)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCellColor, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$color = _props.color,
                color = _props$color === undefined ? "" : _props$color,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible;

            if (!visible || !color || color === null || color === "") {
                return false;
            } else {
                return _react2.default.createElement(
                    "div",
                    { className: "wf--cell wf--cell-color" },
                    _react2.default.createElement("span", { className: "wf-e-color", style: { background: color } })
                );
            }
        }
    }]);
    return WFCellColor;
}(_react.Component);

// ------------------- //

exports.default = WFCellColor;

// ------------------- //

/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF CELL CONTENT ------------------- //

// ------------------- //

var WFCellContent = function (_Component) {
    (0, _inherits3.default)(WFCellContent, _Component);

    function WFCellContent() {
        (0, _classCallCheck3.default)(this, WFCellContent);
        return (0, _possibleConstructorReturn3.default)(this, (WFCellContent.__proto__ || (0, _getPrototypeOf2.default)(WFCellContent)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCellContent, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$label = _props.label,
                label = _props$label === undefined ? "" : _props$label,
                _props$legend = _props.legend,
                legend = _props$legend === undefined ? "" : _props$legend,
                _props$styles = _props.styles,
                styles = _props$styles === undefined ? {} : _props$styles,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible;

            if (!visible) {
                return false;
            } else {
                var _styles$optionLabel = styles.optionLabel,
                    optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
                    _styles$optionLegend = styles.optionLegend,
                    optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

                return _react2.default.createElement(
                    "div",
                    { className: "wf--cell wf--cell-content" },
                    _react2.default.createElement(
                        _WFText2.default,
                        { style: optionLabel, className: "wf-option-label" },
                        label
                    ),
                    _react2.default.createElement(
                        _WFText2.default,
                        { style: optionLegend, className: "wf-option-legend" },
                        legend
                    )
                );
            }
        }
    }]);
    return WFCellContent;
}(_react.Component);

// ------------------- //

exports.default = WFCellContent;

// ------------------- //

/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF CELL ICON ------------------- //

// ------------------- //

var WFCellIcon = function (_Component) {
    (0, _inherits3.default)(WFCellIcon, _Component);

    function WFCellIcon() {
        (0, _classCallCheck3.default)(this, WFCellIcon);
        return (0, _possibleConstructorReturn3.default)(this, (WFCellIcon.__proto__ || (0, _getPrototypeOf2.default)(WFCellIcon)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCellIcon, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$image = _props.image,
                image = _props$image === undefined ? "" : _props$image,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible;

            if (!visible || !image || image === null || image === "") {
                return false;
            } else {
                return _react2.default.createElement(
                    "div",
                    { className: "wf--cell wf--cell-icon" },
                    _react2.default.createElement(_WFImg2.default, { src: image })
                );
            }
        }
    }]);
    return WFCellIcon;
}(_react.Component);

// ------------------- //

exports.default = WFCellIcon;

// ------------------- //

/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF CELL IMG ------------------- //

// ------------------- //

var WFCellImg = function (_Component) {
    (0, _inherits3.default)(WFCellImg, _Component);

    function WFCellImg() {
        (0, _classCallCheck3.default)(this, WFCellImg);
        return (0, _possibleConstructorReturn3.default)(this, (WFCellImg.__proto__ || (0, _getPrototypeOf2.default)(WFCellImg)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCellImg, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$image = _props.image,
                image = _props$image === undefined ? "" : _props$image,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible;

            if (!visible || !image || image === null || image === "") {
                return false;
            } else {
                var h = "auto";
                if (style.hasOwnProperty('height')) {
                    h = style.height;
                }
                return _react2.default.createElement(
                    "div",
                    { className: "wf--cell wf--cell-img",
                        style: {
                            height: h
                        }
                    },
                    _react2.default.createElement(_WFImg2.default, { src: image, style: style })
                );
            }
        }
    }]);
    return WFCellImg;
}(_react.Component);

// ------------------- //

exports.default = WFCellImg;

// ------------------- //

/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF CELL STATE ------------------- //

// ------------------- //

var WFCellState = function (_Component) {
    (0, _inherits3.default)(WFCellState, _Component);

    function WFCellState() {
        (0, _classCallCheck3.default)(this, WFCellState);
        return (0, _possibleConstructorReturn3.default)(this, (WFCellState.__proto__ || (0, _getPrototypeOf2.default)(WFCellState)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFCellState, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$checked = _props.checked,
                checked = _props$checked === undefined ? false : _props$checked,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$hiddenNull = _props.hiddenNull,
                hiddenNull = _props$hiddenNull === undefined ? false : _props$hiddenNull;

            if (!visible) {
                return false;
            } else {
                var displayIcon = true;
                if (hiddenNull && checked === false) {
                    displayIcon = false;
                }
                return _react2.default.createElement(
                    "div",
                    { className: "wf--cell wf--cell-state" },
                    _react2.default.createElement(_WFIcon.WFICheck2, { visible: displayIcon, checked: checked })
                );
            }
        }
    }]);
    return WFCellState;
}(_react.Component);

// ------------------- //

exports.default = WFCellState;

// ------------------- //

/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TAB ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFTab = function (_Component) {
	(0, _inherits3.default)(WFTab, _Component);

	function WFTab() {
		(0, _classCallCheck3.default)(this, WFTab);
		return (0, _possibleConstructorReturn3.default)(this, (WFTab.__proto__ || (0, _getPrototypeOf2.default)(WFTab)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFTab, [{
		key: 'render',
		value: function render() {
			var _props$visible = this.props.visible,
			    visible = _props$visible === undefined ? false : _props$visible;

			if (!visible) return false;
			return _react2.default.createElement(
				'wf-tab',
				null,
				this.props.children
			);
		}
	}]);
	return WFTab;
}(_react.Component);

// ------------------- //

exports.default = WFTab;

// ------------------- //

/*
	
	<WFTabs visible={} id={'toto'}>
		...
	</WFTabs>

*/

/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Mobile = __webpack_require__(261);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CLASSIC = "classic";
var EXTRA = "extra";
var WFTHEME = "wf-wonderform-theme";

var WFormConditionHelper = function () {
  function WFormConditionHelper() {
    (0, _classCallCheck3.default)(this, WFormConditionHelper);
  }

  (0, _createClass3.default)(WFormConditionHelper, null, [{
    key: "fieldIsHidden",

    /**
     * Check field is hidden by name
     * @param wfCpt
     * @param fieldName string
     * @return boolean
     */
    value: function fieldIsHidden(wfCpt, fieldName) {
      var _wfCpt$state$fieldsHi = wfCpt.state.fieldsHidden,
          fieldsHidden = _wfCpt$state$fieldsHi === undefined ? [] : _wfCpt$state$fieldsHi;

      return fieldsHidden.includes(fieldName);
    }

    /**
     * Check field is disable by name
     * @param wfCpt
     * @param fieldName string
     * @return boolean
     */

  }, {
    key: "fieldIsDisable",
    value: function fieldIsDisable(wfCpt, fieldName) {
      var _wfCpt$state$fieldsDi = wfCpt.state.fieldsDisable,
          fieldsDisable = _wfCpt$state$fieldsDi === undefined ? [] : _wfCpt$state$fieldsDi;

      return fieldsDisable.includes(fieldName);
    }

    /**
     * Check step.type is extra
     * @param wfCpt
     * @return boolean
     */

  }, {
    key: "isExtraContent",
    value: function isExtraContent(wfCpt) {
      var _wfCpt$state = wfCpt.state,
          _wfCpt$state$hasTheme = _wfCpt$state.hasTheme,
          hasTheme = _wfCpt$state$hasTheme === undefined ? "" : _wfCpt$state$hasTheme,
          _wfCpt$state$currentS = _wfCpt$state.currentStepValue,
          currentStepValue = _wfCpt$state$currentS === undefined ? {} : _wfCpt$state$currentS;
      var _currentStepValue$typ = currentStepValue.type,
          type = _currentStepValue$typ === undefined ? CLASSIC : _currentStepValue$typ;

      if (hasTheme === WFTHEME) {
        if (type === EXTRA) {
          return true;
        } else {
          return false;
        }
      } else {
        return false;
      }
    }
  }]);
  return WFormConditionHelper;
}();

exports.default = WFormConditionHelper;

// WFormConditionHelper.isExtraContent(this)

/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
/**
 * API MODULE                        // ------------------- //
 */
var WF_PREFIX = exports.WF_PREFIX = __WF__.SLUG || "wf";
var WF_DOMAIN_URL = exports.WF_DOMAIN_URL = "http://www.wonderform.net";
var WF_ADMIN_MODULE_NAME = exports.WF_ADMIN_MODULE_NAME = 'wfc';
var WF_CUSTOM_MODULE_NAME = exports.WF_CUSTOM_MODULE_NAME = 'custom';
/**
 * CLIENT ACTIONS                    // ------------------- //
 */
var WF_CLIENT_FIND = exports.WF_CLIENT_FIND = 1;
var WF_CLIENT_FIND_BY = exports.WF_CLIENT_FIND_BY = 2;
var WF_CLIENT_FIND_BY_ID = exports.WF_CLIENT_FIND_BY_ID = 3;
var WF_CLIENT_VIEW = exports.WF_CLIENT_VIEW = 4;
var WF_CLIENT_SAVE = exports.WF_CLIENT_SAVE = 5;
var WF_CLIENT_DELETE = exports.WF_CLIENT_DELETE = 6;
var WF_CLIENT_PUBLISH = exports.WF_CLIENT_PUBLISH = 7;
var WF_CLIENT_UNPUBLISH = exports.WF_CLIENT_UNPUBLISH = 8;
var WF_CLIENT_EXPORT_CSV = exports.WF_CLIENT_EXPORT_CSV = 9;
var WF_CLIENT_IMPORT_CSV = exports.WF_CLIENT_IMPORT_CSV = 10;
var WF_CLIENT_CATEGORY_GROUP = exports.WF_CLIENT_CATEGORY_GROUP = 11;
var WF_CLIENT_CATEGORY_GROUP_LEAFS = exports.WF_CLIENT_CATEGORY_GROUP_LEAFS = 12;
var WF_CLIENT_CHECK_LICENSE = exports.WF_CLIENT_CHECK_LICENSE = 13;
var WF_CLIENT_FIND_ALL_CUSTOM_FORMS = exports.WF_CLIENT_FIND_ALL_CUSTOM_FORMS = 14;
var WF_CLIENT_FIND_FORMCONFIG_BY_ID = exports.WF_CLIENT_FIND_FORMCONFIG_BY_ID = 15;
var WF_CLIENT_FIND_FORMCONFIG_BY_NAME = exports.WF_CLIENT_FIND_FORMCONFIG_BY_NAME = 16;
var WF_CLIENT_FIND_OPTIONENTRY_BY_ID = exports.WF_CLIENT_FIND_OPTIONENTRY_BY_ID = 17;
var WF_CLIENT_FIND_OPTIONENTRIES = exports.WF_CLIENT_FIND_OPTIONENTRIES = 18;
var WF_CLIENT_DEL_OPTIONENTRY = exports.WF_CLIENT_DEL_OPTIONENTRY = 19;
var WF_CLIENT_OPTIONENTRY_INCR = exports.WF_CLIENT_OPTIONENTRY_INCR = 20;
var WF_CLIENT_OPTIONENTRY_SET = exports.WF_CLIENT_OPTIONENTRY_SET = 21;
var WF_CLIENT_FIND_FORMSTATS_BY_DATE = exports.WF_CLIENT_FIND_FORMSTATS_BY_DATE = 22;
var WF_CLIENT_FIND_FORMSTATS_BY_YEAR = exports.WF_CLIENT_FIND_FORMSTATS_BY_YEAR = 23;
var WF_CLIENT_FIND_FORMSTATS_BY_YEAR_MONTH = exports.WF_CLIENT_FIND_FORMSTATS_BY_YEAR_MONTH = 24;
var WF_CLIENT_FIND_FORMSTATS_BY_YEAR_WEEK = exports.WF_CLIENT_FIND_FORMSTATS_BY_YEAR_WEEK = 25;
var WF_CLIENT_FORMSTATS_INCR_VIEW_COUNT = exports.WF_CLIENT_FORMSTATS_INCR_VIEW_COUNT = 26;
var WF_CLIENT_FORMSTATS_INCR_COMPLETED_COUNT = exports.WF_CLIENT_FORMSTATS_INCR_COMPLETED_COUNT = 27;
var WF_CLIENT_FORMSTATS_INCR_UNCOMPLETED_COUNT = exports.WF_CLIENT_FORMSTATS_INCR_UNCOMPLETED_COUNT = 28;

/**
 * HEADER ACCEPT                     // ------------------- //
 */
var HEADER_ACCEPT_JSON = exports.HEADER_ACCEPT_JSON = 'application/json';
var HEADER_ACCEPT_FORM_DATA = exports.HEADER_ACCEPT_FORM_DATA = 'multipart/form-data';
/**
 * HTTP RESULT STATUS                // ------------------- //
 */
var STATUS_404 = exports.STATUS_404 = 404;
var STATUS_MAINTENANCE = exports.STATUS_MAINTENANCE = 403;
/**
 * QUERY STRING                      // ------------------- //
 */
var QUERY_SEARCH = exports.QUERY_SEARCH = "?";
var QUERY_ORDER_ASC = exports.QUERY_ORDER_ASC = "asc";
var QUERY_ORDER_DESC = exports.QUERY_ORDER_DESC = "desc";
var QUERY_PARAM_START = exports.QUERY_PARAM_START = "wf_start";
var QUERY_PARAM_LIMIT = exports.QUERY_PARAM_LIMIT = "wf_limit";
var QUERY_PARAM_SEARCH = exports.QUERY_PARAM_SEARCH = "search?";
var QUERY_PARAM_ORDER_BY = exports.QUERY_PARAM_ORDER_BY = "wf_orderby";
var QUERY_PARAM_ORDER_BY_DIRECTION = exports.QUERY_PARAM_ORDER_BY_DIRECTION = "wf_orderby_direction";
/**
 * API FORM                          // ------------------- //
 */
var WF_FORM = exports.WF_FORM = "form";
var WF_FORM_CONFIG = exports.WF_FORM_CONFIG = "form-config";
var WF_OPTION = exports.WF_OPTION = "option";
var WF_OPTION_GROUP = exports.WF_OPTION_GROUP = "option-group";

/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_CONFIG COLLECTION MANAGER ------------------- //

// ------------------- //

var WFConfigCollectionMgr = function () {
  var collection = new _WFArray2.default({
    isCollection: true,
    findBy: "id"
  });
  var action = {
    clear: function clear() {
      return collection.clear();
    },
    getValue: function getValue() {
      return collection.getValue();
    },
    setValue: function setValue(rows) {
      return collection.setValue(rows);
    }
  };
  return {
    clear: action.clear,
    getValue: action.getValue,
    setValue: action.setValue
  };
}();

// ------------------- //
exports.default = WFConfigCollectionMgr;
// ------------------- //

/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_CONFIG QUERY PARAMS MANAGER ------------------- //

// ------------------- //

var WFConfigQueryMgr = new _WFQueryParams2.default();

// ------------------- // 
exports.default = WFConfigQueryMgr;
// ------------------- //

/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ACTION LIST STATE MANAGER ------------------- //

// ------------------- //

var WFActionFormStateMgr = new _WFormStateMgr2.default({
  formName: 'action',
  formType: _WFProductType.WF_CORE_ACTION_ID,
  hasVolatileId: true
});

// ------------------- //
exports.default = WFActionFormStateMgr;
// ------------------- //

/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFActionMgr = __webpack_require__(237);

var _WFActionMgr2 = _interopRequireDefault(_WFActionMgr);

var _WFActionViewMgr = __webpack_require__(239);

var _WFActionViewMgr2 = _interopRequireDefault(_WFActionViewMgr);

var _WFActionResources = __webpack_require__(238);

var _WFActionResources2 = _interopRequireDefault(_WFActionResources);

var _WFActionFormStateMgr = __webpack_require__(156);

var _WFActionFormStateMgr2 = _interopRequireDefault(_WFActionFormStateMgr);

var _WFActionClientMgr = __webpack_require__(235);

var _WFActionClientMgr2 = _interopRequireDefault(_WFActionClientMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFAction = {
  key: "WFAction",
  mgr: _WFActionMgr2.default,
  viewMgr: _WFActionViewMgr2.default,
  clientMgr: _WFActionClientMgr2.default,
  formStateMgr: _WFActionFormStateMgr2.default,
  resources: _WFActionResources2.default
};
// ------------------- //
exports.default = WFAction;
// ------------------- //

window.WFAction = WFAction;

/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY COLLECTION MANAGER ------------------- //

// ------------------- //

var WFEntryCollectionMgr = function () {
  var collection = new _WFArray2.default({
    isCollection: true,
    findBy: "id"
  });
  var action = {
    clear: function clear() {
      return collection.clear();
    },
    getValue: function getValue() {
      return collection.getValue();
    },
    setValue: function setValue(rows) {
      return collection.setValue(rows);
    }
  };
  return {
    clear: action.clear,
    getValue: action.getValue,
    setValue: action.setValue
  };
}();

// ------------------- //
exports.default = WFEntryCollectionMgr;
// ------------------- //

/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY QUERY PARAMS MANAGER ------------------- //

// ------------------- //

var WFEntryQueryMgr = new _WFQueryParams2.default();

// ------------------- // 
exports.default = WFEntryQueryMgr;
// ------------------- //

/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFEntryMgr = __webpack_require__(417);

var _WFEntryMgr2 = _interopRequireDefault(_WFEntryMgr);

var _WFEntryFormStateMgr = __webpack_require__(244);

var _WFEntryFormStateMgr2 = _interopRequireDefault(_WFEntryFormStateMgr);

var _WFEntryViewMgr = __webpack_require__(246);

var _WFEntryViewMgr2 = _interopRequireDefault(_WFEntryViewMgr);

var _WFEntryQueryMgr = __webpack_require__(159);

var _WFEntryQueryMgr2 = _interopRequireDefault(_WFEntryQueryMgr);

var _WFEntrySelectMgr = __webpack_require__(245);

var _WFEntrySelectMgr2 = _interopRequireDefault(_WFEntrySelectMgr);

var _WFEntryClientMgr = __webpack_require__(243);

var _WFEntryClientMgr2 = _interopRequireDefault(_WFEntryClientMgr);

var _WFEntryCollectionMgr = __webpack_require__(158);

var _WFEntryCollectionMgr2 = _interopRequireDefault(_WFEntryCollectionMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFEntry = {
  key: "WFEntry",
  mgr: _WFEntryMgr2.default,
  viewMgr: _WFEntryViewMgr2.default,
  queryMrg: _WFEntryQueryMgr2.default,
  selectMgr: _WFEntrySelectMgr2.default,
  clientMgr: _WFEntryClientMgr2.default,
  formStateMgr: _WFEntryFormStateMgr2.default,
  collectionMgr: _WFEntryCollectionMgr2.default
};
// ------------------- //
exports.default = WFEntry;
// ------------------- //

window.WFEntry = WFEntry;

/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CLASSIC = "classic";
var EXTRA = "extra";

var getConstants = function getConstants() {
  return {
    CLASSIC: CLASSIC,
    EXTRA: EXTRA
  };
};

// ------------------- //

// ADMIN FIELDS    ------------------- //

// ------------------- //

// ------------------- //
// COLOR     ------------------- //
// ------------------- //

var color = {

  info: {
    name: "color",
    label: "Color"
  },

  defaultValues: {
    stringValue: "",
    placeholder: "",
    inputClass: ""
  }
};

// ------------------- //
// MEDIA     ------------------- //
// ------------------- //

var media = {

  info: {
    name: "media",
    label: "Media",
    type: "string"
  },

  defaultValues: {
    stringValue: "",
    placeholder: "",
    preview: true,
    isFile: false,
    btnLabel: "Media"
  }
};

// ------------------- //
// PANEL     ------------------- //
// ------------------- //

var panel = {

  info: {
    name: "panel",
    label: "Panel",
    type: "string"
  },

  defaultValues: {
    stringValue: "",
    numberValue: 0,
    booleanValue: false,
    placeholder: "",
    valueBy: "name",
    labelBy: "label",
    data: [],
    grid: "col-xs-4"
  }
};

// ------------------- //
// GRID      ------------------- //
// ------------------- //

var grid = {

  info: {
    name: "grid",
    label: "Grid",
    type: "string"
  },

  defaultValues: {
    stringValue: "",
    placeholder: ""
  }
};

// ------------------- //

// CLASSIC FIELDS  ------------------- //

// ------------------- //

// ------------------- //
// INPUT TEXT     ------------------- //
// ------------------- //

var text = {

  info: {
    name: "text",
    label: "Single line Text",
    type: "string"
  },

  displayFields: ["label", "legend",
  // "required",
  "placeholder", "stringValue", "searchable"],

  defaultValues: {
    input: "text",
    stringValue: "",
    placeholder: "",
    inputClass: "",
    data: [],
    minLength: 1,
    maxLength: 500,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      minLength: 1,
      maxLength: 500
    },

    displayFields: ["required", "minLength", "maxLength", "transformable", "transform"]
  }
};

// ------------------- //
// EMAIL          ------------------- //
// ------------------- //

var email = {

  info: {
    name: "email",
    label: "Email Address",
    type: "string"
  },

  displayFields: ["label", "legend",
  // "required",
  "placeholder", "stringValue", "searchable"],

  defaultValues: {
    input: "email",
    stringValue: "",
    placeholder: "",
    inputClass: "",

    //required        : false,
    minLength: 5,
    maxLength: 500,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      format: "email",
      minLength: 5,
      maxLength: 500
    },

    displayFields: ["required", "minLength", "maxLength"]
  }
};

// ------------------- //
// PASSWORD          ------------------- //
// ------------------- //

var password = {

  info: {
    name: "password",
    label: "Password",
    type: "string"
  },

  displayFields: ["label", "legend",
  //  "required",
  "placeholder",
  //"defaultValue",
  "searchable"],

  defaultValues: {
    input: "password",
    stringValue: "",
    placeholder: "",
    inputClass: "",

    //required        : false,
    minLength: 6,
    maxLength: 100,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      minLength: 6,
      maxLength: 100
    },

    displayFields: ["required", "minLength", "maxLength"]
  }
};

// ------------------- //
// PHONE          ------------------- //
// ------------------- //

var phone = {

  info: {
    name: "phone",
    label: "Phone Number",
    type: "string"
  },

  displayFields: ["label", "legend",
  //  "required",
  "placeholder", "stringValue", "searchable"],

  defaultValues: {
    input: "phone",
    stringValue: "",
    placeholder: "",
    inputClass: "",

    //required        : false,
    minLength: 1,
    maxLength: 100,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      format: "phone",
      minLength: 1,
      maxLength: 100
    },

    displayFields: ["required", "minLength", "maxLength"]
  }
};

// ------------------- //
// URL            ------------------- //
// ------------------- //

var url = {

  info: {
    name: "url",
    label: "Website/Url",
    type: "string"
  },

  displayFields: ["label", "legend",
  //  "required",
  "placeholder", "stringValue", "searchable"],

  defaultValues: {
    input: "url",
    stringValue: "",
    placeholder: "",
    inputClass: "",

    //required        : false,
    minLength: 1,
    maxLength: 1000,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      format: "url",
      minLength: 1,
      maxLength: 1000
    },

    displayFields: ["required", "minLength", "maxLength"]
  }
};

// ------------------- //
// TEXTAREA       ------------------- //
// ------------------- //

var textarea = {

  info: {
    name: "textarea",
    label: "Paragraph text",
    type: "text"
  },

  displayFields: ["label", "legend",
  //  "required",
  "placeholder", "rows", "stringValue", "searchable"],

  defaultValues: {
    input: "text",
    stringValue: "",
    placeholder: "",
    inputClass: "",
    rows: 4,
    isMultiliner: false,

    //required        : false,
    transformable: false,
    transform: "",
    minLength: 1,
    maxLength: 5000
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      minLength: 1,
      maxLength: 5000
    },

    displayFields: ["required", "minLength", "maxLength", "transformable", "transform"]
  }
};

// ------------------- //
// NUMBER         ------------------- //
// ------------------- //

var number = {

  info: {
    name: "number",
    label: "Number",
    type: "number"
  },

  displayFields: ["label", "legend",
  //"required",
  //"placeholder",
  "numberValue",
  //"isFloat",
  //"minimum",
  //"maximum",
  "searchable"],

  defaultValues: {
    input: "number",
    numberValue: 0,
    placeholder: "",
    inputClass: "",
    maximum: 0,
    minimum: 0,
    isFloat: false
  },

  validationStrategy: {

    validation_schema: {
      type: "number",
      minimum: 0
    },

    displayFields: ["required", "minimum", "maximum"]
  }
};

// ------------------- //
// RANGE          ------------------- //
// ------------------- //

var range = {

  info: {
    name: "range",
    label: "Range",
    type: "number"
  },

  displayFields: ["label", "legend",
  //"required",
  "numberValue", "minimum", "maximum", "step", "sufix", "searchable"],

  defaultValues: {
    numberValue: 0,
    placeholder: "",
    inputClass: "",
    step: 0,
    sufix: "",
    maximum: 0,
    minimum: 100
  },

  validationStrategy: {

    validation_schema: {
      type: "number",
      minimum: 0,
      maximum: 100
    },

    displayFields: ["required", "minimum", "maximum"]
  }
};

// ------------------- //
// DATE     ------------------- //
// ------------------- //

var date = {

  info: {
    name: "date",
    label: "Date",
    type: "string"
  },

  displayFields: ["label", "legend", "placeholder",
  //"stringValue",
  //"required",
  "dateFormat", "showMonthDropdown", "showYearDropdown", "showWeekNumbers", "monthsShown", "searchable"],

  defaultValues: {
    input: "date",
    stringValue: "",
    placeholder: "select date",
    dateFormat: "YYYY/MM/DD",
    showMonthDropdown: false,
    showYearDropdown: false,
    showWeekNumbers: false,
    monthsShown: 1,
    //required        : false,
    minLength: 5,
    maxLength: 100,
    transformable: false,
    transform: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "string"
    },

    displayFields: ["required",
    // (todo charly need found solution for date...)
    "minDate", "maxDate"]
  }
};

// ------------------- //
// CHECKBOX       ------------------- //
// ------------------- //

var checkbox = {

  info: {
    name: "checkbox",
    label: "Checkbox",
    type: "boolean"
  },

  displayFields: ["label", "hiddenLabel", "legend", "placeholder", "booleanValue", "checkedValue", "uncheckedValue", "required", "searchable"],

  defaultValues: {
    hiddenLabel: false,
    booleanValue: false,
    placeholder: "active option...",
    inputClass: ""
  }
};

// ------------------- //
// SELECT          ------------------- //
// ------------------- //

var select = {

  info: {
    name: "select",
    label: "Single Select",
    type: "string",
    isBaobabBranch: true
  },

  displayFields: ["label", "legend", "searchable"],

  defaultValues: {
    stringValue: "",
    numberValue: 0,
    booleanValue: false,
    placeholder: "",
    valueBy: "label",
    labelBy: "label",
    data: []
  },

  validationStrategy: {

    validation_schema: {
      type: "string",
      minLength: 1,
      maxLength: 255
    },

    displayFields: ["required"]
  }
};

// ------------------- //
// RADIO BUTTON          ------------------- //
// ------------------- //

var radioButton = {

  info: {
    name: "radioButton",
    label: "Radio Buttons",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "legend", "isInlineOption"],

  defaultValues: {
    stringValue: "",
    valueBy: "id",
    labelBy: "label",
    data: [],
    isMultiple: true,
    isInlineOption: false
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// FILE     ------------------- //
// ------------------- //

var file = {

  info: {
    name: "file",
    label: "File Upload",
    type: "string"
  },

  displayFields: ["label", "legend", "placeholder", "searchable"],

  defaultValues: {
    stringValue: "",
    placeholder: "Select file..."
  },

  validationStrategy: {
    validation_schema: {
      type: "string",
      minLength: 1
    },
    displayFields: ["required"]
  }
};

// ------------------- //
// SELECT2          ------------------- //
// ------------------- //

var select2 = {

  info: {
    name: "select2",
    label: "Select 2",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "legend", "placeholder",
  //"required",
  // "stylizer"
  "canSearch", "isUnfold", "searchable"],

  defaultValues: {
    stringValue: "",
    placeholder: "search option...",
    valueBy: "id",
    labelBy: "label",
    data: [],
    canSearch: true,
    isUnfold: false,
    isMultiple: false
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// SELECT2 BAOBAB   ------------------- //
// ------------------- //

var select2baobab = {

  info: {
    name: "select2baobab",
    label: "Select 2 Baobab",
    type: "select_multiple",
    isBaobab: true
  },

  displayFields: ["label", "legend", "placeholder",
  //"required",
  // "stylizer"
  "searchable"],

  defaultValues: {
    stringValue: "",
    placeholder: "",
    valueBy: "id",
    labelBy: "label",
    data: [],
    isUnfold: false,
    isBaobab: true,
    isMultiple: false,
    canSearch: true,
    optionType: ""
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1,
      maxItems: 1
    },

    displayFields: ["required"]
  }
};

// ------------------- //
// SELECT2 MONKEY   ------------------- //
// ------------------- //

var select2monkey = {

  info: {
    name: "select2monkey",
    label: "Select 2 Monkey",
    type: "select_multiple",
    isMonkey: true
  },

  displayFields: ["label", "legend", "placeholder",
  //"required",
  // "stylizer",

  "monkeyObserve", "monkeyFilterBy", "monkeyBranch", "searchable"],

  defaultValues: {
    stringValue: "",
    placeholder: "",
    valueBy: "id",
    labelBy: "label",
    data: [],
    isUnfold: false,
    isMonkey: true,
    isMultiple: false,
    canSearch: true,

    monkeyGroup: "", // fieldName
    monkeyObserve: "", // fieldName
    monkeyFilterBy: "", // filter by branch (parent_id) or option (option_group_id)
    monkeyBranch: 0 // branch_id
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1,
      maxItems: 1
    },

    displayFields: ["required"]
  }
};

// ------------------- //

// WONDER FIELDS    ------------------- //

// ------------------- //

// ------------------- //
// SELECT WORD      ------------------- //
// ------------------- //

var WFieldSelectWord = {

  info: {
    name: "WFieldSelectWord",
    label: "Select Word",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "wf_label", "legend", "wf_width"],

  defaultValues: {
    isMultiple: false,
    optionType: "",
    data: [],
    valueBy: "id",
    labelBy: "label",
    wf_width: 900,
    wf_label: "",
    isInlineOption: false
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// SELECT NUMBER    ------------------- //
// ------------------- //

var WFieldSelectNum = {

  info: {
    name: "WFieldSelectNum",
    label: "Select Bubble",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "wf_label", "legend", "wf_width"],

  defaultValues: {
    isMultiple: false,
    optionType: "",
    data: [],
    valueBy: "id",
    labelBy: "label",
    wf_width: 900,
    wf_label: "",
    isInlineOption: true
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// SELECT LINE      ------------------- //
// ------------------- //

var WFieldSelectLine = {

  info: {
    name: "WFieldSelectLine",
    label: "Select Line",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "wf_label", "legend", "wf_width"],

  defaultValues: {
    isMultiple: false,
    isUnfold: true,
    optionType: "",
    data: [],
    valueBy: "id",
    labelBy: "label",
    wf_width: 900,
    wf_label: "",
    canSearch: true
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// SELECT IMAGE     ------------------- //
// ------------------- //

var WFieldSelectImage = {

  info: {
    name: "WFieldSelectImage",
    label: "Select Image",
    type: "select_multiple",
    isBaobabBranch: true
  },

  displayFields: ["label", "wf_label", "legend", "wf_height", "wf_option_image_radius", "wf_option_width", "wf_option_image_height"],

  defaultValues: {
    isMultiple: false,
    isUnfold: true,
    optionType: "",
    data: [],
    valueBy: "id",
    labelBy: "label",
    canSearch: true,
    wf_label: "",
    wf_height: 275,
    wf_option_width: 200,
    wf_option_padding: 0,
    wf_option_margin: 0,
    wf_option_image_height: 0,
    wf_option_image_radius: 0
  },

  validationStrategy: {

    validation_schema: {
      type: "array",
      minItems: 1
    },

    displayFields: ["required", "isMultiple", "minItems", "maxItems"]
  }
};

// ------------------- //
// ------------------- //

// ------------------- //
// FIELD ARCHIVE    ------------------- //
// ------------------- //

// CLASSIC FIELD LIST INFO    ------------------- //

var getClassicFieldListInfo = function getClassicFieldListInfo() {
  return [text, textarea, email, phone, url, checkbox, number, range, radioButton, select, select2, select2baobab,
  // select2monkey,
  date, file, password].map(function (fld) {
    return fld.info;
  });
};

var getLimitedClassicFieldListInfo = function getLimitedClassicFieldListInfo() {
  return [text, email, phone, url, textarea, number, checkbox, select].map(function (fld) {
    return fld.info;
  });
};

// WONDER FIELD LIST INFO    ------------------- //

var getWonderFieldListInfo = function getWonderFieldListInfo() {
  return [WFieldSelectWord, WFieldSelectNum, WFieldSelectLine, WFieldSelectImage].map(function (fld) {
    return fld.info;
  });
};

// ------------------- //
// FIELD STYLE    ------------------- //
// ------------------- //

var fieldStyle = [{
  name: CLASSIC,
  label: "Classic-Fields"
}, {
  name: EXTRA,
  label: "Wonder-Fields"
}];

var getFieldStyle = function getFieldStyle() {
  return fieldStyle;
};
var getFieldDisable = function getFieldDisable(isLimited) {
  var data = {};
  if (isLimited) {
    [range, radioButton, password, file, date, select2, select2baobab, select2monkey, WFieldSelectWord, WFieldSelectNum, WFieldSelectLine, WFieldSelectImage].map(function (fld) {
      data[fld.info.name] = true;
    });
    return data;
  } else {
    return data;
  }
};

// ------------------- //
// FIELDS ------------------- //
// ------------------- //

var Fields = {
  text: text,
  email: email,
  phone: phone,
  url: url,
  textarea: textarea,
  number: number,
  range: range,
  checkbox: checkbox,
  radioButton: radioButton,
  select: select,
  select2: select2,
  select2baobab: select2baobab,
  select2monkey: select2monkey,
  color: color,
  panel: panel,
  media: media,
  file: file,
  date: date,
  grid: grid,
  password: password,
  WFieldSelectWord: WFieldSelectWord,
  WFieldSelectNum: WFieldSelectNum,
  WFieldSelectLine: WFieldSelectLine,
  WFieldSelectImage: WFieldSelectImage
};

var getField = function getField(name) {
  if (Fields.hasOwnProperty(name)) {
    return Fields[name];
  } else {
    return null;
  }
};

// ------------------- //
// CONFIG FOR MANAGE FIELDCONFIG    ------------------- //
// ------------------- //

var configToCreate = function configToCreate(isLimited) {
  if (isLimited) {
    var _args;

    return {
      displayFields: ["input_type", "label", "name", "required", "searchable"],
      fields: [{
        "name": "contentType",
        "type": "string",
        "input_type": "panel",
        "label": "Field Style",
        "create_column": false,
        "attributes": {
          "valueBy": "name",
          "grid": "col-sm-6",
          "data": fieldStyle
        }
      }, {
        "name": "input_type",
        "type": "string",
        "input_type": "panel",
        "label": "Field Type",
        "create_column": true,
        "attributes": {
          "valueBy": "name",
          "grid": "col-sm-4",
          "data": getClassicFieldListInfo(),
          "dataDisabled": getFieldDisable(isLimited),
          "condition": {
            "action": ["change_data"],
            "rules": ["contentType", "change"],
            "args": (_args = {
              "valueKey": "contentType"
            }, (0, _defineProperty3.default)(_args, CLASSIC, getClassicFieldListInfo()), (0, _defineProperty3.default)(_args, EXTRA, getWonderFieldListInfo()), _args)
          }
        }
      }]
    };
  } else {
    var _args2;

    return {
      displayFields: ["contentType", "input_type", "label", "name", "required", "searchable"],
      fields: [{
        "name": "contentType",
        "type": "string",
        "input_type": "panel",
        "label": "Field Style",
        "create_column": false,
        "attributes": {
          "valueBy": "name",
          "grid": "col-sm-6",
          "data": fieldStyle
        }
      }, {
        "name": "input_type",
        "type": "string",
        "input_type": "panel",
        "label": "Field Type",
        "create_column": true,
        "attributes": {
          "valueBy": "name",
          "grid": "col-sm-4",
          "data": getClassicFieldListInfo(),
          "condition": {
            "action": ["change_data"],
            "rules": ["contentType", "change"],
            "args": (_args2 = {
              "valueKey": "contentType"
            }, (0, _defineProperty3.default)(_args2, CLASSIC, getClassicFieldListInfo()), (0, _defineProperty3.default)(_args2, EXTRA, getWonderFieldListInfo()), _args2)
          }
        }
      }]
    };
  };
};

var configToEdit = {};

// ------------------- //
exports.default = {
  configToCreate: configToCreate,
  configToEdit: configToEdit,
  getField: getField,
  getFieldStyle: getFieldStyle,
  getConstants: getConstants
};
// ------------------- //

/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFLicenseMgr = __webpack_require__(420);

var _WFLicenseMgr2 = _interopRequireDefault(_WFLicenseMgr);

var _WFLicenseValuesMgr = __webpack_require__(253);

var _WFLicenseValuesMgr2 = _interopRequireDefault(_WFLicenseValuesMgr);

var _WFLicenseQueryMgr = __webpack_require__(252);

var _WFLicenseQueryMgr2 = _interopRequireDefault(_WFLicenseQueryMgr);

var _WFLicenseClientMgr = __webpack_require__(250);

var _WFLicenseClientMgr2 = _interopRequireDefault(_WFLicenseClientMgr);

var _WFLicenseFormStateMgr = __webpack_require__(251);

var _WFLicenseFormStateMgr2 = _interopRequireDefault(_WFLicenseFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
/**
 * Important!
 * if you want validate a wf_producttype_id
 * @code
 * WFLicense.valueMgr.isValid(wf_producttype_id);
 * @/code
 **/
// ------------------- //
var WFLicense = {
  key: "WFLicense",
  mgr: _WFLicenseMgr2.default,
  valueMgr: _WFLicenseValuesMgr2.default,
  queryMrg: _WFLicenseQueryMgr2.default,
  clientMgr: _WFLicenseClientMgr2.default,
  formStateMgr: _WFLicenseFormStateMgr2.default
};
// ------------------- //
exports.default = WFLicense;
// ------------------- //

window.WFLicense = WFLicense;

/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Form config parser
 */
var WFormConfigParser = function () {
  function WFormConfigParser() {
    (0, _classCallCheck3.default)(this, WFormConfigParser);
  }

  (0, _createClass3.default)(WFormConfigParser, null, [{
    key: 'parse',

    /**
     * @param config a given form config to parse
     * @return Object containing form config infos
     */
    value: function parse(config) {
      var _config$id = config.id,
          id = _config$id === undefined ? 0 : _config$id,
          _config$entry_id = config.entry_id,
          entry_id = _config$entry_id === undefined ? 0 : _config$entry_id,
          _config$published = config.published,
          published = _config$published === undefined ? false : _config$published,
          _config$name = config.name,
          name = _config$name === undefined ? '' : _config$name,
          _config$created_tms = config.created_tms,
          created_tms = _config$created_tms === undefined ? '' : _config$created_tms,
          _config$entries_table = config.entries_table,
          entries_table = _config$entries_table === undefined ? '' : _config$entries_table,
          _config$title = config.title,
          title = _config$title === undefined ? '' : _config$title,
          _config$description = config.description,
          description = _config$description === undefined ? '' : _config$description,
          _config$attributes = config.attributes,
          attributes = _config$attributes === undefined ? '' : _config$attributes,
          _config$wf_producttyp = config.wf_producttype_id,
          wf_producttype_id = _config$wf_producttyp === undefined ? 0 : _config$wf_producttyp,
          _config$wf_optiongrou = config.wf_optiongroup_id,
          wf_optiongroup_id = _config$wf_optiongrou === undefined ? 0 : _config$wf_optiongrou,
          _config$wf_categorygr = config.wf_categorygroup_id,
          wf_categorygroup_id = _config$wf_categorygr === undefined ? 0 : _config$wf_categorygr,
          _config$display_field = config.display_fields,
          display_fields = _config$display_field === undefined ? [] : _config$display_field,
          _config$actions = config.actions,
          actions = _config$actions === undefined ? [] : _config$actions,
          _config$fields = config.fields,
          fields = _config$fields === undefined ? [] : _config$fields;


      var formConfig = {};
      var fieldsIds = {};

      if (entry_id) {
        formConfig['entry_id'] = entry_id;
        formConfig['form_id'] = entry_id;
      } else {
        formConfig['entry_id'] = id;
        formConfig['form_id'] = id;
      }

      formConfig['name'] = name;
      formConfig['created_tms'] = created_tms;
      formConfig['entries_table'] = entries_table;
      formConfig['published'] = published;
      formConfig['title'] = title;
      formConfig['description'] = description;
      formConfig['wf_producttype_id'] = wf_producttype_id;
      formConfig['wf_categorygroup_id'] = wf_categorygroup_id;
      formConfig['type'] = wf_producttype_id;
      formConfig['wf_optiongroup_id'] = wf_optiongroup_id;
      formConfig['attributes'] = attributes;

      if ((0, _Lodash.isArray)(fields) && fields.length > 0) {
        formConfig['fields'] = fields;
        for (var i = 0; i < fields.length; i++) {
          var fld = fields[i];
          if (fld.hasOwnProperty('name')) {
            if (fld.hasOwnProperty('id')) {
              fieldsIds[fld.name] = fld.id;
            } else {
              fieldsIds[fld.name] = 0;
            }
          }
        }
      } else {
        formConfig['fields'] = [];
      }

      if ((0, _Lodash.isArray)(display_fields) && display_fields.length > 0) {
        formConfig['display_fields'] = display_fields;
      } else {
        formConfig['display_fields'] = [];
      }

      if ((0, _Lodash.isArray)(actions) && actions.length > 0) {
        formConfig['actions'] = actions;
      } else {
        formConfig['actions'] = [];
      }

      formConfig['fields_ids'] = fieldsIds;

      return formConfig;
    }

    /**
     * Merge initial form config with the given form config
     * @param config the initial form config
     * @param defaultConfig the default form config
     * @return Object containing the merged form config
     */

  }, {
    key: 'merge',
    value: function merge(config, defaultConfig) {
      var formConfig = WFormConfigParser.parse(config);

      for (var i = 0; i < defaultConfig.fields.length; i++) {
        var fld = defaultConfig.fields[i];
        if (!formConfig.fields_ids.hasOwnProperty(fld.name)) {
          formConfig.fields.push(fld);
        }
      }

      if (!formConfig.display_fields.length) {
        formConfig.display_fields = defaultConfig.display_fields;
      }

      if (!formConfig.attributes) {
        formConfig.attributes = defaultConfig.attributes;
      }

      return formConfig;
    }
  }]);
  return WFormConfigParser;
}();

;

exports.default = WFormConfigParser;

/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFBaobabMonkey = __webpack_require__(407);

var _WFBaobabMonkey2 = _interopRequireDefault(_WFBaobabMonkey);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormViewSetting = __webpack_require__(437);

var _WFormViewSetting2 = _interopRequireDefault(_WFormViewSetting);

var _WFormViewStep = __webpack_require__(438);

var _WFormViewStep2 = _interopRequireDefault(_WFormViewStep);

var _WFormViewContent = __webpack_require__(436);

var _WFormViewContent2 = _interopRequireDefault(_WFormViewContent);

var _WFieldStringView = __webpack_require__(433);

var _WFieldStringView2 = _interopRequireDefault(_WFieldStringView);

var _WFieldNumberView = __webpack_require__(431);

var _WFieldNumberView2 = _interopRequireDefault(_WFieldNumberView);

var _WFieldBooleanView = __webpack_require__(429);

var _WFieldBooleanView2 = _interopRequireDefault(_WFieldBooleanView);

var _WFieldDateView = __webpack_require__(430);

var _WFieldDateView2 = _interopRequireDefault(_WFieldDateView);

var _WFieldSelectView = __webpack_require__(432);

var _WFieldSelectView2 = _interopRequireDefault(_WFieldSelectView);

var _Lodash = __webpack_require__(6);

var _WFConstants = __webpack_require__(58);

var _WFEventTypes = __webpack_require__(16);

var _WFDataTypes = __webpack_require__(74);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormViewHelpers = function () {
  function WFormViewHelpers() {
    (0, _classCallCheck3.default)(this, WFormViewHelpers);
  }

  (0, _createClass3.default)(WFormViewHelpers, null, [{
    key: "init",


    /**
     * Init the formView  changeErrors
     * set fld observer
     * load fieldsDisable
     * load fieldsHidden
     * load settings
     * load current theme
     * view manager define observer
     * view manager init
     * set status to edit formState's values
     * @param formView
     */
    value: function init(formView) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var formState = formView.getFormState();
      // Set field's observer
      var flds = formView.getFields();
      for (var name in flds) {
        WFormViewHelpers.observeField(formView, flds[name]);
      }
      // Extract prev configs for manager
      //let attributes = this.getFormState().getAttributes();
      var attributes = formState.getSettings();
      formView.defaultConfig = (0, _assign2.default)({}, formView.defaultConfig, attributes);

      var _formView$defaultConf = formView.defaultConfig,
          _formView$defaultConf2 = _formView$defaultConf.settingConfig,
          settingConfig = _formView$defaultConf2 === undefined ? {} : _formView$defaultConf2,
          _formView$defaultConf3 = _formView$defaultConf.contentConfig,
          contentConfig = _formView$defaultConf3 === undefined ? {} : _formView$defaultConf3,
          _formView$defaultConf4 = _formView$defaultConf.stepConfig,
          stepConfig = _formView$defaultConf4 === undefined ? {} : _formView$defaultConf4;

      // Create Manager

      formView.settings = new _WFormViewSetting2.default(settingConfig);
      formView.steps = new _WFormViewStep2.default(stepConfig);
      formView.contents = new _WFormViewContent2.default(contentConfig);

      // Create monkey fields
      WFormViewHelpers.createFieldMonkey(formView);

      // Create observer 
      WFormViewHelpers.createObserver(formView);

      // Publish Ready
      formView.viewMrg.init();
      formView.isInit = true;

      if (formView.isAdmin) {
        formView.setStatus(_WFConstants.WF_STATUS_EDITING);
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Create monkey fields
     * @param callback(state)
     */

  }, {
    key: "createFieldMonkey",
    value: function createFieldMonkey(formView) {
      _WFBaobabMonkey2.default.create(formView);
    }

    /**
     * Set ViewMgr's Observer
     * @param callback(state)
     */

  }, {
    key: "createObserver",
    value: function createObserver(formView) {
      formView.viewMrg.setObserver({
        init: function init() {
          formView.changeStatus();
          formView.changeResults();
          formView.changeStepStatus();
          formView.changeIsValid();
          formView.changeSteps();
          formView.changeStepStatus();
          formView.changeContent();
          formView.changeFields();
          formView.changeFieldStatus();
          formView.changeSetting();
        },
        change: function change(newVal) {

          // todo charly remove
          //console.warn("LOAD/CHANGE ...");
          //console.log(newVal);

          if ((0, _Lodash.isObject)(newVal)) {
            formView.viewMrg.setState(newVal);
            formView.pub(_WFEventTypes.WF_EVENT_ONCHANGE, newVal);
            if (formView.editorObserver) {
              formView.editorObserver(formView.viewMrg.getState());
            }
          }
        },
        ready: function ready() {

          // todo charly remove
          //console.warn("READY ...");

          if (formView.editorObserver) {
            formView.changeStatus();
            formView.changeIsValid();
            formView.changeStepStatus();
            formView.changeFieldStatus();
            formView.changeSteps();
            formView.changeFields();
            formView.changeSetting();
            formView.editorObserver(formView.viewMrg.getState());
          }
          formView.pub(_WFEventTypes.WF_EVENT_ONREADY, formView.viewMrg.getState());
        }
      });
    }

    // FIELD ------------- //

    /**
     * All field action events
     * @param params is object
     */

  }, {
    key: "getFieldAction",
    value: function getFieldAction(params) {
      //console.dir(params)
      var fieldName = params.fieldName,
          fieldInput = params.fieldInput,
          action = params.action,
          values = params.values,
          _params$args = params.args,
          args = _params$args === undefined ? {} : _params$args;

      var events = {
        'visible': function visible(formView) {
          if (formView.fieldIsHidden(fieldName)) {
            formView.fieldDisplay(fieldName);
          }
        },
        'hidden': function hidden(formView) {
          if (!formView.fieldIsHidden(fieldName)) {
            formView.fieldHidden(fieldName);
          }
        },
        'active': function active(formView) {
          if (formView.fieldIsDisable(fieldName)) {
            formView.fieldActive(fieldName);
          }
        },
        'disable': function disable(formView) {
          if (!formView.fieldIsDisable(fieldName)) {
            formView.fieldDisable(fieldName);
          }
        },
        'change_data': function change_data(formView) {
          var _args$getBy = args.getBy,
              getBy = _args$getBy === undefined ? "name" : _args$getBy,
              _args$valueKey = args.valueKey,
              valueKey = _args$valueKey === undefined ? null : _args$valueKey;

          if (values && values.hasOwnProperty(valueKey)) {
            var key = values[valueKey];
            var fld = formView.getField(valueKey);
            if (key && args.hasOwnProperty(key)) {
              var data = args[key];
              fieldInput.setData(data);
            }
          }
        }
      };
      if (events.hasOwnProperty(action)) {
        return events[action];
      } else {
        return null;
      }
    }

    /**
     * Subscribe to fields events
     */

  }, {
    key: "observeField",
    value: function observeField(formView, fld) {
      if (fld instanceof _WFormField2.default) {
        fld.getType();
        var inputMgr = null;
        var valueMgr = fld.getValueMgr();
        var type = fld.getType();
        switch (type) {

          case _WFDataTypes.WF_TYPE_NUMBER:
          case _WFDataTypes.WF_TYPE_INTEGER:
          case _WFDataTypes.WF_TYPE_FLOAT:
            inputMgr = new _WFieldNumberView2.default(valueMgr);
            break;

          case _WFDataTypes.WF_TYPE_BOOLEAN:
            inputMgr = new _WFieldBooleanView2.default(valueMgr);
            break;

          case _WFDataTypes.WF_TYPE_SELECT:
          case _WFDataTypes.WF_TYPE_SELECT_SINGLE:
          case _WFDataTypes.WF_TYPE_SELECT_MULTIPLE:
            inputMgr = new _WFieldSelectView2.default(valueMgr);
            break;

          /*
          case WF_TYPE_DATE:
            inputMgr = new WFieldDateView(valueMgr);
            break;
          */

          default:
            inputMgr = new _WFieldStringView2.default(valueMgr);
            break;
        }
        if (inputMgr) {
          fld.setInputMgr(inputMgr);
          fld.getInputMgr().setObserver(WFormViewHelpers.createFieldObserver(formView, fld));
        }
      }
    }

    /**
     * Hook field's events with WFormView
     * @param WFormView is instance 
     * @param fld instance of WFormField 
     * @return observer object contains some events
     */

  }, {
    key: "createFieldObserver",
    value: function createFieldObserver(formView, fld) {
      if (fld instanceof _WFormField2.default) {
        var _observer;

        var fldName = fld.getName();
        var fldType = fld.getType();
        var observer = (_observer = {
          call: function call(evenType, eventArgs) {
            if (observer.hasOwnProperty(evenType)) {
              var event = observer[evenType];
              event(eventArgs);
            }
          }

        }, (0, _defineProperty3.default)(_observer, _WFEventTypes.WF_EVENT_ONWILLMOUNT, function (fieldInput) {
          formView.setCurrentField(fldName, fieldInput);
          formView.setFieldCondition(fldName, fieldInput);
          if (fld.getRequired()) {
            formView.setValidField(fldName);
          }
        }), (0, _defineProperty3.default)(_observer, _WFEventTypes.WF_EVENT_ONWILLUNMOUNT, function () {
          formView.unsetCurrentField(fldName);
          if (fld.getRequired()) {
            formView.unsetValidField(fldName);
          }
        }), (0, _defineProperty3.default)(_observer, _WFEventTypes.WF_EVENT_ONCHANGE, function (fieldStatus) {
          formView.setCurrentField(fldName, fieldStatus);
          formView.valuesChange();
        }), (0, _defineProperty3.default)(_observer, _WFEventTypes.WF_EVENT_ONVALIDATE, function (fieldInput) {
          formView.setValidField(fldName, fieldInput);
        }), (0, _defineProperty3.default)(_observer, _WFEventTypes.WF_EVENT_ONCLEAR, function (fieldInput) {}), _observer);
        return observer;
      } else {
        return null;
      }
    }

    // ERRROR ------------- //


    /**
     * Set field error with entry error 
     * @param formState is instance 
     * @param errors is object {messages}
     */

  }, {
    key: "setError",
    value: function setError(formState, errors) {
      var _errors$messages = errors.messages,
          messages = _errors$messages === undefined ? {} : _errors$messages;

      for (var x in messages) {
        var _messages$x = messages[x],
            _messages$x$name = _messages$x.name,
            name = _messages$x$name === undefined ? "" : _messages$x$name,
            _messages$x$msg = _messages$x.msg,
            msg = _messages$x$msg === undefined ? "" : _messages$x$msg;

        var fld = formState.getField(name);
        if (fld) {
          fld.getInputMgr().setState({
            valid: true,
            errors: msg
          });
        }
      }
    }

    /**
     * Set field error with entry error 
     * @param formState is instance 
     * @param callback 
     */

  }, {
    key: "mapError",
    value: function mapError(errors, callback) {
      var _errors$messages2 = errors.messages,
          messages = _errors$messages2 === undefined ? {} : _errors$messages2;

      for (var x in messages) {
        var _messages$x2 = messages[x],
            _messages$x2$name = _messages$x2.name,
            name = _messages$x2$name === undefined ? "" : _messages$x2$name,
            _messages$x2$msg = _messages$x2.msg,
            msg = _messages$x2$msg === undefined ? "" : _messages$x2$msg;

        callback(msg);
      }
    }
  }]);
  return WFormViewHelpers;
}();

exports.default = WFormViewHelpers;

/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_SETTING FORMSTATE MANAGER ------------------- //

// ------------------- //

var WFSettingFormStateMgr = new _WFormStateMgr2.default({
  formName: 'setting',
  formType: _WFProductType.WF_CORE_SETTING_ID,
  objKey: "param_name"
});

// ------------------- //
exports.default = WFSettingFormStateMgr;
// ------------------- //

/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY QUERY PARAMS MANAGER ------------------- //

// ------------------- //

var WFSettingQueryMgr = new _WFQueryParams2.default({
  limit: 100
});

// ------------------- // 
exports.default = WFSettingQueryMgr;
// ------------------- //

/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS BOOLEAN MANAGER ------------------- //

// ------------------- //
var WFBoolean = function (_WFType) {
  (0, _inherits3.default)(WFBoolean, _WFType);

  /**
   * Constructor
   */
  function WFBoolean() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFBoolean);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFBoolean.__proto__ || (0, _getPrototypeOf2.default)(WFBoolean)).call(this, _WFValueTypes.WF_BOOLEAN_VALUE));

    var _config$value = config.value,
        value = _config$value === undefined ? false : _config$value;

    _this.booleanValue = false;
    _this.setValue(value);
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFBoolean, [{
    key: 'get',


    /**
     * Get value
     * @return boolean
     */
    value: function get() {
      return this.booleanValue;
    }
  }, {
    key: 'getValue',
    value: function getValue(val) {
      this.get();
    }

    /**
     * Set value
     * @param val boolean
     */

  }, {
    key: 'set',
    value: function set(val) {
      var value = null;
      if ((0, _Lodash.isBoolean)(val)) {
        value = val;
      } else if (val == null || val == 0) {
        value = false;
      } else if (val == 1) {
        value = true;
      }
      this.booleanValue = value;
    }
  }, {
    key: 'setValue',
    value: function setValue(val) {
      this.set(val);
    }

    /**
     * Toggle value state
     */

  }, {
    key: 'toggle',
    value: function toggle() {
      this.set(!this.get());
    }

    /**
     * Alias of isTrue
     * @return boolean
     */

  }, {
    key: 'isActive',
    value: function isActive() {
      return this.isTrue();
    }

    /**
     * Check value is true
     * @return boolean
     */

  }, {
    key: 'isTrue',
    value: function isTrue() {
      return this.get() === true;
    }

    /**
     * Check value is true
     * @return boolean
     */

  }, {
    key: 'isFalse',
    value: function isFalse() {
      return this.get() === false;
    }

    /**
     * clear value
     */

  }, {
    key: 'clear',
    value: function clear() {
      this.booleanValue = false;
      if (this.input) {
        this.input.setState((0, _defineProperty3.default)({}, this.getKey(), this.get()));
      }
    }

    /**
     * Show current value in console
     */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFBoolean');
      console.log('value =>', this.booleanValue);
      console.log("");
    }
  }], [{
    key: 'instanceOf',
    value: function instanceOf(obj) {
      return obj instanceof WFBoolean;
    }
  }]);
  return WFBoolean;
}(_WFType3.default);
// ------------------- //


exports.default = WFBoolean;
// ------------------- //

/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// SCREEN ---------------- //

// ------------------- //

var scrollTop = exports.scrollTop = function scrollTop() {
	return window.scrollTo(0, 0);
},


// ----------------- //

VerticalAlign = exports.VerticalAlign = function VerticalAlign(_ref) {
	var _ref$content = _ref.content,
	    content = _ref$content === undefined ? 600 : _ref$content,
	    _ref$minHeight = _ref.minHeight,
	    minHeight = _ref$minHeight === undefined ? 780 : _ref$minHeight,
	    _ref$top = _ref.top,
	    top = _ref$top === undefined ? 100 : _ref$top,
	    _ref$down = _ref.down,
	    down = _ref$down === undefined ? 100 : _ref$down;

	var maxHeight = minHeight - (top + down);
	if (content < maxHeight) {
		return minHeight;
	} else {
		return content + top + down;
	}
}

// ----------------- //

;

/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// SLUGIFY ---------------- //

exports.default = function (value) {
	var sep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "-";


	var rExps = [{ re: /[\xC0-\xC6]/g, ch: 'A' }, { re: /[\xE0-\xE6]/g, ch: 'a' }, { re: /[\xC8-\xCB]/g, ch: 'E' }, { re: /[\xE8-\xEB]/g, ch: 'e' }, { re: /[\xCC-\xCF]/g, ch: 'I' }, { re: /[\xEC-\xEF]/g, ch: 'i' }, { re: /[\xD2-\xD6]/g, ch: 'O' }, { re: /[\xF2-\xF6]/g, ch: 'o' }, { re: /[\xD9-\xDC]/g, ch: 'U' }, { re: /[\xF9-\xFC]/g, ch: 'u' }, { re: /[\xC7-\xE7]/g, ch: 'c' }, { re: /[\xD1]/g, ch: 'N' }, { re: /[\xF1]/g, ch: 'n' }];

	// converti les caractères accentués en leurs équivalent alpha
	for (var i = 0, len = rExps.length; i < len; i++) {
		value = value.replace(rExps[i].re, rExps[i].ch);
	}

	// 1) met en bas de casse
	// 2) remplace les espace par des tirets
	// 3) enleve tout les caratères non alphanumeriques
	// 4) enlève les doubles tirets
	return value.toLowerCase().replace(/\s+/g, sep).replace(/[^a-z0-9-_]/g, '').replace(/\-{2,}/g, sep);
};

/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFormViewHelpers = __webpack_require__(164);

var _WFormViewHelpers2 = _interopRequireDefault(_WFormViewHelpers);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _index = __webpack_require__(416);

var _index2 = _interopRequireDefault(_index);

var _wfieldconfig = __webpack_require__(249);

var _wfieldconfig2 = _interopRequireDefault(_wfieldconfig);

var _WFAdminView = __webpack_require__(18);

var _utils = __webpack_require__(455);

var _utils2 = _interopRequireDefault(_utils);

var _baobab = __webpack_require__(264);

var _baobab2 = _interopRequireDefault(_baobab);

var _setting = __webpack_require__(265);

var _setting2 = _interopRequireDefault(_setting);

var _action = __webpack_require__(266);

var _action2 = _interopRequireDefault(_action);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFormManagers = __webpack_require__(30);

var _WFConstants = __webpack_require__(58);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TREE_SELECTED = "tree_selected";
var BRANCH_SELECTED = "branch_selected";

// ----------------- //

// WFUI.WFC.EDITOR ----------------- //

// ----------------- //


/**
 * editor hook the current view with the model
 * view => WFAction.viewMrg contains global state
 * model => WFAction.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/

var editor = function () {

  /**
   * Observe Baobab Manager
   **/
  _wfconfig2.default.baobabMgr.viewMgr.setObserver({
    ready: function ready() {
      _wfconfig2.default.editor.viewMgr.setState(_wfconfig2.default.baobabMgr.getState());
    }
  });

  /**
   * Private props
   **/
  var _isInit = false;
  var _isPublish = false;
  var _isFieldSaved = false;
  var productTypeId = null;
  var cache = new _WFObject2.default();

  /**
   * Private method
   **/
  var editorSave = null;
  var editorUnPublish = null;

  var refreshTheme = function refreshTheme(values) {
    var formEntryView = _WFormManagers.formEntryMgr.get().formView;
    formEntryView.setState(values);
  };

  var observeValues = function observeValues(formEntryView) {
    formEntryView.sub(_WFConstants.WF_VALUES_CHANGE, function (newValues) {
      var attributes = formEntryView.getFormState().getAttributes();
      _wfconfig2.default.editor.mgr.change({
        wfc_values: newValues,
        wfc_attributes: attributes
      }, true);
    });
  };

  var _itEditable = function _itEditable(next) {
    if (!_isPublish) {
      next();
    } else {
      (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
        labelCancel: "no",
        labelValid: "yes",
        message: 'Would you want unpublish ?',
        legend: 'to edit the form unpublish this',
        onValid: function onValid() {
          return editorUnPublish();
        }
      });
    }
  };

  /**
   * Public method
   **/
  var fn = {
    /**
     * Check if editor is init
     * @return bool isInit
     */
    isInit: function isInit() {
      return _isInit;
    },

    /**
     * Check if wfc is publish
     * @return bool isPublish
     */
    isPublish: function isPublish() {
      return _isPublish;
    },

    /**
     * Check if a fieldConfig has saved
     * @return bool isFieldSaved
     */
    isFieldSaved: function isFieldSaved() {
      return _isFieldSaved;
    },

    /**
     * Check if editor is editable
     * next callback
     */
    itEditable: function itEditable(next) {
      return _itEditable(next);
    },

    /**
     * Call before display editor page
     * @param editorOnSave is callback
     * @param formConfig
     * @param next callback
     */
    start: function start(wfc, formConfig, next) {
      var _formConfig$published = formConfig.published,
          published = _formConfig$published === undefined ? false : _formConfig$published,
          _formConfig$wf_produc = formConfig.wf_producttype_id,
          wf_producttype_id = _formConfig$wf_produc === undefined ? 0 : _formConfig$wf_produc;

      productTypeId = wf_producttype_id;
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      var formEntryState = _WFormManagers.formEntryMgr.get().formState;
      fn.initFieldConfigMgr(formConfig);
      _wfconfig2.default.baobabMgr.init(formEntryState);
      _wfconfig2.default.editor.mgr.observe(formEntryView);
      observeValues(formEntryView);
      editorSave = wfc.onSave;
      editorUnPublish = wfc.onUnPublish;
      if (published == true) {
        fn.onPublish();
      } else {
        fn.onUnPublish();
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    },


    /**
     * Get productTypeId
     * @return wf_producttype_id
     */
    getProductTypeId: function getProductTypeId() {
      return productTypeId;
    },

    /**
     * Ready : refresh state
     * @param additional object value
     */
    change: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _wfconfig2.default.editor.mgr.change(obj);
    },

    /**
     * Ready : refresh state
     * @param additional object value
     */
    ready: function ready() {
      _wfconfig2.default.editor.mgr.ready();
    },

    /**
     * Call when the user enters the page
     * @param next callback
     */
    onInit: function onInit() {
      if (!_isInit) {
        _wfconfig2.default.editor.mgr.init();
        (0, _WFAdminView.Pub)(_Constants.WF_REDIRECT, function () {
          return fn.onCancel();
        });
        _isInit = true;
      }
    },

    /**
     * Set new value in cache
     * @param obj
     */
    onCaching: function onCaching(obj) {
      cache.set(obj);
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      if (_isInit) {
        cache.clear();
        editorSave = null;
        productTypeId = null;
        _WFormManagers.formEntryMgr.clear();
        _WFormManagers.formConfigMgr.clear();
        _wfconfig2.default.mgr.clear();
        _wfieldconfig2.default.mgr.clear();
        _wfconfig2.default.editor.mgr.clear();
        _action2.default.onClear();
        // clear global and local Baobab
        _wfconfig2.default.baobabMgr.clear();
        _baobab2.default.onClear(true);
        // reset boolean
        _isInit = false;
        _isPublish = false;
        _isFieldSaved = false;
        (0, _WFAdminView.Pub)(_Constants.WF_PAGE_TITLE);
        (0, _WFAdminView.Pub)(_Constants.WF_REDIRECT);
      }
    },

    /**
     * Call when the user want leave
     */
    onCancel: function onCancel() {
      var _WFConfig$editor$view = _wfconfig2.default.editor.viewMgr.getState(),
          wfc_saved = _WFConfig$editor$view.wfc_saved;

      if (wfc_saved) {
        (0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_HOME, _Constants.TAB_HOME_FORM]);
      } else {
        (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
          labelCancel: "no",
          labelValid: "yes",
          message: 'Are you sure ?',
          legend: "...",
          onValid: function onValid() {
            return (0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_HOME, _Constants.TAB_HOME_FORM]);
          },
          onCancel: function onCancel() {
            return (0, _WFAdminView.Pub)(_Constants.WF_REDIRECT, function () {
              return fn.onCancel();
            });
          }
        });
      }
    },

    /**
     * Set isPublish to true
     */
    onPublish: function onPublish() {
      _isPublish = true;
      _wfconfig2.default.editor.mgr.setPublish(_isPublish);
      _WFormManagers.formEntryMgr.get().formState.setPublished(_isPublish);
    },


    /**
     * Set isPublish to false
     */
    onUnPublish: function onUnPublish() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      _isPublish = false;
      _wfconfig2.default.editor.mgr.setPublish(_isPublish);
      _WFormManagers.formEntryMgr.get().formState.setPublished(_isPublish);

      var _WFAdminView$getCurre = WFAdminView.getCurrentViewState(),
          view_tab_current = _WFAdminView$getCurre.view_tab_current;

      if (view_tab_current === _Constants.TAB_EDITOR_ENTRIES || view_tab_current === _Constants.TAB_EDITOR_ANALYTICS) {
        (0, _WFAdminView.Pub)(_Constants.WF_PAGE, [PAGE_FORM_EDITOR, _Constants.TAB_EDITOR_STUDIO]);
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    },


    /**
     * Save all settings
     */
    onSave: function onSave() {
      var _Object$assign2;

      var productTypeId = fn.getProductTypeId();
      var formConfigState = _WFormManagers.formConfigMgr.get().formState;
      var formEntryState = _WFormManagers.formEntryMgr.get().formState;
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      var attributes = formEntryState.getSettings();
      var stepMgr = formEntryView.getStepMgr();
      var contentMgr = formEntryView.getContentMgr();
      var settingMgr = formEntryView.getSettingMgr();
      // Save Settings
      attributes = (0, _assign2.default)(attributes, (_Object$assign2 = {}, (0, _defineProperty3.default)(_Object$assign2, stepMgr.getKey(), stepMgr.toConfig()), (0, _defineProperty3.default)(_Object$assign2, contentMgr.getKey(), contentMgr.toConfig()), (0, _defineProperty3.default)(_Object$assign2, settingMgr.getKey(), settingMgr.toConfig()), (0, _defineProperty3.default)(_Object$assign2, 'canCreateEntry', _setting2.default.hasLicense(productTypeId)), (0, _defineProperty3.default)(_Object$assign2, 'displayFields', formEntryState.getDisplayFields()), _Object$assign2));
      attributes = (0, _JSON.stringify)(attributes);
      formConfigState.setValues({ attributes: attributes });
      // Save DisplayFields
      /*
      let displayFields = formEntryState.getDisplayFields();
      formConfigState.setDisplayFields(displayFields);
      */
    },

    // THEME SETTING ---------------------- //

    /**
     * Change current theme
     * @param theme is themeName
     */
    onSelectThemeSetting: function onSelectThemeSetting(theme) {
      _itEditable(function () {
        var _WFConfig$themes$get = _wfconfig2.default.themes.get(theme),
            _WFConfig$themes$get$ = _WFConfig$themes$get.settingValues,
            settingValues = _WFConfig$themes$get$ === undefined ? {} : _WFConfig$themes$get$;

        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        _wfconfig2.default.editor.mgr.observe(formEntryView);
        formEntryView.getSettingMgr().select(theme, settingValues);
        formEntryView.ready();
        fn.change();
      });
    },


    /**
     * Edit current setting values
     * @param settingName
     */
    onEditThemeSetting: function onEditThemeSetting(name) {
      _itEditable(function () {
        // Get defaultValues
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        var defaultValues = formEntryView.getSettingMgr().get();
        // Get Ressources
        var config = {};
        var setting = _wfconfig2.default.resources.getSetting(name);

        var _WFConfig$themes$get2 = _wfconfig2.default.themes.get(formEntryView.getSettingMgr().getCurrent()),
            _WFConfig$themes$get3 = _WFConfig$themes$get2.fieldsDisable,
            fieldsDisable = _WFConfig$themes$get3 === undefined ? [] : _WFConfig$themes$get3;

        _utils2.default.setEditorConfig(setting, config);
        // Create formState to manipulate formSettings
        var formState = new _WFormState2.default({
          entry_id: 255 // just to make editor happy. not used
        });
        var formView = _wfconfig2.default.mgr.createFormView(formState, {
          fields: config.fields,
          displayFields: config.displayFields,
          defaultValues: defaultValues
        });
        formView.fieldDisable(fieldsDisable);
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: formView,
          widget: "wf_panel",
          icon: config.icon,
          title: config.label,
          labelValid: "Update",
          labelCancel: "Cancel",
          // Save new values
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
            var values = formState.getCleanValues();
            formEntryView.getSettingMgr().assign(values);
            fn.change();
          },
          // Restore prev values
          onCancel: function onCancel() {
            refreshTheme(defaultValues);
          }
        });
        // Observe form.change to refresh theme settings
        setTimeout(function () {
          formView.sub(_WFConstants.WF_VALUES_CHANGE, function (values) {
            refreshTheme(values);
          });
        }, 300);
      });
    },


    // STEPS ---------------------- //

    /**
     * Create new step
     */
    onCreateStep: function onCreateStep() {
      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        formEntryView.getStepMgr().create();
        formEntryView.ready();
        fn.change();
      });
    },

    /**
     * Delete step
     */
    onDelStep: function onDelStep() {
      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        if (formEntryView.getStepMgr().currentIsEmpty()) {
          formEntryView.getStepMgr().del();
          formEntryView.ready();
          fn.change();
        } else {
          (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
            msg: "Step is not empty..."
          });
        }
      });
    },

    /**
     * Select step
     */
    onSelectStep: function onSelectStep(row) {
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      formEntryView.onSelect(row.id);
    },

    /**
     * Select prev step
     */
    onSelectPrevStep: function onSelectPrevStep() {
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      formEntryView.onPrev();
    },

    /**
     * Select next step
     */
    onSelectNextStep: function onSelectNextStep() {
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      formEntryView.onNext();
    },

    /**
     * Reorder all step
     */
    // todo experimental

    onReorderStep: function onReorderStep(order) {
      var formEntryView = _WFormManagers.formEntryMgr.get().formView;
      formEntryView.getStepMgr().setOrder(order.map(function (o) {
        return o.id;
      }));
      formEntryView.ready();
      fn.change();
    },

    /**
     * Reorder current step contents
     */
    onReorderStepOrder: function onReorderStepOrder(order) {
      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        formEntryView.getStepMgr().setCurrentOrder(order);
        formEntryView.generateDisplayFields();
        fn.change();
      });
    },

    // CONTENTS BUILDER ---------------------- //

    /**
     * Get default config
     * @return object contains current & schema
     */
    getContentBuilderConfig: function getContentBuilderConfig() {
      return {
        current: "test-1",
        schema: [{
          title: "",
          name: "test-1",
          type: "button",
          data: [{
            label: "Add Fields"
          }, {
            label: "Add Content"
          }]
        }, {
          title: "Select Content Style",
          name: "test-2",
          type: "button",
          data: [{
            label: "Classic Content"
          }, {
            label: "Extra Content"
          }]
        }, {
          title: "Select Content Type",
          name: "test-3",
          type: "icon",
          data: [{
            label: "Select 1",
            icon: "pencil"
          }, {
            label: "Select 2",
            icon: "picture"
          }, {
            label: "Select 3",
            icon: "play"
          }, {
            label: "Select 4",
            icon: "wonderforms"
          }]
        }]
      };
    },

    /**
     * Control the Editor Comonent
     * @param builderCpt is react component
     * @param value is option selected
     */
    onContentBuilder: function onContentBuilder(builderCpt, value) {
      _itEditable(function () {

        console.error("onContentBuilder...");

        var current = builderCpt.state.current;


        console.error("ON SELECT", current);
        console.log(value);
      });
    },

    // CONTENTS ---------------------- //

    /**
     * Create new content
     */
    onCreateContent: function onCreateContent() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      _itEditable(function () {
        var _options$isField = options.isField,
            isField = _options$isField === undefined ? false : _options$isField,
            _options$fieldConfig = options.fieldConfig,
            fieldConfig = _options$fieldConfig === undefined ? null : _options$fieldConfig;

        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        var content = formEntryView.getContentMgr().create(args);
        formEntryView.getStepMgr().addElem(content.name);
        if (type) {
          formEntryView.getStepMgr().setCurrentType(type);
        }
        if (isField) {
          formEntryView.addFields([fieldConfig]);
          formEntryView.generateDisplayFields();
        }
        formEntryView.ready();
        fn.change();
      });
    },

    /**
     * Update content
     */
    onUpdateContent: function onUpdateContent(name) {
      var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        var content = formEntryView.getContentMgr().create(args);
        formEntryView.getStepMgr().addElem(content.name);
        formEntryView.getContentMgr().assign(name, values);
        formEntryView.ready();
        fn.change();
      });
    },

    /**
     * Delete content
     */
    onDelContent: function onDelContent(name) {
      var isField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        formEntryView.getStepMgr().delElem(name);
        formEntryView.getContentMgr().del(name);
        if (isField) {
          formEntryView.deleteField(name);
          formEntryView.generateDisplayFields();
        }
        formEntryView.ready();
        fn.change();
      });
    },

    /**
     * Ignore content
     */
    onIgnoreContent: function onIgnoreContent(name) {
      _itEditable(function () {
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        formEntryView.getContentMgr().ignore(name);
        formEntryView.ready();
        fn.change();
      });
    },

    /**
     * Delete content
     */
    onEditGridContent: function onEditGridContent(name) {
      _itEditable(function () {
        var config = {};
        var setting = _wfconfig2.default.resources.getSetting("gridStrategy");
        _utils2.default.setEditorConfig(setting, config);
        // Get defaultValues
        var formEntryView = _WFormManagers.formEntryMgr.get().formView;
        var defaultValues = formEntryView.getContentMgr().get(name);
        // Create formState to manipulate formSettings
        var formState = new _WFormState2.default({
          entry_id: 255 // just to make editor happy. not used
        });
        var formView = _wfconfig2.default.mgr.createFormView(formState, {
          fields: config.fields,
          displayFields: config.displayFields,
          defaultValues: {
            cols: (0, _JSON.stringify)(defaultValues.cols)
          }
        });
        // Open editor
        var fld = formView.getField("cols");
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: formView,
          widget: "wf_panel",
          icon: config.icon,
          title: config.label,
          labelValid: "Update",
          labelCancel: "Cancel",
          // Save new values
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
            fn.change();
          },
          // Restore prev values
          onCancel: function onCancel() {
            formEntryView.getContentMgr().assign(name, defaultValues);
            formEntryView.changeContent();
          }
        });
        // Observe values.change to refresh live player
        setTimeout(function () {
          formView.sub(_WFConstants.WF_VALUES_CHANGE, function () {
            var cols = (0, _JSON.parse)(fld.getValue());
            formEntryView.getContentMgr().assign(name, { cols: cols });
            formEntryView.changeContent();
          });
        }, 300);
      });
    },

    // FIELDCONFIG ---------------------- //

    /**
     * Init WFieldConfigMgr
     * @param formConfig
     */
    initFieldConfigMgr: function initFieldConfigMgr(formConfig) {
      _wfieldconfig2.default.mgr.init(formConfig);
    },


    /**
     * Save fieldState
     * @param formState
     * @param next callback
     */
    onSaveFieldConfig: function onSaveFieldConfig() {
      var fieldState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var reload = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

      (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
      _wfieldconfig2.default.mgr.save(fieldState, {
        onSuccess: function onSuccess(fieldConfig) {
          // Stop loader
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          // if next fire
          if ((0, _Lodash.isFunction)(next)) {

            _isFieldSaved = true;
            var formConfigView = _WFormManagers.formConfigMgr.get().formView;
            var formEntryView = _WFormManagers.formEntryMgr.get().formView;
            // Update current form
            formConfigView.createOrUpdateField(fieldConfig);
            formEntryView.createOrUpdateField(fieldConfig);
            formEntryView.ready();

            // Reload form
            if (reload) {
              formEntryView.onReload(100, formEntryView.steps.getCurrentIndex());
              next(fieldConfig);
            } else {
              next(fieldConfig);
            }
          }
        },
        onError: function onError(err) {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          _WFormViewHelpers2.default.mapError(err, function (msg) {
            (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
              type: _Constants.NOTIFY_ERROR,
              msg: msg,
              delay: 6000
            });
          });
        }
      });
    },

    /**
     * 0/ Create new fieldConfig
     * 1/ save fieldConfig
     * 2/ create fieldConfig's content
     * 3/ save formConfigState
     */
    onCreateFieldConfig: function onCreateFieldConfig() {
      _itEditable(function () {
        var _formEntryMgr$get = _WFormManagers.formEntryMgr.get(),
            formView = _formEntryMgr$get.formView,
            formState = _formEntryMgr$get.formState;
        // get product id and check license


        var productTypeId = fn.getProductTypeId();
        var isLimited = _setting2.default.isProductTypeLimited(productTypeId);
        // Create formView and limit fields by license status
        var fieldView = _wfieldconfig2.default.mgr.create(formState.getFormId(), isLimited);
        if (_WFormManagers.formEntryMgr.formView.getSettingMgr().getCurrent() !== "WFTheme") {
          isLimited = true;
        }
        if (isLimited || !isLimited && formView.steps.getCurrentType()) {
          fieldView.fieldHidden("contentType");
        }
        // Get field searchable and set by default
        var searchableFlds = formState.getAllFieldSearchable().filter(function (schema) {
          var type = schema.type;

          return type === "string" || type === "text" || type === "number" || type.includes("select");
        });
        var countSearchableFlds = searchableFlds.length;
        if (countSearchableFlds <= 10) {
          var searchableMgr = fieldView.getField('searchable');
          searchableMgr.setValue(true);
        }
        // Open editor
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: fieldView,
          widget: "wf_modal",
          icon: "cog",
          title: "Create Field",
          message: "...",
          labelValid: "Create",
          labelCancel: "Cancel",
          onValid: function onValid() {
            // Create fieldConfig in wfapi (server)
            var fieldState = fieldView.getFormState();
            var flds = fieldState.getFields();
            fn.onSaveFieldConfig(fieldState, function (fieldConfig) {
              fn.onCreateContent({
                isField: true,
                name: flds.name.getValue()
              }, flds.contentType.getValue(), {
                isField: true,
                fieldConfig: fieldConfig
              });
              editorSave(null, function () {
                _isFieldSaved = false;
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                  type: _Constants.NOTIFY_SUCCESS,
                  msg: "Field is created...",
                  delay: 3000
                });
              });
            });
          }
        });
      });
    },


    /**
     * Delete fieldConfig
     * @param fieldName
     */
    onDelFieldConfig: function onDelFieldConfig(fieldName) {
      _itEditable(function () {
        (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
          labelCancel: "no",
          labelValid: "yes",
          message: 'Would you want to delete field ?',
          legend: fieldName,
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
            var schema = _WFormManagers.formConfigMgr.get().formState.getField(fieldName).getSchema();
            var fieldView = _wfieldconfig2.default.mgr.edit(fieldName, { schema: schema });
            var fieldState = fieldView.getFormState();
            _wfconfig2.default.baobabMgr.delFieldConfigBranch(schema.wf_optiongroup_id, fieldState, {
              onError: function onError(err) {
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                console.error(err);
                console.dir(err);
              },
              onSuccess: function onSuccess() {
                _wfieldconfig2.default.mgr.del(fieldState, {
                  onSuccess: function onSuccess(row) {
                    fn.onDelContent(fieldName, true);
                    editorSave(null, function () {
                      _isFieldSaved = false;
                      (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                      (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                        type: _Constants.NOTIFY_SUCCESS,
                        msg: "Field is deleted...",
                        delay: 3000
                      });
                    });
                  },
                  onError: function onError(err) {
                    (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                    // Todo charly add errors view
                    console.error("_____ERROR____");
                    console.dir(err);
                  }
                });
              }
            });
          }
        });
      });
    },


    /**
     * Edit fieldConfig
     * @param fieldName
     */
    onEditFieldConfig: function onEditFieldConfig(fieldName, fieldInputType) {
      _itEditable(function () {
        var schema = _WFormManagers.formConfigMgr.get().formState.getField(fieldName).getSchema();
        var fieldView = _wfieldconfig2.default.mgr.edit(fieldName, { schema: schema });
        fn.controlMonkeyField(fieldName, fieldInputType, fieldView);
        var cancelCallBack = fn.observeWonderField(fieldName, fieldInputType, fieldView);
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: fieldView,
          widget: "wf_panel",
          icon: "cog",
          title: "Field Setting",
          message: "...",
          labelValid: "Update",
          labelCancel: "Cancel",
          onValid: function onValid() {
            fn.onSaveFieldConfig(fieldView.getFormState(), function (fieldConfig) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                type: _Constants.NOTIFY_SUCCESS,
                msg: "Field is updated...",
                delay: 3000
              });
            }, true // reload
            );
          },
          onCancel: function onCancel() {
            if ((0, _Lodash.isFunction)(cancelCallBack)) {
              cancelCallBack();
            }
          }
        });
      });
    },


    /**
     * Observe WonderField
     * @param fieldName
     * @param fieldInputType
     * @param fieldView
     */
    observeWonderField: function observeWonderField(fieldName, fieldInputType, fieldView) {
      var fieldObservable = ["WFieldSelectWord", "WFieldSelectNum", "WFieldSelectLine", "WFieldSelectImage"];
      var propObservable = [
      //"label", 
      //"wf_label",
      //"legend",
      "wf_height", "wf_width", "wf_option_image_height", "wf_option_image_radius", "wf_option_width"];
      if (fieldObservable.includes(fieldInputType)) {
        var fld = _WFormManagers.formEntryMgr.formState.getField(fieldName);
        if (!fld) {
          return null;
        } else {
          var input = fld.getInputMgr();
          var defaultValues = fld.getSchema();
          var callback = function callback() {
            input.setState(defaultValues);
          };
          setTimeout(function () {
            fieldView.sub(_WFConstants.WF_VALUES_CHANGE, function (values) {
              var nextValues = {};
              propObservable.forEach(function (key) {
                if (values.hasOwnProperty(key) && values[key] != defaultValues[key]) {
                  nextValues[key] = values[key];
                }
              });
              input.setState(nextValues);
            });
          }, 300);
          return callback;
        }
      } else {
        return null;
      }
    },


    /**
     * Edit Monkey Field
     * @param fieldName
     * @param fieldInputType
     * @param fieldView
     */
    controlMonkeyField: function controlMonkeyField(fieldName, fieldInputType, fieldView) {
      if (fieldInputType.includes('monkey')) {
        var _formEntryMgr$get2 = _WFormManagers.formEntryMgr.get(),
            formState = _formEntryMgr$get2.formState,
            formView = _formEntryMgr$get2.formView;

        var initialValue = "none";
        var fields = fieldView.getFields();
        var schema = formState.getAllFieldSelect();
        var data = schema.filter(function (f) {
          var name = f.name,
              _f$isBaobab = f.isBaobab,
              isBaobab = _f$isBaobab === undefined ? false : _f$isBaobab,
              _f$isMonkey = f.isMonkey,
              isMonkey = _f$isMonkey === undefined ? false : _f$isMonkey;

          if (name !== fieldName && isBaobab || name !== fieldName && isMonkey) {
            return f;
          }
        });
        data.unshift({
          name: "none",
          label: "Select Field..."
        });
        fields.monkeyObserve.getInputMgr().setData(data);
        fieldView.sub(_WFConstants.WF_VALUES_CHANGE, function (newValues) {

          console.error("MONKEY SELECT CHANGE...");
          console.dir(newValues);

          if (!newValues || !newValues.hasOwnProperty("monkeyFilterBy")) {
            return;
          }
          var monkeyFilterByVal = newValues["monkeyFilterBy"];
          var monkeyObserveVal = newValues["monkeyObserve"];

          console.error("GET SCHEMA", monkeyObserveVal);
          console.log('\n            monkeyFilterByVal ' + monkeyFilterByVal + '\n            monkeyObserveVal ' + monkeyObserveVal + '\n\n            monkeyObserveVal !== initialValue ' + (monkeyObserveVal !== initialValue) + '\n          ');

          var fld = formState.getField(monkeyObserveVal);
          console.error("GET FLD");
          console.dir(fld);

          if (monkeyObserveVal === "none") {
            fields.monkeyBranch.getInputMgr().setData([]);
            fields.monkeyBranch.clearValue();
          } else if (fld) {
            initialValue = monkeyObserveVal;

            var _fld$getSchema = fld.getSchema(),
                name = _fld$getSchema.name,
                _fld$getSchema$isBaob = _fld$getSchema.isBaobab,
                isBaobab = _fld$getSchema$isBaob === undefined ? false : _fld$getSchema$isBaob,
                _fld$getSchema$isMonk = _fld$getSchema.isMonkey,
                isMonkey = _fld$getSchema$isMonk === undefined ? false : _fld$getSchema$isMonk,
                monkeyGroup = _fld$getSchema.monkeyGroup,
                wf_optiongroup = _fld$getSchema.wf_optiongroup,
                optionType = _fld$getSchema.optionType;

            console.error("GET SCHEMA", monkeyObserveVal);
            console.dir(fld.getSchema());

            if (isMonkey) {
              fields.monkeyGroup.setValue(monkeyGroup);
              fn.findBranch(monkeyGroup, function (branches) {
                fields.monkeyGroup.setValue(monkeyGroup);
                fields.monkeyBranch.getInputMgr().setData(branches);
              });
            } else if (isBaobab) {
              if (optionType === "tree") {

                console.error("FLD IS TREE");

                fn.findBranch(name, function (branches) {
                  fields.monkeyGroup.setValue(name);
                  fields.monkeyBranch.getInputMgr().setData(branches);
                });
              } else if (optionType === "branch") {

                console.error("FLD IS BRANCH");
                console.dir(wf_optiongroup);

                var parent_id = wf_optiongroup.parent_id;

                fn.findBranch(name, function (branches) {
                  fields.monkeyGroup.setValue(name);
                  fields.monkeyBranch.getInputMgr().setData(branches);
                });
              }
            }
          }

          return;

          if (monkeyObserveVal === "none") {
            fields.monkeyBranch.getInputMgr().setData([]);
            fields.monkeyBranch.clearValue();
          } else if (monkeyObserveVal !== initialValue) {

            console.error("GET FLD 22");
            console.dir(fld);

            if (fld) {
              initialValue = monkeyObserveVal;

              var _fld$getSchema2 = fld.getSchema(),
                  _name = _fld$getSchema2.name,
                  _fld$getSchema2$isBao = _fld$getSchema2.isBaobab,
                  _isBaobab = _fld$getSchema2$isBao === undefined ? false : _fld$getSchema2$isBao,
                  _fld$getSchema2$isMon = _fld$getSchema2.isMonkey,
                  _isMonkey = _fld$getSchema2$isMon === undefined ? false : _fld$getSchema2$isMon,
                  _monkeyGroup = _fld$getSchema2.monkeyGroup,
                  _wf_optiongroup = _fld$getSchema2.wf_optiongroup;

              console.error("GET SCHEMA", monkeyObserveVal);
              console.dir(fld.getSchema());

              if (_isMonkey) {
                fields.monkeyGroup.setValue(_monkeyGroup);
                fn.findBranch(_monkeyGroup, function (branches) {
                  fields.monkeyGroup.setValue(_name);
                  fields.monkeyBranch.getInputMgr().setData(branches);
                });
              } else if (_isBaobab) {
                fn.findBranch(_name, function (branches) {
                  fields.monkeyGroup.setValue(_name);
                  fields.monkeyBranch.getInputMgr().setData(branches);
                });
              }

              console.error("FLD SCHEMA...");
              console.dir(fld.getSchema());
            }
          }

          /*
          if (monkeyFilterByVal === "option") {
            fields.monkeyBranch.getInputMgr().setData([]);
            fields.monkeyBranch.clearValue();
          } else {
           }
          */
        });
      }
    },


    /**
     * Find All Branch of field
     * @param fieldName
     * @param callback
     */
    findBranch: function findBranch(fieldName, callback) {
      var _formEntryMgr$get3 = _WFormManagers.formEntryMgr.get(),
          formState = _formEntryMgr$get3.formState,
          formView = _formEntryMgr$get3.formView;

      var fld = formState.getField(fieldName);
      if (fld) {
        var input = fld.getInputMgr();
        if (input.hasOwnProperty("baobabOptMgr")) {
          input.baobabOptMgr.findBranch({}, function () {
            var _input$baobabOptMgr$g = input.baobabOptMgr.getSchema(),
                branches = _input$baobabOptMgr$g.branches;

            callback(branches);
          });
        }
      }
    },


    /**
     * Toggle fieldConfig visible
     * @param fieldName
     * @param isVisible
     */
    onToggleVisibleFieldConfig: function onToggleVisibleFieldConfig(fieldName, isVisible) {
      _itEditable(function () {
        var schema = _WFormManagers.formConfigMgr.get().formState.getField(fieldName).getSchema();
        var fieldView = _wfieldconfig2.default.mgr.edit(fieldName, { schema: schema });
        var formState = fieldView.getFormState();
        formState.setValues({ visible: !isVisible });
        fn.onSaveFieldConfig(formState, function (fieldConfig) {
          (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
          (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
            type: _Constants.NOTIFY_SUCCESS,
            msg: "Field is updated...",
            delay: 3000
          });
        }, true // reload
        );
      });
    },


    /**
     * Edit fieldConfig Validation Strategy
     * @param fieldName
     * @param fieldInputType
     */
    onEditFieldConfigValidation: function onEditFieldConfigValidation(fieldName, fieldInputType) {
      _itEditable(function () {
        var _WFieldConfig$resourc = _wfieldconfig2.default.resources.getField(fieldInputType),
            _WFieldConfig$resourc2 = _WFieldConfig$resourc.validationStrategy,
            validationStrategy = _WFieldConfig$resourc2 === undefined ? {} : _WFieldConfig$resourc2;

        var _validationStrategy$d = validationStrategy.displayFields,
            displayFields = _validationStrategy$d === undefined ? [] : _validationStrategy$d,
            _validationStrategy$v = validationStrategy.validation_schema,
            validation_schema = _validationStrategy$v === undefined ? {} : _validationStrategy$v;

        var schema = _WFormManagers.formConfigMgr.get().formState.getField(fieldName).getSchema();
        var fieldView = _wfieldconfig2.default.mgr.edit(fieldName, {
          schema: schema,
          displayFields: displayFields,
          validation_schema: validation_schema
        });
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: fieldView,
          widget: "wf_panel",
          icon: "police",
          title: "Validation Strategy",
          message: "...",
          labelValid: "Update",
          labelCancel: "Cancel",
          onValid: function onValid() {
            fn.onSaveFieldConfig(fieldView.getFormState(), function (fieldConfig) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                type: _Constants.NOTIFY_SUCCESS,
                msg: "Field is updated...",
                delay: 3000
              });
            }, true // reload
            );
          }
        });
      });
    },


    /**
     * Edit Baobab fields options
     * @param fieldName
     */
    onEditFieldConfigBaobab: function onEditFieldConfigBaobab(fieldName, fieldInputType) {
      _itEditable(function () {
        var _WFieldConfig$resourc3 = _wfieldconfig2.default.resources.getField(fieldInputType),
            info = _WFieldConfig$resourc3.info;

        var _info$isBaobab = info.isBaobab,
            isBaobab = _info$isBaobab === undefined ? false : _info$isBaobab,
            _info$isBaobabBranch = info.isBaobabBranch,
            isBaobabBranch = _info$isBaobabBranch === undefined ? false : _info$isBaobabBranch;

        var size = 'lg';
        var title = null;

        var customView = null;
        var customViewArgs = {};

        var formConfigState = _WFormManagers.formConfigMgr.get().formState;
        var formEntryState = _WFormManagers.formEntryMgr.get().formState;

        var fieldConfigSchema = formConfigState.getField(fieldName).getSchema();
        var fieldEntryState = formEntryState.getField(fieldName);
        var fieldView = _wfieldconfig2.default.mgr.edit(fieldName, { schema: fieldConfigSchema });

        var onSave = null;
        var onClearBaobab = function onClearBaobab() {
          return _baobab2.default.onClear(true);
        };
        var save = function save() {
          var reload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

          fn.onSaveFieldConfig(fieldView.getFormState(), function (fieldConfig) {
            _isFieldSaved = false;
          }, reload);
        };

        // EDIT BAOBAB --------- //

        if (isBaobab) {
          var _fieldConfigSchema$op = fieldConfigSchema.optionType,
              optionType = _fieldConfigSchema$op === undefined ? "" : _fieldConfigSchema$op,
              wf_optiongroup = fieldConfigSchema.wf_optiongroup,
              _fieldConfigSchema$wf = fieldConfigSchema.wf_optiongroup_id,
              wf_optiongroup_id = _fieldConfigSchema$wf === undefined ? null : _fieldConfigSchema$wf;

          if (wf_optiongroup_id) {
            var optionConfig = wf_optiongroup;
            optionConfig["id"] = optionConfig.id.toString();
            if (optionType === "tree") {
              customViewArgs[TREE_SELECTED] = optionConfig;
            } else if (optionType === "branch") {
              customViewArgs[BRANCH_SELECTED] = optionConfig;
            }
          }
          onSave = function onSave() {
            var optType = "";
            var optConfig = {};
            var optionTypeMgr = fieldView.getField("optionType");
            var optionGroupIdMgr = fieldView.getField("wf_optiongroup_id");
            var monkeyBranchMgr = fieldView.getField("monkeyBranch");
            if (cache.get(TREE_SELECTED)) {
              optConfig = cache.get(TREE_SELECTED);
              optType = "tree";
            } else if (cache.get(BRANCH_SELECTED)) {
              optConfig = cache.get(BRANCH_SELECTED);
              optType = "branch";
            }
            if ((0, _keys2.default)(optConfig).length > 0 && optConfig.hasOwnProperty('id')) {
              optionTypeMgr.setValue(optType);
              optionGroupIdMgr.setValue(optConfig.id);
              if (optType === "branch") {
                monkeyBranchMgr.setValue(optConfig.parent_id);
              }
              setTimeout(function () {
                return save();
              }, 100);
            }
            onClearBaobab();
            (0, _WFAdminView.Pub)(_Constants.WF_PANELS);
          };

          (0, _WFAdminView.Pub)(_Constants.WF_PANELS, {
            customView: "WFBaobab",
            customViewArgs: customViewArgs,
            title: "Baobab Select2 Manager",
            icon: "layers",
            size: 'md',
            onValid: function onValid() {
              return onSave();
            },
            onCancel: function onCancel() {
              return onClearBaobab();
            }
          });
        }

        // EDIT BAOBAB BRANCH --------- //

        else if (isBaobabBranch) {

            fn.createBaobabBranch(fieldView.getFormState(), function () {
              if (fieldInputType === "select") {
                onSave = function onSave() {
                  var data = _wfconfig2.default.baobabMgr.getCurrentBranch().getOptionMgr().map(function (o) {
                    return {
                      label: o.label,
                      id: o.id
                    };
                  });
                  fieldView.setValues({ data: data });
                  (0, _WFAdminView.Pub)(_Constants.WF_PANELS);
                  setTimeout(function () {
                    onClearBaobab();
                    save();
                  }, 100);
                };
              } else {
                onSave = function onSave() {
                  var data = _wfconfig2.default.baobabMgr.getCurrentBranch().getOptionMgr().getValue();
                  fieldView.setValues({ data: data });
                  (0, _WFAdminView.Pub)(_Constants.WF_PANELS);
                  setTimeout(function () {
                    onClearBaobab();
                    save();
                  }, 100);
                };
              }

              var _formConfigState$getF = formConfigState.getField(fieldName).getSchema(),
                  wf_optiongroup = _formConfigState$getF.wf_optiongroup;

              customView = "WFBaobabBranch";
              customViewArgs["optionConfig"] = wf_optiongroup;
              (0, _WFAdminView.Pub)(_Constants.WF_PANELS, {
                customView: "WFBaobabBranch",
                customViewArgs: customViewArgs,
                title: "Select Manager",
                icon: "layers",
                size: 'md',
                onValid: function onValid() {
                  return onSave();
                },
                onCancel: function onCancel() {
                  return onClearBaobab();
                }
              });
            });
          }
      });
    },


    /**
     * Create Baobab branch if fieldState need
     * @param fieldState
     * @param next callback
     */
    createBaobabBranch: function createBaobabBranch(fieldState, next) {
      _wfconfig2.default.baobabMgr.createFieldConfigBranch(fieldState, {
        onError: function onError(err) {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
        },
        onSuccess: function onSuccess(isBranch) {
          if (!isBranch) {
            next();
          } else {
            fn.onSaveFieldConfig(fieldState, function (fieldConfig) {
              editorSave(null, function () {
                _isFieldSaved = false;
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                  type: _Constants.NOTIFY_SUCCESS,
                  msg: "Field is update...",
                  delay: 3000
                });
                next();
              });
            });
          }
        }
      });
    }
  };
  return fn;
}();

exports.default = editor;

/***/ }),
/* 171 */,
/* 172 */,
/* 173 */,
/* 174 */,
/* 175 */,
/* 176 */,
/* 177 */,
/* 178 */,
/* 179 */,
/* 180 */,
/* 181 */,
/* 182 */,
/* 183 */,
/* 184 */,
/* 185 */,
/* 186 */,
/* 187 */,
/* 188 */,
/* 189 */,
/* 190 */,
/* 191 */,
/* 192 */,
/* 193 */,
/* 194 */,
/* 195 */,
/* 196 */,
/* 197 */,
/* 198 */,
/* 199 */,
/* 200 */,
/* 201 */,
/* 202 */,
/* 203 */,
/* 204 */,
/* 205 */,
/* 206 */,
/* 207 */,
/* 208 */,
/* 209 */,
/* 210 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf-section-boxed",
    row: "row"
};

// ------------------- //

var WFBoxed = function (_Component) {
    (0, _inherits3.default)(WFBoxed, _Component);

    function WFBoxed() {
        (0, _classCallCheck3.default)(this, WFBoxed);
        return (0, _possibleConstructorReturn3.default)(this, (WFBoxed.__proto__ || (0, _getPrototypeOf2.default)(WFBoxed)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFBoxed, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$row = _props.row,
                row = _props$row === undefined ? true : _props$row,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className;

            return _react2.default.createElement(
                "div",
                { className: (row ? classes.row : "") + " " + classes.wrapper + " " + className
                },
                this.props.children
            );
        }
    }]);
    return WFBoxed;
}(_react.Component);

// ------------------- //

exports.default = WFBoxed;

// ------------------- //

/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//import Chartist from "chartist";

if (!Chartist) {
  console.error("Chartist not found...");
}

// ------------------- //

// WF CHARTIST GRAPH ------------------- //

// ------------------- //

var WFChartistGraph = function (_Component) {
  (0, _inherits3.default)(WFChartistGraph, _Component);

  function WFChartistGraph(props) {
    (0, _classCallCheck3.default)(this, WFChartistGraph);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFChartistGraph.__proto__ || (0, _getPrototypeOf2.default)(WFChartistGraph)).call(this, props));

    _this.displayName = 'WFChartistGraph';
    _this.chartist = null;
    _this.state = {};
    return _this;
  }

  // ------------------- //

  (0, _createClass3.default)(WFChartistGraph, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          _props$className = _props.className,
          className = _props$className === undefined ? "" : _props$className,
          _props$wrapperClassNa = _props.wrapperClassName,
          wrapperClassName = _props$wrapperClassNa === undefined ? "" : _props$wrapperClassNa,
          style = _props.style,
          children = _props.children,
          data = _props.data,
          type = _props.type;

      var childrenWithProps = children && _react.Children.map(children, function (child) {
        return (0, _react.cloneElement)(child, {
          type: type,
          data: data
        });
      });
      return _react2.default.createElement(
        'div',
        { className: 'wf--chart ' + wrapperClassName },
        _react2.default.createElement(
          'div',
          { className: 'ct-chart ' + (className || ''), ref: 'chart', style: style },
          childrenWithProps
        )
      );
    }

    // ------------------- //

  }, {
    key: 'updateChart',
    value: function updateChart(config) {
      var type = config.type,
          data = config.data;

      var options = config.options || {};
      var responsiveOptions = config.responsiveOptions || [];
      var event = void 0;
      if (this.chartist) {
        this.chartist.update(data, options, responsiveOptions);
      } else {
        this.chartist = new Chartist[type](this.refs.chart, data, options, responsiveOptions);
        if (config.listener) {
          for (event in config.listener) {
            if (config.listener.hasOwnProperty(event)) {
              this.chartist.on(event, config.listener[event]);
            }
          }
        }
      }
      return this.chartist;
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(newProps) {
      this.updateChart(newProps);
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      if (this.chartist) {
        try {
          this.chartist.detach();
        } catch (err) {
          throw new Error('Internal chartist error', err);
        }
      }
    }
  }, {
    key: 'componentDidMount',
    value: function componentDidMount() {
      this.updateChart(this.props);
    }
  }]);
  return WFChartistGraph;
}(_react.Component);

// ------------------- //

WFChartistGraph.propTypes = {
  type: _react2.default.PropTypes.oneOf(['Line', 'Bar', 'Pie']).isRequired,
  data: _react2.default.PropTypes.object.isRequired,
  className: _react2.default.PropTypes.string,
  options: _react2.default.PropTypes.object,
  responsiveOptions: _react2.default.PropTypes.array,
  style: _react2.default.PropTypes.object
};

// ------------------- //
exports.default = WFChartistGraph;
// ------------------- //

/***/ }),
/* 212 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ERROR ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-errors",
	error: "wf-error"
};

// ------------------- //

var WFError = function (_Component) {
	(0, _inherits3.default)(WFError, _Component);

	function WFError() {
		(0, _classCallCheck3.default)(this, WFError);
		return (0, _possibleConstructorReturn3.default)(this, (WFError.__proto__ || (0, _getPrototypeOf2.default)(WFError)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFError, [{
		key: "render",


		// ------------------- //

		value: function render() {
			var _props$errors = this.props.errors,
			    errors = _props$errors === undefined ? null : _props$errors;

			if (!errors || (0, _Lodash.isArray)(errors) && errors.length === 0) return false;
			return _react2.default.createElement(
				"wf-error",
				null,
				this.get(errors)
			);
		}

		// ------------------- //

	}, {
		key: "get",
		value: function get(errors) {
			if ((0, _Lodash.isArray)(errors)) return this.getErrors(errors);else if ((0, _Lodash.isString)(errors)) return this.getError(errors);else return false;
		}

		// SINGLE ------------------- //

	}, {
		key: "getError",
		value: function getError() {
			var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
			var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

			if (!error) return false;
			return _react2.default.createElement(
				"span",
				{ key: i, className: classes.error },
				error
			);
		}

		// ARCHIVE ------------------- //

	}, {
		key: "getErrors",
		value: function getErrors() {
			var _this2 = this;

			var errors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

			if (errors.length === 0) return false;
			return _react2.default.createElement(
				"div",
				{ className: classes.wrapper },
				errors.map(function (err, i) {
					return _this2.getError(err, i);
				})
			);
		}
	}]);
	return WFError;
}(_react.Component);

// ------------------- //

exports.default = WFError;

// ------------------- //

/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.OPTIONS = undefined;

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TYPE_PHONE = "phone";
var TYPE_TABLETS = "tablet";
var TYPE_LAPTOP = "laptop";
var TYPE_DESKTOP = "desktop";

var FRAME_LANDSCAPE = 1;
var FRAME_PORTRAIT = 2;

var OPTIONS = exports.OPTIONS = [{
  type: TYPE_PHONE,
  position: FRAME_PORTRAIT,
  isMobile: true,
  width: "100%",
  height: "375px",
  maxWidth: "627px"
}, {
  type: TYPE_TABLETS,
  position: FRAME_LANDSCAPE,
  isMobile: true,
  width: "100%",
  height: "768px",
  maxWidth: "1024px"
}, {
  type: TYPE_LAPTOP,
  position: FRAME_LANDSCAPE,
  isMobile: false,
  width: "100%",
  height: "768px",
  maxWidth: "1366px"
}, {
  type: TYPE_DESKTOP,
  position: FRAME_LANDSCAPE,
  isMobile: false,
  width: "100%",
  height: "780px",
  maxWidth: "100%"
}];

// ------------------- //

// WF LIVE PLAYER ------------------- //

// ------------------- //

var WFLivePlayer = function (_Component) {
  (0, _inherits3.default)(WFLivePlayer, _Component);

  function WFLivePlayer(props) {
    (0, _classCallCheck3.default)(this, WFLivePlayer);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFLivePlayer.__proto__ || (0, _getPrototypeOf2.default)(WFLivePlayer)).call(this, props));

    var _props$option = props.option,
        option = _props$option === undefined ? OPTIONS[3] : _props$option;

    _this.isInit = false;
    _this.frame = null;
    _this.state = (0, _extends3.default)({
      visible: false,
      title: ""
    }, option, {
      option: option
    });
    return _this;
  }

  (0, _createClass3.default)(WFLivePlayer, [{
    key: "render",
    value: function render() {
      var _state$visible = this.state.visible,
          visible = _state$visible === undefined ? false : _state$visible;

      if (!visible) {
        return false;
      } else {
        return _react2.default.createElement(
          "wf-live-player",
          null,
          _react2.default.createElement(
            "div",
            { className: "wf-live-player-header" },
            this.getHeader()
          ),
          _react2.default.createElement(
            "div",
            { className: "wf-live-player-body" },
            this.getBody()
          )
        );
      }
    }
  }, {
    key: "getHeader",
    value: function getHeader() {
      var _this2 = this;

      var _state = this.state,
          type = _state.type,
          title = _state.title,
          isMobile = _state.isMobile,
          position = _state.position;
      var onClose = this.props.onClose;

      return _react2.default.createElement(
        _WFRow2.default,
        null,
        _react2.default.createElement(
          _WFCol2.default,
          null,
          _react2.default.createElement(_WFList2.default, {
            rows: OPTIONS,
            selected: [type],
            selectedBy: "type",
            selectable: true,
            rowsClassName: "wf-live-player",
            view: function view(option, i) {
              return _react2.default.createElement(_WFIcon.WFIcon, { icon: option.type });
            },
            onSelect: function onSelect(option) {
              //console.log("onSelect : ", option )
              _this2.setState((0, _extends3.default)({}, option, {
                option: option
              }));
            }
          }),
          _react2.default.createElement(
            _WFText2.default,
            { className: "wf-title" },
            title
          ),
          _react2.default.createElement(_WFIcon.WFIcon, {
            icon: "loop",
            visible: isMobile,
            className: "rotate",
            onClick: function onClick() {
              var newVal = "";
              if (position === FRAME_PORTRAIT) {
                newVal = FRAME_LANDSCAPE;
              } else {
                newVal = FRAME_PORTRAIT;
              }
              _this2.setState({
                position: newVal
              });
            }
          }),
          _react2.default.createElement(_WFIcon.WFIClose, {
            onClick: function onClick() {
              return onClose();
            }
          })
        )
      );
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var _props = this.props,
          _props$height = _props.height,
          height = _props$height === undefined ? 0 : _props$height,
          _props$autoHeight = _props.autoHeight,
          autoHeight = _props$autoHeight === undefined ? false : _props$autoHeight;

      return _react2.default.createElement(
        _WFScrollBars2.default,
        {
          style: {
            width: '100%', height: 900
          } },
        this.getFrame()
      );
    }
  }, {
    key: "getFrame",
    value: function getFrame() {
      var _this3 = this;

      return _react2.default.createElement(
        "div",
        { className: "wf-frame" },
        _react2.default.createElement("iframe", (0, _extends3.default)({
          id: "wf-frame",
          ref: function ref(e) {
            return _this3.frame = e;
          }
        }, this.getFrameConfig()))
      );
    }
  }, {
    key: "getFrameConfig",
    value: function getFrameConfig() {
      var _state2 = this.state,
          position = _state2.position,
          isMobile = _state2.isMobile,
          width = _state2.width,
          height = _state2.height,
          maxWidth = _state2.maxWidth,
          _state2$option = _state2.option,
          option = _state2$option === undefined ? {} : _state2$option;

      var src = this.getFrameSrc();
      var style = {
        width: width,
        height: height,
        maxWidth: maxWidth
      };
      if (isMobile && position === FRAME_PORTRAIT) {
        style = {
          width: width,
          height: option.maxWidth,
          maxWidth: option.height
        };
      }
      return {
        src: src,
        style: style
      };
    }
  }, {
    key: "getFrameSrc",
    value: function getFrameSrc() {
      var _props$src = this.props.src,
          src = _props$src === undefined ? "" : _props$src;
      var _state$id = this.state.id,
          id = _state$id === undefined ? 1 : _state$id;

      return src + "&wf-form=" + id; //"https://fr.yahoo.com/";
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillReceiveProps",
    value: function componentWillReceiveProps() {
      var nextProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (nextProps.hasOwnProperty('option')) {
        if (this.isInit) {
          return;
        }
        var _nextProps$option = nextProps.option,
            option = _nextProps$option === undefined ? {} : _nextProps$option;

        this.setState((0, _extends3.default)({}, option, nextProps));
        this.isInit = true;
      } else {
        this.setState({
          visible: false,
          title: "",
          id: 0
        });
        this.isInit = false;
      }
    }
  }]);
  return WFLivePlayer;
}(_react.Component);

// ------------------- //


exports.default = WFLivePlayer;
// ------------------- //

/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF MODAL ------------------- //

// ------------------- //

var classes = {
    icon: "police",
    state: {
        ready: "wf-ready"
    },
    head: {
        icon: "wf-head-icon",
        close: "wf-head-close",
        title: "wf-head-title",
        description: "wf-head-description"
    },
    foot: {
        cancel: {
            btn: "wf-btn-cancel",
            icon: "close"
        },
        update: {
            btn: "wf-btn-update",
            icon: "check"
        }
    }
};

// ------------------- //

var WFModal = function (_Component) {
    (0, _inherits3.default)(WFModal, _Component);

    function WFModal(props) {
        (0, _classCallCheck3.default)(this, WFModal);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFModal.__proto__ || (0, _getPrototypeOf2.default)(WFModal)).call(this, props));

        var _props$isReady = props.isReady,
            isReady = _props$isReady === undefined ? true : _props$isReady;

        _this.state = {
            ready: isReady
        };
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFModal, [{
        key: "render",
        value: function render() {
            var _props$visible = this.props.visible,
                visible = _props$visible === undefined ? false : _props$visible;

            if (!visible) return false;
            return _react2.default.createElement(
                "wf-modal",
                null,
                _react2.default.createElement(
                    "wf-modal-content",
                    { style: { width: this.props.width || 500 } },
                    this.getHeader(),
                    this.getBody(),
                    this.getFooter()
                )
            );
        }

        // ------------------- //

    }, {
        key: "getHeader",
        value: function getHeader() {
            var _this2 = this;

            var _props = this.props,
                _props$icon = _props.icon,
                icon = _props$icon === undefined ? "cog" : _props$icon,
                _props$iconStyle = _props.iconStyle,
                iconStyle = _props$iconStyle === undefined ? { background: "#ffd200" } : _props$iconStyle,
                _props$onCancelCallBa = _props.onCancelCallBack,
                onCancelCallBack = _props$onCancelCallBa === undefined ? null : _props$onCancelCallBa,
                onChange = _props.onChange;

            return _react2.default.createElement(
                "wf-modal-head",
                null,
                _react2.default.createElement(
                    _WFRow2.default,
                    null,
                    _react2.default.createElement(
                        _WFCol2.default,
                        { xs: "12" },
                        _react2.default.createElement(_WFIcon.WFIClose, {
                            className: classes.head.close,
                            onClick: function onClick() {
                                return _this2.props.onChange(onCancelCallBack);
                            } }),
                        _react2.default.createElement(_WFIcon.WFIcon, { className: classes.head.icon, icon: icon, style: iconStyle }),
                        this.getHeaderContent()
                    )
                )
            );
        }
    }, {
        key: "getHeaderContent",
        value: function getHeaderContent() {
            var _props2 = this.props,
                _props2$title = _props2.title,
                title = _props2$title === undefined ? "Modal Editor" : _props2$title,
                _props2$message = _props2.message,
                message = _props2$message === undefined ? "Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum" : _props2$message,
                _props2$HeaderView = _props2.HeaderView,
                HeaderView = _props2$HeaderView === undefined ? null : _props2$HeaderView;

            if ((0, _Lodash.isFunction)(HeaderView)) {
                return _react2.default.createElement(HeaderView, null);
            } else {
                return _react2.default.createElement(
                    "span",
                    null,
                    _react2.default.createElement(
                        _WFText2.default,
                        { className: classes.head.title },
                        title
                    ),
                    _react2.default.createElement(
                        _WFText2.default,
                        { className: classes.head.description },
                        message
                    )
                );
            }
        }

        // ------------------- //

    }, {
        key: "getBody",
        value: function getBody() {
            var _props$hasScrollBar = this.props.hasScrollBar,
                hasScrollBar = _props$hasScrollBar === undefined ? false : _props$hasScrollBar;

            if (!hasScrollBar) {
                return _react2.default.createElement(
                    "wf-panel-body",
                    null,
                    this.getChildren()
                );
            } else {
                return _react2.default.createElement(
                    "wf-panel-body",
                    null,
                    _react2.default.createElement(
                        _WFScrollBars2.default,
                        {
                            style: {
                                width: "100%",
                                height: this.props.height
                            } },
                        this.getChildren()
                    )
                );
            }
        }
    }, {
        key: "getBody",
        value: function getBody() {
            var _props3 = this.props,
                height = _props3.height,
                children = _props3.children,
                _props3$hasBody = _props3.hasBody,
                hasBody = _props3$hasBody === undefined ? true : _props3$hasBody,
                _props3$hasScrollBar = _props3.hasScrollBar,
                hasScrollBar = _props3$hasScrollBar === undefined ? false : _props3$hasScrollBar;

            if (!hasBody) return false;
            if (!hasScrollBar) {
                return _react2.default.createElement(
                    "wf-modal-body",
                    null,
                    _react2.default.createElement(
                        "div",
                        { style: {
                                padding: "0 5px"
                            } },
                        children
                    )
                );
            } else {
                return _react2.default.createElement(
                    "wf-modal-body",
                    null,
                    _react2.default.createElement(
                        _WFScrollBars2.default,
                        {
                            autoHide: true,
                            autoHeight: true,
                            autoHeightMin: 400,
                            autoHeightMax: height,
                            style: { width: "100%" } },
                        children
                    )
                );
            }
        }

        // ------------------- //

    }, {
        key: "getFooter",
        value: function getFooter() {
            var _this3 = this;

            var _props4 = this.props,
                _props4$labelCancel = _props4.labelCancel,
                labelCancel = _props4$labelCancel === undefined ? "Cancel" : _props4$labelCancel,
                _props4$labelValid = _props4.labelValid,
                labelValid = _props4$labelValid === undefined ? "Save" : _props4$labelValid,
                _props4$onValidCallBa = _props4.onValidCallBack,
                onValidCallBack = _props4$onValidCallBa === undefined ? null : _props4$onValidCallBa,
                _props4$onCancelCallB = _props4.onCancelCallBack,
                onCancelCallBack = _props4$onCancelCallB === undefined ? null : _props4$onCancelCallB,
                onChange = _props4.onChange;
            var ready = this.state.ready;

            return _react2.default.createElement(
                "wf-modal-foot",
                null,
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "6", resetLeft: true },
                    _react2.default.createElement(
                        _WFBtn2.default,
                        {
                            className: classes.foot.cancel.btn,
                            onClick: function onClick() {
                                return _this3.props.onChange(onCancelCallBack);
                            }
                        },
                        labelCancel
                    )
                ),
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "6", resetRight: true },
                    _react2.default.createElement(
                        _WFBtn2.default,
                        {
                            disable: !ready,
                            className: classes.foot.update.btn + " " + (ready ? classes.state.ready : ""),
                            onClick: function onClick() {
                                return _this3.props.onChange(onValidCallBack);
                            }
                        },
                        labelValid
                    )
                )
            );
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: "componentWillReceiveProps",
        value: function componentWillReceiveProps(nextProps) {
            if (nextProps.isReady !== this.state.ready) {
                this.setState({
                    ready: nextProps.isReady
                });
            }
        }
    }]);
    return WFModal;
}(_react.Component);

// ------------------- //

exports.default = WFModal;

// ------------------- //

/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF OVERLAY ------------------- //

// ------------------- //

var WFOverlay = function (_Component) {
    (0, _inherits3.default)(WFOverlay, _Component);

    function WFOverlay() {
        (0, _classCallCheck3.default)(this, WFOverlay);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFOverlay.__proto__ || (0, _getPrototypeOf2.default)(WFOverlay)).call(this));

        _this.state = {
            visible: false,
            color: _Constants.OVERLAY_TRANSPARENT
        };
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFOverlay, [{
        key: 'render',
        value: function render() {
            var _state$visible = this.state.visible,
                visible = _state$visible === undefined ? false : _state$visible;
            var _props = this.props,
                _props$zIndex = _props.zIndex,
                zIndex = _props$zIndex === undefined ? 4000 : _props$zIndex,
                _props$callBacks = _props.callBacks,
                callBacks = _props$callBacks === undefined ? {} : _props$callBacks;

            var _callBacks$onMouseEnt = callBacks.onMouseEnter,
                _onMouseEnter = _callBacks$onMouseEnt === undefined ? null : _callBacks$onMouseEnt,
                _callBacks$onMouseLea = callBacks.onMouseLeave,
                _onMouseLeave = _callBacks$onMouseLea === undefined ? null : _callBacks$onMouseLea,
                _callBacks$onTouchSta = callBacks.onTouchStart,
                _onTouchStart = _callBacks$onTouchSta === undefined ? null : _callBacks$onTouchSta,
                _callBacks$onClick = callBacks.onClick,
                _onClick = _callBacks$onClick === undefined ? null : _callBacks$onClick;

            if (!visible) return false;
            return _react2.default.createElement('wf-overlay', {
                style: { backgroundColor: this.state.color, zIndex: zIndex },
                onMouseEnter: function onMouseEnter() {
                    return (0, _Lodash.isFunction)(_onMouseEnter) ? _onMouseEnter() : "";
                },
                onMouseLeave: function onMouseLeave() {
                    return (0, _Lodash.isFunction)(_onMouseLeave) ? _onMouseLeave() : "";
                },
                onTouchStart: function onTouchStart() {
                    return (0, _Lodash.isFunction)(_onTouchStart) ? _onTouchStart() : "";
                },
                onClick: function onClick() {
                    return (0, _Lodash.isFunction)(_onClick) ? _onClick() : "";
                }
            });
        }

        // ------------------- //

    }, {
        key: 'display',
        value: function display() {
            var _this2 = this;

            var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
            var _props$color = props.color,
                color = _props$color === undefined ? _Constants.OVERLAY_TRANSPARENT : _props$color,
                _props$afterOpen = props.afterOpen,
                afterOpen = _props$afterOpen === undefined ? null : _props$afterOpen;

            this.setState({ visible: true });
            setTimeout(function () {
                return _this2.setState({ color: color });
            }, 10);
            if ((0, _Lodash.isFunction)(afterOpen)) setTimeout(function () {
                return afterOpen();
            }, 200);
        }

        // ------------------- //

    }, {
        key: 'hidden',
        value: function hidden() {
            var _this3 = this;

            var _props$beforeClose = this.props.beforeClose,
                beforeClose = _props$beforeClose === undefined ? null : _props$beforeClose;

            this.setState({ color: _Constants.OVERLAY_TRANSPARENT });
            setTimeout(function () {
                _this3.setState({ visible: false });
                if ((0, _Lodash.isFunction)(beforeClose)) beforeClose();
            }, 200);
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: 'componentWillReceiveProps',
        value: function componentWillReceiveProps(nextProps) {
            var _nextProps$visible = nextProps.visible,
                visible = _nextProps$visible === undefined ? false : _nextProps$visible,
                _nextProps$color = nextProps.color,
                color = _nextProps$color === undefined ? null : _nextProps$color;

            if (color && color !== this.state.color) {
                this.setState({
                    color: color
                });
            }
            if (visible !== this.state.visible) {
                if (visible) this.display(nextProps);
                if (!visible) this.hidden();
            }
        }

        // ------------------- //

    }, {
        key: 'componentDidMount',
        value: function componentDidMount() {
            var _props$visible = this.props.visible,
                visible = _props$visible === undefined ? false : _props$visible;

            if (visible) this.display(this.props);
        }
    }]);
    return WFOverlay;
}(_react.Component);

// ------------------- //

// ------------------- //

exports.default = WFOverlay;

// ------------------- //

/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _GetFileName = __webpack_require__(260);

var _GetFileName2 = _interopRequireDefault(_GetFileName);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TYPE_SELECT_SINGLE = "select_single";

// ------------------- //

var TYPE_SELECT_MULITPLE = "select_multiple";

// ------------------- //

// WF TABLE CELL ------------------- //

// ------------------- //

var classes = {
	wrapper: "wf-c",
	filters: "wf-filters",
	state: {
		empty: "empty",
		editable: "editable",
		selected: "selected"
	},
	type: {
		action: "action",
		id: "id",
		number: "number",
		date: "date",
		file: "file",
		string: "string",
		text: "text",
		boolean: "boolean",
		shortcode: "shortcode",
		select: "select",
		"select_single": "select",
		"select_multiple": "select"
	},
	action: {
		null: "cell-null",
		empty: "cell-empty",
		custom: "custom",
		check: "check",
		add: "set",
		open: "open",
		edit: "edit",
		delete: "delete"
	}
};

// ------------------- //

var WFCell = function (_Component) {
	(0, _inherits3.default)(WFCell, _Component);

	function WFCell() {
		(0, _classCallCheck3.default)(this, WFCell);
		return (0, _possibleConstructorReturn3.default)(this, (WFCell.__proto__ || (0, _getPrototypeOf2.default)(WFCell)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFCell, [{
		key: "render",
		value: function render() {
			var _props$callback = this.props.callback,
			    callback = _props$callback === undefined ? null : _props$callback;
			//if(!visible || !type) return false;

			if ((0, _Lodash.isFunction)(callback)) {
				return this.getCellWithCallBack();
			} else {
				return this.getCell();
			}
		}
	}, {
		key: "getCell",
		value: function getCell() {
			var _props = this.props,
			    _props$visible = _props.visible,
			    visible = _props$visible === undefined ? true : _props$visible,
			    _props$type = _props.type,
			    type = _props$type === undefined ? "" : _props$type,
			    _props$row = _props.row,
			    row = _props$row === undefined ? {} : _props$row,
			    _props$action = _props.action,
			    action = _props$action === undefined ? "" : _props$action,
			    _props$value = _props.value,
			    value = _props$value === undefined ? "" : _props$value,
			    _props$cellConfig = _props.cellConfig,
			    cellConfig = _props$cellConfig === undefined ? {} : _props$cellConfig,
			    _props$callback2 = _props.callback,
			    callback = _props$callback2 === undefined ? null : _props$callback2;

			return _react2.default.createElement(
				"wf-cell",
				null,
				_react2.default.createElement(
					"span",
					{
						className: this.getClass(type, action, false)
					},
					this.getCellValue(type, action)
				),
				this.getFilters(value)
			);
		}
	}, {
		key: "getCellWithCallBack",
		value: function getCellWithCallBack() {
			var _props2 = this.props,
			    _props2$visible = _props2.visible,
			    visible = _props2$visible === undefined ? true : _props2$visible,
			    _props2$type = _props2.type,
			    type = _props2$type === undefined ? "" : _props2$type,
			    _props2$row = _props2.row,
			    row = _props2$row === undefined ? {} : _props2$row,
			    _props2$action = _props2.action,
			    action = _props2$action === undefined ? "" : _props2$action,
			    _props2$value = _props2.value,
			    value = _props2$value === undefined ? "" : _props2$value,
			    _props2$cellConfig = _props2.cellConfig,
			    cellConfig = _props2$cellConfig === undefined ? {} : _props2$cellConfig,
			    _props2$callback = _props2.callback,
			    callback = _props2$callback === undefined ? null : _props2$callback;

			return _react2.default.createElement(
				"wf-cell",
				null,
				_react2.default.createElement(
					"span",
					{
						onClick: function onClick() {
							return callback(value, row);
						},
						className: this.getClass(type, action, true)
					},
					this.getCellValue(type, action)
				),
				this.getFilters(value)
			);
		}

		// ------------------- //

	}, {
		key: "getFilters",
		value: function getFilters() {
			var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
			var _props3 = this.props,
			    _props3$filters = _props3.filters,
			    filters = _props3$filters === undefined ? false : _props3$filters,
			    _props3$isFiltered = _props3.isFiltered,
			    isFiltered = _props3$isFiltered === undefined ? false : _props3$isFiltered;

			if (!filters) return false;
			var _filters$up = filters.up,
			    up = _filters$up === undefined ? false : _filters$up,
			    _filters$down = filters.down,
			    down = _filters$down === undefined ? false : _filters$down;

			if (!up || !down) return false;
			if ((0, _Lodash.isFunction)(up) && (0, _Lodash.isFunction)(down)) {
				return _react2.default.createElement(
					"span",
					{ className: classes.filters + " " + (isFiltered ? "filter-" + isFiltered : "") },
					_react2.default.createElement(_WFIcon.WFIUp, { onClick: function onClick() {
							return up(value);
						} }),
					_react2.default.createElement(_WFIcon.WFIDown, { onClick: function onClick() {
							return down(value);
						} })
				);
			} else return false;
		}

		// ------------------- //

	}, {
		key: "getCellValue",
		value: function getCellValue(type, action) {
			var _props4 = this.props,
			    _props4$value = _props4.value,
			    value = _props4$value === undefined ? "" : _props4$value,
			    _props4$isHead = _props4.isHead,
			    isHead = _props4$isHead === undefined ? false : _props4$isHead,
			    _props4$cellConfig = _props4.cellConfig,
			    cellConfig = _props4$cellConfig === undefined ? {} : _props4$cellConfig,
			    _props4$attributes = _props4.attributes,
			    attributes = _props4$attributes === undefined ? {} : _props4$attributes,
			    _props4$previewDirect = _props4.previewDirection,
			    previewDirection = _props4$previewDirect === undefined ? "bottom" : _props4$previewDirect;
			var _cellConfig$limit = cellConfig.limit,
			    limit = _cellConfig$limit === undefined ? {} : _cellConfig$limit,
			    _cellConfig$preview = cellConfig.preview,
			    preview = _cellConfig$preview === undefined ? true : _cellConfig$preview,
			    _cellConfig$previewSp = cellConfig.previewSplit,
			    previewSplit = _cellConfig$previewSp === undefined ? ";" : _cellConfig$previewSp;


			if (isHead) {
				return value;
			}

			/*
   console.error("CELL _______", type)
   console.error(value)
   console.dir(value)
   */

			/*
   console.log("")
     console.error("CELL _______", type) 
     console.dir(attributes)
     console.dir(this.props)
   console.log("")
   */

			// BOOLEAN
			if (type === "boolean") {
				if (value === "") return;
				var boolVal = value == true;
				var strVal = boolVal ? "true" : "false";
				return _react2.default.createElement(
					"span",
					{ className: "wf-" + strVal },
					_react2.default.createElement(_WFIcon.WFICheck, { checked: boolVal }),
					strVal
				);
			}

			// SELECT2
			else if (type && type.includes("select")) {
					if (value === "") {
						return "";
					} else {
						var values = "";
						if ((0, _Lodash.isString)(value)) {
							values = (0, _JSON.parse)(value);
						} else {
							values = value;
						}
						if ((0, _Lodash.isArray)(values)) {
							values = values.join(" | ");
						} else if ((0, _Lodash.isObject)(values)) {
							var elems = [];
							for (var x in values) {
								elems.push(values[x]);
							}
							values = elems.join(" | ");
						}
						return _react2.default.createElement(
							_WFText2.default,
							{
								limit: limit[type],
								limitSufix: "...",
								preview: preview,
								previewSplit: "|",
								previewDirection: previewDirection
							},
							values
						);
					}
				}

				// OTHER
				else {

						switch (type) {

							// ------------- //

							case _Constants.CELL_ACTION:

								return this.getCellAction(action);

							// ------------- //
							case "id":
							case _Constants.CELL_NUMBER:

								return value ? parseFloat(value) : "";

							// ------------- //

							case _Constants.CELL_DATE:

								return value;

							// ------------- //

							case _Constants.CELL_STRING:
							case _Constants.CELL_TEXT:

								if (!limit || !limit.hasOwnProperty(type)) {
									return value;
								}

								return _react2.default.createElement(
									_WFText2.default,
									{
										limit: limit[type],
										limitSufix: "...",
										preview: preview,
										previewDirection: previewDirection
									},
									value
								);

							// ------------- //

							case _Constants.CELL_FILE:

								if (value === "") return "";

								return _react2.default.createElement(
									"span",
									{
										onClick: function onClick() {
											_WFUrl2.default.download(value);
										} },
									_react2.default.createElement(
										_WFText2.default,
										null,
										"Download file"
									)
								);

							// ------------- //

							case _Constants.CELL_SHORTCODE:

								return _react2.default.createElement("input", {
									type: "text",
									readOnly: true,
									defaultValue: value
								});

							// ------------- //
							default:
								return "";
						}
					}
		}

		// ------------------- //

	}, {
		key: "getCellAction",
		value: function getCellAction(action) {
			var _props5 = this.props,
			    _props5$icon = _props5.icon,
			    icon = _props5$icon === undefined ? "" : _props5$icon,
			    _props5$open = _props5.open,
			    open = _props5$open === undefined ? false : _props5$open,
			    _props5$check = _props5.check,
			    check = _props5$check === undefined ? false : _props5$check;


			switch (action) {

				// ------------- //

				case _Constants.CELL_ACTION_NULL:

					return _react2.default.createElement("span", null);
				// ------------- //

				case _Constants.CELL_ACTION_EMPTY:

					return _react2.default.createElement("span", null);

				// ------------- //

				case _Constants.CELL_ACTION_CUSTOM:

					return _react2.default.createElement(_WFIcon.WFIcon, { icon: icon });

				// ------------- //

				case _Constants.CELL_ACTION_CHECK:

					return _react2.default.createElement(_WFIcon.WFICheck, { checked: check });

				// ------------- //

				case _Constants.CELL_ACTION_DELETE:

					return _react2.default.createElement(_WFIcon.WFIClose, null);

				// ------------- //

				case _Constants.CELL_ACTION_ADD:

					return _react2.default.createElement(_WFIcon.WFIAdd, null);

				// ------------- //

				case _Constants.CELL_ACTION_OPEN:

					return _react2.default.createElement(_WFIcon.WFIOpen, { open: open });

				// ------------- //

				case _Constants.CELL_ACTION_EDIT:

					return _react2.default.createElement(_WFIcon.WFIEdit, null);

				// ------------- //
			}
		}

		// ------------------- //

	}, {
		key: "getClass",
		value: function getClass(type) {
			var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
			var hasCallback = arguments[2];
			var _props$isEmpty = this.props.isEmpty,
			    isEmpty = _props$isEmpty === undefined ? false : _props$isEmpty;

			var classType = classes.type[type];
			var classAction = action !== "" ? classes.action[action] : "";
			var classCallBack = hasCallback ? classes.state.editable : "";
			return classes.wrapper + " " + classType + " " + classAction + " " + classCallBack;
			// isEmpty?classes.state.empty:""
		}
	}]);
	return WFCell;
}(_react.Component);

// ------------------- //

exports.default = WFCell;

// ------------------- //

/*
	
	<WFCell 
		visible={true} 
		type={type} 
		action={action}
	
		value={value},

		limit={true}, 
		limitPreview={40}, 
		preview={true}, 
		previewSplit={","},
		previewDirection={"bottom"},
		
		icon={icon},
		isHead={false}, 
		isEmpty={false},
		isOpen={openState}
		isSelected={selectState}
	/>

*/

/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _WFDataTypes = __webpack_require__(74);

var _WFInputTypes = __webpack_require__(34);

var _WFInputString = __webpack_require__(117);

var _WFTextarea = __webpack_require__(386);

var _WFTextarea2 = _interopRequireDefault(_WFTextarea);

var _WFCheckbox = __webpack_require__(375);

var _WFCheckbox2 = _interopRequireDefault(_WFCheckbox);

var _WFRadioButton = __webpack_require__(384);

var _WFRadioButton2 = _interopRequireDefault(_WFRadioButton);

var _WFInputNumber = __webpack_require__(381);

var _WFInputNumber2 = _interopRequireDefault(_WFInputNumber);

var _WFRange = __webpack_require__(385);

var _WFRange2 = _interopRequireDefault(_WFRange);

var _WFInputFile = __webpack_require__(379);

var _WFInputFile2 = _interopRequireDefault(_WFInputFile);

var _WFInputDate = __webpack_require__(378);

var _WFInputDate2 = _interopRequireDefault(_WFInputDate);

var _WFSelect = __webpack_require__(223);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFSelect3 = __webpack_require__(83);

var _WFSelect4 = _interopRequireDefault(_WFSelect3);

var _WFSelect2Word = __webpack_require__(406);

var _WFSelect2Word2 = _interopRequireDefault(_WFSelect2Word);

var _WFSelect2Number = __webpack_require__(405);

var _WFSelect2Number2 = _interopRequireDefault(_WFSelect2Number);

var _WFSelect2Line = __webpack_require__(404);

var _WFSelect2Line2 = _interopRequireDefault(_WFSelect2Line);

var _WFSelect2Image = __webpack_require__(403);

var _WFSelect2Image2 = _interopRequireDefault(_WFSelect2Image);

var _WFPanel = __webpack_require__(383);

var _WFPanel2 = _interopRequireDefault(_WFPanel);

var _WFGrid = __webpack_require__(377);

var _WFGrid2 = _interopRequireDefault(_WFGrid);

var _WFColor = __webpack_require__(376);

var _WFColor2 = _interopRequireDefault(_WFColor);

var _WFMediaFile = __webpack_require__(382);

var _WFMediaFile2 = _interopRequireDefault(_WFMediaFile);

var _WFInputMailer = __webpack_require__(380);

var _WFInputMailer2 = _interopRequireDefault(_WFInputMailer);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF INPUT FACTORY ------------------- //

// ------------------- //

var WFInputFactoryForAdmin = function () {
  function WFInputFactoryForAdmin() {
    (0, _classCallCheck3.default)(this, WFInputFactoryForAdmin);
  }

  (0, _createClass3.default)(WFInputFactoryForAdmin, null, [{
    key: "get",
    value: function get(type) {
      var input_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var isAdminForm = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;


      if (!type) {
        throw new Error('WFInputFactoryAdmin => fieldSchema is not defined');
        return false;
      }

      var inputType = _WFInputTypes.INPUT_TEXT;
      if (input_type) {
        inputType = input_type;
      } else if (type) {
        inputType = type;
      }

      /**
       * Select input by inputType 
       **/
      switch (inputType) {

        // TEXTAREA ------- //
        case _WFInputTypes.INPUT_TEXTAREA:
          return _WFTextarea2.default;

        // TEXT ------- //
        case _WFInputTypes.INPUT_TEXT:
          return _WFInputString.WFInputText;

        // TEXT ------- //
        case _WFInputTypes.INPUT_MAILER:
          return _WFInputMailer2.default;

        // EMAIL ------- //
        case _WFInputTypes.INPUT_EMAIL:
          return _WFInputString.WFInputEmail;

        // TEL ------- //
        case _WFInputTypes.INPUT_TEL:
          return _WFInputString.WFInputTel;

        // NUMBER ------- //
        case _WFInputTypes.INPUT_NUMBER:
        case _WFDataTypes.WF_TYPE_INTEGER:
        case _WFDataTypes.WF_TYPE_NUMBER:
          return _WFInputNumber2.default;

        // URL ------- //
        case _WFInputTypes.INPUT_URL:
          return _WFInputString.WFInputUrl;

        // PASSWORD ------- //
        case _WFInputTypes.INPUT_PASSWORD:
          return _WFInputString.WFInputPassword;

        // FILE ------- //
        case _WFInputTypes.INPUT_FILE:
          return _WFInputFile2.default;

        // CHECKBOX ------ //
        case _WFInputTypes.INPUT_CHECKBOX:
        case _WFDataTypes.WF_TYPE_BOOLEAN:
          return _WFCheckbox2.default;

        case _WFInputTypes.INPUT_RADIO_BUTTON:
          return _WFRadioButton2.default;

        // RANGE ------ //
        case _WFInputTypes.INPUT_RANGE:
          return _WFRange2.default;

        // SELECT -------- //
        case _WFInputTypes.INPUT_SELECT:
          return _WFSelect2.default;

        // SELECT 2 ------ //
        case _WFInputTypes.INPUT_SELECT2:
        case _WFInputTypes.INPUT_SELECT2_BAOBAB:
        case _WFInputTypes.INPUT_SELECT2_MONKEY:
        case _WFDataTypes.WF_TYPE_SELECT_SINGLE:
        case _WFDataTypes.WF_TYPE_SELECT_MULTIPLE:
          return _WFSelect4.default;

        // WFIELD SELECT ------ //
        case _WFInputTypes.INPUT_SELECT_WORD:
          if (isAdminForm) {
            return _WFRadioButton2.default;
          } else {
            return _WFSelect2Word2.default;
          }

        case _WFInputTypes.INPUT_SELECT_NUMBER:
          if (isAdminForm) {
            return _WFRadioButton2.default;
          } else {
            return _WFSelect2Number2.default;
          }

        case _WFInputTypes.INPUT_SELECT_LINE:
          if (isAdminForm) {
            return _WFSelect4.default;
          } else {
            return _WFSelect2Line2.default;
          }

        case _WFInputTypes.INPUT_SELECT_IMAGE:
          if (isAdminForm) {
            return _WFSelect4.default;
          } else {
            return _WFSelect2Image2.default;
          }

        // DATE ------ //
        case _WFDataTypes.WF_TYPE_DATE:
        case _WFInputTypes.INPUT_DATE:
          return _WFInputDate2.default;

        // COLOR ------ //
        case _WFInputTypes.INPUT_COLOR:
          return _WFColor2.default;

        // MEDIA ------ //
        case _WFInputTypes.INPUT_MEDIA:
          return _WFMediaFile2.default;

        // GRID ------ //
        case _WFInputTypes.INPUT_GRID:
          return _WFGrid2.default;

        // PANEL ------ //
        case _WFInputTypes.INPUT_PANEL:
          return _WFPanel2.default;

        // NULL ------- //
        default:
          return _WFInputString.WFInputText;
      }
    }
  }]);
  return WFInputFactoryForAdmin;
}();

// ------------------- //


exports.default = WFInputFactoryForAdmin;
// ------------------- //

/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFieldLabel = __webpack_require__(365);

var _WFieldLabel2 = _interopRequireDefault(_WFieldLabel);

var _WFieldLegend = __webpack_require__(366);

var _WFieldLegend2 = _interopRequireDefault(_WFieldLegend);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FIELD ------------------- //

// ------------------- //

var classes = {
  toggle: "wf-field-toggle",
  inline: 'wf-inline',
  optional: 'wf-optional',
  required: "wf-required",
  disabled: "wf-disabled",
  error: "wf-has-error",
  valid: "wf-validate"
};

var WFieldComponent = function (_Component) {
  (0, _inherits3.default)(WFieldComponent, _Component);

  /**
   * Constructor
   */
  function WFieldComponent(props) {
    (0, _classCallCheck3.default)(this, WFieldComponent);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldComponent.__proto__ || (0, _getPrototypeOf2.default)(WFieldComponent)).call(this, props));

    var on = props.on,
        type = props.type,
        onGetInput = props.onGetInput,
        _props$input_type = props.input_type,
        input_type = _props$input_type === undefined ? null : _props$input_type;

    _this.displayName = "WField_" + (input_type ? input_type : type);
    _this.input = onGetInput(type, input_type, true);
    _this.extraInput = onGetInput(type, input_type, false);
    on(_WFEventTypes.WF_EVENT_ONINIT, _this);
    _this.state = {};
    return _this;
  }

  /**
   * Render the final HTML output
   * @return string html
   */


  (0, _createClass3.default)(WFieldComponent, [{
    key: "render",
    value: function render() {
      var _props$fieldEditableM = this.props.fieldEditableMenu,
          fieldEditableMenu = _props$fieldEditableM === undefined ? null : _props$fieldEditableM;

      if ((0, _Lodash.isFunction)(fieldEditableMenu)) {
        return fieldEditableMenu(this);
      } else {
        return this.getField();
      }
    }

    /**
     * Get field or custom field
     */

  }, {
    key: "getField",
    value: function getField() {
      var _props = this.props,
          on = _props.on,
          _props$customComponen = _props.customComponent,
          customComponent = _props$customComponen === undefined ? null : _props$customComponen;

      if ((0, _Lodash.isFunction)(customComponent)) {
        return customComponent({
          fieldComponent: this,
          on: on
        });
      } else {
        return _react2.default.createElement(
          "wf-field",
          null,
          this.getWrapper()
        );
      }
    }

    // ------------------- //

    // FIELD WRAPPER ------------------- //

    // ------------------- //

  }, {
    key: "getWrapper",
    value: function getWrapper() {
      var _props2 = this.props,
          _props2$isInline = _props2.isInline,
          isInline = _props2$isInline === undefined ? false : _props2$isInline,
          _props2$isOptional = _props2.isOptional,
          isOptional = _props2$isOptional === undefined ? false : _props2$isOptional,
          _props2$isAdminForm = _props2.isAdminForm,
          isAdminForm = _props2$isAdminForm === undefined ? false : _props2$isAdminForm,
          _props2$isWonderField = _props2.isWonderField,
          isWonderField = _props2$isWonderField === undefined ? false : _props2$isWonderField;

      if (isWonderField) {
        return this.getWrapperExtra();
      } else {
        if (isInline) {
          return this.getWrapperInline();
        } else if (isOptional) {
          return this.getWrapperOptional();
        } else {
          return this.getWrapperByDefault();
        }
      }
    }

    // ------------------- //

  }, {
    key: "getWrapperByDefault",
    value: function getWrapperByDefault() {
      var _props$isFirst = this.props.isFirst,
          isFirst = _props$isFirst === undefined ? false : _props$isFirst;

      var firstClass = "";
      if (isFirst) {
        firstClass = "first-child";
      }
      return _react2.default.createElement(
        _WFRow2.default,
        { className: firstClass },
        this.getLabel(),
        _react2.default.createElement(
          _WFCol2.default,
          { sm: 12 },
          this.getInput()
        ),
        this.getLegend()
      );
    }

    // ------------------- //

  }, {
    key: "getWrapperInline",
    value: function getWrapperInline() {
      return _react2.default.createElement(
        _WFRow2.default,
        null,
        this.getLabel(5),
        _react2.default.createElement(
          _WFCol2.default,
          { xs: 7 },
          this.getInput()
        ),
        this.getLegend(classes.inline)
      );
    }

    // ------------------- //

  }, {
    key: "getWrapperOptional",
    value: function getWrapperOptional() {
      // todo implement 
      // field has checkbox to toggle status
      return false;
    }

    // ------------------- //

  }, {
    key: "getWrapperExtra",
    value: function getWrapperExtra() {
      var _props3 = this.props,
          _props3$wf_width = _props3.wf_width,
          wf_width = _props3$wf_width === undefined ? 900 : _props3$wf_width,
          _props3$input_type = _props3.input_type,
          input_type = _props3$input_type === undefined ? "" : _props3$input_type;

      var rowStyle = {};
      if (wf_width) {
        rowStyle["maxWidth"] = wf_width;
      }
      if (input_type === "WFieldSelectImage") {
        rowStyle["maxWidth"] = "100%";
      }
      return _react2.default.createElement(
        _WFRow2.default,
        {
          className: "wf-wonder-field " + (this.props.isFirst ? "first-child" : ""),
          style: rowStyle
        },
        _react2.default.createElement(
          _WFCol2.default,
          { sm: 12 },
          this.getLabel()
        ),
        _react2.default.createElement(
          _WFCol2.default,
          { sm: 12 },
          this.getExtraInput()
        ),
        _react2.default.createElement(
          _WFCol2.default,
          { sm: 12 },
          this.getLegend()
        )
      );
    }

    // ------------------- //

    // FIELD LABEL ------------------- //

    // ------------------- //

  }, {
    key: "getLabel",
    value: function getLabel() {
      var col = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 12;
      var _state = this.state,
          stringValue = _state.stringValue,
          valid = _state.valid,
          errors = _state.errors,
          _state$focused = _state.focused,
          focused = _state$focused === undefined ? false : _state$focused,
          _state$isInline = _state.isInline,
          isInline = _state$isInline === undefined ? false : _state$isInline,
          _state$hasCounter = _state.hasCounter,
          hasCounter = _state$hasCounter === undefined ? false : _state$hasCounter,
          _state$counter = _state.counter,
          counter = _state$counter === undefined ? 0 : _state$counter,
          maxLength = _state.maxLength,
          minLength = _state.minLength,
          _state$max = _state.max,
          max = _state$max === undefined ? null : _state$max;
      var _props4 = this.props,
          _props4$type = _props4.type,
          type = _props4$type === undefined ? "" : _props4$type,
          styles = _props4.styles,
          disabled = _props4.disabled,
          _props4$label = _props4.label,
          label = _props4$label === undefined ? "" : _props4$label,
          _props4$wf_label = _props4.wf_label,
          wf_label = _props4$wf_label === undefined ? "" : _props4$wf_label,
          _props4$required = _props4.required,
          required = _props4$required === undefined ? false : _props4$required,
          _props4$isEditable = _props4.isEditable,
          isEditable = _props4$isEditable === undefined ? false : _props4$isEditable,
          _props4$input_type = _props4.input_type,
          input_type = _props4$input_type === undefined ? null : _props4$input_type,
          _props4$hasLabel = _props4.hasLabel,
          hasLabel = _props4$hasLabel === undefined ? true : _props4$hasLabel,
          _props4$hiddenLabel = _props4.hiddenLabel,
          hiddenLabel = _props4$hiddenLabel === undefined ? false : _props4$hiddenLabel;

      var err = errors;
      if (!hasLabel || !label || label === "" || hiddenLabel) {
        return false;
      } else {
        var count = 0;
        if (hasCounter || type.includes("select")) {
          count = counter;
        }
        if (input_type === "select") {
          count = 0;
        }
        if (type === "boolean") {
          err = [];
        }
        return _react2.default.createElement(
          _WFCol2.default,
          { xs: col, className: disabled ? "wf-disabled" : "" },
          _react2.default.createElement(
            _WFieldLabel2.default,
            {
              type: type,
              focused: focused,
              required: required,
              isInline: isInline,
              valid: valid,
              errors: err,
              counter: count,
              minLength: minLength,
              maxLength: maxLength,
              isEditable: isEditable,
              styles: styles },
            wf_label ? wf_label : label
          )
        );
      }
    }

    // ------------------- //

    // FIELD LEGEND ------------------- //

    // ------------------- //

  }, {
    key: "getLegend",
    value: function getLegend() {
      var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var _props5 = this.props,
          _props5$legend = _props5.legend,
          legend = _props5$legend === undefined ? "" : _props5$legend,
          _props5$styles = _props5.styles,
          styles = _props5$styles === undefined ? {} : _props5$styles;

      if (!legend || legend === "") {
        return false;
      } else {
        return _react2.default.createElement(
          _WFCol2.default,
          { className: className },
          _react2.default.createElement(
            _WFieldLegend2.default,
            {
              style: styles.legend || {}
            },
            legend
          )
        );
      }
    }

    // ------------------- //

    // FIELD INPUT ------------------- //

    // ------------------- //

  }, {
    key: "getInput",
    value: function getInput() {
      var Input = this.input;
      if (this.input) {
        return _react2.default.createElement(
          "wf-input",
          null,
          _react2.default.createElement(Input, (0, _extends3.default)({}, this.props, this.state))
        );
      } else {
        return false;
      }
    }
  }, {
    key: "getExtraInput",
    value: function getExtraInput() {
      var Input = this.extraInput;
      if (this.input) {
        return _react2.default.createElement(
          "wf-input",
          null,
          _react2.default.createElement(Input, (0, _extends3.default)({}, this.props, this.state))
        );
      } else {
        return false;
      }
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      this.props.on(_WFEventTypes.WF_EVENT_ONWILLMOUNT, this);
    }
    // ------------------- //

  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.on(_WFEventTypes.WF_EVENT_ONDIDMOUNT, this);
    }
    // ------------------- //

  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.props.on(_WFEventTypes.WF_EVENT_ONWILLUNMOUNT, this);
    }
  }]);
  return WFieldComponent;
}(_react.Component);

// ------------------- //


exports.default = WFieldComponent;
// ------------------- //

/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _windowWatcher = __webpack_require__(347);

var _windowWatcher2 = _interopRequireDefault(_windowWatcher);

var _Lodash = __webpack_require__(6);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFClear = __webpack_require__(98);

var _WFClear2 = _interopRequireDefault(_WFClear);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFLoader = __webpack_require__(99);

var _WFLoader2 = _interopRequireDefault(_WFLoader);

var _WFVideoHTML = __webpack_require__(363);

var _WFVideoHTML2 = _interopRequireDefault(_WFVideoHTML);

var _WFIcon = __webpack_require__(8);

var _WFormStatusHelper = __webpack_require__(373);

var _WFormStatusHelper2 = _interopRequireDefault(_WFormStatusHelper);

var _WFormConditionHelper = __webpack_require__(152);

var _WFormConditionHelper2 = _interopRequireDefault(_WFormConditionHelper);

var _WFormStyleHelper = __webpack_require__(222);

var _WFormStyleHelper2 = _interopRequireDefault(_WFormStyleHelper);

var _WFormStepHelper = __webpack_require__(221);

var _WFormStepHelper2 = _interopRequireDefault(_WFormStepHelper);

var _WFormNavHelper = __webpack_require__(372);

var _WFormNavHelper2 = _interopRequireDefault(_WFormNavHelper);

var _WFormVideoHelper = __webpack_require__(374);

var _WFormVideoHelper2 = _interopRequireDefault(_WFormVideoHelper);

var _WFormContainer = __webpack_require__(367);

var _WFormContainer2 = _interopRequireDefault(_WFormContainer);

var _WFormStep = __webpack_require__(371);

var _WFormStep2 = _interopRequireDefault(_WFormStep);

var _WFormContent = __webpack_require__(220);

var _WFormContent2 = _interopRequireDefault(_WFormContent);

var _WFieldComponent = __webpack_require__(218);

var _WFieldComponent2 = _interopRequireDefault(_WFieldComponent);

var _WFormResults = __webpack_require__(369);

var _WFEventTypes = __webpack_require__(16);

var _WFConstants = __webpack_require__(58);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM ------------------- //

// ------------------- //

// FORM CONSTANTS


// FORM CHILD COMPONENTS


// FORM HELPERS
var classes = {
  wrapper: "wf-form-wrapper",
  container: "wf-form-container",
  theme: "wf-default-theme",
  loader: "wf-form-loader"
};

// FORM EVENTS


// COMPONENTS

var WFormComponent = function (_Component) {
  (0, _inherits3.default)(WFormComponent, _Component);

  /**
   * Constructor
   * @required in props :
   * @code
   * // app is formView instance
   * <WFormComponent
   *   isEditable={false}
   *   navigation={true}
   *   onPrev={() => app.onPrev()}
   *   onNext={() => app.onNext()}
   *   onSubmit={() => app.onSubmit()}
   *   on={(evenType, eventArgs = {}) => { 
   *     app.on(evenType, eventArgs)
   *   }}
   *   onField={(name, evenType, eventArgs = {}) => {
   *     app.onField(name, evenType, eventArgs)
   *   }}
   *   onGetInput={(type, input_type, isAdminForm) => {
   *     return WFInputFactory.get(type, input_type, isAdminForm);
   *   }}
   * />
   * @endcode
   */
  function WFormComponent(props) {
    (0, _classCallCheck3.default)(this, WFormComponent);

    //console.dir(props)
    var _this = (0, _possibleConstructorReturn3.default)(this, (WFormComponent.__proto__ || (0, _getPrototypeOf2.default)(WFormComponent)).call(this, props));

    if (!(0, _Lodash.isFunction)(props.on)) {
      throw new Error('WFormComponent => on is not defined');
    }
    if (!(0, _Lodash.isFunction)(props.onField)) {
      throw new Error('WFormComponent => onField is not defined');
    }
    _this.state = {
      hasTheme: props.hasTheme
    };
    // Hook formComponent and formView
    props.on(_WFEventTypes.WF_EVENT_ONINIT, _this);
    return _this;
  }

  /**
   * Render the final HTML output
   * @return string html
   */


  (0, _createClass3.default)(WFormComponent, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props$isAdmin = this.props.isAdmin,
          isAdmin = _props$isAdmin === undefined ? false : _props$isAdmin;
      var _state = this.state,
          _state$wf_results = _state.wf_results,
          wf_results = _state$wf_results === undefined ? {} : _state$wf_results,
          _state$wf_custom_resu = _state.wf_custom_results,
          wf_custom_results = _state$wf_custom_resu === undefined ? {} : _state$wf_custom_resu;

      return _react2.default.createElement(
        'wf-form',
        null,
        this.getProgressBar(),
        _react2.default.createElement(
          _WFormContainer2.default,
          (0, _extends3.default)({
            visible: true,
            className: _WFormStyleHelper2.default.getContainerClass(this)
          }, _WFormStyleHelper2.default.getVerticalAlignConfig(this)),
          _react2.default.createElement(
            'wf-content',
            null,
            this.getTimeline(),
            _WFormStatusHelper2.default.getContent({
              loaderView: function loaderView() {
                return _react2.default.createElement(
                  _WFRow2.default,
                  null,
                  _react2.default.createElement(
                    _WFCol2.default,
                    null,
                    _react2.default.createElement(_WFLoader2.default, {
                      className: classes.loader
                    })
                  )
                );
              },
              editView: function editView() {
                return _react2.default.createElement(
                  'wf-content',
                  {
                    ref: 'WFContent',
                    style: _WFormStyleHelper2.default.getContentStyle(_this2) },
                  _react2.default.createElement('wf-form-header', null),
                  _react2.default.createElement(
                    'wf-form-body',
                    null,
                    _this2.getContent()
                  ),
                  _react2.default.createElement(
                    'wf-form-footer',
                    {
                      style: _WFormStyleHelper2.default.getFooterStyle(_this2) },
                    _this2.getNavigation()
                  ),
                  _react2.default.createElement(_WFClear2.default, null)
                );
              },
              resultErrorView: function resultErrorView() {
                return _react2.default.createElement(
                  _WFRow2.default,
                  null,
                  _react2.default.createElement(
                    _WFCol2.default,
                    null,
                    _react2.default.createElement(_WFormResults.WFormResultError, wf_results)
                  )
                );
              },
              resultSuccessView: function resultSuccessView() {
                return _react2.default.createElement(
                  _WFRow2.default,
                  null,
                  _react2.default.createElement(
                    _WFCol2.default,
                    null,
                    _react2.default.createElement(_WFormResults.WFormResultSuccess, wf_results)
                  )
                );
              },
              resultCustomView: function resultCustomView() {
                return _react2.default.createElement(
                  _WFRow2.default,
                  null,
                  _react2.default.createElement(
                    _WFCol2.default,
                    null,
                    _react2.default.createElement(_WFormResults.WFormResultCustom, wf_custom_results)
                  )
                );
              }
            }, this),
            _react2.default.createElement(_WFClear2.default, null)
          )
        ),
        _react2.default.createElement(_WFClear2.default, null),
        _react2.default.createElement(
          'wf-form-custom',
          null,
          this.getBg(),
          this.getCover(),
          this.getVideoHTML5(),
          this.getTexture(),
          this.getOverlay()
        ),
        _react2.default.createElement(
          'wf-form-custom-control',
          null,
          this.getVideoHTML5Control()
        )
      );
    }

    // ------------------- //

    // BODY ------------------- //

    // ------------------- //

  }, {
    key: 'getContent',
    value: function getContent() {
      var _props = this.props,
          _props$hasSteps = _props.hasSteps,
          hasSteps = _props$hasSteps === undefined ? true : _props$hasSteps,
          _props$hasCustomView = _props.hasCustomView,
          hasCustomView = _props$hasCustomView === undefined ? false : _props$hasCustomView,
          _props$customView = _props.customView,
          customView = _props$customView === undefined ? null : _props$customView;

      if (hasCustomView && (0, _Lodash.isFunction)(customView)) {
        return customView(this);
      } else if (!hasSteps) {
        return this.getDefaultContent();
      } else {
        return this.getStepContent();
      }
    }

    /**
     * Get display fields
     * @state display_fields is array
     * @return string html
     */

  }, {
    key: 'getDefaultContent',
    value: function getDefaultContent() {
      var _this3 = this;

      var _props2 = this.props,
          isAdmin = _props2.isAdmin,
          on = _props2.on,
          _onField = _props2.onField,
          onFieldEditableMenu = _props2.onFieldEditableMenu,
          onGetInput = _props2.onGetInput;
      var _state2 = this.state,
          _state2$fieldSchema = _state2.fieldSchema,
          fieldSchema = _state2$fieldSchema === undefined ? {} : _state2$fieldSchema,
          _state2$display_field = _state2.display_fields,
          display_fields = _state2$display_field === undefined ? [] : _state2$display_field;

      return display_fields.map(function (name, i) {
        if (!fieldSchema.hasOwnProperty(name)) {
          return false;
        } else {
          var schema = fieldSchema[name];
          var _schema$visible = schema.visible,
              visible = _schema$visible === undefined ? true : _schema$visible;

          if (!visible) {
            return false;
          } else {
            return _react2.default.createElement(_WFormContent2.default, {
              key: name,
              isAdmin: isAdmin,
              isField: true,
              fieldSchema: schema,
              onGetInput: onGetInput,
              onField: function onField(evenType, eventArgs) {
                _onField(name, evenType, eventArgs);
              },
              hidden: _WFormConditionHelper2.default.fieldIsHidden(_this3, name),
              disabled: _WFormConditionHelper2.default.fieldIsDisable(_this3, name),
              fieldEditableMenu: !(0, _Lodash.isFunction)(onFieldEditableMenu) ? null : function (fldCpt) {
                return onFieldEditableMenu(name, schema, fldCpt);
              }
            });
          }
        }
      });
    }
  }, {
    key: 'getStepContent',
    value: function getStepContent() {
      var _this4 = this;

      var _props3 = this.props,
          on = _props3.on,
          _onField2 = _props3.onField,
          _props3$isEditable = _props3.isEditable,
          isEditable = _props3$isEditable === undefined ? false : _props3$isEditable,
          onFieldEditableMenu = _props3.onFieldEditableMenu,
          onGetInput = _props3.onGetInput;
      var _state3 = this.state,
          _state3$steps = _state3.steps,
          steps = _state3$steps === undefined ? [] : _state3$steps,
          _state3$contents = _state3.contents,
          contents = _state3$contents === undefined ? {} : _state3$contents,
          _state3$currentStepIn = _state3.currentStepIndex,
          currentStepIndex = _state3$currentStepIn === undefined ? 0 : _state3$currentStepIn,
          _state3$fieldSchema = _state3.fieldSchema,
          fieldSchema = _state3$fieldSchema === undefined ? {} : _state3$fieldSchema;

      var fieldStyle = _WFormStyleHelper2.default.getFieldStyle(this);
      var isExtraContent = _WFormConditionHelper2.default.isExtraContent(this);
      if (steps.length > 0) {
        return steps.map(function (step, i) {
          var id = step.id,
              type = step.type,
              _step$order = step.order,
              order = _step$order === undefined ? [] : _step$order;

          if (order.length === 0 || currentStepIndex !== i) {
            if (currentStepIndex !== i) {
              return false;
            } else {
              return _react2.default.createElement(
                _WFormStep2.default,
                { key: id },
                _this4.getContentBuilder()
              );
            }
          } else {
            return _react2.default.createElement(
              _WFormStep2.default,
              { key: id },
              order.map(function (name, x) {
                var _contents$name = contents[name],
                    _contents$name$cols = _contents$name.cols,
                    cols = _contents$name$cols === undefined ? _Constants.DEFAULT_COL_CONFIG : _contents$name$cols,
                    isField = _contents$name.isField,
                    isIgnored = _contents$name.isIgnored,
                    attributes = _contents$name.attributes;

                if (isIgnored) {
                  return false;
                } else if (isField) {
                  if (!fieldSchema.hasOwnProperty(name)) {
                    return false;
                  } else {
                    var schema = fieldSchema[name];
                    var _schema$visible2 = schema.visible,
                        visible = _schema$visible2 === undefined ? true : _schema$visible2;

                    if (!visible) {
                      return false;
                    } else {
                      return _react2.default.createElement(_WFormContent2.default, (0, _extends3.default)({}, cols, {
                        key: name,
                        isField: isField,
                        fieldSchema: schema,
                        fieldStyle: fieldStyle,
                        isEditable: isEditable,
                        isExtraContent: isExtraContent,
                        onGetInput: onGetInput,
                        onField: function onField(evenType, eventArgs) {
                          _onField2(name, evenType, eventArgs);
                        },
                        onRefreshParentHeight: function onRefreshParentHeight() {
                          return _this4.refreshHeight();
                        },
                        hidden: _WFormConditionHelper2.default.fieldIsHidden(_this4, name),
                        disabled: _WFormConditionHelper2.default.fieldIsDisable(_this4, name),
                        fieldEditableMenu: !(0, _Lodash.isFunction)(onFieldEditableMenu) ? null : function (fldCpt) {
                          return onFieldEditableMenu(name, schema, fldCpt);
                        }
                      }));
                    }
                  }
                } else {
                  var _contents$name2 = contents[name],
                      _contents$name2$cols = _contents$name2.cols,
                      _cols = _contents$name2$cols === undefined ? _Constants.DEFAULT_COL_CONFIG : _contents$name2$cols,
                      _isField = _contents$name2.isField,
                      _isIgnored = _contents$name2.isIgnored,
                      _attributes = _contents$name2.attributes;

                  return _react2.default.createElement(_WFormContent2.default, (0, _extends3.default)({}, _cols, {
                    key: name,
                    schema: _attributes,
                    isEditable: isEditable,
                    isExtraContent: isExtraContent,
                    onGetContentBuilder: function onGetContentBuilder() {
                      return _this4.getContentBuilder("content", _attributes);
                    },
                    onRefreshParentHeight: function onRefreshParentHeight() {
                      return _this4.refreshHeight();
                    }
                    /*
                    fieldEditableMenu={
                      ! isFunction(onFieldEditableMenu) 
                      ? null 
                      : (fldCpt) => onFieldEditableMenu(name, schema, fldCpt)
                    }*/
                  }));
                }
              }),
              _react2.default.createElement(_WFClear2.default, null),
              _this4.getContentBuilder()
            );
          }
        });
      }
      /*
      else {
        return (
          <WFormStep key={0}>
            {this.getContentBuilder()}
          </WFormStep>
        )
      }
      */
    }
  }, {
    key: 'getContentBuilder',
    value: function getContentBuilder() {
      var contenType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var contentSchema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var onGetContentBuilder = this.props.onGetContentBuilder;

      if ((0, _Lodash.isFunction)(onGetContentBuilder)) {
        return onGetContentBuilder(contenType, contentSchema);
      } else {
        return false;
      }
    }

    // ------------------- //

    // NAVIGATION ------------------- //

    // ------------------- //

  }, {
    key: 'getNavigation',
    value: function getNavigation() {
      if (!this.props.navigation) {
        return false;
      }
      var _props4 = this.props,
          onPrev = _props4.onPrev,
          onNext = _props4.onNext,
          onSubmit = _props4.onSubmit,
          _props4$isEditable = _props4.isEditable,
          isEditable = _props4$isEditable === undefined ? false : _props4$isEditable;
      var _state4 = this.state,
          _state4$prev_label = _state4.prev_label,
          prev_label = _state4$prev_label === undefined ? "" : _state4$prev_label,
          _state4$next_label = _state4.next_label,
          next_label = _state4$next_label === undefined ? "" : _state4$next_label,
          _state4$submit_label = _state4.submit_label,
          submit_label = _state4$submit_label === undefined ? "" : _state4$submit_label,
          _state4$isValid = _state4.isValid,
          isValid = _state4$isValid === undefined ? false : _state4$isValid;

      var _WFormNavHelper$getNa = _WFormNavHelper2.default.getNavState(this),
          Grid = _WFormNavHelper$getNa.Grid,
          Btn = _WFormNavHelper$getNa.Btn;

      var _WFormStyleHelper$get = _WFormStyleHelper2.default.getNavStyle(this),
          _WFormStyleHelper$get2 = _WFormStyleHelper$get.prevStyle,
          prevStyle = _WFormStyleHelper$get2 === undefined ? {} : _WFormStyleHelper$get2,
          _WFormStyleHelper$get3 = _WFormStyleHelper$get.nextStyle,
          nextStyle = _WFormStyleHelper$get3 === undefined ? {} : _WFormStyleHelper$get3,
          _WFormStyleHelper$get4 = _WFormStyleHelper$get.submitStyle,
          submitStyle = _WFormStyleHelper$get4 === undefined ? {} : _WFormStyleHelper$get4;

      var isCompleted = isValid;
      if (isEditable) {
        //isCompleted = true;
      }
      return _react2.default.createElement(
        'wf-form-navigation',
        null,
        _react2.default.createElement(
          _WFRow2.default,
          null,
          _react2.default.createElement(
            _WFCol2.default,
            { xs: Grid.left },
            _react2.default.createElement(
              _WFBtn2.default,
              {
                visible: Btn.prev,
                style: prevStyle,
                onClick: function onClick() {
                  return onPrev();
                }
              },
              prev_label
            )
          ),
          _react2.default.createElement(
            _WFCol2.default,
            { xs: Grid.right },
            _react2.default.createElement(
              _WFBtn2.default,
              {
                visible: Btn.next
                //visible={true}
                , disable: !isCompleted,
                style: nextStyle,
                onClick: function onClick() {
                  return onNext();
                }
              },
              next_label
            ),
            _react2.default.createElement(
              _WFBtn2.default,
              {
                visible: Btn.submit
                //visible={true}
                , disable: !isCompleted,
                style: submitStyle,
                onClick: function onClick() {
                  return onSubmit();
                }
              },
              submit_label
            )
          )
        )
      );
    }

    // ------------------- //

    // COMPONENT CUSTOM ------------------- //

    // ------------------- //

  }, {
    key: 'getBg',
    value: function getBg() {
      var cover_color = this.state.cover_color;

      if (!cover_color || cover_color === "" || cover_color === "transparent") {
        return false;
      } else {
        return _react2.default.createElement('wf-form-bg', { style: {
            backgroundColor: cover_color
          } });
      }
    }

    // ------------------- //

  }, {
    key: 'getCover',
    value: function getCover() {
      var _state5 = this.state,
          _state5$cover_image = _state5.cover_image,
          cover_image = _state5$cover_image === undefined ? "" : _state5$cover_image,
          _state5$cover_bg_filt = _state5.cover_bg_filter,
          cover_bg_filter = _state5$cover_bg_filt === undefined ? "none" : _state5$cover_bg_filt,
          _state5$cover_bg_blur = _state5.cover_bg_blur,
          cover_bg_blur = _state5$cover_bg_blur === undefined ? 4 : _state5$cover_bg_blur,
          _state5$cover_bg_opac = _state5.cover_bg_opacity,
          cover_bg_opacity = _state5$cover_bg_opac === undefined ? 100 : _state5$cover_bg_opac;

      if (!cover_image || cover_image === "") {
        return false;
      } else {
        var style = { backgroundImage: 'url(' + cover_image + ')' };
        var opacity = parseInt(cover_bg_opacity);
        if (opacity < 100) {
          style['opacity'] = opacity / 100;
        }
        if (cover_bg_filter === "blur") {
          var blur = parseInt(cover_bg_blur);
          if (blur > 0) {
            style['-webkit-filter'] = 'blur(' + blur + 'px)'; /* Safari */
            style['filter'] = 'blur(' + blur + 'px)';
          }
        } else if (cover_bg_filter === "sepia") {
          style['-webkit-filter'] = 'sepia(100%)'; //* Webkit */
          style['filter'] = 'sepia(100%)'; //* W3C */
        } else if (cover_bg_filter === "grayscale") {
          style['-webkit-filter'] = 'grayscale(1)'; //* Webkit */
          style['filter'] = 'gray'; //* IE6-9 */
          style['filter'] = 'grayscale(1)'; //* W3C */
        } else if (cover_bg_filter === "invert") {
          style['-webkit-filter'] = 'invert(100%)'; //* Webkit */
          style['filter'] = 'invert(100%)'; //* W3C */
        }

        return _react2.default.createElement('wf-form-cover', { style: style });
      }
    }

    // ------------------- //

  }, {
    key: 'getTexture',
    value: function getTexture() {
      var cover_texture = this.state.cover_texture;

      if (!cover_texture || cover_texture === "") {
        return false;
      } else {
        return _react2.default.createElement('wf-form-texture', { style: {
            backgroundImage: 'url(' + cover_texture + ')'
          } });
      }
    }

    // ------------------- //

  }, {
    key: 'getOverlay',
    value: function getOverlay() {
      var cover_overlay = this.state.cover_overlay;

      if (!cover_overlay || cover_overlay === "" || cover_overlay === "transparent") {
        return false;
      } else {
        return _react2.default.createElement('wf-form-overlay', { style: {
            backgroundColor: cover_overlay
          } });
      }
    }

    // ------------------- //

  }, {
    key: 'getVideoHTML5',
    value: function getVideoHTML5() {
      var _state6 = this.state,
          use_cover_video = _state6.use_cover_video,
          _state6$playing = _state6.playing,
          playing = _state6$playing === undefined ? true : _state6$playing,
          _state6$heigth = _state6.heigth,
          heigth = _state6$heigth === undefined ? 0 : _state6$heigth;

      if (!use_cover_video) {
        return false;
      } else {
        return _react2.default.createElement(
          'wf-form-video',
          null,
          _react2.default.createElement(_WFVideoHTML2.default, {
            hasHeigth: heigth,
            context: _WFormVideoHelper2.default.getCtxHTML5(this),
            isPlaying: playing
          })
        );
      }
    }

    // ------------------- //

  }, {
    key: 'getVideoHTML5Control',
    value: function getVideoHTML5Control() {
      var _this5 = this;

      var _state7 = this.state,
          use_cover_video = _state7.use_cover_video,
          _state7$playing = _state7.playing,
          playing = _state7$playing === undefined ? true : _state7$playing;

      if (!use_cover_video) {
        return false;
      } else {
        return _react2.default.createElement(_WFIcon.WFIPlay, {
          className: 'wf-control-video',
          playing: playing,
          onClick: function onClick() {
            return _this5.setState({
              playing: !playing
            });
          }
        });
      }
    }

    // ------------------- //

    // PROGRESS BAR ------------------- //

    // ------------------- //

  }, {
    key: 'getProgressBar',
    value: function getProgressBar() {
      var _state8 = this.state,
          use_progressbar = _state8.use_progressbar,
          progressbar_color = _state8.progressbar_color;

      var _WFormStepHelper$getS = _WFormStepHelper2.default.getStepState(this),
          isUniq = _WFormStepHelper$getS.isUniq,
          progress = _WFormStepHelper$getS.progress;

      if (!use_progressbar || !_WFormStatusHelper2.default.isEditing(this) || _WFormStatusHelper2.default.isLoading(this) || isUniq) {
        return false;
      } else {
        return _react2.default.createElement(
          'wf-form-progress-bar',
          null,
          _react2.default.createElement('wf-progress-bar', { style: {
              backgroundColor: progressbar_color,
              width: progress
            } })
        );
      }
    }

    // ------------------- //

    // TIMELINE ------------------- //

    // ------------------- //

  }, {
    key: 'getTimeline',
    value: function getTimeline() {
      var _state9 = this.state,
          use_timeline = _state9.use_timeline,
          timeline_small = _state9.timeline_small;

      var _WFormStepHelper$getS2 = _WFormStepHelper2.default.getStepState(this),
          count = _WFormStepHelper$getS2.count,
          current = _WFormStepHelper$getS2.current,
          isUniq = _WFormStepHelper$getS2.isUniq;

      var timeline = use_timeline;
      if (!_WFormStatusHelper2.default.isEditing(this) || _WFormStatusHelper2.default.isLoading(this) || isUniq || count < 2) {
        timeline = false;
      } else if (timeline) {
        return _react2.default.createElement(
          'wf-form-timeline',
          { ref: 'WFTimeline' },
          timeline_small ? this.getTimelineMin(current, count) : this.getTimelineMax(current)
        );
      } else {
        return false;
      }
    }

    // ------------------- //

  }, {
    key: 'getTimelineMin',
    value: function getTimelineMin(counter, max) {
      return _react2.default.createElement(
        'wf-timeline-min',
        null,
        _react2.default.createElement(_WFCounter2.default, {
          max: max,
          counter: counter + 1,
          all: true,
          parenthesis: false
        })
      );
    }

    // ------------------- //

  }, {
    key: 'getTimelineMax',
    value: function getTimelineMax(current) {
      var _props$isEditable = this.props.isEditable,
          isEditable = _props$isEditable === undefined ? false : _props$isEditable;
      var _state10 = this.state,
          completedStep = _state10.completedStep,
          timeline_color = _state10.timeline_color,
          timeline_label = _state10.timeline_label;

      var limit = 7;
      var visible = 3;
      var _steps = [];
      var completed = completedStep;
      //if(isEditable) {
      completed = this.state.steps || [];
      completed = completed.map(function (s, i) {
        return i;
      });
      //}
      var i = 0,
          l = completed.length;
      if (l < limit) _steps = completed;else {
        var min = current - visible;
        var max = current + visible;
        var minPos = l - current;
        var minNeg = current;
        var minLim = limit - visible;
        var maxLim = limit + visible;
        var lastCursor = l - limit;
        for (i = 0; i < l; i++) {
          if (current === limit || current === limit - 1) {
            if (i === current || i >= minLim && i < current || i <= maxLim && i > current) {
              _steps.push(i);
            }
          } else if (current < limit) {
            if (i === current || i < minNeg && i < current || i <= minPos && i > current) {
              _steps.push(i);
            }
          } else {
            if (i === current || i > lastCursor || i >= min && i < current || i <= max && i > current) {
              _steps.push(i);
            }
          }
          if (_steps.length === limit || completed.length === i) {
            if (_steps[_steps.length - 1] >= limit) {
              _steps[_steps.length - 1] = l - 1;
            }
            break;
          }
        }
      }
      return _react2.default.createElement(
        'wf-timeline-max',
        null,
        _steps.map(function (step, i) {
          var index = step + 1;
          var state = {
            icon: "",
            bg: "transparent",
            state: "transparent"
          };
          if (step < current) {
            state["clss"] = "wf--prev";
            state["icon"] = "check";
            state["bg"] = timeline_color;
          } else if (step > current) {
            state["clss"] = "wf--next";
            state["state"] = "rgba(255, 255, 255, 0.3)";
          } else if (step === current) {
            state["clss"] = "wf--current";
            state["state"] = timeline_color;
          }
          return _react2.default.createElement(
            'span',
            { key: i, className: 'wf--step ' + state.clss },
            _react2.default.createElement(
              _WFText2.default,
              {
                counter: index,
                counterParenthesis: false
              },
              timeline_label || " "
            ),
            _react2.default.createElement(
              'span',
              {
                className: 'wf-marker',
                style: { backgroundColor: state.bg } },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: state.icon }),
              _react2.default.createElement('span', { className: 'wf--state', style: { backgroundColor: state.state } })
            )
          );
        })
      );
    }

    // ------------------- //

    // UTILS ------------------- //

    // ------------------- //

  }, {
    key: 'refreshHeight',
    value: function refreshHeight() {
      _WFormStyleHelper2.default.refreshHeight(this);
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: 'componentDidUpdate',
    value: function componentDidUpdate() {
      this.refreshHeight();
    }
    // ------------------- //

  }, {
    key: 'componentWillMount',
    value: function componentWillMount() {
      var _this6 = this;

      var _props5 = this.props,
          on = _props5.on,
          _props5$onWillMount = _props5.onWillMount,
          onWillMount = _props5$onWillMount === undefined ? null : _props5$onWillMount;

      this.refreshHeight();
      _windowWatcher2.default.on('resize', function () {
        return _this6.refreshHeight();
      });
      on(_WFEventTypes.WF_EVENT_ONWILLMOUNT, this);
      if ((0, _Lodash.isFunction)(onWillMount)) {
        onWillMount();
      }
    }
    // ------------------- //

  }, {
    key: 'componentDidMount',
    value: function componentDidMount() {
      var _props6 = this.props,
          on = _props6.on,
          _props6$onDidMount = _props6.onDidMount,
          onDidMount = _props6$onDidMount === undefined ? null : _props6$onDidMount;

      this.refreshHeight();
      on(_WFEventTypes.WF_EVENT_ONDIDMOUNT, this);
      if ((0, _Lodash.isFunction)(onDidMount)) {
        onDidMount();
      }
    }
    // ------------------- //

  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      var _props7 = this.props,
          on = _props7.on,
          _props7$onWillUnmount = _props7.onWillUnmount,
          onWillUnmount = _props7$onWillUnmount === undefined ? null : _props7$onWillUnmount;

      this.refreshHeight = function () {
        return false;
      };
      on(_WFEventTypes.WF_EVENT_ONWILLUNMOUNT, this);
      if ((0, _Lodash.isFunction)(onWillUnmount)) {
        onWillUnmount();
      }
    }
  }]);
  return WFormComponent;
}(_react.Component);

// ------------------- //


exports.default = WFormComponent;
// ------------------- //

//WFormStyleHelper.

/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _stringify = __webpack_require__(104);

var _stringify2 = _interopRequireDefault(_stringify);

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFieldComponent = __webpack_require__(218);

var _WFieldComponent2 = _interopRequireDefault(_WFieldComponent);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

var _WFIcon2 = _interopRequireDefault(_WFIcon);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM STEP CONTENT ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFormContent = function (_Component) {
  (0, _inherits3.default)(WFormContent, _Component);

  function WFormContent() {
    (0, _classCallCheck3.default)(this, WFormContent);
    return (0, _possibleConstructorReturn3.default)(this, (WFormContent.__proto__ || (0, _getPrototypeOf2.default)(WFormContent)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFormContent, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          _props$isField = _props.isField,
          isField = _props$isField === undefined ? false : _props$isField,
          _props$contentEditabl = _props.contentEditableMenu,
          contentEditableMenu = _props$contentEditabl === undefined ? null : _props$contentEditabl;

      return this.getTheField();
      /*
      if (isField) {
        return this.getTheField();
       // return this.getTheContent();
      } else {
        if (isFunction(contentEditableMenu)) {
          return contentEditableMenu(this);
        } else {
          return this.getTheContent();
        }
      } 
      */
    }
  }, {
    key: 'getTheField',
    value: function getTheField() {
      var _props2 = this.props,
          isAdmin = _props2.isAdmin,
          onField = _props2.onField,
          onGetInput = _props2.onGetInput,
          _props2$fieldStyle = _props2.fieldStyle,
          fieldStyle = _props2$fieldStyle === undefined ? {} : _props2$fieldStyle,
          _props2$fieldSchema = _props2.fieldSchema,
          fieldSchema = _props2$fieldSchema === undefined ? {} : _props2$fieldSchema,
          _props2$fieldEditable = _props2.fieldEditableMenu,
          fieldEditableMenu = _props2$fieldEditable === undefined ? null : _props2$fieldEditable,
          _props2$hidden = _props2.hidden,
          hidden = _props2$hidden === undefined ? false : _props2$hidden,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$isExtraConten = _props2.isExtraContent,
          isExtraContent = _props2$isExtraConten === undefined ? false : _props2$isExtraConten,
          _props2$isEditable = _props2.isEditable,
          isEditable = _props2$isEditable === undefined ? false : _props2$isEditable,
          _props2$customCompone = _props2.customComponent,
          customComponent = _props2$customCompone === undefined ? null : _props2$customCompone;

      var isDisable = disabled;
      var style = {
        opacity: hidden ? 0 : 1,
        visibility: hidden ? "hidden" : "visible"
      };
      if (hidden) {
        style["display"] = "none";
      }
      if ((0, _Lodash.isFunction)(customComponent)) {
        return _react2.default.createElement(_WFieldComponent2.default, (0, _extends3.default)({}, fieldSchema, {
          isAdminForm: isAdmin,
          disabled: isDisable,
          isWonderField: isExtraContent,
          isEditable: isEditable,
          fieldEditableMenu: fieldEditableMenu,
          customComponent: customComponent,
          onGetInput: onGetInput,
          on: onField
        }));
      } else {
        return _react2.default.createElement(
          _WFCol2.default,
          (0, _extends3.default)({
            reset: true,
            className: "_c",
            style: style
          }, this.props),
          _react2.default.createElement(_WFieldComponent2.default, (0, _extends3.default)({}, fieldSchema, fieldStyle, {
            isAdminForm: isAdmin,
            disabled: isDisable,
            isWonderField: isExtraContent,
            isEditable: isEditable,
            fieldEditableMenu: fieldEditableMenu,
            customComponent: customComponent,
            onGetInput: onGetInput,
            on: onField
          }))
        );
      }
    }
  }, {
    key: 'getTheContent',
    value: function getTheContent() {
      var _props3 = this.props,
          isAdmin = _props3.isAdmin,
          _props3$schema = _props3.schema,
          schema = _props3$schema === undefined ? {} : _props3$schema,
          _props3$contentStyle = _props3.contentStyle,
          contentStyle = _props3$contentStyle === undefined ? {} : _props3$contentStyle,
          _props3$hidden = _props3.hidden,
          hidden = _props3$hidden === undefined ? false : _props3$hidden,
          _props3$disabled = _props3.disabled,
          disabled = _props3$disabled === undefined ? false : _props3$disabled,
          _props3$isExtraConten = _props3.isExtraContent,
          isExtraContent = _props3$isExtraConten === undefined ? false : _props3$isExtraConten,
          _props3$isEditable = _props3.isEditable,
          isEditable = _props3$isEditable === undefined ? false : _props3$isEditable;

      var style = {};
      style.col = {
        opacity: hidden ? 0 : 1,
        visibility: hidden ? "hidden" : "visible"
      };
      style.wrapper = {
        textAlign: "text-center",
        maxWidth: "960px",
        margin: "0 auto"
      };
      style.material = {};
      return _react2.default.createElement(
        _WFCol2.default,
        (0, _extends3.default)({
          reset: true,
          className: "_c __c",
          style: style.col
        }, this.props),
        _react2.default.createElement(
          'div',
          { style: style.wrapper },
          this.getText(style.material),
          this.getImg(style.material),
          this.getSeparator(style.material),
          _react2.default.createElement(
            'wf-debugger',
            null,
            _react2.default.createElement(
              'div',
              null,
              _react2.default.createElement(
                'pre',
                null,
                'schema : ',
                (0, _stringify2.default)(schema, 0, 2)
              )
            )
          )
        )
      );
    }
  }, {
    key: 'getText',
    value: function getText() {

      var className = "";
      var style = {};

      /*
        border: 2px solid rgba(255, 255, 255, 0.21);
        padding: 14px;
        margin: 20px;
        display: inline-block;
        max-width: 740px;
      */

      return _react2.default.createElement(
        'div',
        { className: '' },
        _react2.default.createElement(
          'div',
          { className: 'wf--text wf--t' },
          this.getContentHtml('\n            <strong>What is</strong> Lorem Ipsum?\n          ', style)
        ),
        _react2.default.createElement(
          'div',
          { className: 'wf--text wf--s' },
          this.getContentHtml('\n            Lorem Ipsum is simply dummy text of the printing and typesetting industry. \n            Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s,\n          ', style)
        ),
        _react2.default.createElement(
          'div',
          { className: 'wf--text wf--p' },
          this.getContentHtml('\n            The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. \n            Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced \n            in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.\n          ', style)
        ),
        _react2.default.createElement(
          'div',
          { className: 'wf--text wf--c' },
          this.getContentHtml('\n            The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. \n            Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced \n            in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.\n          ', style)
        )
      );
    }
  }, {
    key: 'getContentHtml',
    value: function getContentHtml(content) {
      var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      var html = content.replace(/\r\n/g, "<br>").replace(/^\s+|\s+$/g, "");
      return _react2.default.createElement('span', { style: style, dangerouslySetInnerHTML: { __html: html } });
    }
  }, {
    key: 'getSeparator',
    value: function getSeparator() {

      var className = "";
      var style = {};

      return _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(_WFSep2.default, null),
        _react2.default.createElement(_WFSep2.default, { type: 'solid', style: style }),
        _react2.default.createElement(_WFSep2.default, { type: 'dotted', style: style }),
        _react2.default.createElement(_WFSep2.default, { type: 'dashed', style: style }),
        _react2.default.createElement(_WFSep2.default, { type: 'double', style: style })
      );
    }
  }, {
    key: 'getImg',
    value: function getImg() {
      var _this2 = this;

      var className = "";
      var style = {};

      /*
      
        border: 2px solid rgba(255, 255, 255, 0.21);
        padding: 3px;
        margin: 20px 0;
        background: white;
      
      */

      return _react2.default.createElement(
        'div',
        { className: 'text-center' },
        _react2.default.createElement(_WFImg2.default, {
          src: 'http://lorempixel.com/1200/320/',
          style: style,
          className: className,
          groupId: 12,
          onReady: function onReady() {
            console.error("IMG IS READY...");
            _this2.props.onRefreshParentHeight();
          }
        })
      );
    }
  }, {
    key: 'getVideo',
    value: function getVideo() {

      var className = "";
      var style = {};

      /*
      
        border: 2px solid rgba(255, 255, 255, 0.21);
        padding: 3px;
        margin: 20px 0;
        background: white;
      
      */

      return _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          'div',
          { className: 'embed-responsive embed-responsive-16by9' },
          _react2.default.createElement('iframe', {
            className: 'embed-responsive-item',
            src: '//www.youtube.com/embed/zpOULjyy-n8?rel=0',
            onLoad: function onLoad() {
              console.error("IFRAME READY...");
            }
          })
        )
      );
    }

    /*
    
      WFClear
      <WFClear />
    
      WFText
      <WFText
      html={true}
      className={className}
      ><strong>Hello<strong> world...</strong></WFText>
    
      WFIcon
      <WFIcon
        icon={icon}
        className={className}
        onClick={optional}
      />
      
      WFImg
      <WFImg 
      src={logo} 
      className={classe} 
      />
    
      WFBtn
      <WFBtn 
      className={classes} 
      onClick={onClick} 
      icon={icon}>
        Save form
      </WFBtn>
    
    */

  }]);
  return WFormContent;
}(_react.Component);

// ------------------- //

exports.default = WFormContent;

// ------------------- //

/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormConditionHelper = __webpack_require__(152);

var _WFormConditionHelper2 = _interopRequireDefault(_WFormConditionHelper);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormStepHelper = function () {
  function WFormStepHelper() {
    (0, _classCallCheck3.default)(this, WFormStepHelper);
  }

  (0, _createClass3.default)(WFormStepHelper, null, [{
    key: "getStepState",
    value: function getStepState(wfCpt) {
      return {
        count: WFormStepHelper.countStep(wfCpt),
        stepId: WFormStepHelper.currentStep(wfCpt),
        current: WFormStepHelper.currentStepIndex(wfCpt),
        isFirst: WFormStepHelper.isFirstStep(wfCpt),
        isLast: WFormStepHelper.isLastStep(wfCpt),
        isUniq: WFormStepHelper.hasUniqStep(wfCpt),
        isCompleted: WFormStepHelper.isCompletedStep(wfCpt),
        progress: WFormStepHelper.progressStep(wfCpt)
      };
    }
  }, {
    key: "countStep",
    value: function countStep(wfCpt) {
      var _wfCpt$state$steps = wfCpt.state.steps,
          steps = _wfCpt$state$steps === undefined ? [] : _wfCpt$state$steps;

      return steps.length;
    }
  }, {
    key: "currentStep",
    value: function currentStep(wfCpt) {
      var _wfCpt$state$currentS = wfCpt.state.currentStep,
          currentStep = _wfCpt$state$currentS === undefined ? 0 : _wfCpt$state$currentS;

      return currentStep;
    }
  }, {
    key: "currentStepIndex",
    value: function currentStepIndex(wfCpt) {
      var _wfCpt$state$currentS2 = wfCpt.state.currentStepIndex,
          currentStepIndex = _wfCpt$state$currentS2 === undefined ? 0 : _wfCpt$state$currentS2;

      return currentStepIndex;
    }
  }, {
    key: "progressStep",
    value: function progressStep(wfCpt) {
      var currentIndex = WFormStepHelper.currentStepIndex(wfCpt);
      var counter = WFormStepHelper.countStep(wfCpt);
      return currentIndex / counter * 100 + "%";
    }
  }, {
    key: "hasUniqStep",
    value: function hasUniqStep(wfCpt) {
      var counter = WFormStepHelper.countStep(wfCpt);
      return counter === 1 || counter === 0;
    }
  }, {
    key: "isFirstStep",
    value: function isFirstStep(wfCpt) {
      return WFormStepHelper.currentStepIndex(wfCpt) === 0;
    }
  }, {
    key: "isLastStep",
    value: function isLastStep(wfCpt) {
      var currentIndex = WFormStepHelper.currentStepIndex(wfCpt);
      var counter = WFormStepHelper.countStep(wfCpt);
      return counter === currentIndex + 1;
    }
  }, {
    key: "isCompletedStep",
    value: function isCompletedStep(wfCpt) {
      var _wfCpt$props$isEditab = wfCpt.props.isEditable,
          isEditable = _wfCpt$props$isEditab === undefined ? false : _wfCpt$props$isEditab;

      if (isEditable) {
        return true;
      }
      var _wfCpt$state$complete = wfCpt.state.completedStep,
          completedStep = _wfCpt$state$complete === undefined ? [null] : _wfCpt$state$complete;

      return completedStep.includes(WFormStepHelper.currentStep(wfCpt));
    }
  }]);
  return WFormStepHelper;
}();

exports.default = WFormStepHelper;

/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _Mobile = __webpack_require__(261);

var _Screen = __webpack_require__(168);

var _WFormConditionHelper = __webpack_require__(152);

var _WFormConditionHelper2 = _interopRequireDefault(_WFormConditionHelper);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CLASSIC_FIELD = "classic";
var WFCONTENT = "WFContent";
var WFTIMELINE = "WFTimeline";
var WFTHEME = "wf-wonderform-theme";

var WFormStyleHelper = function () {
  function WFormStyleHelper() {
    (0, _classCallCheck3.default)(this, WFormStyleHelper);
  }

  (0, _createClass3.default)(WFormStyleHelper, null, [{
    key: 'getHeight',


    // ------------------- //

    // UTILS ------------------- //

    // ------------------- //

    value: function getHeight(wfCpt, refId) {
      var node = _reactDom2.default.findDOMNode(wfCpt.refs[refId]);
      if (!node) return 0;
      return node.offsetHeight;
    }

    // ------------------- //

  }, {
    key: 'refreshHeight',
    value: function refreshHeight(wfCpt) {
      var currentContentHeight = wfCpt.state.currentContentHeight;

      var nextContentHeight = WFormStyleHelper.getHeight(wfCpt, WFCONTENT);
      if (nextContentHeight !== currentContentHeight) {
        WFormStyleHelper.updateHeigth(wfCpt);
        wfCpt.setState({
          isMobile: (0, _Mobile.isMobileSize)(),
          currentContentHeight: nextContentHeight
        });
      }
    }

    // ------------------- //

    // VERTICAL ALIGN ------------------- //

    // ------------------- //

  }, {
    key: 'getVerticalAlignConfig',
    value: function getVerticalAlignConfig(wfCpt) {
      var _wfCpt$props$isEditab = wfCpt.props.isEditable,
          isEditable = _wfCpt$props$isEditab === undefined ? false : _wfCpt$props$isEditab;
      var _wfCpt$state = wfCpt.state,
          _wfCpt$state$use_vert = _wfCpt$state.use_vertical_align,
          use_vertical_align = _wfCpt$state$use_vert === undefined ? false : _wfCpt$state$use_vert,
          _wfCpt$state$heigth = _wfCpt$state.heigth,
          heigth = _wfCpt$state$heigth === undefined ? 0 : _wfCpt$state$heigth;

      var height = 0;
      var isActive = false;
      if (isEditable || use_vertical_align) {
        height = heigth;
        isActive = true;
      }
      return {
        isActive: isActive,
        height: height
      };
    }
  }, {
    key: 'updateHeigth',
    value: function updateHeigth(wfCpt) {
      var _wfCpt$props$isEditab2 = wfCpt.props.isEditable,
          isEditable = _wfCpt$props$isEditab2 === undefined ? false : _wfCpt$props$isEditab2;
      var _wfCpt$state2 = wfCpt.state,
          _wfCpt$state2$use_ver = _wfCpt$state2.use_vertical_align,
          use_vertical_align = _wfCpt$state2$use_ver === undefined ? false : _wfCpt$state2$use_ver,
          vertical_align_height = _wfCpt$state2.vertical_align_height,
          vertical_align_padding = _wfCpt$state2.vertical_align_padding;

      var verticalAlign = false;
      var verticalAlignHeight = 780;
      var verticalAlignPadding = 50;
      if (use_vertical_align) {
        verticalAlign = true;
        verticalAlignHeight = parseInt(vertical_align_height);
        verticalAlignPadding = parseInt(vertical_align_padding);
      }
      if (isEditable) {
        verticalAlign = true;
      }
      if (!verticalAlign) {
        return false;
      }
      var contentH = WFormStyleHelper.getHeight(wfCpt, WFCONTENT);
      var timelineH = WFormStyleHelper.getHeight(wfCpt, WFTIMELINE);
      var nextHeight = (0, _Screen.VerticalAlign)({
        content: contentH + (timelineH ? timelineH / 2 : 0),
        minHeight: verticalAlignHeight,
        top: verticalAlignPadding,
        down: verticalAlignPadding });
      wfCpt.setState({
        heigth: nextHeight
      });
    }

    // ------------------- //

    // FOOTER STYLE ------------------- //

    // ------------------- //

  }, {
    key: 'getFooterStyle',
    value: function getFooterStyle(wfCpt) {
      var isExtraContent = _WFormConditionHelper2.default.isExtraContent(wfCpt);
      if (!isExtraContent) {
        return {};
      } else {
        return {
          maxWidth: "550px"
        };
      }
    }

    // ------------------- //

    // CONTENT STYLE ------------------- //

    // ------------------- //

  }, {
    key: 'getContainerClass',
    value: function getContainerClass(wfCpt) {
      var _wfCpt$props$isAdmin = wfCpt.props.isAdmin,
          isAdmin = _wfCpt$props$isAdmin === undefined ? false : _wfCpt$props$isAdmin;
      var _wfCpt$state3 = wfCpt.state,
          _wfCpt$state3$hasThem = _wfCpt$state3.hasTheme,
          hasTheme = _wfCpt$state3$hasThem === undefined ? "" : _wfCpt$state3$hasThem,
          _wfCpt$state3$hasThem2 = _wfCpt$state3.hasThemeOption,
          hasThemeOption = _wfCpt$state3$hasThem2 === undefined ? "" : _wfCpt$state3$hasThem2,
          _wfCpt$state3$customC = _wfCpt$state3.customClassName,
          customClassName = _wfCpt$state3$customC === undefined ? "" : _wfCpt$state3$customC,
          _wfCpt$state3$current = _wfCpt$state3.currentStepValue,
          currentStepValue = _wfCpt$state3$current === undefined ? {} : _wfCpt$state3$current,
          use_vertical_align = _wfCpt$state3.use_vertical_align,
          _wfCpt$state3$heigth = _wfCpt$state3.heigth,
          heigth = _wfCpt$state3$heigth === undefined ? 0 : _wfCpt$state3$heigth;
      var _currentStepValue$typ = currentStepValue.type,
          type = _currentStepValue$typ === undefined ? CLASSIC_FIELD : _currentStepValue$typ;

      var clss = "";
      clss += !isAdmin ? "wf-default-theme" : "";
      clss += ' ' + hasTheme;
      clss += ' ' + hasThemeOption;
      if (hasTheme === WFTHEME) {
        clss += ' wf-' + type + '-step';
      } else {
        clss += ' wf-' + CLASSIC_FIELD + '-step';
      }
      clss += ' ' + customClassName;
      return clss;
    }
  }, {
    key: 'getContentStyle',
    value: function getContentStyle(wfCpt) {
      var _wfCpt$state4 = wfCpt.state,
          _wfCpt$state4$isMobil = _wfCpt$state4.isMobile,
          isMobile = _wfCpt$state4$isMobil === undefined ? false : _wfCpt$state4$isMobil,
          container_bg = _wfCpt$state4.container_bg,
          container_width = _wfCpt$state4.container_width,
          container_padding = _wfCpt$state4.container_padding,
          container_border_radius = _wfCpt$state4.container_border_radius;

      var contentStyle = {};
      if (!isMobile) {
        if (_WFormConditionHelper2.default.isExtraContent(wfCpt)) {
          if (container_bg) {
            contentStyle['backgroundColor'] = "transparent";
          }
          if (container_width) {
            contentStyle['maxWidth'] = "100%";
          }
          if (container_padding) {
            contentStyle['padding'] = container_padding;
          }
          if (container_border_radius) {
            contentStyle['borderRadius'] = "0";
          }
        } else {
          if (container_bg) {
            contentStyle['backgroundColor'] = container_bg;
          }
          if (container_width) {
            contentStyle['maxWidth'] = container_width;
          }
          if (container_padding) {
            contentStyle['padding'] = container_padding;
          }
          if (container_border_radius) {
            contentStyle['borderRadius'] = container_border_radius;
          }
        }
      } else {
        contentStyle['padding'] = 15;
        contentStyle['backgroundColor'] = "#FFF";
      }
      return contentStyle;
    }

    // ------------------- //

    // FIELD STYLE ------------------- //

    // ------------------- //

  }, {
    key: 'getFieldStyle',
    value: function getFieldStyle(wfCpt) {
      var _wfCpt$state5 = wfCpt.state,
          _wfCpt$state5$isMobil = _wfCpt$state5.isMobile,
          isMobile = _wfCpt$state5$isMobil === undefined ? false : _wfCpt$state5$isMobil,
          field_inline = _wfCpt$state5.field_inline,
          field_no_label = _wfCpt$state5.field_no_label,
          field_color = _wfCpt$state5.field_color,
          field_font_size = _wfCpt$state5.field_font_size,
          field_padding = _wfCpt$state5.field_padding,
          field_legend_color = _wfCpt$state5.field_legend_color,
          field_legend_font_size = _wfCpt$state5.field_legend_font_size,
          field_legend_padding = _wfCpt$state5.field_legend_padding,
          wf_label_font_size = _wfCpt$state5.wf_label_font_size,
          wf_label_color = _wfCpt$state5.wf_label_color,
          wf_label_padding = _wfCpt$state5.wf_label_padding,
          wf_legend_color = _wfCpt$state5.wf_legend_color,
          wf_legend_font_size = _wfCpt$state5.wf_legend_font_size,
          wf_legend_padding = _wfCpt$state5.wf_legend_padding,
          wf_option_label_color = _wfCpt$state5.wf_option_label_color,
          wf_option_legend_color = _wfCpt$state5.wf_option_legend_color;


      var label = {};
      var legend = {};

      var labelText = {};
      var labelRequired = {};

      var optionLabel = {};
      var optionLegend = {};
      if (!isMobile) {
        if (_WFormConditionHelper2.default.isExtraContent(wfCpt)) {
          if (wf_label_padding) {
            label["padding"] = wf_label_padding + 'px 0';
          }
          if (wf_label_font_size) {
            labelRequired["fontSize"] = labelText["fontSize"] = wf_label_font_size + 'px';
          }
          if (wf_label_color) {
            labelRequired["color"] = labelText["color"] = wf_label_color;
          }

          if (wf_legend_padding) {
            legend["padding"] = wf_legend_padding + 'px 0';
          }
          if (wf_legend_font_size) {
            legend["fontSize"] = wf_legend_font_size + 'px';
          }
          if (wf_legend_color) {
            legend["color"] = wf_legend_color;
          }

          if (wf_option_label_color) {
            optionLabel["color"] = wf_option_label_color;
          }
          if (wf_option_legend_color) {
            optionLegend["color"] = wf_option_legend_color;
          }
        } else {
          if (field_padding) {
            label["padding"] = field_padding + 'px 0';
          }
          if (field_font_size) {
            labelText["fontSize"] = field_font_size + 'px';
          }
          if (field_color) {
            labelText["color"] = field_color;
          }

          if (field_legend_padding) {
            legend["padding"] = field_legend_padding + 'px 0';
          }
          if (field_legend_font_size) {
            legend["fontSize"] = field_legend_font_size + 'px';
          }
          if (field_legend_color) {
            legend["color"] = field_legend_color;
          }
        }
      } else {
        labelText["fontSize"] = '14px';
        labelText["color"] = "#555";
        legend["fontSize"] = '12px';
        legend["color"] = "#666";
      }
      var styles = {
        label: label,
        labelText: labelText,
        labelRequired: labelRequired,
        legend: legend,
        optionLabel: optionLabel,
        optionLegend: optionLegend
      };
      return {
        styles: styles,
        isInline: field_inline,
        hasLabel: !field_no_label
      };
    }

    // ------------------- //

    // OPTIONS STYLE ------------------- //

    // ------------------- //

  }, {
    key: 'getOptionStyle',
    value: function getOptionStyle(wfCpt) {
      var _wfCpt$props = wfCpt.props,
          _wfCpt$props$wf_heigh = _wfCpt$props.wf_height,
          wf_height = _wfCpt$props$wf_heigh === undefined ? 275 : _wfCpt$props$wf_heigh,
          _wfCpt$props$wf_optio = _wfCpt$props.wf_option_width,
          wf_option_width = _wfCpt$props$wf_optio === undefined ? 200 : _wfCpt$props$wf_optio,
          wf_option_margin = _wfCpt$props.wf_option_margin,
          wf_option_padding = _wfCpt$props.wf_option_padding,
          wf_option_image_height = _wfCpt$props.wf_option_image_height,
          wf_option_image_radius = _wfCpt$props.wf_option_image_radius;

      var imageStyle = {};
      var optionStyle = {};
      var optionWidth = 200;
      var scrollBarHeight = 275;
      if (wf_height) {
        scrollBarHeight = wf_height;
      }
      if (wf_option_width) {
        optionWidth = wf_option_width;
      }
      if (wf_option_image_height) {
        imageStyle["maxHeight"] = wf_option_image_height + 'px';
      }
      if (wf_option_image_radius) {
        imageStyle["borderRadius"] = wf_option_image_radius + '%';
      }
      if (wf_option_margin) {
        optionStyle["margin"] = wf_option_margin;
      }
      if (wf_option_padding) {
        optionStyle["padding"] = wf_option_padding;
      }
      return {
        imageStyle: imageStyle,
        optionStyle: optionStyle,
        optionWidth: optionWidth,
        scrollBarHeight: scrollBarHeight
      };
    }

    // ------------------- //

    // NAVIGATION STYLE ------------------- //

    // ------------------- //

  }, {
    key: 'getNavStyle',
    value: function getNavStyle(wfCpt) {
      var _wfCpt$state6 = wfCpt.state,
          _wfCpt$state6$isMobil = _wfCpt$state6.isMobile,
          isMobile = _wfCpt$state6$isMobil === undefined ? false : _wfCpt$state6$isMobil,
          prev_color = _wfCpt$state6.prev_color,
          prev_bg = _wfCpt$state6.prev_bg,
          next_color = _wfCpt$state6.next_color,
          next_bg = _wfCpt$state6.next_bg,
          submit_font_size = _wfCpt$state6.submit_font_size,
          submit_padding = _wfCpt$state6.submit_padding,
          submit_border_radius = _wfCpt$state6.submit_border_radius,
          submit_color = _wfCpt$state6.submit_color,
          submit_bg = _wfCpt$state6.submit_bg;


      var prevStyle = {};
      var nextStyle = {};
      var submitStyle = {};

      if (prev_bg) {
        prevStyle["backgroundColor"] = '' + prev_bg;
      }
      if (prev_color) {
        prevStyle["color"] = '' + prev_color;
      }

      if (next_bg) {
        nextStyle["backgroundColor"] = '' + next_bg;
      }
      if (next_color) {
        nextStyle["color"] = '' + next_color;
      }

      if (submit_bg) {
        submitStyle["backgroundColor"] = '' + submit_bg;
      }
      if (submit_color) {
        submitStyle["color"] = '' + submit_color;
      }

      if (!isMobile) {
        if (submit_font_size) {
          prevStyle["fontSize"] = nextStyle["fontSize"] = submitStyle["fontSize"] = submit_font_size + 'px';
        }
        if (submit_padding) {
          prevStyle["padding"] = nextStyle["padding"] = submitStyle["padding"] = submit_padding + 'px 0';
        }
        if (submit_border_radius) {
          prevStyle["borderRadius"] = nextStyle["borderRadius"] = submitStyle["borderRadius"] = submit_border_radius + 'px';
        }
      } else {
        prevStyle["fontSize"] = nextStyle["fontSize"] = submitStyle["fontSize"] = '10px';

        prevStyle["padding"] = nextStyle["padding"] = submitStyle["padding"] = '12px 0';

        prevStyle["borderRadius"] = nextStyle["borderRadius"] = submitStyle["borderRadius"] = '0';
      }
      return {
        prevStyle: prevStyle,
        nextStyle: nextStyle,
        submitStyle: submitStyle
      };
    }
  }]);
  return WFormStyleHelper;
}();

exports.default = WFormStyleHelper;

/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT ------------------- //
// ------------------- //

var WFSelect = function (_Component) {
  (0, _inherits3.default)(WFSelect, _Component);

  function WFSelect(props) {
    (0, _classCallCheck3.default)(this, WFSelect);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect.__proto__ || (0, _getPrototypeOf2.default)(WFSelect)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFSelect, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          valueBy = _props.valueBy,
          labelBy = _props.labelBy;

      var data = this.getData();
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        willMount: function willMount() {
          WFSelect.setIntialValue(_this2.props);
        },
        didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "selectWord");
        },
        view: function view(input) {
          var counter = data.length;

          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            'wf-select-single',
            null,
            _react2.default.createElement(
              'select',
              {
                value: value,
                disabled: disabled || counter === 0,
                onChange: function onChange(e) {
                  return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, e.target.value));
                }
              },
              data.map(function (row, i) {
                var label = row[labelBy];
                var value = row[valueBy];
                return _react2.default.createElement(
                  'option',
                  { key: i, value: value },
                  label
                );
              })
            ),
            _react2.default.createElement(_WFIcon.WFIDown, null)
          );
        }
      }));
    }
  }, {
    key: 'getData',
    value: function getData() {
      var _state$sampleData = this.state.sampleData,
          sampleData = _state$sampleData === undefined ? [] : _state$sampleData;
      var _props$data = this.props.data,
          data = _props$data === undefined ? [] : _props$data;

      if (data.length > 0) {
        return data;
      } else {
        return sampleData;
      }
    }
  }], [{
    key: 'setIntialValue',
    value: function setIntialValue(props) {
      var on = props.on,
          valueBy = props.valueBy,
          _props$data2 = props.data,
          data = _props$data2 === undefined ? [] : _props$data2;

      var _WFInputComponent$get2 = _WFInputComponent2.default.getStrCfg(props),
          key = _WFInputComponent$get2.key,
          value = _WFInputComponent$get2.value;

      on(_WFEventTypes.WF_EVENT_ONCUSTOM, function (input) {
        var preValue = input.field.getValue();
        if (data.length > 0) {
          if (!preValue || preValue === "") {
            var initialValue = data[0][valueBy];
            on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, initialValue));
          }
        }
      });
    }
  }]);
  return WFSelect;
}(_react.Component);

// ------------------- //


exports.default = WFSelect;
// ------------------- //

/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

var _WFBaobabOption = __webpack_require__(226);

var _WFBaobabOption2 = _interopRequireDefault(_WFBaobabOption);

var _WFBoolean = __webpack_require__(167);

var _WFBoolean2 = _interopRequireDefault(_WFBoolean);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFSelect = __webpack_require__(259);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(72);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF BAOBAB ------------------- //
// ------------------- //
var WFBaobab = function () {
  /**
   * Constructor
   */
  function WFBaobab() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFBaobab);
    var _config$isAdmin = config.isAdmin,
        isAdmin = _config$isAdmin === undefined ? true : _config$isAdmin,
        _config$isPrivate = config.isPrivate,
        isPrivate = _config$isPrivate === undefined ? true : _config$isPrivate,
        _config$initialState = config.initialState,
        initialState = _config$initialState === undefined ? {} : _config$initialState,
        _config$initConfigFor = config.initConfigForOption,
        initConfigForOption = _config$initConfigFor === undefined ? {} : _config$initConfigFor;
    // Props

    this.map = new _WFObject2.default();
    this.history = new _WFArray2.default();
    this.currentTree = null;
    this.currentBranch = null;
    this.currentOption = null;
    this.isAdmin = isAdmin;
    // Manager
    this.viewMgr = new _WFViewMgr2.default(initialState);
    this.queryMgr = new _WFQueryParams2.default();
    this.selectMgr = new _WFArray2.default({
      isCollection: true,
      findBy: 'id'
    });
    // Collection
    this.treeMgr = new _WFArray2.default({
      isCollection: true,
      findBy: 'name'
    });
    // configForOption
    this.configForOption = initConfigForOption;
    // Set QueryMgr
    //this.queryMgr.toAsc();
    //this.queryMgr.setOrderBy('entry_id');
    if (isPrivate) {
      this.queryMgr.setFilter(_Constants.WF_BAOBAB_PRIV_OPTION, true, true);
    }
  }

  // STATE ------------ //

  /**
   * Notify when state change
   */


  (0, _createClass3.default)(WFBaobab, [{
    key: "change",
    value: function change() {
      this.viewMgr.change();
    }

    /**
     * Notify when state is ready
     */

  }, {
    key: "ready",
    value: function ready() {
      this.viewMgr.ready();
    }

    // ACTIONS ------------ //

    /**
     * Explore option by type
     * @param optionConfig is object
     * @param type of option tree || branch || option
     **/

  }, {
    key: "explore",
    value: function explore(optionConfig) {
      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants.WF_BAOBAB_TREE;

      this.selectMgr.clear();
      switch (type) {

        case _Constants.WF_BAOBAB_TREE:
          this.setCurrentTree(optionConfig);
          break;

        case _Constants.WF_BAOBAB_BRANCH:
          this.setCurrentBranch(optionConfig);
          break;

        case _Constants.WF_BAOBAB_OPTION:
          this.setCurrentOption(optionConfig);
          break;

        default:
          return false;
      }
    }

    /**
     * Find 
     * @param args contains {page}
     * @param next is optional callback
     **/

  }, {
    key: "find",
    value: function find() {
      var _this = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      this.selectMgr.clear();
      if (this.isBranchArchive()) {
        this.change();
        this.currentBranch.find(args, function () {
          return _this.ready();
        });
      } else if (this.isOptionArchive()) {
        this.change();
        this.currentOption.find(args, function () {
          return _this.ready();
        });
      } else if (this.isTreeArchive()) {
        this.change();
        this.currentTree.find(args, function () {
          return _this.ready();
        });
      } else {
        this.findTrees(args, next);
      }
    }

    /**
     * Search 
     * @param args contains {page}
     * @param type of option tree || branch || option
     * @param next is optional callback
     **/

  }, {
    key: "search",
    value: function search() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var _this2 = this;

      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      this.selectMgr.clear();
      if (this.isBranchArchive()) {
        this.change();
        this.currentBranch.search(args, function () {
          return _this2.ready();
        });
      } else if (this.isOptionArchive()) {
        this.change();
        this.currentOption.search(args, function () {
          return _this2.ready();
        });
      } else if (this.isTreeArchive()) {
        this.change();
        this.currentTree.search(args, function () {
          return _this2.ready();
        });
      } else {
        this.searchTrees(args, next);
      }
    }

    /**
     * Select/Unselect
     * @param optionId is integer 
     **/

  }, {
    key: "select",
    value: function select(optionConfig) {
      var _this3 = this;

      if (this.selectMgr.has(optionConfig.id)) {
        this.selectMgr.delete(optionConfig.id, function () {
          return _this3.ready();
        });
      } else {
        this.selectMgr.insert(optionConfig, function () {
          return _this3.ready();
        });
      }
    }

    /**
     * Get Select Value
     * @return collection
     **/

  }, {
    key: "getSelectValue",
    value: function getSelectValue() {
      return this.selectMgr.getValue();
    }

    /**
     * Get View Manager
     */

  }, {
    key: "getViewMgr",
    value: function getViewMgr() {
      return this.viewMgr;
    }

    /**
     * Get Query Manager
     */

  }, {
    key: "getQueryMgr",
    value: function getQueryMgr() {
      return this.queryMgr;
    }

    /**
     * Get Tree Manager
     */

  }, {
    key: "getTreeMgr",
    value: function getTreeMgr() {
      return this.treeMgr;
    }

    /**
     * Get Select Manager
     */

  }, {
    key: "GetSelectMgr",
    value: function GetSelectMgr() {
      return this.selectMgr;
    }

    /**
     * Get History
     * @return array
     */

  }, {
    key: "getHistory",
    value: function getHistory() {
      return this.history.getValue();
    }

    /**
     * Get schema
     * @retrurn collection 
     */

  }, {
    key: "getSchema",
    value: function getSchema() {
      var _this4 = this;

      return this.history.getValue().map(function (key) {
        return _this4.map.get(key);
      });
    }

    // TREE ARCHIVE ------------ //

    /**
     * Find tree archive
     **/

  }, {
    key: "findTrees",
    value: function findTrees() {
      var _this5 = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var _args$page = args.page,
          page = _args$page === undefined ? null : _args$page;


      if (page) {
        this.getQueryMgr().setPage(page);
      }

      var urlArgs = {
        apiBaseUrl: _WFUrl2.default.getBaseUrl(),
        formName: _Constants.WF_OPTION_GROUP,
        isAppAdmin: this.isAdmin,
        query: this.getQueryMgr().get()
      };

      this.change();
      _WFClient2.default.find(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getFindResponse(res);

        var _wfRes$getResultset = wfRes.getResultset(),
            _wfRes$getResultset$r = _wfRes$getResultset.rows,
            rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
            _wfRes$getResultset$c = _wfRes$getResultset.count,
            count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

        _this5.getQueryMgr().refresh(rows.length, count);
        _this5.getTreeMgr().set(rows);
        _this5.ready();
      }).catch(function (error) {
        console.dir(error);
      });
    }

    /**
     * Search tree by name
     **/

  }, {
    key: "searchTrees",
    value: function searchTrees() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var searchStartAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;

      var l = value.length;
      if (l === 0) {
        this.getQueryMgr().clearFilters();
        this.findTrees();
      } else if (l > searchStartAt) {
        this.getQueryMgr().setPage(1);
        this.getQueryMgr().setFilter('name', value);
        this.findTrees();
      }
    }

    // CURRENT ------------ //

    /**
     * Set current tree
     * @param optionConfig is object
     */

  }, {
    key: "setCurrentTree",
    value: function setCurrentTree(optionConfig) {
      var _this6 = this;

      var tree = new _WFBaobabOption2.default(_Constants.WF_BAOBAB_TREE, optionConfig, null, this.configForOption);
      if (tree) {
        var treeId = tree.getId();
        if (this.currentTree && this.currentTree.getId() === treeId) {
          this.clear(false);
          this.ready();
        } else {
          this.currentTree = tree;
          this.map.set((0, _defineProperty3.default)({}, treeId, tree));
          this.history.insert(treeId);
          this.change();
          this.currentTree.find({}, function () {
            return _this6.ready();
          });
        }
      }
    }

    /**
     * Set current branch
     * @param optionConfig is object
     */

  }, {
    key: "setCurrentBranch",
    value: function setCurrentBranch(optionConfig) {
      var _this7 = this;

      var branch = new _WFBaobabOption2.default(_Constants.WF_BAOBAB_BRANCH, optionConfig, null, this.configForOption);
      if (branch) {
        var branchId = branch.getId();
        if (this.currentBranch && this.currentBranch.getId() === branchId) {
          this.unsetCurrentBranch();
          this.ready();
        } else {
          this.currentBranch = branch;
          this.change();
          this.currentBranch.find({}, function () {
            return _this7.ready();
          });
        }
      }
    }

    /**
     * Set current option
     * @param optionConfig is object
     */

  }, {
    key: "setCurrentOption",
    value: function setCurrentOption(optionConfig) {
      var _this8 = this;

      var option = new _WFBaobabOption2.default(_Constants.WF_BAOBAB_OPTION, optionConfig, null, this.configForOption);
      if (option) {
        var optionId = option.getId();
        if (this.currentOption && this.currentOption.getId() === optionId || this.currentOption && this.history.has(optionId)) {
          this.history.deleteIndexAndAfter({
            index: this.history.indexOf(optionId)
          });
          var mapValue = this.map.getValue();
          this.map.clear();
          this.history.getValue().forEach(function (id) {
            _this8.map.set((0, _defineProperty3.default)({}, id, mapValue[id]));
          });
          var lastId = this.history.getLast();
          this.currentOption = mapValue[lastId];
          this.ready();
        } else {
          this.currentOption = option;
          this.map.set((0, _defineProperty3.default)({}, optionId, option));
          this.history.insert(optionId);
          this.change();
          this.currentOption.find({}, function () {
            return _this8.ready();
          });
        }
      }
    }

    /**
     * Get current
     */

  }, {
    key: "getCurrentTree",
    value: function getCurrentTree() {
      return this.currentTree;
    }
  }, {
    key: "getCurrentBranch",
    value: function getCurrentBranch() {
      return this.currentBranch;
    }
  }, {
    key: "getCurrentOption",
    value: function getCurrentOption() {
      return this.currentOption;
    }

    /**
     * Get current Id
     */

  }, {
    key: "getCurrentTreeId",
    value: function getCurrentTreeId() {
      if (this.currentTree === null) {
        return null;
      } else {
        return this.currentTree.getId();
      }
    }
  }, {
    key: "getCurrentBranchId",
    value: function getCurrentBranchId() {
      if (this.currentBranch === null) {
        return null;
      } else {
        return this.currentBranch.getId();
      }
    }
  }, {
    key: "getCurrentOptionId",
    value: function getCurrentOptionId() {
      if (this.currentOption === null) {
        return null;
      } else {
        return this.currentOption.getId();
      }
    }

    /**
     * Get current Config
     */

  }, {
    key: "getCurrentConfig",
    value: function getCurrentConfig() {
      var currentTreeConfig = {};
      var currentBranchConfig = {};
      var currentOptionConfig = {};
      if (this.currentTree) {
        currentTreeConfig = this.currentTree.getSchema();
      }
      if (this.currentBranch) {
        currentBranchConfig = this.currentBranch.getSchema();
      }
      if (this.currentOption) {
        currentOptionConfig = this.currentOption.getSchema();
      }
      return {
        currentTreeConfig: currentTreeConfig,
        currentBranchConfig: currentBranchConfig,
        currentOptionConfig: currentOptionConfig
      };
    }

    /**
     * Unset current
     */

  }, {
    key: "unsetCurrentTree",
    value: function unsetCurrentTree() {
      this.currentTree = null;
    }
  }, {
    key: "unsetCurrentBranch",
    value: function unsetCurrentBranch() {
      this.currentBranch = null;
    }
  }, {
    key: "unsetCurrentOption",
    value: function unsetCurrentOption() {
      this.currentOption = null;
    }

    // CONTIONAL ------------ //

    /**
     * Check if tree archive
     * @return boolean
     */

  }, {
    key: "isTreeArchive",
    value: function isTreeArchive() {
      if (this.currentBranch || this.currentOption) {
        return false;
      } else {
        return this.currentTree !== null;
      }
    }

    /**
     * Check if branch archive
     * @return boolean
     */

  }, {
    key: "isBranchArchive",
    value: function isBranchArchive() {
      return this.currentBranch !== null;
    }

    /**
     * Check if option archive
     * @return boolean
     */

  }, {
    key: "isOptionArchive",
    value: function isOptionArchive() {
      return this.currentOption !== null;
    }

    // RESET ------------ //

    /**
     * Clear state
     */

  }, {
    key: "clear",
    value: function clear() {
      var hardReset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

      if (hardReset) {
        this.viewMgr.resetState();
        this.getQueryMgr().reset();
        this.getTreeMgr().clear();
      }
      this.GetSelectMgr().clear();
      this.unsetCurrentTree();
      this.unsetCurrentBranch();
      this.unsetCurrentOption();
      this.map.clear();
      this.history.clear();
      this.ready();
    }
  }]);
  return WFBaobab;
}();
// ------------------- //


exports.default = WFBaobab;
// ------------------- //

/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Lodash = __webpack_require__(6);

var WFBaobabObserver = {
  /**
   * Observe WFBaobabMgr
   * @param WFBaobabMgr
   * @param callback {change, ready}
   * @return next state
   */
  observe: function observe(WFBaobabMgr) {
    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var _callback$change = callback.change,
        _change = _callback$change === undefined ? null : _callback$change,
        _callback$ready = callback.ready,
        _ready = _callback$ready === undefined ? null : _callback$ready;

    WFBaobabMgr.viewMgr.setObserver({
      change: function change() {
        if ((0, _Lodash.isFunction)(_change)) {
          _change();
        }
      },
      ready: function ready() {
        WFBaobabMgr.viewMgr.setState(WFBaobabObserver.getState(WFBaobabMgr));
        if ((0, _Lodash.isFunction)(_ready)) {
          _ready();
        }
      }
    });
  },

  /**
   * Unset observer
   * @param WFBaobabMgr
   */
  unObserve: function unObserve(WFBaobabMgr) {
    WFBaobabMgr.viewMgr.setObserver({});
  },

  /**
   * Create current state
   * @param WFBaobabMgr
   */
  getState: function getState(WFBaobabMgr) {
    var _WFBaobabMgr$getCurre = WFBaobabMgr.getCurrentConfig(),
        _WFBaobabMgr$getCurre2 = _WFBaobabMgr$getCurre.currentTreeConfig,
        currentTreeConfig = _WFBaobabMgr$getCurre2 === undefined ? {} : _WFBaobabMgr$getCurre2,
        _WFBaobabMgr$getCurre3 = _WFBaobabMgr$getCurre.currentBranchConfig,
        currentBranchConfig = _WFBaobabMgr$getCurre3 === undefined ? {} : _WFBaobabMgr$getCurre3,
        _WFBaobabMgr$getCurre4 = _WFBaobabMgr$getCurre.currentOptionConfig,
        currentOptionConfig = _WFBaobabMgr$getCurre4 === undefined ? {} : _WFBaobabMgr$getCurre4;

    return {
      wf_baobab_schema: WFBaobabMgr.getSchema(),
      wf_baobab_history: WFBaobabMgr.getHistory(),
      wf_baobab_selection: WFBaobabMgr.GetSelectMgr().getValue().map(function (o) {
        return o.id;
      }),
      wf_baobab_tree_rows: WFBaobabMgr.getTreeMgr().getValue(),
      wf_baobab_tree_pager: WFBaobabMgr.getQueryMgr().getPagination(),
      wf_baobab_current_tree: currentTreeConfig,
      wf_baobab_current_branch: currentBranchConfig,
      wf_baobab_current_option: currentOptionConfig,
      wf_baobab_current_tree_id: WFBaobabMgr.getCurrentTreeId(),
      wf_baobab_current_branch_id: WFBaobabMgr.getCurrentBranchId(),
      wf_baobab_current_option_id: WFBaobabMgr.getCurrentOptionId(),
      wf_baobab_is_tree_archive: WFBaobabMgr.isTreeArchive(),
      wf_baobab_is_branch_archive: WFBaobabMgr.isBranchArchive(),
      wf_baobab_is_option_archive: WFBaobabMgr.isOptionArchive()
    };
  }
};

exports.default = WFBaobabObserver;

/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFNumber = __webpack_require__(103);

var _WFNumber2 = _interopRequireDefault(_WFNumber);

var _WFBoolean = __webpack_require__(167);

var _WFBoolean2 = _interopRequireDefault(_WFBoolean);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFBaobabOptionView = __webpack_require__(408);

var _WFBaobabOptionView2 = _interopRequireDefault(_WFBaobabOptionView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(72);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF BAOBAB OPTION ------------------- //
// ------------------- //
var WFBaobabOption = function () {
  /**
   * Constructor
   * @param config is object contain optionConfig
   */
  function WFBaobabOption() {
    var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _Constants.WF_BAOBAB_OPTION;
    var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var observer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var initConfig = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
    (0, _classCallCheck3.default)(this, WFBaobabOption);
    var _config$id = config.id,
        id = _config$id === undefined ? 0 : _config$id,
        _config$name = config.name,
        name = _config$name === undefined ? "" : _config$name,
        _config$label = config.label,
        label = _config$label === undefined ? "" : _config$label,
        _config$entryId = config.entryId,
        entryId = _config$entryId === undefined ? 0 : _config$entryId,
        _config$wf_optiongrou = config.wf_optiongroup_id,
        wf_optiongroup_id = _config$wf_optiongrou === undefined ? null : _config$wf_optiongrou,
        _config$parent_id = config.parent_id,
        parent_id = _config$parent_id === undefined ? null : _config$parent_id,
        _config$options_count = config.options_count,
        options_count = _config$options_count === undefined ? 0 : _config$options_count,
        _config$subgroups_cou = config.subgroups_count,
        subgroups_count = _config$subgroups_cou === undefined ? 0 : _config$subgroups_cou,
        _config$is_private = config.is_private,
        is_private = _config$is_private === undefined ? false : _config$is_private;
    // Hook with component or class
    // callbacks {change, ready}

    this.observer = observer;
    // Props
    this.name = name;
    this.type = type;
    this.label = label;
    this.id = new _WFNumber2.default({ value: entryId ? entryId : id });
    this.wf_optiongroup_id = new _WFNumber2.default({ value: wf_optiongroup_id });
    this.parent_id = new _WFNumber2.default({ value: parent_id });
    this.options_count = new _WFNumber2.default({ value: options_count });
    this.subgroups_count = new _WFNumber2.default({ value: subgroups_count });
    this.is_private = new _WFBoolean2.default({ value: is_private });
    // Collection
    this.branchMgr = new _WFArray2.default({
      isCollection: true,
      findBy: 'name'
    });
    this.optionMgr = new _WFArray2.default({
      isCollection: true,
      findBy: 'name'
    });
    // Manager
    this.optionQueryMgr = new _WFQueryParams2.default();
    this.branchQueryMgr = new _WFQueryParams2.default();
    // Component
    this.viewMgr = new _WFBaobabOptionView2.default(this);
    // Manager Config
    this.initConfig = initConfig;
    this.init();
  }

  /**
   * Get EntryId
   */


  (0, _createClass3.default)(WFBaobabOption, [{
    key: "getId",
    value: function getId() {
      return this.id.get();
    }

    /**
     * Set EntryId
     */

  }, {
    key: "setId",
    value: function setId(id) {
      return this.id.set(id);
    }

    /**
     * Get Name
     */

  }, {
    key: "getName",
    value: function getName() {
      return this.name;
    }

    /**
     * Get Label
     */

  }, {
    key: "getLabel",
    value: function getLabel() {
      return this.label;
    }

    /**
     * Get View Manager
     */

  }, {
    key: "getViewMgr",
    value: function getViewMgr() {
      return this.viewMgr;
    }

    /**
     * Get Query Manager
     */

  }, {
    key: "getOptionQueryMgr",
    value: function getOptionQueryMgr() {
      return this.optionQueryMgr;
    }

    /**
     * Get Query Manager
     */

  }, {
    key: "getBranchQueryMgr",
    value: function getBranchQueryMgr() {
      return this.branchQueryMgr;
    }

    /**
     * Get Branch Manager
     */

  }, {
    key: "getBranchMgr",
    value: function getBranchMgr() {
      return this.branchMgr;
    }

    /**
     * Get Option Manager
     */

  }, {
    key: "getOptionMgr",
    value: function getOptionMgr() {
      return this.optionMgr;
    }

    /**
     * Notify when state change
     */

  }, {
    key: "change",
    value: function change() {
      if (this.observer && this.observer.hasOwnProperty("change") && (0, _Lodash.isFunction)(this.observer.change)) {
        this.observer.change(this);
      }
    }

    /**
     * Notify when state is ready
     * @return new state
     */

  }, {
    key: "ready",
    value: function ready() {
      if (this.getViewMgr().isInit) {
        var schema = this.getSchema();
        this.getViewMgr().setState(schema);
      }
      if (this.observer && this.observer.hasOwnProperty("ready") && (0, _Lodash.isFunction)(this.observer.ready)) {
        this.observer.ready(this);
      }
    }

    /**
     * Find options
     */

  }, {
    key: "find",
    value: function find() {
      var _this = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var _args$treeFindAll = args.treeFindAll,
          treeFindAll = _args$treeFindAll === undefined ? true : _args$treeFindAll;

      switch (this.type) {
        case _Constants.WF_BAOBAB_TREE:
          if (treeFindAll) {
            this.findBranch({}, function () {
              return _this.findOption(args, next);
            });
          } else {
            this.findBranch({}, next);
          }
          break;
        case _Constants.WF_BAOBAB_BRANCH:
          this.findOption(args, next);
          break;
        case _Constants.WF_BAOBAB_OPTION:
          this.findOption(args, next);
          break;
      }
    }

    /**
     * Search options
     * @param config is object contain optionConfig
     */

  }, {
    key: "search",
    value: function search() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var searchStartAt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

      var l = value.length;
      if (l === 0) {
        this.getOptionQueryMgr().clearFilters();
        this.find({}, next);
      } else if (l > searchStartAt) {
        this.getOptionQueryMgr().setPage(1);
        this.getOptionQueryMgr().setFilter('name', value);
        this.find({}, next);
      }
    }

    /**
     * Get Schema
     * @return config
     */

  }, {
    key: "getSchema",
    value: function getSchema() {
      var branches = this.branchMgr.getValue();
      var options = this.optionMgr.getValue();
      return {
        id: this.getId(),
        name: this.getName(),
        label: this.getLabel(),
        wf_optiongroup_id: this.wf_optiongroup_id.get(),
        parent_id: this.parent_id.get(),
        options_count: this.options_count.get(),
        subgroups_count: this.subgroups_count.get(),
        is_private: this.is_private.get(),
        branchPager: this.getBranchQueryMgr().getPagination(),
        optionPager: this.getOptionQueryMgr().getPagination(),
        branches: branches,
        options: options,
        branchesId: branches.map(function (b) {
          return parseInt(b.id);
        }),
        optionsId: options.map(function (o) {
          return parseInt(o.id);
        })
      };
    }

    /**
     * Find this branches
     * @param config is object contain optionConfig
     */

  }, {
    key: "findBranch",
    value: function findBranch() {
      var _this2 = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      this.change();
      WFBaobabOption.dbFind(this.getBranchQueryMgr(), {
        onSuccess: function onSuccess(wfRes) {
          var _wfRes$getResultset = wfRes.getResultset(),
              _wfRes$getResultset$r = _wfRes$getResultset.rows,
              rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
              _wfRes$getResultset$c = _wfRes$getResultset.count,
              count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

          _this2.getBranchMgr().set(rows);
          _this2.ready();
          if ((0, _Lodash.isFunction)(next)) {
            next();
          }
        },
        onError: function onError(err) {
          console.error("FIND_BRANCH ERROR");
          console.error(err);
        }
      });
    }

    /**
     * Find this options
     * @param config is object contain optionConfig
     */

  }, {
    key: "findOption",
    value: function findOption() {
      var _this3 = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var _args$page = args.page,
          page = _args$page === undefined ? null : _args$page;

      if (page) {
        this.getOptionQueryMgr().setPage(page);
      }
      this.change();
      WFBaobabOption.dbFind(this.optionQueryMgr, {
        onSuccess: function onSuccess(wfRes) {
          var _wfRes$getResultset2 = wfRes.getResultset(),
              _wfRes$getResultset2$ = _wfRes$getResultset2.rows,
              rows = _wfRes$getResultset2$ === undefined ? [] : _wfRes$getResultset2$,
              _wfRes$getResultset2$2 = _wfRes$getResultset2.count,
              count = _wfRes$getResultset2$2 === undefined ? 0 : _wfRes$getResultset2$2;

          _this3.getOptionMgr().set(rows);
          _this3.getOptionQueryMgr().refresh(rows.length, count);
          _this3.ready();
          if ((0, _Lodash.isFunction)(next)) {
            next();
          }
        },
        onError: function onError(err) {
          console.error("FIND_OPTION ERROR");
          console.error(err);
        }
      });
    }

    /**
     * Set callback
     */

  }, {
    key: "setObserver",
    value: function setObserver(actions) {
      this.observer = actions;
    }

    /**
     * Set this props
     * @param config is optionConfig
     */

  }, {
    key: "setProps",
    value: function setProps(config) {
      var _config$label2 = config.label,
          label = _config$label2 === undefined ? "" : _config$label2,
          _config$entryId2 = config.entryId,
          entryId = _config$entryId2 === undefined ? 0 : _config$entryId2,
          _config$wf_optiongrou2 = config.wf_optiongroup_id,
          wf_optiongroup_id = _config$wf_optiongrou2 === undefined ? null : _config$wf_optiongrou2,
          _config$parent_id2 = config.parent_id,
          parent_id = _config$parent_id2 === undefined ? null : _config$parent_id2,
          _config$options_count2 = config.options_count,
          options_count = _config$options_count2 === undefined ? 0 : _config$options_count2,
          _config$subgroups_cou2 = config.subgroups_count,
          subgroups_count = _config$subgroups_cou2 === undefined ? 0 : _config$subgroups_cou2,
          _config$is_private2 = config.is_private,
          is_private = _config$is_private2 === undefined ? false : _config$is_private2;

      this.label = label;
      this.wf_optiongroup_id.set(wf_optiongroup_id);
      this.parent_id.set(parent_id);
      this.options_count.set(options_count);
      this.subgroups_count.set(subgroups_count);
      this.is_private.set(is_private);
    }

    /**
     * Init option
     * Config the QueryManager(s) by option's type
     */

  }, {
    key: "init",
    value: function init() {
      var clearReqFilters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var _initConfig = this.initConfig,
          _initConfig$treeLimit = _initConfig.treeLimitBranch,
          treeLimitBranch = _initConfig$treeLimit === undefined ? 100 : _initConfig$treeLimit,
          _initConfig$treeLimit2 = _initConfig.treeLimitOption,
          treeLimitOption = _initConfig$treeLimit2 === undefined ? 50 : _initConfig$treeLimit2,
          _initConfig$branchLim = _initConfig.branchLimitOption,
          branchLimitOption = _initConfig$branchLim === undefined ? 50 : _initConfig$branchLim,
          _initConfig$optionLim = _initConfig.optionLimitOption,
          optionLimitOption = _initConfig$optionLim === undefined ? 50 : _initConfig$optionLim;


      if (clearReqFilters) {
        this.branchQueryMgr.clearReqFilters();
        this.optionQueryMgr.clearReqFilters();
      }

      switch (this.type) {
        case _Constants.WF_BAOBAB_TREE:
          // Manager Config
          this.branchQueryMgr.setLimit(treeLimitBranch);
          this.branchQueryMgr.setFilter(_Constants.WF_BAOBAB_PARENT_ID, this.id.get(), true);
          this.optionQueryMgr.setLimit(treeLimitOption);
          this.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_OPTIONGROUP_ID, this.id.get(), true);
          break;
        case _Constants.WF_BAOBAB_BRANCH:
          // Manager Config
          this.branchQueryMgr.setLimit(treeLimitBranch);
          this.branchQueryMgr.setFilter(_Constants.WF_BAOBAB_PARENT_ID, this.parent_id.get(), true);
          this.optionQueryMgr.setLimit(branchLimitOption);
          this.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_PARENT_ID, this.id.get(), true);
          break;
        case _Constants.WF_BAOBAB_OPTION:
          // Manager Config
          this.optionQueryMgr.setLimit(optionLimitOption);
          this.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_OPTIONGROUP_ID, this.id.get(), true);
          break;
      }
    }

    /**
     * Find this branches or  options
     * @param queryMgr
     * @param next callback {onError, onSuccess}
     * @param isAdmin boolean
     */

  }], [{
    key: "dbFind",
    value: function dbFind(queryMgr) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var isAdmin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

      var urlArgs = {
        apiBaseUrl: _WFUrl2.default.getBaseUrl(),
        formName: _Constants.WF_OPTION,
        isAppAdmin: isAdmin,
        query: queryMgr.get()
      };
      _WFClient2.default.find(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getFindResponse(res);
        if (wfRes.getHasLogicErrors()) {
          next.onError(wfRes.getLogicErrors());
        } else {
          next.onSuccess(wfRes);
        }
      }).catch(function (error) {
        console.dir(error);
      });
    }
  }]);
  return WFBaobabOption;
}();

// ------------------- //


exports.default = WFBaobabOption;
// ------------------- //

/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS WF PARAM ------------------- //

// ------------------- // 

var WFParam = function () {
  /**
   * Constructor
   */
  function WFParam(name) {
    var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    (0, _classCallCheck3.default)(this, WFParam);

    this.name = name;
    this.value = value;
  }

  /**
   * Get param
   * @return string
   */


  (0, _createClass3.default)(WFParam, [{
    key: "get",
    value: function get() {
      if (this.value) {
        return WFParam.format(this.getName(), this.getValue());
      } else {
        return null;
      }
    }

    /**
     * Get name param 
     * @return string
     */

  }, {
    key: "getName",
    value: function getName() {
      return this.name;
    }

    /**
     * Get value
     */

  }, {
    key: "getValue",
    value: function getValue() {
      return this.value;
    }

    /**
     * Set value
     */

  }, {
    key: "setValue",
    value: function setValue(newValue) {
      this.value = newValue;
    }

    /**
     * Create query string param 
     * @param key
     * @param value
     * @return string
     */

  }], [{
    key: "format",
    value: function format(k, v) {
      return k + "=" + encodeURIComponent(v.toString());
    }
  }]);
  return WFParam;
}();

// ------------------- // 


exports.default = WFParam;
// ------------------- //

/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFieldConfigResources = __webpack_require__(161);

var _WFieldConfigResources2 = _interopRequireDefault(_WFieldConfigResources);

var _WFBaobab = __webpack_require__(224);

var _WFBaobab2 = _interopRequireDefault(_WFBaobab);

var _WFBaobabClient = __webpack_require__(119);

var _WFBaobabClient2 = _interopRequireDefault(_WFBaobabClient);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(72);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var initConfigForOption = {
  treeLimitBranch: 200,
  treeLimitOption: 50,
  branchLimitOption: 50,
  optionLimitOption: 50
};

// ------------------- //

// WF_CONFIG BAOBAB MANAGER ------------------- //

// ------------------- //

var WFConfigBaobabMgr = function () {

  /**
   * Manager
   **/
  var mgr = new _WFBaobab2.default({ initConfigForOption: initConfigForOption });

  /**
   * Check if fieldState is branch
   * @param fields is fieldState's fields
   * @return boolean 
   **/
  var isBranch = function isBranch(fields) {
    var input = fields.input_type.getValue();

    var _WFieldConfigResource = _WFieldConfigResources2.default.getField(input),
        info = _WFieldConfigResource.info;

    var _info$isBaobabBranch = info.isBaobabBranch,
        isBaobabBranch = _info$isBaobabBranch === undefined ? false : _info$isBaobabBranch;

    return isBaobabBranch;
  };

  /**
   * Create branch config
   * @param fields is fieldState's fields
   * @param wf_optiongroup_id is fieldState's wf_optiongroup_id
   * @return config 
   **/
  var createBranchConfig = function createBranchConfig(fields) {
    var wf_optiongroup_id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

    var config = {
      parent_id: mgr.getCurrentTreeId(),
      name: fields.name.getValue(),
      label: fields.label.getValue()
    };
    if (wf_optiongroup_id) {
      config["id"] = wf_optiongroup_id;
    }
    return config;
  };

  /**
   * Set Current Tree 
   * @param formState
   **/
  mgr.init = function (formState) {
    if (!formState) {
      throw new Error('WFConfigBaobabMgr init => formState not valid...');
    } else {
      mgr.explore(formState.getTreeSchema(), _Constants.WF_BAOBAB_TREE);
    }
  };

  /**
   * Get current state
   **/
  mgr.getState = function () {
    var tree = mgr.getCurrentTree();
    if (!tree) {
      return {
        wfc_baobab_tree_id: null,
        wfc_baobab_branches: []
      };
    } else {
      return {
        wfc_baobab_tree_id: tree.getId(),
        wfc_baobab_branches: tree.branchMgr.getValue()
      };
    }
  };

  /**
   * If fieldState is branch create optionGroup
   * @param fieldState 
   * @param next {onSuccess, onError} callback
   **/
  mgr.createFieldConfigBranch = function (fieldState, next) {
    if (!fieldState) {
      throw new Error('WFConfigBaobabMgr createBranchForField => fieldState not valid...');
    } else {
      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigBaobabMgr createBranchForField => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            _onSuccess = next.onSuccess;

        var flds = fieldState.getFields();
        if (!isBranch(flds) || flds.wf_optiongroup_id.getValue() > 0) {
          _onSuccess(false);
        } else {
          var config = createBranchConfig(flds);
          var formState = _WFBaobabClient2.default.createOptionGroup(config);
          _WFBaobabClient2.default.saveOptionGroup(formState, {
            onError: onError,
            onSuccess: function onSuccess(res) {
              var entry_id = res.entry_id;

              flds.wf_optiongroup_id.setValue(entry_id);
              mgr.find({
                treeFindAll: false
              });
              _onSuccess(true);
            }
          });
        }
      }
    }
  };

  /**
   * If fieldState is branch delete option
   * @param wf_optiongroup_id 
   * @param fieldState 
   * @param next {onSuccess, onError} callback
   **/
  mgr.delFieldConfigBranch = function (wf_optiongroup_id, fieldState, next) {
    if (!fieldState) {
      throw new Error('WFConfigBaobabMgr delFieldConfigBranch => fieldState not valid...');
    } else {
      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigBaobabMgr delFieldConfigBranch => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            _onSuccess2 = next.onSuccess;

        var flds = fieldState.getFields();
        if (!isBranch(flds) || flds.wf_optiongroup_id.getValue() === 0) {
          _onSuccess2();
        } else {
          var config = createBranchConfig(flds, wf_optiongroup_id);
          var formState = _WFBaobabClient2.default.createOptionGroup(config);
          _WFBaobabClient2.default.delOption(formState, {
            onError: onError,
            onSuccess: function onSuccess(res) {
              mgr.find({
                treeFindAll: false
              });
              _onSuccess2();
            }
          });
        }
      }
    }
  };

  return mgr;
}();

// ------------------- //
exports.default = WFConfigBaobabMgr;
// ------------------- //

/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFConfigQueryMgr = __webpack_require__(155);

var _WFConfigQueryMgr2 = _interopRequireDefault(_WFConfigQueryMgr);

var _WFConfigCollectionMgr = __webpack_require__(154);

var _WFConfigCollectionMgr2 = _interopRequireDefault(_WFConfigCollectionMgr);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFConfigClientMgr = {
  /**   
   * Find by name
   * @param name
   * @param onError is callback
   * @param onSuccess is callback(formConfig, formConfigState, formEntryState)
   **/
  findFormByName: function findFormByName(name) {
    var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    var onSuccess = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

    var urlArgs = {
      apiBaseUrl: _WFUrl2.default.getBaseUrl(),
      formName: name,
      isAppAdmin: true
    };
    _WFClient2.default.findFormByName(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        var formConfig = _WFormStateFactory2.default.getMergedFormConfig(wfRes.getResultset());
        var formConfigState = _WFormStateFactory2.default.createFormConfigState(formConfig);
        var formEntryState = _WFormStateFactory2.default.createFormEntryState(formConfig);
        onSuccess(formConfig, formConfigState, formEntryState);
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**   
   * Find in db.
   * @param args {page}
   * @param onError is callback
   * @param onSuccess is callback
   **/
  find: function find() {
    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    var onSuccess = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var _args$page = args.page,
        page = _args$page === undefined ? null : _args$page;


    if (page) {
      _WFConfigQueryMgr2.default.setPage(page);
    }

    var urlArgs = {
      apiBaseUrl: _WFUrl2.default.getBaseUrl(),
      query: _WFConfigQueryMgr2.default.get()
    };

    _WFClient2.default.findAllCustomForms(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getFindResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        var _wfRes$getResultset = wfRes.getResultset(),
            _wfRes$getResultset$r = _wfRes$getResultset.rows,
            rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
            _wfRes$getResultset$c = _wfRes$getResultset.count,
            count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

        _WFConfigQueryMgr2.default.refresh(rows.length, count);
        _WFConfigCollectionMgr2.default.setValue(rows);
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.dir(error);
    });
  },


  /**   
   * Save in db. Create it if not exists
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   **/
  save: function save(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formState.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        formState.setValues(wfRes.getResultset()[0]);
        onSuccess(wfRes.getResultset()[0]);
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
   * Publish
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   */
  publish: function publish(formState, onError, onSuccess) {
    var fldName = formState.getField("name");
    if (fldName) {
      var urlArgs = {
        isAppAdmin: true,
        formName: fldName.getValue(),
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };
      _WFClient2.default.publish(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getPublishResponse(res);
        if (wfRes.getHasLogicErrors()) {
          onError(wfRes.getLogicErrors());
        } else {
          formState.setValues(wfRes.getResultset());
          formState.setPublished(wfRes.getResultset().published);
          onSuccess(formState.getValues(), wfRes.getResultset());
        }
      }).catch(function (error) {
        console.error(error);
      });
    }
  },


  /**
   * UnPublish
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   */
  unpublish: function unpublish(formState, onError, onSuccess) {
    var formNameFld = formState.getField("name");
    if (formNameFld) {
      var urlArgs = {
        isAppAdmin: true,
        formName: formNameFld.getValue(),
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };
      _WFClient2.default.unpublish(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getUnPublishResponse(res);
        if (wfRes.getHasLogicErrors()) {
          onError(wfRes.getLogicErrors());
        } else {
          formState.setValues(wfRes.getResultset());
          formState.setPublished(wfRes.getResultset().published);
          onSuccess(formState.getValues(), wfRes.getResultset());
        }
      }).catch(function (error) {
        console.error(error);
      });
    }
  },


  /**   
   * Delete in db.
   * @param formStateMgr instance of WFormStateMgr
   * @param onError is callback
   * @param onSuccess is callback
   **/
  del: function del(formStateMgr, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formStateMgr.del(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getDelResponse(res);
      formStateMgr.clear();
      onSuccess(wfRes.getResultset());
    }).catch(function (error) {
      onError(error);
    });
  }
};

// ------------------- //
exports.default = WFConfigClientMgr;
// ------------------- //

/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {
  wfc_saved: true,
  wfc_published: false,
  wfc_step_current: null,
  wfc_step_order: [],
  wfc_step_value: {},
  wfc_steps: [],
  wfc_contents: {},
  wfc_fields: [],
  wfc_values: {},
  wfc_attributes: {}
};
// ------------------- //

// WF_CONFIG VIEW MANAGER ------------------- //

// ------------------- //
var WFConfigEditorViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFConfigEditorViewMgr;
// ------------------- //

/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ACTION LIST STATE MANAGER ------------------- //

// ------------------- //

var WFConfigFormStateMgr = new _WFormStateMgr2.default({
  formName: 'form-config',
  formType: _WFProductType.WF_CORE_FORM_CONFIG_ID,
  objKey: 'name'
});

// ------------------- //
exports.default = WFConfigFormStateMgr;
// ------------------- //

/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Lodash = __webpack_require__(6);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY SELECT MANAGER ------------------- //

// ------------------- //

var WFConfigSelectMgr = function () {
  var collection = new _WFArray2.default({
    isCollection: true,
    findBy: "name"
  });
  var action = {
    clear: function clear() {
      return collection.clear();
    },
    getValue: function getValue() {
      return collection.getValue();
    },
    getKeys: function getKeys() {
      var by = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "name";
      return collection.map(function (r) {
        return r[by];
      });
    },
    select: function select(row) {
      if ((0, _Lodash.isObject)(row)) {
        if (!collection.has(row.name)) {
          collection.insert(row);
        } else {
          collection.delete(row.name);
        }
      } else {
        throw new Error('WFConfigSelectMgr select => invalid row ...');
      }
    },
    remove: function remove(delResults) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(delResults)) {
        delResults.forEach(function (id) {
          collection.deleteBy("id", id.toString());
        });
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }
  };
  return {
    select: action.select,
    remove: action.remove,
    clear: action.clear,
    getValue: action.getValue,
    getKeys: action.getKeys
  };
}();

// ------------------- //
exports.default = WFConfigSelectMgr;
// ------------------- //

/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var img = __WF__.ASSETS + "/img/trash/bg01.png";
var videoHTML5 = {
  poster: "http://localhost:9000/wp-content/uploads/video/01.jpg",
  mp4: "http://localhost:9000/wp-content/uploads/video/01.mp4",
  webm: "http://localhost:9000/wp-content/uploads/video/01.webm",
  ogv: false
};
var constrolLabel = {
  prev: "Prev",
  next: "Next",
  submit: "Submit"
};

// PRIVATE THEMES ------------------- //

// ------------------- //
// THEME ADMIN    ------------------- //
// ------------------- //

var WFAdminTheme = {

  info: {
    label: "Admin Theme",
    name: "WFAdminTheme",
    version: "2.0.0"
  },

  fieldsDisable: [],

  settingValues: {

    // THEME CLASSES          ------------------- //

    hasTheme: "wf-admin-theme",
    hasThemeOption: "wf-dark",

    // CONTAINER SETTING      ------------------- //

    container_bg: "transparent",
    container_width: "100%",
    container_padding: 0
  }
};

// GLOBAL THEMES ------------------- //

// ------------------- //
// THEME NO STYLE   ------------------- //
// ------------------- //

var WFNoStyleTheme = {

  info: {
    label: "Theme No Style",
    name: "WFNoStyleTheme",
    version: "1.5.0",
    license: ["*"]
  },

  fieldsDisable: ["use_timeline", "timeline_label", "timeline_limit", "timeline_visible", "timeline_small", "timeline_color", "cover_color", "cover_bg", "cover_bg_filter", "cover_bg_blur", "cover_bg_opacity", "cover_image", "cover_texture", "cover_overlay", "use_cover_video", "cover_video_mp4", "cover_video_webm", "cover_video_ogv", "use_vertical_align", "vertical_align_height", "vertical_align_padding", "wf_label_font_size", "wf_label_color", "wf_legend_color", "wf_legend_font_size", "wf_label_padding", "wf_legend_padding", "wf_option_label_color", "wf_option_legend_color"],

  settingValues: {

    // THEME CLASSES          ------------------- //

    hasTheme: "",
    hasThemeOption: "",
    custom_classes: "",

    // GLOBAL SETTING         ------------------- //

    use_progressbar: false,
    progressbar_color: "rgb(0, 0, 0)",

    // CONTAINER SETTING      ------------------- //

    container_bg: "#FFF",
    container_width: 1024,
    container_padding: 15,
    container_border_radius: 0,

    // FIELD SETTING          ------------------- //

    field_inline: false,
    field_no_label: false,
    field_color: "rgb(0, 0, 0)",
    field_font_size: 12,
    field_padding: 0,

    field_legend_color: "#919496",
    field_legend_font_size: 12,
    field_legend_padding: 5,

    // CONTROL SETTING        ------------------- //

    prev_label: constrolLabel.prev,
    next_label: constrolLabel.next,
    submit_label: constrolLabel.submit,

    prev_font_size: 10,
    prev_padding: 10,
    prev_border_radius: 0,
    prev_color: "rgb(0, 0, 0)",
    prev_bg: "rgb(239, 239, 239)",

    next_font_size: 10,
    next_padding: 10,
    next_border_radius: 0,
    next_color: "rgb(0, 0, 0)",
    next_bg: "rgb(239, 239, 239)",

    submit_font_size: 10,
    submit_padding: 10,
    submit_border_radius: 0,
    submit_color: "rgb(0, 0, 0)",
    submit_bg: "rgb(239, 239, 239)"

  }
};

// ------------------- //
// THEME CORPORATE  ------------------- //
// ------------------- //

var WFCorporateTheme = {

  info: {
    label: "Theme Corporate",
    name: "WFCorporateTheme",
    version: "1.5.0",
    license: ["*"]
  },

  fieldsDisable: ["use_timeline", "timeline_label", "timeline_limit", "timeline_visible", "timeline_small", "timeline_color", "cover_color", "cover_bg", "cover_bg_filter", "cover_bg_blur", "cover_bg_opacity", "cover_image", "cover_texture", "cover_overlay", "use_cover_video", "cover_video_mp4", "cover_video_webm", "cover_video_ogv", "use_vertical_align", "vertical_align_height", "vertical_align_padding", "wf_label_font_size", "wf_label_color", "wf_legend_color", "wf_legend_font_size", "wf_label_padding", "wf_legend_padding", "wf_option_label_color", "wf_option_legend_color"],

  settingValues: {

    // THEME CLASSES          ------------------- //

    hasTheme: "wf-corporate-theme",
    hasThemeOption: "wf-light",
    custom_classes: "",

    // GLOBAL SETTING         ------------------- //

    use_progressbar: true,
    progressbar_color: '#8BC34A',

    // CONTAINER SETTING      ------------------- //

    container_bg: "#FFF",
    container_width: 780,
    container_padding: 30,
    container_border_radius: 0,

    // FIELD SETTING          ------------------- //

    field_inline: false,
    field_no_label: false,
    field_color: "#666666",
    field_font_size: 16,
    field_padding: 0,

    field_legend_color: "#919496",
    field_legend_font_size: 13,
    field_legend_padding: 5,

    // CONTROL SETTING        ------------------- //

    prev_label: constrolLabel.prev,
    next_label: constrolLabel.next,
    submit_label: constrolLabel.submit,

    prev_font_size: 10,
    prev_padding: 12,
    prev_border_radius: 0,
    prev_color: "#fff",
    prev_bg: "#058de0",

    next_font_size: 10,
    next_padding: 12,
    next_border_radius: 0,
    next_color: "#fff",
    next_bg: "#058de0",

    submit_font_size: 10,
    submit_padding: 12,
    submit_border_radius: 0,
    submit_color: "#fff",
    submit_bg: "#4CAF50"
  }
};

// ------------------- //
// THEME WONDERFORM  ------------------- //
// ------------------- //


var WFTheme = {

  info: {
    label: "Theme WonderForm",
    name: "WFTheme",
    version: "2.0.0",
    license: ["pro"]
  },

  fieldsDisable: [],

  settingValues: {

    // THEME CLASSES          ------------------- //

    hasTheme: "wf-wonderform-theme",
    hasThemeOption: "wf-dark",

    custom_classes: "",

    // GLOBAL SETTING         ------------------- //

    use_progressbar: true,
    progressbar_color: '#8BC34A',

    use_timeline: true,
    timeline_label: "Step",
    timeline_limit: 7,
    timeline_visible: 3,
    timeline_small: false,
    timeline_color: "#4DBA13",

    // COVER SETTING          ------------------- //

    cover_color: "rgba(0, 0, 0, 0)",
    cover_bg_opacity: 100,
    cover_bg_filter: 'none',
    cover_bg_blur: 4,
    cover_image: "",
    cover_texture: "",
    cover_overlay: "",

    use_cover_video: false,
    cover_video_poster: "",
    cover_video_mp4: "",
    cover_video_webm: "",
    cover_video_ogv: "",

    // CONTAINER SETTING      ------------------- //

    container_bg: "rgba(123, 123, 123, 0.498039)",
    container_width: 780,
    container_padding: 30,
    container_border_radius: 0,

    use_vertical_align: true,
    vertical_align_height: 780,
    vertical_align_padding: 100,

    // FIELD SETTING          ------------------- //

    field_inline: false,
    field_no_label: false,
    field_color: "#fff",
    field_font_size: 14,
    field_padding: 0,

    field_legend_color: "#d3d3d3",
    field_legend_font_size: 12,
    field_legend_padding: 5,

    // WFIELD SETTING         ------------------- //

    wf_label_font_size: 42,
    wf_label_color: "#fff",
    wf_label_padding: 30,

    wf_legend_color: "#d3d3d3",
    wf_legend_font_size: 16,
    wf_legend_padding: 30,

    wf_option_label_color: "#fff",
    wf_option_legend_color: "#fff",

    // CONTROL SETTING        ------------------- //

    prev_label: constrolLabel.prev,
    next_label: constrolLabel.next,
    submit_label: constrolLabel.submit,

    prev_font_size: 12,
    prev_padding: 12,
    prev_border_radius: 0,
    prev_color: "#000",
    prev_bg: "rgba(255, 255, 255, 0.7)",

    next_font_size: 12,
    next_padding: 12,
    next_border_radius: 0,
    next_color: "#000",
    next_bg: "rgba(255, 255, 255, 0.7)",

    submit_font_size: 12,
    submit_padding: 12,
    submit_border_radius: 0,
    submit_color: "rgba(232,221,221,1)",
    submit_bg: "#0073aa"
  }
};

/* 
 * Define values by default 
 * WFTheme is the reference for other themes
 */
for (var key in WFTheme.settingValues) {
  if (!WFNoStyleTheme.settingValues.hasOwnProperty(key)) {
    WFNoStyleTheme.settingValues[key] = null;
  }
  if (!WFCorporateTheme.settingValues.hasOwnProperty(key)) {
    WFCorporateTheme.settingValues[key] = null;
  }
  if (!WFAdminTheme.settingValues.hasOwnProperty(key)) {
    WFAdminTheme.settingValues[key] = null;
  }
}

// ------------------- //
// THEME ARCHIVE     ------------------- //
// ------------------- //

var List = [WFCorporateTheme, WFTheme, WFNoStyleTheme];

var getList = function getList() {
  var isLimited = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

  if (!isLimited) {
    return List;
  } else {
    return [WFCorporateTheme, WFNoStyleTheme];
  }
};

// ------------------- //
// THEME INFOS     ------------------- //
// ------------------- //

var ListInfo = { WFAdminTheme: WFAdminTheme };
List.map(function (a) {
  ListInfo[a.info.name] = a;
});

var get = function get(name) {
  if (ListInfo.hasOwnProperty(name)) {
    return ListInfo[name];
  } else {
    return {};
  }
};

// ----------------- //

var WFThemes = {
  get: get,
  getList: getList
};

// ----------------- //
exports.default = WFThemes;
// ----------------- //

/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {
  wfconfigs: [],
  wfconfigs_selected: [],
  wfconfigs_pager: {}
};
// ------------------- //

// WF_CONFIG VIEW MANAGER ------------------- //

// ------------------- //
var WFConfigViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFConfigViewMgr;
// ------------------- //

/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFActionFormStateMgr = __webpack_require__(156);

var _WFActionFormStateMgr2 = _interopRequireDefault(_WFActionFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFActionClientMgr = {
  /**
   * Mass actions save
   * @param massUpdater a given mass updater
   **/
  massSave: function massSave(next) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    _WFActionFormStateMgr2.default.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      next();
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**   
  * Save in db. Create it if not exists
  * @param formState
  * @param onError is callback
  * @param onSuccess is callback
  **/
  save: function save(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formState.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        formState.setValues(wfRes.getResultset()[0]);
        onSuccess(wfRes.getResultset()[0]);
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
   * Delete from db
  * @param formState
  * @param onError is callback
  * @param onSuccess is callback
   **/
  del: function del(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      formName: formState.getName(),
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formState.del(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getDelResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  }
};

// ------------------- //
exports.default = WFActionClientMgr;
// ------------------- //

/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_PUBLISH_ENTRY_ID = 100;
var WF_SUCCESS_MESSAGE_ID = 200;
var WF_ERROR_MESSAGE_ID = 300;
var WF_MAIL_NOTIFICATION_ID = 400;
var WF_REDIRECT_ID = 500;
var WF_FILE_DOWNLOAD_ID = 600;
var WF_NEXUS_STRATEGY_ID = 700;
var WF_FORM_ANALYTICS_ID = 800;
var WF_FIELDS_ANALYTICS_ID = 801;

var WF_PUBLISH_ENTRY_NAME = "publish_entry";
var WF_SUCCESS_MESSAGE_NAME = "success_message";
var WF_ERROR_MESSAGE_NAME = "error_message";
var WF_MAIL_NOTIFICATION_NAME = "mail_notification";
var WF_REDIRECT_NAME = "redirect";
var WF_FILE_DOWNLOAD_NAME = "file_download";
var WF_NEXUS_STRATEGY_NAME = "nexus_strategy";
var WF_FORM_ANALYTICS_NAME = "form_analytics";
var WF_FIELDS_ANALYTICS_NAME = "fields_analytics";

var WF_PUBLISH_ENTRY_STR = "Publish Entry";
var WF_SUCCESS_MESSAGE_STR = "Success Message";
var WF_ERROR_MESSAGE_STR = "Error Message";
var WF_MAIL_NOTIFICATION_STR = "Mail Notification";
var WF_REDIRECT_STR = "Redirect";
var WF_FILE_DOWNLOAD_STR = "File Download";
var WF_NEXUS_STRATEGY_STR = "Nexus Strategy";
var WF_FORM_ANALYTICS_STR = "Form Analytics";
var WF_FIELDS_ANALYTICS_STR = "Fields Analytics";

var getConstants = function getConstants() {
  return {
    WF_PUBLISH_ENTRY_ID: WF_PUBLISH_ENTRY_ID,
    WF_SUCCESS_MESSAGE_ID: WF_SUCCESS_MESSAGE_ID,
    WF_ERROR_MESSAGE_ID: WF_ERROR_MESSAGE_ID,
    WF_MAIL_NOTIFICATION_ID: WF_MAIL_NOTIFICATION_ID,
    WF_REDIRECT_ID: WF_REDIRECT_ID,
    WF_FILE_DOWNLOAD_ID: WF_FILE_DOWNLOAD_ID,
    WF_NEXUS_STRATEGY_ID: WF_NEXUS_STRATEGY_ID,
    WF_FORM_ANALYTICS_ID: WF_FORM_ANALYTICS_ID,
    WF_FIELDS_ANALYTICS_ID: WF_FIELDS_ANALYTICS_ID,

    WF_PUBLISH_ENTRY_NAME: WF_PUBLISH_ENTRY_NAME,
    WF_SUCCESS_MESSAGE_NAME: WF_SUCCESS_MESSAGE_NAME,
    WF_ERROR_MESSAGE_NAME: WF_ERROR_MESSAGE_NAME,
    WF_MAIL_NOTIFICATION_NAME: WF_MAIL_NOTIFICATION_NAME,
    WF_REDIRECT_NAME: WF_REDIRECT_NAME,
    WF_FILE_DOWNLOAD_NAME: WF_FILE_DOWNLOAD_NAME,
    WF_NEXUS_STRATEGY_NAME: WF_NEXUS_STRATEGY_NAME,
    WF_FORM_ANALYTICS_NAME: WF_FORM_ANALYTICS_NAME,
    WF_FIELDS_ANALYTICS_NAME: WF_FIELDS_ANALYTICS_NAME,

    WF_PUBLISH_ENTRY_STR: WF_PUBLISH_ENTRY_STR,
    WF_SUCCESS_MESSAGE_STR: WF_SUCCESS_MESSAGE_STR,
    WF_ERROR_MESSAGE_STR: WF_ERROR_MESSAGE_STR,
    WF_MAIL_NOTIFICATION_STR: WF_MAIL_NOTIFICATION_STR,
    WF_REDIRECT_STR: WF_REDIRECT_STR,
    WF_FILE_DOWNLOAD_STR: WF_FILE_DOWNLOAD_STR,
    WF_NEXUS_STRATEGY_STR: WF_NEXUS_STRATEGY_STR,
    WF_FORM_ANALYTICS_STR: WF_FORM_ANALYTICS_STR,
    WF_FIELDS_ANALYTICS_STR: WF_FIELDS_ANALYTICS_STR
  };
};

exports.default = getConstants;

/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFActionViewMgr = __webpack_require__(239);

var _WFActionViewMgr2 = _interopRequireDefault(_WFActionViewMgr);

var _WFActionClientMgr = __webpack_require__(235);

var _WFActionClientMgr2 = _interopRequireDefault(_WFActionClientMgr);

var _WFActionFormStateMgr = __webpack_require__(156);

var _WFActionFormStateMgr2 = _interopRequireDefault(_WFActionFormStateMgr);

var _WFActionResources = __webpack_require__(238);

var _WFActionResources2 = _interopRequireDefault(_WFActionResources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ACTION MANAGER ------------------- //

// ------------------- //

var isInit = false;

var WFActionMgr = function () {
  function WFActionMgr() {
    (0, _classCallCheck3.default)(this, WFActionMgr);
  }

  (0, _createClass3.default)(WFActionMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFActionViewMgr2.default.setState(obj);
    }

    /**
     * Ready : refresh state
     */

  }, {
    key: "ready",
    value: function ready() {
      _WFActionViewMgr2.default.setState({
        actions: WFActionMgr.getValues()
      });
    }

    /**
     * Init : find wfc.actions to init WFActionFormStateMgr
     * @param actions
     */

  }, {
    key: "init",
    value: function init() {
      var actions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      if (!(0, _Lodash.isArray)(actions)) {
        throw new Error('WFActionMgr init => actions is not valid array...');
      } else {
        if (!isInit) {
          actions = actions.map(function (r) {
            r._id = parseInt((0, _Lodash.uniqueId)());
            return r;
          });
          _WFActionFormStateMgr2.default.init(actions);
          WFActionMgr.ready();
          isInit = true;
        }
      }
    }

    /**
     * Clear WFActionFormStateMgr and restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      isInit = false;
      _WFActionFormStateMgr2.default.clear();
      _WFActionViewMgr2.default.resetState();
      WFActionMgr.ready();
    }

    /**
     * Get all actions
     */

  }, {
    key: "getValues",
    value: function getValues() {
      var actions = _WFActionFormStateMgr2.default.getAllValues();
      return actions.map(function (a) {
        var action_id = null;
        if (a.hasOwnProperty('attributes') && a['attributes'] !== "") {
          var attributes = (0, _JSON.parse)(a['attributes']);
          action_id = attributes["action_id"];
        }
        return (0, _assign2.default)({}, a, { action_id: action_id });
      });
    }

    /**
     * Create new action
     * @required {action_id, wf_formconfig_id}
     * @return formState 
     */

  }, {
    key: "create",
    value: function create() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var action_id = args.action_id,
          wf_formconfig_id = args.wf_formconfig_id,
          wf_formactiontype_id = args.wf_formactiontype_id,
          _args$displayFields = args.displayFields,
          displayFields = _args$displayFields === undefined ? [] : _args$displayFields,
          _args$defaultValues = args.defaultValues,
          defaultValues = _args$defaultValues === undefined ? {} : _args$defaultValues;


      if (!(0, _Lodash.isNumber)(action_id)) {
        throw new Error('WFActionMgr create => action_id is required...');
        return null;
      } else if (!(0, _Lodash.isNumber)(wf_formconfig_id)) {
        throw new Error('WFActionMgr create => wf_formconfig_id is required...');
        return null;
      } else if (!(0, _Lodash.isNumber)(wf_formactiontype_id)) {
        throw new Error('WFActionMgr create => wf_formactiontype_id is required...');
        return null;
      } else {
        var _id = parseInt((0, _Lodash.uniqueId)());
        var formState = _WFActionFormStateMgr2.default.getOrCreate({
          _id: _id,
          action_id: action_id,
          wf_formconfig_id: wf_formconfig_id,
          wf_formactiontype_id: wf_formactiontype_id
        });
        formState.setDisplayFields(displayFields);
        formState.setValues(defaultValues);
        if (wf_formactiontype_id) {
          var flds = formState.getFields();
          flds.wf_formactiontype_id.setValue(wf_formactiontype_id);
        }
        return formState;
      }
    }

    /**
     * Edit action
     * @return formState 
     */

  }, {
    key: "edit",
    value: function edit(action) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var wf_formconfig_id = args.wf_formconfig_id,
          wf_formactiontype_id = args.wf_formactiontype_id,
          _args$displayFields2 = args.displayFields,
          displayFields = _args$displayFields2 === undefined ? [] : _args$displayFields2;

      if (!(0, _Lodash.isObject)(action)) {
        throw new Error('WFActionMgr create => this action is not valid...');
        return null;
      } else {
        var formState = _WFActionFormStateMgr2.default.getOrCreate((0, _extends3.default)({
          wf_formconfig_id: wf_formconfig_id,
          wf_formactiontype_id: wf_formactiontype_id
        }, action));
        formState.setDisplayFields(displayFields);
        return formState;
      }
    }

    /**
     * Save action
     * @required {formState, next}
     * @param formState
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "save",
    value: function save(formState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!formState) {
        throw new Error('WFActionMgr save => formState is required...');
      } else if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFActionMgr save => next is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        _WFActionClientMgr2.default.save(formState, onError, function (res) {
          _WFActionFormStateMgr2.default.update(res);
          WFActionMgr.ready();
          onSuccess(res);
        });
      }
    }

    /**
     * Del action
     * @required {formState, next}
     * @param formState
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "del",
    value: function del(formState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!formState) {
        throw new Error('WFActionMgr del => formState null...');
      } else if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFActionMgr del => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        var _id = formState.getVolatileId();
        _WFActionClientMgr2.default.del(formState, onError, function (res) {
          _WFActionFormStateMgr2.default.unset(_id);
          WFActionMgr.ready();
          onSuccess(res);
        });
      }
    }

    /**
     * Create actions by default
     * Call this method after create wfc
     * @param wf_formconfig_id
     */

  }, {
    key: "createActionsByDefault",
    value: function createActionsByDefault(args, next) {
      var wf_formconfig_id = args.wf_formconfig_id,
          _args$defaultActions = args.defaultActions,
          defaultActions = _args$defaultActions === undefined ? null : _args$defaultActions;

      if (!wf_formconfig_id) {
        throw new Error('WFActionMgr createActionsByDefault => wf_formconfig_id null...');
      } else {
        var c = _WFActionResources2.default.getConstants();
        var actions = [c.WF_PUBLISH_ENTRY_ID, c.WF_SUCCESS_MESSAGE_ID, c.WF_ERROR_MESSAGE_ID, c.WF_FORM_ANALYTICS_ID, c.WF_FIELDS_ANALYTICS_ID];
        if ((0, _Lodash.isArray)(defaultActions) && defaultActions.length > 0) {
          actions = defaultActions;
        }
        actions.forEach(function (action_id) {
          var _WFActionResources$ge = _WFActionResources2.default.get(action_id),
              _WFActionResources$ge2 = _WFActionResources$ge.wf_formactiontype_id,
              wf_formactiontype_id = _WFActionResources$ge2 === undefined ? 1 : _WFActionResources$ge2,
              _WFActionResources$ge3 = _WFActionResources$ge.displayFields,
              displayFields = _WFActionResources$ge3 === undefined ? [] : _WFActionResources$ge3,
              _WFActionResources$ge4 = _WFActionResources$ge.defaultValues,
              defaultValues = _WFActionResources$ge4 === undefined ? {} : _WFActionResources$ge4;

          WFActionMgr.create({
            action_id: action_id,
            wf_formconfig_id: wf_formconfig_id,
            wf_formactiontype_id: wf_formactiontype_id,
            displayFields: displayFields,
            defaultValues: defaultValues
          });
        });
        _WFActionClientMgr2.default.massSave(function () {
          WFActionMgr.clear();
          next();
        });
      }
    }
  }]);
  return WFActionMgr;
}();

// ------------------- //


exports.default = WFActionMgr;
// ------------------- //

/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFActionConstants = __webpack_require__(236);

var _WFActionConstants2 = _interopRequireDefault(_WFActionConstants);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ACTION RESOURCES ------------------- //

// ------------------- //

var _getConstants = (0, _WFActionConstants2.default)(),
    WF_PUBLISH_ENTRY_ID = _getConstants.WF_PUBLISH_ENTRY_ID,
    WF_SUCCESS_MESSAGE_ID = _getConstants.WF_SUCCESS_MESSAGE_ID,
    WF_ERROR_MESSAGE_ID = _getConstants.WF_ERROR_MESSAGE_ID,
    WF_MAIL_NOTIFICATION_ID = _getConstants.WF_MAIL_NOTIFICATION_ID,
    WF_REDIRECT_ID = _getConstants.WF_REDIRECT_ID,
    WF_FILE_DOWNLOAD_ID = _getConstants.WF_FILE_DOWNLOAD_ID,
    WF_NEXUS_STRATEGY_ID = _getConstants.WF_NEXUS_STRATEGY_ID,
    WF_FORM_ANALYTICS_ID = _getConstants.WF_FORM_ANALYTICS_ID,
    WF_FIELDS_ANALYTICS_ID = _getConstants.WF_FIELDS_ANALYTICS_ID,
    WF_PUBLISH_ENTRY_STR = _getConstants.WF_PUBLISH_ENTRY_STR,
    WF_SUCCESS_MESSAGE_STR = _getConstants.WF_SUCCESS_MESSAGE_STR,
    WF_ERROR_MESSAGE_STR = _getConstants.WF_ERROR_MESSAGE_STR,
    WF_MAIL_NOTIFICATION_STR = _getConstants.WF_MAIL_NOTIFICATION_STR,
    WF_REDIRECT_STR = _getConstants.WF_REDIRECT_STR,
    WF_FILE_DOWNLOAD_STR = _getConstants.WF_FILE_DOWNLOAD_STR,
    WF_NEXUS_STRATEGY_STR = _getConstants.WF_NEXUS_STRATEGY_STR,
    WF_FORM_ANALYTICS_STR = _getConstants.WF_FORM_ANALYTICS_STR,
    WF_FIELDS_ANALYTICS_STR = _getConstants.WF_FIELDS_ANALYTICS_STR;

// ------------------- //
// PUBLISH_ENTRY     ------------------- //
// ------------------- //

var WFPublishEntry = {
  info: {
    action_id: WF_PUBLISH_ENTRY_ID,
    label: WF_PUBLISH_ENTRY_STR,
    icon: "layers",
    className: "wf_action_publish",
    level: 1,
    selectable: false,
    editable: false,
    removable: false
  },
  wf_formactiontype_id: 1,
  displayFields: [],
  fields: []
};

// ------------------- //
// SUCCESS_MESSAGE     ------------------- //
// ------------------- //

var WFSuccessMessage = {
  info: {
    action_id: WF_SUCCESS_MESSAGE_ID,
    label: WF_SUCCESS_MESSAGE_STR,
    icon: "check",
    className: "wf_action_success",
    level: 2,
    selectable: false,
    editable: true,
    removable: false
  },
  defaultValues: {
    success_title: "Success Message",
    success_message: "Your responses were successfully submitted"
  },
  displayFields: ["success_title", "success_message"]
};

// ------------------- //
// ERROR_MESSAGE     ------------------- //
// ------------------- //

var WFErrorMessage = {
  info: {
    action_id: WF_ERROR_MESSAGE_ID,
    label: WF_ERROR_MESSAGE_STR,
    icon: "close",
    className: "wf_action_error",
    level: 2,
    selectable: false,
    editable: true,
    removable: false
  },
  defaultValues: {
    err404_title: "Error 404",
    err404_message: "internal error try to contact the admin to resolve the situation.",
    maintenance_title: "Sorry",
    maintenance_message: "this form is undergoing maintenance. please try again later"
  },
  displayFields: ["err404_title", "err404_message", "maintenance_title", "maintenance_message"]
};

// ------------------- //
// MAIL_NOTIFICATION     ------------------- //
// ------------------- //

var mailSample = {
  to: "{\"{{ admin_email }}\":\"Administrator\"}",
  from: "{\"{{ admin_email }}\":\"{{ site_name }}\"}",
  body: "{{ default_message | raw }}"
};

var WFMailNotification = {
  info: {
    action_id: WF_MAIL_NOTIFICATION_ID,
    label: WF_MAIL_NOTIFICATION_STR,
    icon: "envelope",
    className: "wf_action_mail",
    level: 2,
    editable: true,
    removable: true
  },
  wf_formactiontype_id: 2,
  customView: "WFMailer",
  widgetConfig: { size: "lg" },
  defaultValues: {
    mail_to: mailSample.to,
    mail_cc: "",
    mail_bcc: "",
    mail_from: mailSample.from,
    mail_subject: "",
    mail_body: mailSample.body,
    mail_attachments: "",
    template_name: ""
  },
  displayFields: ["mail_to", "mail_cc", "mail_bcc", "mail_from", "mail_subject", "mail_body"]
};

// ------------------- //
// FORM_ANALYTICS     ------------------- //
// ------------------- //

var WFormAnalytics = {
  info: {
    action_id: WF_FORM_ANALYTICS_ID,
    label: WF_FORM_ANALYTICS_STR,
    icon: "linegraph",
    className: "wf_action_analytics_form",
    level: 2,
    selectable: false,
    editable: false,
    removable: false
  },
  displayFields: []
};

// ------------------- //
// FIELDS_ANALYTICS     ------------------- //
// ------------------- //

var WFieldAnalytics = {
  info: {
    action_id: WF_FIELDS_ANALYTICS_ID,
    label: WF_FIELDS_ANALYTICS_STR,
    icon: "piechart",
    className: "wf_action_analytics_fields",
    level: 2,
    selectable: false,
    editable: true,
    removable: false
  },
  //widgetConfig: {size:"lg"},
  //customView: "WFieldAnalytics",
  defaultValues: {
    //singleResultIsPublic: false,
    //btnLabelSingle: "Show your results",
    globalResultIsPublic: false,
    btnLabelGlobal: "Show the results",
    globalResultsTitle: "Global result",
    globalResultsMessage: ""
  },
  displayFields: [
  // "singleResultIsPublic",
  // "btnLabelSingle",
  "globalResultIsPublic", "btnLabelGlobal", "globalResultsTitle", "globalResultsMessage"]
};

// ------------------- //
// REDIRECT     ------------------- //
// ------------------- //

var WFRedirect = {
  info: {
    action_id: WF_REDIRECT_ID,
    label: WF_REDIRECT_STR,
    icon: "anchor",
    className: "wf_action_redirect",
    level: 1,
    editable: true,
    removable: true
  },
  defaultValues: {
    to: "http://www.wonderform.net",
    delay: 5000,
    message: "Vous allez etre redirigé..."
  },
  displayFields: ["to", "delay", "message"]
};

// ------------------- //
// FILE_DOWNLOAD     ------------------- //
// ------------------- //

var WFileDownload = {
  info: {
    action_id: WF_FILE_DOWNLOAD_ID,
    label: WF_FILE_DOWNLOAD_STR,
    icon: "download",
    className: "wf_action_download",
    level: 2,
    editable: true,
    removable: true
  },
  defaultValues: {
    files: "",
    btnLabel: "Telecharger",
    message: "Votre fichier est pret à etre telecharger"
  },
  displayFields: ["files", "btnLabel", "message"]
};

// ------------------- //
// NEXUS_STRATEGY     ------------------- //
// ------------------- //

var WFNexusStrategy = {
  info: {
    action_id: WF_NEXUS_STRATEGY_ID,
    label: WF_NEXUS_STRATEGY_STR,
    icon: "genius",
    className: "wf_action_nexus",
    level: 1,
    editable: true,
    removable: true
  },
  widgetConfig: { size: "lg" },
  customView: "WFNexusStrategy",
  defaultValues: {},
  displayFields: ["field_selected"]
};

// ------------------- //
// ACTIONS ARCHIVE     ------------------- //
// ------------------- //

var List = [WFPublishEntry, WFSuccessMessage, WFErrorMessage, WFormAnalytics, WFieldAnalytics, WFMailNotification,
//WFNexusStrategy,
WFRedirect, WFileDownload];

var getList = function getList() {
  return List;
};

// ------------------- //
// ACTIONS INFOS     ------------------- //
// ------------------- //

var ListInfo = {};
List.map(function (a) {
  ListInfo[a.info.action_id] = a;
});

var get = function get(action_id) {
  if (ListInfo.hasOwnProperty(action_id)) {
    return ListInfo[action_id];
  } else {
    return {};
  }
};
// ------------------- //
exports.default = {
  get: get,
  getList: getList,
  getConstants: _WFActionConstants2.default
};
// ------------------- //

/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {
  actions: []
};
// ------------------- //

// WF_ACTION VIEW MANAGER ------------------- //

// ------------------- //
var WFActionViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFActionViewMgr;
// ------------------- //

/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFAnalyticsClientMgr = {

  formName: null,

  /**   
   * Get the formName
   * @return formName
   **/
  getFormName: function getFormName() {
    return {
      formName: WFAnalyticsClientMgr.formName
    };
  },

  /**   
   * Set the formName
   * @param formState
   **/
  setFormName: function setFormName(formState) {
    WFAnalyticsClientMgr.formName = formState.getName();
  },

  /**
    * Find form stats by year groupby month
    * @param integer year
    * @param onError is callback
    * @param onSuccess is callback
    */
  findFormStatsByYear: function findFormStatsByYear(year, onError, onSuccess) {
    _WFClient2.default.findFormStatsByYear(WFAnalyticsClientMgr.getFormName(), year).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormStatsResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
    * Find form stats by year and month groupby week
    * @param integer year
    * @param integer month
    * @param onError is callback
    * @param onSuccess is callback
    */
  findFormStatsByYearMonth: function findFormStatsByYearMonth(year, month, onError, onSuccess) {
    _WFClient2.default.findFormStatsByYearMonth(WFAnalyticsClientMgr.getFormName(), year, WFAnalyticsClientMgr.fixedMonthIndex(month)).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormStatsResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
    * Format month index
    * client index [0-11]
    * server index [1-12]
    * @param month
    * @src client || server
    * @return month formatted
    */
  fixedMonthIndex: function fixedMonthIndex(month) {
    var src = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "client";

    var m = parseInt(month);
    if (src === "client") {
      return m + 1;
    } else if (src === "server") {
      return m - 1;
    }
  },


  /**
    * Find form stats by year and week
    * @param integer year
    * @param integer week
    * @param onError is callback
    * @param onSuccess is callback
    */
  findFormStatsByYearWeek: function findFormStatsByYearWeek(year, week, onError, onSuccess) {
    _WFClient2.default.findFormStatsByYearWeek(WFAnalyticsClientMgr.getFormName(), year, week).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormStatsResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
    * Find option entries
    * @param integer formEntryId
    * @param onError is callback
    * @param onSuccess is callback
    */
  findOptionEntries: function findOptionEntries(formEntryId, onError, onSuccess) {
    _WFClient2.default.findOptionEntries(WFAnalyticsClientMgr.getFormName(), formEntryId).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormStatsResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
    * Count option entries
    * @param integer formEntryId
    * @param onError is callback
    * @param onSuccess is callback
    */
  countOptionEntries: function countOptionEntries(onError, onSuccess) {
    _WFClient2.default.countOptionEntries(WFAnalyticsClientMgr.getFormName()).then(function (res) {
      var wfRes = _WFResponse2.default.getFindFormStatsResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  }
};

// ------------------- //
exports.default = WFAnalyticsClientMgr;
// ------------------- //

/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {

  // Utils

  year: (0, _WFMoment2.default)().year(),
  days: _WFMoment2.default.weekdaysShort(true),
  months: _WFMoment2.default.monthsShort('-MMM-'),
  monthWeeks: [],

  // formConfig

  startYear: null,
  startMonth: null,
  startWeek: null,

  endYear: (0, _WFMoment2.default)().year(),
  endMonth: (0, _WFMoment2.default)().month(),
  endWeek: (0, _WFMoment2.default)().isoWeek(),

  currentYear: (0, _WFMoment2.default)().year(),
  currentMonth: (0, _WFMoment2.default)().month(),
  currentWeek: (0, _WFMoment2.default)().isoWeek(),

  yearResult: [],
  monthResult: [],
  weekResult: [],

  viewByYear: [],
  completedByYear: [],
  uncompletedByYear: [],

  monthLabel: [],
  viewByMonth: [],
  completedByMonth: [],
  uncompletedByMonth: [],

  weeksLabel: [],
  viewByWeek: [],
  completedByWeek: [],
  uncompletedByWeek: [],

  // fieldConfig

  fields: [],
  optionResults: [],

  currentField: 0,
  currentFieldValue: {},

  currentOptionLabels: [],
  currentOptionSeries: []

};
// ------------------- //

// WF_ANALYTICS VIEW MANAGER ------------------- //

// ------------------- //
var WFAnalyticsViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFAnalyticsViewMgr;
// ------------------- //

/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var CLASSIC = "classic";
var EXTRA = "extra";

// ------------------- //
// TEXT     ------------------- //
// ------------------- //

var text = {

  info: {
    name: "text",
    label: "Text",
    icon: ""
  },

  defaultValues: {
    value: "",
    type: ""
  }
};

// ------------------- //
// IMG     ------------------- //
// ------------------- //

var image = {

  info: {
    name: "image",
    label: "Image",
    icon: ""
  },

  defaultValues: {
    value: ""
  }
};

// ------------------- //
// VIDEO     ------------------- //
// ------------------- //

var video = {

  info: {
    name: "video",
    label: "Video",
    icon: ""
  },

  defaultValues: {
    value: "",
    type: ""
  }
};

// ------------------- //
// BUTTON     ------------------- //
// ------------------- //

var button = {

  info: {
    name: "button",
    label: "Button",
    icon: ""
  },

  defaultValues: {
    value: "",
    type: ""
  }
};

// ------------------- //
// CONTENTS ------------------- //
// ------------------- //

var Contents = {
  text: text,
  image: image,
  video: video,
  button: button
};

var getContent = function getContent(name) {
  if (Contents.hasOwnProperty(name)) {
    return Contents[name];
  } else {
    return null;
  }
};

var getContentListInfo = function getContentListInfo() {
  return [text, image, video, button].map(function (c) {
    return c.info;
  });
};

// ------------------- //
// CONTENT STYLE    ------------------- //
// ------------------- //

var ContentStyle = [{
  name: CLASSIC,
  label: "Classic-Content"
}, {
  name: EXTRA,
  label: "Wonder-Content"
}];

var getContentStyle = function getContentStyle() {
  return ContentStyle;
};

// ------------------- //
// CONFIG FOR MANAGE CONTENTCONFIG    ------------------- //
// ------------------- //

var configToCreate = function configToCreate() {
  return {
    displayFields: ["input_type", "label", "name", "required", "searchable"],
    fields: [{
      "name": "contentType",
      "type": "string",
      "input_type": "panel",
      "label": "Content Style",
      "create_column": false,
      "attributes": {
        "valueBy": "name",
        "grid": "col-sm-6",
        "data": ContentStyle
      }
    }, {
      "name": "input_type",
      "type": "string",
      "input_type": "panel",
      "label": "Field Type",
      "create_column": true,
      "attributes": {
        "valueBy": "name",
        "grid": "col-sm-6",
        "data": getContentListInfo()
      }
    }]
  };
};

var configToEdit = function configToEdit() {};

// ------------------- //
exports.default = {
  configToCreate: configToCreate,
  configToEdit: configToEdit,
  getContent: getContent,
  getContentStyle: getContentStyle
};
// ------------------- //

/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFEntryQueryMgr = __webpack_require__(159);

var _WFEntryQueryMgr2 = _interopRequireDefault(_WFEntryQueryMgr);

var _WFEntryCollectionMgr = __webpack_require__(158);

var _WFEntryCollectionMgr2 = _interopRequireDefault(_WFEntryCollectionMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFEntryClientMgr = {

  formName: null,

  /**   
  * Get the formName
  * @return formName
  **/
  getFormName: function getFormName() {
    return WFEntryClientMgr.formName;
  },

  /**   
  * Set the formName
  * @param formState
  **/
  setFormName: function setFormName(formState) {
    WFEntryClientMgr.formName = formState.getName();
  },

  /**   
  * Find in db.
  * @param args {page}
  * @param onError is callback
  * @param onSuccess is callback
  **/
  find: function find() {
    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    var onSuccess = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var _args$page = args.page,
        page = _args$page === undefined ? null : _args$page;


    if (page) {
      _WFEntryQueryMgr2.default.setPage(page);
    }

    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl(),
      formName: WFEntryClientMgr.getFormName(),
      query: _WFEntryQueryMgr2.default.get()
    };

    _WFClient2.default.find(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getFindResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        var _wfRes$getResultset = wfRes.getResultset(),
            _wfRes$getResultset$r = _wfRes$getResultset.rows,
            rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
            _wfRes$getResultset$c = _wfRes$getResultset.count,
            count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

        _WFEntryQueryMgr2.default.refresh(rows.length, count);
        _WFEntryCollectionMgr2.default.setValue(rows);
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.dir(error);
    });
  },


  /**   
  * Delete in db.
  * @param formStateMgr instance of WFormStateMgr
  * @param onError is callback
  * @param onSuccess is callback
  **/
  del: function del(formStateMgr, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formStateMgr.del(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getDelResponse(res);
      formStateMgr.clear();
      onSuccess(wfRes.getResultset());
    }).catch(function (error) {
      onError(error);
    });
  }
};

// ------------------- //
exports.default = WFEntryClientMgr;
// ------------------- //

/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY FORMSTATE MANAGER ------------------- //

// ------------------- //

var WFEntryFormStateMgr = new _WFormStateMgr2.default({
  formName: 'entry', // todo verify the formName & formType
  formType: _WFProductType.WF_CUSTOM_CUSTOM_ID,
  objKey: "id"
});

// ------------------- //
exports.default = WFEntryFormStateMgr;
// ------------------- //

// formEntryMgr.get().formState.getFormId()

/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Lodash = __webpack_require__(6);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY SELECT MANAGER ------------------- //

// ------------------- //

var WFEntrySelectMgr = function () {
  var collection = new _WFArray2.default({
    isCollection: true,
    findBy: "id"
  });
  var action = {
    clear: function clear() {
      return collection.clear();
    },
    getValue: function getValue() {
      return collection.getValue();
    },
    getKeys: function getKeys() {
      var by = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "id";
      return collection.map(function (r) {
        return r[by];
      });
    },
    select: function select(row) {
      if ((0, _Lodash.isObject)(row)) {
        if (!collection.has(row.id)) {
          collection.insert(row);
        } else {
          collection.delete(row.id);
        }
      } else {
        throw new Error('WFEntrySelectMgr select => invalid row ...');
      }
    },
    remove: function remove(delResults) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if ((0, _Lodash.isArray)(delResults)) {
        delResults.forEach(function (id) {
          collection.delete(id.toString());
        });
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }
  };
  return {
    select: action.select,
    remove: action.remove,
    clear: action.clear,
    getValue: action.getValue,
    getKeys: action.getKeys
  };
}();

// ------------------- //
exports.default = WFEntrySelectMgr;
// ------------------- //

/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {
  entries: [],
  entries_selected: [],
  entries_pager: {}
};
// ------------------- //

// WF_ENTRY VIEW MANAGER ------------------- //

// ------------------- //
var WFEntryViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFEntryViewMgr;
// ------------------- //

/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFieldConfigClientMgr = {
  /**   
   * Save in db. Create it if not exists
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   **/
  save: function save(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formState.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        formState.setValues(wfRes.getResultset()[0]);
        onSuccess(wfRes.getResultset()[0]);
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
   * Delete from db
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   **/
  del: function del(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      formName: formState.getName(),
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };
    formState.del(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getDelResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  }
};

// ------------------- //
exports.default = WFieldConfigClientMgr;
// ------------------- //

/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_FIELD_CONFIG STATE MANAGER ------------------- //

// ------------------- //

var WFieldConfigFormStateMgr = new _WFormStateMgr2.default({
  formName: 'field-config',
  formType: _WFProductType.WF_CORE_FIELD_CONFIG_ID,
  objKey: 'name'
});

WFieldConfigFormStateMgr.create = function (wf_formconfig_id) {
  var fieldState = _WFormStateFactory2.default.create(_WFProductType.WF_CORE_FIELD_CONFIG_ID);
  fieldState.setValues({ wf_formconfig_id: wf_formconfig_id });
  return fieldState;
};

// ------------------- //
exports.default = WFieldConfigFormStateMgr;
// ------------------- //

/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFieldConfigMgr = __webpack_require__(418);

var _WFieldConfigMgr2 = _interopRequireDefault(_WFieldConfigMgr);

var _WFieldConfigResources = __webpack_require__(161);

var _WFieldConfigResources2 = _interopRequireDefault(_WFieldConfigResources);

var _WFieldConfigClientMgr = __webpack_require__(247);

var _WFieldConfigClientMgr2 = _interopRequireDefault(_WFieldConfigClientMgr);

var _WFieldConfigFormStateMgr = __webpack_require__(248);

var _WFieldConfigFormStateMgr2 = _interopRequireDefault(_WFieldConfigFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFieldConfig = {
  key: "WFieldConfig",
  mgr: _WFieldConfigMgr2.default,
  clientMgr: _WFieldConfigClientMgr2.default,
  formStateMgr: _WFieldConfigFormStateMgr2.default,
  resources: _WFieldConfigResources2.default
};
// ------------------- //
exports.default = WFieldConfig;
// ------------------- //

window.WFieldConfig = WFieldConfig;

/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _Lodash = __webpack_require__(6);

var _WFLicenseQueryMgr = __webpack_require__(252);

var _WFLicenseQueryMgr2 = _interopRequireDefault(_WFLicenseQueryMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFLicenseClientMgr = {

  /**
   * Get license info
   * @param urlArgs object containing elements to build the request url
   * @param next is callback
   **/
  getLicenseInfo: function getLicenseInfo(urlArgs, next) {
    _WFClient2.default.getLicenseInfo(urlArgs).then(function (res) {
      next(res.resultset);
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**   
  * Find in db.
  * @param args {page}
  * @param onError is callback
  * @param onSuccess is callback
  **/
  find: function find() {
    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    var onSuccess = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var _args$page = args.page,
        page = _args$page === undefined ? null : _args$page;


    if (page) {
      _WFLicenseQueryMgr2.default.setPage(page);
    }

    var urlArgs = {
      isAppAdmin: true,
      formName: 'license',
      apiBaseUrl: _WFUrl2.default.getBaseUrl(),
      query: _WFLicenseQueryMgr2.default.get()
    };

    _WFClient2.default.find(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getFindResponse(res);
      if (wfRes.getHasLogicErrors()) {
        if (onError) {
          onError(wfRes.getLogicErrors());
        }
      } else {
        var _wfRes$getResultset = wfRes.getResultset(),
            _wfRes$getResultset$r = _wfRes$getResultset.rows,
            rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
            _wfRes$getResultset$c = _wfRes$getResultset.count,
            count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

        _WFLicenseQueryMgr2.default.refresh(rows.length, count);
        if (onSuccess) {
          onSuccess(rows);
        }
      }
    }).catch(function (error) {
      console.dir(error);
    });
  },


  /**   
  * Save in db. Create it if not exists
  * @param formState
  * @param onError is callback
  * @param onSuccess is callback
  **/
  save: function save(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };

    formState.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getLogicErrors());
      } else {
        formState.setValues(wfRes.getResultset()[0]);
        onSuccess(wfRes.getResultset()[0]);
      }
    }).catch(function (error) {
      console.error(error);
    });
  }
};

// ------------------- //
exports.default = WFLicenseClientMgr;
// ------------------- //

/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFormStateMgr = __webpack_require__(84);

var _WFormStateMgr2 = _interopRequireDefault(_WFormStateMgr);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ACTION LIST STATE MANAGER ------------------- //

// ------------------- //

var WFLicenseFormStateMgr = new _WFormStateMgr2.default({
  formName: 'license',
  formType: _WFProductType.WF_CORE_LICENSE_ID,
  objKey: "wf_producttype_id"
});

// ------------------- //
exports.default = WFLicenseFormStateMgr;
// ------------------- //

/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFQueryParams = __webpack_require__(64);

var _WFQueryParams2 = _interopRequireDefault(_WFQueryParams);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_LICENSE QUERY PARAMS MANAGER ------------------- //

// ------------------- //

var WFLicenseQueryMgr = new _WFQueryParams2.default({
  limit: 100
});

// ------------------- // 
exports.default = WFLicenseQueryMgr;
// ------------------- //

/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- // 

// WF_LICENSE VALUES MANAGER ------------------- //

// ------------------- // 

var WFLicenseValuesMgr = function () {
  var store = new _WFObject2.default();
  var actions = {
    has: function has(wf_producttype_id) {
      return store.has(wf_producttype_id);
    },
    get: function get(wf_producttype_id) {
      if (store.has(wf_producttype_id)) {
        return store.get(wf_producttype_id);
      }
    },
    set: function set(wf_producttype_id, obj) {
      store.set((0, _defineProperty3.default)({}, wf_producttype_id, obj));
    },
    getValue: function getValue() {
      return store.getValue();
    },
    isValid: function isValid(wf_producttype_id) {
      if (!store.has(wf_producttype_id)) {
        return false;
      } else {
        var license = store.get(wf_producttype_id);
        if (license.hasOwnProperty("status")) {
          return license.status;
        } else {
          return false;
        }
      }
    }
  };
  return actions;
}();

exports.default = WFLicenseValuesMgr;

/*
  WFLicense.valueMgr.isValid(800)
*/

/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFormConfigParser = __webpack_require__(163);

var _WFormConfigParser2 = _interopRequireDefault(_WFormConfigParser);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFDataTypes = __webpack_require__(74);

var _Lodash = __webpack_require__(6);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Handle form state updates (add, replace, delete)
 */
var WFMassUpdater = function () {
  /**
   * Constructor
   * @param config a given form config to parse
   */
  function WFMassUpdater(config) {
    (0, _classCallCheck3.default)(this, WFMassUpdater);
    var _config$name = config.name,
        name = _config$name === undefined ? '' : _config$name,
        _config$type = config.type,
        type = _config$type === undefined ? 0 : _config$type;


    this.type = new _WFormProp2.default("form_type", _WFDataTypes.WF_TYPE_INTEGER, type);
    this.name = new _WFormProp2.default("form_name", _WFDataTypes.WF_TYPE_STRING, name);

    if (this.getType() >= _WFProductType.WF_CUSTOM_CUSTOM_ID) {
      this.formConfig = _WFormConfigParser2.default.parse(config);
    } else {
      this.formConfig = null;
    }

    this.formStateList = [];
  }

  /**
   * Get the form name
   */


  (0, _createClass3.default)(WFMassUpdater, [{
    key: "getName",
    value: function getName() {
      return this.name.getValue();
    }

    /**
     * Get the form type
     */

  }, {
    key: "getType",
    value: function getType() {
      return this.type.getValue();
    }

    /**
     * Get the form state list
     * @return this.formStateList
     */

  }, {
    key: "getFormStateList",
    value: function getFormStateList() {
      return this.formStateList;
    }

    /**
     * Push new values for update or delete
     * @param values the values to update or delete
     * ex values = {entry_id: 0, subject: 'Hello', message: 'Hello World'}
     * @return postive integer which identify the values to update if push succeeded
     * else return 0
     */

  }, {
    key: "push",
    value: function push(values) {
      var formState = null;
      var volatileId = 0;

      if (this.getType() < _WFProductType.WF_CUSTOM_CUSTOM_ID) {
        formState = _WFormStateFactory2.default.create(this.getType());
      } else {
        formState = _WFormStateFactory2.default.createFormEntryState(this.formConfig);
      }

      if (formState) {
        volatileId = parseInt((0, _Lodash.uniqueId)());
        formState.setVolatileId(volatileId);
        formState.setValues(values);
        this.formStateList.push(formState);
      }

      return volatileId;
    }

    /**
     * Push a formStateList to get all values
     * @param formStateList is prop of WFormStateMgr
     */

  }, {
    key: "pushFormStateMgr",
    value: function pushFormStateMgr(formStateMgr) {
      var _this = this;

      formStateMgr.getAllValues().forEach(function (val) {
        return _this.push(val);
      });
    }

    /**
     * Execute the mass update ==> send the request to server
     * @param urlArgs object containing elements to build the request url
     * @param isAddOrModify
     */

  }, {
    key: "execute",
    value: function execute(urlArgs) {
      var isAddOrModify = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

      urlArgs['formName'] = this.getName();
      urlArgs['formType'] = this.getType();

      var data = [];
      for (var i = 0; i < this.formStateList.length; i++) {
        var formState = this.formStateList[i];
        if (isAddOrModify) {
          data.push(formState.getAsDbRow());
        } else {
          data.push({ entry_id: formState.getEntryId() });
        }
      }

      if (isAddOrModify) {
        return _WFClient2.default.save(urlArgs, data);
      } else {
        return _WFClient2.default.del(urlArgs, 0, data);
      }
    }
  }]);
  return WFMassUpdater;
}();

;

exports.default = WFMassUpdater;

/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// field config schema required number
var formFields = [{
  "name": "attributes",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "Attributes",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": true,
  "ref_form_config": ""
}, {
  "name": "create_column",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "Create Column",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "label",
  "type": "text",
  "input_type": "textarea",
  "len": 255,
  "label": "Label",
  "legend": "",
  "required": true,
  "searchable": false,
  "create_column": true,
  "attributes": {
    rows: 2
  }
}, {
  "name": "legend",
  "type": "text",
  "input_type": "",
  "len": 255,
  "label": "Legend",
  "legend": "",
  "required": false,
  //"editable": true,
  "searchable": false,
  "create_column": true
}, {
  "name": "len",
  "type": "integer",
  "input_type": "",
  "len": 255,
  "label": "Length",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "name",
  "type": "string",
  "input_type": "",
  "len": 32,
  "label": "Name",
  "legend": "",
  "required": true,
  "searchable": true,
  "create_column": true,
  "attributes": {
    "transformable": true,
    "transform": "toName"
  }
}, {
  "name": "input_type",
  "type": "string",
  "input_type": "",
  "len": 32,
  "label": "InputType",
  "required": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "required",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "Required",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": true,
  "attributes": {
    placeholder: "field is required"
  }
}, {
  "name": "validation_schema",
  "type": "text",
  "input_type": "textarea",
  "len": 6555,
  "label": "ValidationSchema",
  "required": false,
  "searchable": false,
  "create_column": true,
  "attributes": {
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["required", "===", true]
    }
  }
}, {
  "name": "searchable",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "Searchable",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": true,
  "attributes": {
    placeholder: "field is searchable"
  }
}, {
  "name": "type",
  "type": "string",
  "input_type": "",
  "len": 32,
  "label": "Type",
  "legend": "",
  "required": true,
  "searchable": true,
  "create_column": true
}, {
  "name": "visible",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "Visible",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "is_category",
  "type": "boolean",
  "len": 1,
  "label": "Is Category",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true,
  "ref_form_config": ""
}, {
  "name": "wf_formconfig_id",
  "type": "integer",
  "input_type": "",
  "len": 11,
  "label": "FormConfig",
  "legend": "",
  "required": true,
  "searchable": true,
  "create_column": true
}, {
  "name": "wf_optiongroup_id",
  "type": "integer",
  "input_type": "",
  "len": 11,
  "label": "OptionGroup",
  "legend": "",
  "required": false,
  "searchable": true,
  "create_column": true
},

// ------- //
// STRING/TEXT INPUT ------- //
// ------- //

{
  "name": "placeholder",
  "type": "string",
  "input_type": "text",
  "label": "Input placeholder",
  "create_column": false
}, {
  "name": "defaultValue",
  "type": "string",
  "input_type": "text",
  "label": "Value by default",
  "legend": "Gives the default value of the input element.",
  "create_column": false
}, {
  "name": "data",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "Data",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "valueBy",
  "type": "string",
  "label": "Select value by",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "labelBy",
  "type": "string",
  "label": "Select value by",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
},

// Validation Strategy

{
  "name": "minLength",
  "type": "number",
  //"input_type": "text",
  "label": " The minimum number of characters allowed",
  "create_column": false
}, {
  "name": "maxLength",
  "type": "number",
  //"input_type": "text",
  "label": " The maximum number of characters allowed",
  "create_column": false
},

// Transform Strategy
{
  "name": "transformable",
  "type": "boolean",
  "input_type": "checkbox",
  "label": "FIELD'S TRANSFORMER",
  "placeholder": "active option",
  "legend": "use transformer to <strong>format value</strong>",
  "create_column": false,
  "attributes": {
    "placeholder": "action option"
  }
}, {
  "name": "transform",
  "type": "string",
  "input_type": "panel",
  "label": "Input placeholder",
  "create_column": false,
  "attributes": {
    "valueBy": "action",
    "grid": "col-sm-6",
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["transformable", "===", true]
    },
    "data": [{
      action: "toCapital",
      label: "CAPITALIZE"
    }, {
      action: "toUpper",
      label: "UPPERCASE"
    }, {
      action: "toLower",
      label: "LOWERCASE"
    }, {
      action: "toSlug",
      label: "SLUGIFY"
    }]
  }
},

// ------- //
// TEXT INPUT ------- //
// ------- //

{
  "name": "rows",
  "type": "number",
  "input_type": "range",
  "label": "Max Rows",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "",
    "minimum": 1,
    "maximum": 20
  }
},

// ------- //
// DATE INPUT ------- //
// ------- //

{
  "name": "dateFormat",
  "type": "string",
  "label": "Date Format",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false,
  "legend": ""
}, {
  "name": "showMonthDropdown",
  "type": "boolean",
  "input_type": "checkbox",
  "label": "",
  "legend": "",
  "create_column": false,
  "attributes": {
    "placeholder": "Show select month input"
  }
}, {
  "name": "showYearDropdown",
  "type": "boolean",
  "input_type": "checkbox",
  "label": "",
  "legend": "",
  "create_column": false,
  "attributes": {
    "placeholder": "Show select years input"
  }
}, {
  "name": "showWeekNumbers",
  "type": "boolean",
  "input_type": "checkbox",
  "label": "",
  "legend": "",
  "create_column": false,
  "attributes": {
    "placeholder": "Display week numbers"
  }
}, {
  "name": "monthsShown",
  "type": "number",
  "input_type": "range",
  "label": "Month visible",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "",
    "minimum": 1,
    "maximum": 4
  }
}, {
  "name": "minDate",
  "type": "string",
  "input_type": "date",
  "label": "Date Minimum",
  "legend": "indicate the allowed range of values for the element.",
  "create_column": false,
  "attributes": {
    "showMonthDropdown": true,
    "showYearDropdown": true
  }
}, {
  "name": "maxDate",
  "type": "string",
  "input_type": "date",
  "label": "Date Maximum",
  "legend": "indicate the allowed range of values for the element",
  "create_column": false,
  "attributes": {
    "showMonthDropdown": true,
    "showYearDropdown": true
  }
},

// ------- //
// CHECKBOX INPUT ------- //
// ------- //

{
  "name": "hiddenLabel",
  "type": "boolean",
  "input_type": "checkbox",
  "label": "",
  "legend": "",
  "create_column": false,
  "attributes": {
    "placeholder": "Label is hidden"
  }
},

// ------- //
// NUMBER INPUT ------- //
// ------- //

{
  "name": "placeholder",
  "type": "string",
  "input_type": "text",
  "label": "Input placeholder",
  "create_column": false
},
/*
{
  "name": "defaultValue",
  "type": "number",
  "input_type": "text",
  "label": "Value by default",
  "legend": "Gives the default value of the input element.",
  "create_column": false
},
*/
{
  "name": "minimum",
  "type": "number",
  //"input_type": "text",
  "label": "Value Minimum",
  "legend": "indicate the allowed range of values for the element.",
  "create_column": false
}, {
  "name": "maximum",
  "type": "number",
  //"input_type": "text",
  "label": "Value Maximum",
  "legend": "indicate the allowed range of values for the element",
  "create_column": false
}, {
  "name": "step",
  "type": "number",
  //"input_type": "text",
  "label": "Step",
  "legend": "Specifies the value granularity of the element’s value.",
  "create_column": false
}, {
  "name": "sufix",
  "type": "string",
  "input_type": "text",
  "label": "Sufix",
  "legend": "exemple : <strong>%, px, cm, l</strong> etc...",
  "create_column": false
}, {
  "name": "isFloat",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "",
  "legend": "",
  "create_column": false,
  "attributes": {
    placeholder: "Accepted decimal number"
  }
},

// ------- //
// SELECT_MULTIPLE INPUT ------- //
// ------- //

{
  "name": "isInlineOption",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": false,
  "attributes": {
    placeholder: "Display option(s) inline"
  }
},

// ------- //
// SELECT_MULTIPLE INPUT ------- //
// ------- //

{
  "name": "placeholder",
  "type": "string",
  "input_type": "text",
  "label": "Input placeholder",
  "create_column": false
}, {
  "name": "data",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "Data",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "valueBy",
  "type": "string",
  "label": "Select value by",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "labelBy",
  "type": "string",
  "label": "Select value by",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "isMonkey",
  "type": "boolean",
  "create_column": false
}, {
  "name": "isBaobab",
  "type": "boolean",
  "create_column": false
}, {
  "name": "optionType",
  "type": "string",
  "input_type": "",
  "label": "Current Tree",
  "required": false,
  "searchable": false,
  "editable": true,
  "create_column": false
}, {
  "name": "minItems",
  "type": "number",
  //"input_type": "text",
  "label": "Minimum items selectable",
  "legend": "indicate the allowed range of values for the element.",
  "create_column": false
}, {
  "name": "maxItems",
  "type": "number",
  //"input_type": "text",
  "label": "Maximum items selectable",
  "legend": "indicate the allowed range of values for the element",
  "create_column": false
}, {
  "name": "isMultiple",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": false,
  "attributes": {
    placeholder: "User can select multiple option(s)"
  }
}, {
  "name": "isUnfold",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": false,
  "attributes": {
    placeholder: "Unfold panel archive option"
  }
}, {
  "name": "canSearch",
  "type": "boolean",
  "input_type": "",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "searchable": false,
  "create_column": false,
  "attributes": {
    placeholder: "Display the search input"
  }
},

// ------- //
// MONKEY SELECT ------- //
// ------- //

{
  "name": "monkeyGroup",
  "type": "string",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "monkeyObserve",
  "type": "string",
  "input_type": "select",
  "label": "Monkey observe field",
  "legend": "select field type <strong>select2 Baobab</strong> or <strong>select2 Monkey</strong>",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false,
  "attributes": {
    valueBy: "name",
    "data": []
  }
}, {
  "name": "monkeyFilterBy",
  "type": "string",
  "input_type": "select",
  "label": "Monkey Filter options result by option or branch",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false,
  "attributes": {
    valueBy: "name",
    "data": [{
      label: "Option",
      name: "option"
    }, {
      label: "Branch",
      name: "branch"
    }]
  }
}, {
  "name": "monkeyBranch",
  "type": "number",
  "input_type": "select",
  "label": "Monkey Select Branch",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": false,
  "attributes": {
    valueBy: "id",
    "data": [],
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["monkeyFilterBy", "===", "branch"]
    }
  }
},

// ------- //
// WFIELD SELECT ------- //
// ------- //

{
  "name": "wf_label",
  "type": "text",
  "input_type": "textarea",
  "label": "Override Label by Html label",
  "legend": "You can use tag html <strong>&lt;strong&gt;</strong> and <strong>&lt;br&gt;</strong> .",
  "create_column": false,
  "len": 600,
  "attributes": {
    rows: 4
  }
}, {
  "name": "wf_height",
  "type": "number",
  "input_type": "range",
  "label": "Min Height",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 0,
    "maximum": 600
  }
}, {
  "name": "wf_width",
  "type": "number",
  "input_type": "range",
  "label": "Max Width",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 400,
    "maximum": 1920
  }
},

// WFIELD SELECT'S OPTIONS ------------ //

{
  "name": "wf_option_width",
  "type": "number",
  "input_type": "range",
  "label": "Options Width",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 100,
    "maximum": 1024
  }
}, {
  "name": "wf_option_padding",
  "type": "number",
  "input_type": "range",
  "label": "Options Padding",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 0,
    "maximum": 100
  }
}, {
  "name": "wf_option_margin",
  "type": "number",
  "input_type": "range",
  "label": "Options Margin",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 0,
    "maximum": 100
  }
}, {
  "name": "wf_option_image_radius",
  "type": "number",
  "input_type": "range",
  "label": "Options Radius",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "%",
    "minimum": 0,
    "maximum": 50
  }
}, {
  "name": "wf_option_image_height",
  "type": "number",
  "input_type": "range",
  "label": "Image Height",
  "create_column": false,
  "attributes": {
    "step": 0,
    "sufix": "px",
    "minimum": 0,
    "maximum": 600
  }
},
/*
  {
    "name": "wf_option_image_width",
    "type": "number",
    "input_type": "range",
    "label": "Options Width",
    "create_column": false,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  },
*/

// ------- //
// DEFAULT VALUE ------- //
// ------- //

{
  "name": "stringValue",
  "type": "string",
  "input_type": "text",
  "label": "value by default",
  "create_column": false
}, {
  "name": "numberValue",
  "type": "number",
  //"input_type": "text",
  "label": "value by default",
  "create_column": false
}, {
  "name": "booleanValue",
  "type": "boolean",
  "input_type": "",
  "label": "",
  "create_column": false,
  "attributes": {
    placeholder: "value by default"
  }
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['label', 'name'];

/**
 * Factory to create new field-config
 */

var WFieldConfigFactory = function () {
  function WFieldConfigFactory() {
    (0, _classCallCheck3.default)(this, WFieldConfigFactory);
  }

  (0, _createClass3.default)(WFieldConfigFactory, null, [{
    key: "create",

    /**
     * Create a fieldConfig form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'field-config',
        type: _WFProductType.WF_CORE_FIELD_CONFIG_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };
      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFieldConfigFactory;
}();

;

exports.default = WFieldConfigFactory;

/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.toLocaleErr = undefined;

var _regenerator = __webpack_require__(271);

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = __webpack_require__(268);

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

var _ajv = __webpack_require__(898);

var _ajv2 = _interopRequireDefault(_ajv);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//import localize from "ajv-i18n/localize/en";
var PHONE_RE = /^[0-9()\-\.\s]+$/;
var EMAIL_RE = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var URL_RE = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
// ------------------- //
var WFAjv = new _ajv2.default({
  allErrors: true
});
// ------------------- //
WFAjv.addFormat('email', EMAIL_RE);
WFAjv.addFormat('phone', PHONE_RE);
WFAjv.addFormat('url', URL_RE);
// ------------------- //
exports.default = WFAjv;
// ------------------- //

var locales = {
  cz: function cz() {
    return __webpack_require__.e/* import() */(13).then(__webpack_require__.bind(null, 901));
  }, // Czech
  de: function de() {
    return __webpack_require__.e/* import() */(12).then(__webpack_require__.bind(null, 902));
  }, // German
  en: function en() {
    return __webpack_require__.e/* import() */(11).then(__webpack_require__.bind(null, 903));
  }, // English
  fr: function fr() {
    return __webpack_require__.e/* import() */(9).then(__webpack_require__.bind(null, 905));
  }, // French
  es: function es() {
    return __webpack_require__.e/* import() */(10).then(__webpack_require__.bind(null, 904));
  }, // Spanish
  hu: function hu() {
    return __webpack_require__.e/* import() */(8).then(__webpack_require__.bind(null, 906));
  }, // Hungarian
  it: function it() {
    return __webpack_require__.e/* import() */(7).then(__webpack_require__.bind(null, 907));
  }, // Italian
  ja: function ja() {
    return __webpack_require__.e/* import() */(6).then(__webpack_require__.bind(null, 908));
  }, // Japanese
  pl: function pl() {
    return __webpack_require__.e/* import() */(5).then(__webpack_require__.bind(null, 909));
  }, // Polish
  ru: function ru() {
    return __webpack_require__.e/* import() */(4).then(__webpack_require__.bind(null, 910));
  }, // Russian
  sk: function sk() {
    return __webpack_require__.e/* import() */(3).then(__webpack_require__.bind(null, 911));
  }, // Slovak
  sv: function sv() {
    return __webpack_require__.e/* import() */(2).then(__webpack_require__.bind(null, 912));
  }, // Swedish
  zh: function zh() {
    return __webpack_require__.e/* import() */(1).then(__webpack_require__.bind(null, 913));
  } };
var localize = null;
var currentLang = null;
var langByDefault = "en";
var setLocalize = function () {
  var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
    return _regenerator2.default.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            if (!__WF__.hasOwnProperty('LOCALE')) {
              _context.next = 13;
              break;
            }

            langByDefault = __WF__.LOCALE.substring(0, 2);

            if (!locales.hasOwnProperty(langByDefault)) {
              _context.next = 8;
              break;
            }

            _context.next = 5;
            return locales[langByDefault]();

          case 5:
            localize = _context.sent;
            _context.next = 11;
            break;

          case 8:
            _context.next = 10;
            return locales.en();

          case 10:
            localize = _context.sent;

          case 11:
            _context.next = 16;
            break;

          case 13:
            _context.next = 15;
            return locales.en();

          case 15:
            localize = _context.sent;

          case 16:
          case 'end':
            return _context.stop();
        }
      }
    }, _callee, undefined);
  }));

  return function setLocalize() {
    return _ref.apply(this, arguments);
  };
}();
setLocalize();
var toLocaleErr = exports.toLocaleErr = function toLocaleErr(errors) {
  if (localize) {
    localize(errors);
  }
  return errors.map(function (err) {
    return err["message"];
  });
};

/*
export const toLocaleErr = (err) => {
  let lang = {
    cz: () => localize.cz(err), // Czech
    de: () => localize.de(err), // German
    en: () => localize.en(err), // English
    fr: () => localize.fr(err), // French
    es: () => localize.es(err), // Spanish
    hu: () => localize.hu(err), // Hungarian
    it: () => localize.it(err), // Italian
    ja: () => localize.ja(err), // Japanese
    pl: () => localize.pl(err), // Polish
    ru: () => localize.ru(err), // Russian
    sk: () => localize.sk(err), // Slovak
    sv: () => localize.sv(err), // Swedish
    zh: () => localize.zh(err), // Chinese
  }
  let fn = lang.en;
  if (lang.hasOwnProperty(currentLang)) {
    fn = lang[currentLang];
  }
  fn();
}
*/
// ------------------- //

/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFClient = __webpack_require__(38);

var _WFClient2 = _interopRequireDefault(_WFClient);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _Lodash = __webpack_require__(6);

var _WFSettingQueryMgr = __webpack_require__(166);

var _WFSettingQueryMgr2 = _interopRequireDefault(_WFSettingQueryMgr);

var _WFSettingFormStateMgr = __webpack_require__(165);

var _WFSettingFormStateMgr2 = _interopRequireDefault(_WFSettingFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFSettingClientMgr = {

  formName: "setting",

  /**   
   * Get the formName
   * @return formName
   **/
  getFormName: function getFormName() {
    return WFSettingClientMgr.formName;
  },

  /**   
   * Set the formName
   * @param formState
   **/
  setFormName: function setFormName(formState) {
    WFSettingClientMgr.formName = formState.getName();
  },

  /**   
   * Find in db.
   * @param args {page}
   * @param onError is callback
   * @param onSuccess is callback
   **/
  find: function find() {
    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    var onSuccess = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var _args$page = args.page,
        page = _args$page === undefined ? null : _args$page;


    if (page) {
      _WFSettingQueryMgr2.default.setPage(page);
    }

    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl(),
      formName: WFSettingClientMgr.getFormName(),
      query: _WFSettingQueryMgr2.default.get()
    };

    _WFClient2.default.find(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getFindResponse(res);
      if (wfRes.getHasLogicErrors()) {
        if (onError) {
          onError(wfRes.getHasLogicErrors());
        }
      } else {
        var _wfRes$getResultset = wfRes.getResultset(),
            _wfRes$getResultset$r = _wfRes$getResultset.rows,
            rows = _wfRes$getResultset$r === undefined ? [] : _wfRes$getResultset$r,
            _wfRes$getResultset$c = _wfRes$getResultset.count,
            count = _wfRes$getResultset$c === undefined ? 0 : _wfRes$getResultset$c;

        _WFSettingQueryMgr2.default.refresh(rows.length, count);
        _WFSettingFormStateMgr2.default.init(rows);
        if (onSuccess) {
          onSuccess(wfRes.getResultset());
        }
      }
    }).catch(function (error) {
      console.dir(error);
    });
  },


  /**   
   * Save in db. Create it if not exists
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   **/
  save: function save(formState, onError, onSuccess) {
    var urlArgs = {
      isAppAdmin: true,
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };

    formState.save(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getSaveResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getHasLogicErrors());
      } else {
        formState.setValues(wfRes.getResultset()[0]);
        onSuccess(wfRes.getResultset()[0]);
      }
    }).catch(function (error) {
      console.error(error);
    });
  },


  /**
   * Delete from db
   * @param formState
   * @param onError is callback
   * @param onSuccess is callback
   **/
  del: function del(formState, onError, onSuccess) {

    var urlArgs = {
      isAppAdmin: true,
      formName: formState.getName(),
      apiBaseUrl: _WFUrl2.default.getBaseUrl()
    };

    formState.del(urlArgs).then(function (res) {
      var wfRes = _WFResponse2.default.getDelResponse(res);
      if (wfRes.getHasLogicErrors()) {
        onError(wfRes.getHasLogicErrors());
      } else {
        onSuccess(wfRes.getResultset());
      }
    }).catch(function (error) {
      console.error(error);
    });
  }
};

// ------------------- //
exports.default = WFSettingClientMgr;
// ------------------- //

/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFViewMgr = __webpack_require__(59);

var _WFViewMgr2 = _interopRequireDefault(_WFViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
var initialState = {
  setting_values: {}
};
// ------------------- //

// WF_SETTING VIEW MANAGER ------------------- //

// ------------------- //
var WFSettingViewMgr = new _WFViewMgr2.default(initialState);
// ------------------- //
exports.default = WFSettingViewMgr;
// ------------------- //

/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFType2 = __webpack_require__(86);

var _WFType3 = _interopRequireDefault(_WFType2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS SELECT MANAGER ------------------- //

// ------------------- //

var WFSelect = function (_WFType) {
  (0, _inherits3.default)(WFSelect, _WFType);

  /** 
   * Constructor
   */
  function WFSelect() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFSelect);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect.__proto__ || (0, _getPrototypeOf2.default)(WFSelect)).call(this, _WFValueTypes.WF_SELECT_VALUE));

    var _config$zipBy = config.zipBy,
        zipBy = _config$zipBy === undefined ? "id" : _config$zipBy,
        _config$labelBy = config.labelBy,
        labelBy = _config$labelBy === undefined ? "name" : _config$labelBy,
        _config$data = config.data,
        data = _config$data === undefined ? [] : _config$data,
        _config$value = config.value,
        value = _config$value === undefined ? [] : _config$value,
        _config$min = config.min,
        min = _config$min === undefined ? 0 : _config$min,
        _config$max = config.max,
        max = _config$max === undefined ? 0 : _config$max,
        _config$multiple = config.multiple,
        multiple = _config$multiple === undefined ? false : _config$multiple,
        _config$canBeEmpty = config.canBeEmpty,
        canBeEmpty = _config$canBeEmpty === undefined ? false : _config$canBeEmpty;
    // source

    _this.data = data;
    // values
    _this.selectValue = new _WFArray2.default();
    _this.arrayValue = [];
    _this.objectValue = {};
    // setting
    _this.zipBy = zipBy;
    _this.labelBy = labelBy;
    _this.multiple = multiple;
    _this.min = parseInt(min);
    _this.max = parseInt(max);
    _this.canBeEmpty = canBeEmpty;
    // caching extra select/unselect method 
    _this.callbacks = null;
    // Set value
    _this.setValue(value);
    return _this;
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFSelect, [{
    key: 'setData',


    /**
     * Refresh this.data by nex data
     * @param data array
     */
    value: function setData() {
      var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      if ((0, _Lodash.isArray)(data)) {
        this.data = data;
      }
    }

    /**
     * Set new selection
     * @param arrayValue [...id]
     */

  }, {
    key: 'setValue',
    value: function setValue() {
      var selectValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      if ((0, _Lodash.isArray)(selectValue)) {
        this.selectValue.set(selectValue);
        this.zip();
      }
    }

    /**
     * Set prev data and value
     * @param values {selectValue, arrayValue}
     */

  }, {
    key: 'setValues',
    value: function setValues() {
      var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (!(0, _Lodash.isObject)(values) || !values.hasOwnProperty("selectValue") || !values.hasOwnProperty("arrayValue") || !values.hasOwnProperty("objectValue")) {
        return;
      }
      var _values$selectValue = values.selectValue,
          selectValue = _values$selectValue === undefined ? [] : _values$selectValue,
          _values$arrayValue = values.arrayValue,
          arrayValue = _values$arrayValue === undefined ? [] : _values$arrayValue,
          _values$objectValue = values.objectValue,
          objectValue = _values$objectValue === undefined ? {} : _values$objectValue;

      var countSelectValue = selectValue.length;
      var countsArrayValue = arrayValue.length;
      if (this.selectValue.isEmpty() && countSelectValue > 0 && countsArrayValue > 0 && countSelectValue === countsArrayValue) {
        this.selectValue.set(selectValue);
        this.arrayValue = arrayValue;
        this.objectValue = objectValue;
        if (this.input) {
          this.input.setState({
            selectValue: selectValue, arrayValue: arrayValue
          });
        }
      }
    }

    /**
     * Get selection
     * @return array
     */

  }, {
    key: 'getValue',
    value: function getValue() {
      return this.selectValue.getValue();
    }
  }, {
    key: 'getObjectValue',
    value: function getObjectValue() {
      var toJson = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

      if (toJson) {
        return (0, _JSON.stringify)(this.objectValue);
      } else {
        return this.objectValue;
      }
    }
  }, {
    key: 'getArrayValue',
    value: function getArrayValue() {
      return this.arrayValue;
    }

    /**
     * Get selection
     * @return array
     */

  }, {
    key: 'get',
    value: function get() {
      var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (!(0, _Lodash.isNumber)(index)) {
        return null;
      } else {
        return this.selectValue.get(index);
      }
    }

    /**
     * Select value
     * Check if value not null
     * Caching callbacks in this.callbacks
     * Check is single select
     * if single select update uniq selection
     * if multiple update selection
     * @param value
     * @param callbacks object with select & unselect extra method
     */

  }, {
    key: 'select',
    value: function select(value) {
      var callbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var target = value;
      if (callbacks) {
        this.callbacks = callbacks;
      }
      if (!value || value === null) {
        return;
      } else {
        !this.isSingle() ? this.update(target) : this.toggle(target);
      }
    }

    /**
     * Only for Select Single
     * Select/Unselect target
     * @param target value
     */

  }, {
    key: 'toggle',
    value: function toggle(target) {
      var _this2 = this;

      var _callbacks = this.callbacks,
          _callbacks$select = _callbacks.select,
          select = _callbacks$select === undefined ? null : _callbacks$select,
          _callbacks$unselect = _callbacks.unselect,
          unselect = _callbacks$unselect === undefined ? null : _callbacks$unselect;

      if (this.canBeEmpty && this.has(target)) {
        this.clear();
        this.zip(function () {
          return _this2.call(unselect);
        });
      } else {
        this.setValue([target]);
        this.zip(function () {
          return _this2.call(select);
        });
      }
    }

    /**
     * Only for Select Multiple
     * Select/Unselect target
     * @param target value
     */

  }, {
    key: 'update',
    value: function update(target) {
      var _this3 = this;

      var _callbacks2 = this.callbacks,
          _callbacks2$select = _callbacks2.select,
          select = _callbacks2$select === undefined ? false : _callbacks2$select,
          _callbacks2$unselect = _callbacks2.unselect,
          unselect = _callbacks2$unselect === undefined ? false : _callbacks2$unselect;

      if (!this.has(target)) {
        if (!this.isMax()) {
          this.selectValue.insert(target);
          this.zip(function () {
            return _this3.call(select);
          });
        }
      } else {
        this.selectValue.delete(target);
        this.zip(function () {
          return _this3.call(unselect);
        });
      }
    }

    /**
     * Get object selected in this.data
     * Save and Map object in this.arrayValue
     * Save and Map object in this.objectValue
     */

  }, {
    key: 'zip',
    value: function zip() {
      var _this4 = this;

      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (this.data.length > 0) {
        this.objectValue = {};
        this.arrayValue = this.data.filter(function (row) {
          var target = row[_this4.zipBy];
          return _this4.has(target);
        });
        this.arrayValue.map(function (row, i) {
          if (row.hasOwnProperty(_this4.labelBy)) {
            var k = row[_this4.zipBy];
            var v = row[_this4.labelBy];
            _this4.objectValue[k] = v;
          }
        });
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Restore initial state
     */

  }, {
    key: 'clear',
    value: function clear() {
      this.selectValue.clear();
      this.arrayValue = [];
      this.objectValue = {};
      if (this.input) {
        var _input$setState;

        this.input.setState((_input$setState = {}, (0, _defineProperty3.default)(_input$setState, _WFValueTypes.WF_SELECT_VALUE, []), (0, _defineProperty3.default)(_input$setState, _WFValueTypes.WF_ARRAY_VALUE, []), _input$setState));
      }
    }

    /**
     * Get and Remove First value
     * @param next callback(value)
     * @return value
     */

  }, {
    key: 'shift',
    value: function shift() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var first = this.selectValue.shift();
      if ((0, _Lodash.isFunction)(next)) {
        next(first);
      } else {
        return first;
      }
    }

    /**
     * Get and Remove Last value
     * @param next callback(value)
     * @return value
     */

  }, {
    key: 'pop',
    value: function pop() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var last = this.selectValue.pop();
      if ((0, _Lodash.isFunction)(next)) {
        next(last);
      } else {
        return last;
      }
    }

    /**
     * Count values selected
     * @return integer
     */

  }, {
    key: 'getCounter',
    value: function getCounter() {
      return this.selectValue.getCounter();
    }

    /**
     * Apply callback if exist 
     * return in callback selectValue, arrayValue, objectValue
     * @param next callback
     */

  }, {
    key: 'call',
    value: function call(next) {
      if ((0, _Lodash.isFunction)(next)) {
        var _next;

        next((_next = {}, (0, _defineProperty3.default)(_next, _WFValueTypes.WF_SELECT_VALUE, this.getValue()), (0, _defineProperty3.default)(_next, _WFValueTypes.WF_ARRAY_VALUE, this.getArrayValue()), (0, _defineProperty3.default)(_next, _WFValueTypes.WF_OBJECT_VALUE, this.getObjectValue()), _next), {
          isMin: this.isMin(),
          isMax: this.isMax(),
          isMultiple: this.isMultiple(),
          counter: this.getCounter()
        });
      }
    }

    /**
     * Check if select has value
     * @return boolean
     */

  }, {
    key: 'has',
    value: function has(value) {
      return this.selectValue.has(value);
    }

    /**
     * Only for single select mode
     * Check if value is selected
     * @param value
     * @return boolean
     */

  }, {
    key: 'is',
    value: function is() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (this.isEmpty() || !this.isSingle()) {
        return null;
      } else {
        var current = this.get();
        return current[0] === value;
      }
    }

    /**
     * Check if selection equal min
     * @return boolean
     */

  }, {
    key: 'isMin',
    value: function isMin() {
      if (this.min === 0) {
        return true;
      } else {
        return this.getCounter() >= this.min;
      }
    }

    /**
     * Check if selection equal max
     * @return boolean
     */

  }, {
    key: 'isMax',
    value: function isMax() {
      if (this.max === 0) {
        return false;
      } else {
        return this.getCounter() === this.max;
      }
    }

    /**
     * Check if select is single
     * @return boolean
     */

  }, {
    key: 'isSingle',
    value: function isSingle() {
      return this.min === 1 && this.max === 1 || this.min === 0 && this.max === 1 || this.multiple === false;
    }

    /**
     * Check if data is empty
     * @return boolean
     */

  }, {
    key: 'isMultiple',
    value: function isMultiple() {
      return !this.isSingle();
    }

    /**
     * Check if data is empty
     * @return boolean
     */

  }, {
    key: 'isEmpty',
    value: function isEmpty() {
      return this.getCounter() === 0;
    }

    /**
     * Export to JSON
     * @return json
     */

  }, {
    key: 'toJSON',
    value: function toJSON() {
      return this.selectValue.toJSON();
    }

    /**
     * Parse json to object
     * Set this.objectValue
     * @param json string
     */
    /*
    fromJSON (json) {
     let data = parse(json);
     if (data!==""
       ||isObject(data) 
       && Object.keys(data).length>0) {
       this.setValueByObjValue(data);
     }
    }
    /**
    * Show current value in console
    */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFSelect');
      console.log('counter =>', this.getCounter());
      console.log("");
      console.log('value =>', (0, _JSON.stringify)(this.get()));
      console.log("");
      console.log('array =>', (0, _JSON.stringify)(this.arrayValue));
      console.log("");
      console.log('object =>', (0, _JSON.stringify)(this.objectValue));
      console.log("");
    }
  }], [{
    key: 'instanceOf',
    value: function instanceOf(obj) {
      return obj instanceof WFSelect;
    }
  }]);
  return WFSelect;
}(_WFType3.default);
// ------------------- //


exports.default = WFSelect;
// ------------------- //

/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// GET FILENAME ---------------- //

exports.default = function () {
	var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";


	if (!url || url === "") return "";
	//this removes the anchor at the end, if there is one
	url = url.substring(0, url.indexOf("#") == -1 ? url.length : url.indexOf("#"));
	//this removes the query after the file name, if there is one
	url = url.substring(0, url.indexOf("?") == -1 ? url.length : url.indexOf("?"));
	//this removes everything before the last slash in the path
	url = url.substring(url.lastIndexOf("/") + 1, url.length);
	//return
	return url;
};

/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// MODILE ---------------- //

// ------------------- //

var userAgent = navigator.userAgent || navigator.vendor || window.opera;

// ------------------- //

var isMobile = exports.isMobile = function isMobile() {
	return (/Mobi/.test(navigator.userAgent)
	);
},


// ----------------- //

isMobileSize = exports.isMobileSize = function isMobileSize() {
	return window.innerWidth < 768;
},


// ----------------- //

isWindowPhone = exports.isWindowPhone = function isWindowPhone() {
	return (/windows phone/i.test(userAgent)
	);
},


// ----------------- //

isAndroidPhone = exports.isAndroidPhone = function isAndroidPhone() {
	return (/android/i.test(userAgent)
	);
},


// ----------------- //

isIOSPhone = exports.isIOSPhone = function isIOSPhone() {
	return (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream
	);
};

/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

// STRING TO ARRAY ---------------- //

exports.default = function () {
	var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

	if (string === "") return [];else return string.replace(/\r\n/g, "\n").replace(/^\s+|\s+$/g, "").split("\n").filter(function (line) {
		return line != "";
	});
};

/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS WF EVENTS ------------------- //

// ------------------- //

var WFEvents = function () {
  /**
   * Constructor
   */
  function WFEvents() {
    var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
    (0, _classCallCheck3.default)(this, WFEvents);

    this.name = name;
    this.channels = {};
  }

  /**
   * Subscribe to channel and set callback
   * If channel exist
   * add new callback
   * Else create new channel
   * @param channel string
   * @param event callback
   */


  (0, _createClass3.default)(WFEvents, [{
    key: "sub",
    value: function sub(channel, callback) {

      // WFConsole.val(`${this.name} subscribe`, channel)

      if (!this.channels[channel]) this.channels[channel] = [];
      this.channels[channel].push({ context: this, callback: callback });
      return this;
    }

    /**
     * Publish channel by name
     * If channel not exist cancel
     * Else Get channel and fire the channel's callbacks 
     * @param channel string
     */

  }, {
    key: "pub",
    value: function pub(channel) {

      //WFConsole.val(`${this.name} publish`, channel)

      if (!this.channels[channel]) return false;
      var args = Array.prototype.slice.call(arguments, 1);
      for (var i = 0, l = this.channels[channel].length; i < l; i++) {
        var subscription = this.channels[channel][i];
        subscription.callback.apply(subscription.context, args);
      }
      return this;
    }

    /**
     * Install mediator in object
     * @param obj object
     */

  }, {
    key: "installTo",
    value: function installTo(obj) {

      obj.sub = this.sub;
      obj.pub = this.pub;
    }

    /**
     * Show current state in console
     */

  }, {
    key: "toConsole",
    value: function toConsole() {
      var keys = (0, _keys2.default)(this.channels);
      console.log("count => " + keys.length);
      console.dir(keys);
      console.dir(this.channels);
    }
  }]);
  return WFEvents;
}();

// ---------------------- //


exports.default = WFEvents;
// ---------------------- //

/*
( Mediator + Facade ) -> 
https://addyosmani.com/largescalejavascript/
*/

/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _baobab = __webpack_require__(491);

var _baobab2 = _interopRequireDefault(_baobab);

var _tree = __webpack_require__(494);

var _tree2 = _interopRequireDefault(_tree);

var _branch = __webpack_require__(492);

var _branch2 = _interopRequireDefault(_branch);

var _option = __webpack_require__(493);

var _option2 = _interopRequireDefault(_option);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (0, _baobab2.default)({
  tree: _tree2.default,
  branch: _branch2.default,
  option: _option2.default
});

/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _setting = __webpack_require__(495);

var _setting2 = _interopRequireDefault(_setting);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
exports.default = (0, _setting2.default)({});
// ------------------- //

/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _wfaction = __webpack_require__(157);

var _wfaction2 = _interopRequireDefault(_wfaction);

var _WFAdminView = __webpack_require__(18);

var _editor = __webpack_require__(170);

var _editor2 = _interopRequireDefault(_editor);

var _Lodash = __webpack_require__(6);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.WFC.ACTION ----------------- //

// ----------------- //

/**
 * action hook the current view with the model
 * view => WFAction.viewMrg contains global state
 * model => WFAction.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var action = function () {
  /**
   * Public method
   **/
  var fn = {

    /**
     * Call when the user enters the page
     */
    onInit: function onInit() {
      _wfaction2.default.mgr.init(_WFormManagers.formEntryMgr.get().formState.getActions());
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      _wfaction2.default.mgr.clear();
    },

    /**
     * Create new wfc's action
     * @param setting 
     */
    onCreate: function onCreate(setting) {
      _editor2.default.itEditable(function () {
        var _setting$info = setting.info,
            info = _setting$info === undefined ? {} : _setting$info,
            _setting$displayField = setting.displayFields,
            displayFields = _setting$displayField === undefined ? [] : _setting$displayField,
            _setting$defaultValue = setting.defaultValues,
            defaultValues = _setting$defaultValue === undefined ? {} : _setting$defaultValue,
            _setting$wf_formactio = setting.wf_formactiontype_id,
            wf_formactiontype_id = _setting$wf_formactio === undefined ? 1 : _setting$wf_formactio;
        var action_id = info.action_id;


        var formState = _wfaction2.default.mgr.create({
          action_id: action_id,
          defaultValues: defaultValues,
          displayFields: displayFields,
          wf_formactiontype_id: wf_formactiontype_id,
          wf_formconfig_id: _WFormManagers.formConfigMgr.get().formState.getEntryId()
        });
        formState.setEntryId(0);
        var onCancel = function onCancel() {
          var _id = formState.getVolatileId();
          _wfaction2.default.formStateMgr.unset(_id);
        };
        fn.edit(formState, setting, onCancel);
      });
    },

    /**
     * Edit wfc's action
     * @param row 
     * @param setting 
     */
    onEdit: function onEdit(row) {
      var setting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      _editor2.default.itEditable(function () {
        var _setting$info2 = setting.info,
            info = _setting$info2 === undefined ? {} : _setting$info2,
            _setting$displayField2 = setting.displayFields,
            displayFields = _setting$displayField2 === undefined ? [] : _setting$displayField2,
            _setting$defaultValue2 = setting.defaultValues,
            defaultValues = _setting$defaultValue2 === undefined ? {} : _setting$defaultValue2,
            _setting$wf_formactio2 = setting.wf_formactiontype_id,
            wf_formactiontype_id = _setting$wf_formactio2 === undefined ? 1 : _setting$wf_formactio2;

        var formState = _wfaction2.default.mgr.edit(row, {
          defaultValues: defaultValues,
          displayFields: displayFields,
          wf_formactiontype_id: wf_formactiontype_id,
          wf_formconfig_id: _WFormManagers.formConfigMgr.get().formState.getEntryId()
        });
        fn.edit(formState, setting);
      });
    },

    /**
     * Delete wfc's action
     * @param row 
     */
    onDel: function onDel(row, setting) {
      _editor2.default.itEditable(function () {
        (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
          labelCancel: "no",
          labelValid: "yes",
          message: 'Would you want to delete action ?',
          legend: setting.info.label,
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
            var formState = _wfaction2.default.mgr.edit(row);
            _wfaction2.default.mgr.del(formState, {
              onSuccess: function onSuccess(res) {
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                console.warn("SUCCESS______");
                console.dir(res);
              },
              onError: function onError(err) {
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                console.error(err);
              }
            });
          }
        });
      });
    },

    /**
     * Edit wfc's action
     * @param formState 
     * @param setting 
     */
    edit: function edit(formState, setting) {
      var onCancel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      _editor2.default.itEditable(function () {
        var _setting$info3 = setting.info,
            info = _setting$info3 === undefined ? {} : _setting$info3,
            _setting$customView = setting.customView,
            customView = _setting$customView === undefined ? null : _setting$customView,
            _setting$customViewAr = setting.customViewArgs,
            customViewArgs = _setting$customViewAr === undefined ? {} : _setting$customViewAr,
            _setting$widgetConfig = setting.widgetConfig,
            widgetConfig = _setting$widgetConfig === undefined ? {} : _setting$widgetConfig;
        var icon = info.icon,
            name = info.name,
            label = info.label,
            action_id = info.action_id;

        var isEditor = true;
        if (customView === "WFMailer") {
          customViewArgs["rows"] = (0, _keys2.default)(_WFormManagers.formEntryMgr.get().formState.getFields());
        } else if (customView === "WFNexusStrategy") {
          isEditor = false;
          customViewArgs["rows"] = (0, _keys2.default)(_WFormManagers.formEntryMgr.get().formState.getFields());
        }
        var formView = new _WFormView2.default(formState, true);
        var configView = {
          icon: icon,
          title: label,
          widget: "wf_panel",
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
            _wfaction2.default.mgr.save(formState, {
              onSuccess: function onSuccess(res) {
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              },
              onError: function onError(err) {
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                console.error(err);
              }
            });
          }
        };
        if ((0, _Lodash.isFunction)(onCancel)) {
          configView = (0, _assign2.default)({ onCancel: onCancel }, configView);
        }
        if (isEditor) {
          (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, (0, _assign2.default)({
            formView: formView,
            customView: customView,
            widgetConfig: widgetConfig,
            customViewArgs: customViewArgs
          }, configView));
        } else {
          customViewArgs['formView'] = formView;
          (0, _WFAdminView.Pub)(_Constants.WF_PANELS, (0, _assign2.default)({
            customView: "WFNexusStrategy", // customView,
            customViewArgs: customViewArgs
          }, widgetConfig, configView));
        }
      });
    }
  };
  return fn;
}();

// ----------------- //
exports.default = action;
// ----------------- //

/***/ }),
/* 267 */,
/* 268 */,
/* 269 */,
/* 270 */,
/* 271 */,
/* 272 */,
/* 273 */,
/* 274 */,
/* 275 */,
/* 276 */,
/* 277 */,
/* 278 */,
/* 279 */,
/* 280 */,
/* 281 */,
/* 282 */,
/* 283 */,
/* 284 */,
/* 285 */,
/* 286 */,
/* 287 */,
/* 288 */,
/* 289 */,
/* 290 */,
/* 291 */,
/* 292 */,
/* 293 */,
/* 294 */,
/* 295 */,
/* 296 */,
/* 297 */,
/* 298 */,
/* 299 */,
/* 300 */,
/* 301 */,
/* 302 */,
/* 303 */,
/* 304 */,
/* 305 */,
/* 306 */,
/* 307 */,
/* 308 */,
/* 309 */,
/* 310 */,
/* 311 */,
/* 312 */,
/* 313 */,
/* 314 */,
/* 315 */,
/* 316 */,
/* 317 */,
/* 318 */,
/* 319 */,
/* 320 */,
/* 321 */,
/* 322 */,
/* 323 */,
/* 324 */,
/* 325 */,
/* 326 */,
/* 327 */,
/* 328 */,
/* 329 */,
/* 330 */,
/* 331 */,
/* 332 */,
/* 333 */,
/* 334 */,
/* 335 */,
/* 336 */,
/* 337 */,
/* 338 */,
/* 339 */,
/* 340 */,
/* 341 */,
/* 342 */,
/* 343 */,
/* 344 */,
/* 345 */,
/* 346 */,
/* 347 */,
/* 348 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _wfadmin = __webpack_require__(453);

var _wfadmin2 = _interopRequireDefault(_wfadmin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


__webpack_require__.p = __WF__.hasOwnProperty('PUBLIC_URL') ? __WF__.PUBLIC_URL : "";

/***/ }),
/* 350 */,
/* 351 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFIcon = __webpack_require__(8);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFOverlay = __webpack_require__(215);

var _WFOverlay2 = _interopRequireDefault(_WFOverlay);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ALERT ------------------- //

// ------------------- //

var WFAlert = function (_Component) {
  (0, _inherits3.default)(WFAlert, _Component);

  function WFAlert() {
    (0, _classCallCheck3.default)(this, WFAlert);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFAlert.__proto__ || (0, _getPrototypeOf2.default)(WFAlert)).call(this));

    _this.state = {
      visible: false,
      context: {}
    };
    return _this;
  }

  // ------------------- //

  (0, _createClass3.default)(WFAlert, [{
    key: "render",
    value: function render() {
      var visible = this.state.visible;
      var overlayColor = this.props.overlayColor;

      if (!visible) {
        return false;
      } else {
        return _react2.default.createElement(
          "wf-alert",
          null,
          _react2.default.createElement(
            "wf-alert-box",
            null,
            this.getHeader(),
            this.getBody(),
            this.getFooter()
          ),
          _react2.default.createElement(_WFOverlay2.default, { visible: true, color: overlayColor })
        );
      }
    }
  }, {
    key: "getHeader",
    value: function getHeader() {
      var _this2 = this;

      var _getContext = this.getContext(),
          _getContext$banner = _getContext.banner,
          banner = _getContext$banner === undefined ? "" : _getContext$banner;

      return _react2.default.createElement(
        "div",
        { className: "wf-alert-header" },
        _react2.default.createElement(_WFIcon.WFIClose, { onClick: function onClick() {
            return _this2.props.onCancel();
          } }),
        _react2.default.createElement("span", {
          className: "wf--banner",
          style: {
            backgroundImage: "url(" + banner + ")"
          }
        })
      );
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var _getContext2 = this.getContext(),
          _getContext2$title = _getContext2.title,
          title = _getContext2$title === undefined ? "" : _getContext2$title,
          _getContext2$message = _getContext2.message,
          message = _getContext2$message === undefined ? "" : _getContext2$message;

      return _react2.default.createElement(
        "div",
        { className: "wf-alert-body" },
        _react2.default.createElement(
          _WFText2.default,
          { className: "wf--title" },
          title
        ),
        _react2.default.createElement(
          _WFText2.default,
          { className: "wf--content", html: true },
          message
        )
      );
    }
  }, {
    key: "getFooter",
    value: function getFooter() {
      var _getContext3 = this.getContext(),
          _getContext3$btnLabel = _getContext3.btnLabel,
          btnLabel = _getContext3$btnLabel === undefined ? "" : _getContext3$btnLabel,
          _getContext3$btnCallb = _getContext3.btnCallback,
          btnCallback = _getContext3$btnCallb === undefined ? "" : _getContext3$btnCallb;

      return _react2.default.createElement(
        "div",
        { className: "wf-alert-footer" },
        _react2.default.createElement(
          _WFBtn2.default,
          {
            className: "wf--link",
            onClick: function onClick() {
              return btnCallback();
            }
          },
          btnLabel
        )
      );
    }
  }, {
    key: "getContext",
    value: function getContext() {
      return this.state.context;
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillReceiveProps",
    value: function componentWillReceiveProps(nextProps) {
      var _nextProps$context = nextProps.context,
          context = _nextProps$context === undefined ? {} : _nextProps$context;

      if ((0, _keys2.default)(context).length > 0) {
        this.setState({
          visible: true,
          context: context
        });
      } else {
        this.setState({
          visible: false,
          context: {}
        });
      }
    }
  }]);
  return WFAlert;
}(_react.Component);

// ------------------- //

exports.default = WFAlert;

// ------------------- //

/***/ }),
/* 352 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFIcon = __webpack_require__(8);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFModal = __webpack_require__(214);

var _WFModal2 = _interopRequireDefault(_WFModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF MODAL COMFIRM ------------------- //

// ------------------- //

var classes = {
	icon: "police",
	body: "wf-comfirm-body",
	message: "large",
	legend: "small"
};

// ------------------- //

var WFComfirm = function (_Component) {
	(0, _inherits3.default)(WFComfirm, _Component);

	function WFComfirm() {
		(0, _classCallCheck3.default)(this, WFComfirm);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFComfirm.__proto__ || (0, _getPrototypeOf2.default)(WFComfirm)).call(this));

		_this.state = {
			visible: false,
			context: {}
		};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(WFComfirm, [{
		key: "render",
		value: function render() {
			var _this2 = this;

			var visible = this.state.visible;

			if (!visible) return false;

			var _getContext = this.getContext(),
			    _getContext$labelCanc = _getContext.labelCancel,
			    labelCancel = _getContext$labelCanc === undefined ? "Cancel" : _getContext$labelCanc,
			    _getContext$labelVali = _getContext.labelValid,
			    labelValid = _getContext$labelVali === undefined ? "Valid" : _getContext$labelVali,
			    _getContext$onValidCa = _getContext.onValidCallBack,
			    onValidCallBack = _getContext$onValidCa === undefined ? null : _getContext$onValidCa,
			    _getContext$onCancelC = _getContext.onCancelCallBack,
			    onCancelCallBack = _getContext$onCancelC === undefined ? null : _getContext$onCancelC;

			return _react2.default.createElement(
				"wf-comfirm",
				null,
				_react2.default.createElement(_WFModal2.default, {
					visible: visible,
					hasBody: false,
					title: "",
					description: "",
					icon: classes.icon,
					iconStyle: { background: "#fff", fontSize: 50 },
					HeaderView: function HeaderView() {
						return _this2.getHeader();
					},
					labelCancel: labelCancel,
					labelValid: labelValid,
					onValidCallBack: onValidCallBack,
					onCancelCallBack: onCancelCallBack,
					onChange: this.props.onChange
				})
			);
		}

		// ------------------- //

	}, {
		key: "getHeader",
		value: function getHeader() {
			var _getContext2 = this.getContext(),
			    _getContext2$message = _getContext2.message,
			    message = _getContext2$message === undefined ? "" : _getContext2$message,
			    _getContext2$legend = _getContext2.legend,
			    legend = _getContext2$legend === undefined ? "" : _getContext2$legend;

			return _react2.default.createElement(
				"div",
				{ className: classes.body },
				_react2.default.createElement(
					_WFText2.default,
					{ className: classes.message },
					message
				),
				_react2.default.createElement(
					_WFText2.default,
					{ className: classes.legend },
					legend
				)
			);
		}

		// ------------------- //

	}, {
		key: "getContext",
		value: function getContext() {
			return this.state.context;
		}

		// ------------------- //

		// COMPONENT LIFECYCLE ------------------- //

		// ------------------- //

	}, {
		key: "componentWillReceiveProps",
		value: function componentWillReceiveProps(nextProps) {
			var _nextProps$context = nextProps.context,
			    context = _nextProps$context === undefined ? {} : _nextProps$context;

			if ((0, _keys2.default)(context).length > 0) {
				this.setState({
					visible: true,
					context: context
				});
			} else {
				this.setState({
					visible: false,
					context: {}
				});
			}
		}
	}]);
	return WFComfirm;
}(_react.Component);

// ------------------- //

exports.default = WFComfirm;

// ------------------- //

/***/ }),
/* 353 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SECTION ------------------- //

// ------------------- //

var classes = {
	children: "wf--children",
	data: "wf--data",
	bar: {
		vertical: "wf---bar-vertical",
		horizontal: "wf---bar-horizontal"
	}
};

// ------------------- //

var WFLivePreview = function (_Component) {
	(0, _inherits3.default)(WFLivePreview, _Component);

	function WFLivePreview() {
		(0, _classCallCheck3.default)(this, WFLivePreview);
		return (0, _possibleConstructorReturn3.default)(this, (WFLivePreview.__proto__ || (0, _getPrototypeOf2.default)(WFLivePreview)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFLivePreview, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(
				"wf-live-preview",
				null,
				_react2.default.createElement(
					"wf-live-preview-container",
					null,
					_react2.default.createElement(
						"div",
						{ className: classes.children },
						this.props.children
					),
					_react2.default.createElement(
						"div",
						{ className: classes.data },
						_react2.default.createElement("span", { className: classes.bar.vertical }),
						_react2.default.createElement("span", { className: classes.bar.horizontal })
					)
				)
			);
		}
	}]);
	return WFLivePreview;
}(_react.Component);

// ------------------- //

exports.default = WFLivePreview;

// ------------------- //

/***/ }),
/* 354 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF MAIN ------------------- //

// ------------------- //

var WFMain = function (_Component) {
    (0, _inherits3.default)(WFMain, _Component);

    function WFMain() {
        (0, _classCallCheck3.default)(this, WFMain);
        return (0, _possibleConstructorReturn3.default)(this, (WFMain.__proto__ || (0, _getPrototypeOf2.default)(WFMain)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFMain, [{
        key: 'render',
        value: function render() {
            return _react2.default.createElement(
                'wf-main',
                null,
                this.props.children
            );
        }
    }]);
    return WFMain;
}(_react.Component);

// ------------------- //

exports.default = WFMain;

// ------------------- //

/***/ }),
/* 355 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFIcon = __webpack_require__(8);

var _WFLoader = __webpack_require__(99);

var _WFLoader2 = _interopRequireDefault(_WFLoader);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

var NOTIFY_INFO = "info";
var NOTIFY_SUCCESS = "success";
var NOTIFY_ERROR = "error";
var NOTIFY_WARNING = "warning";

// ------------------- //

// WF NOTIFY ------------------- //

// ------------------- //

var defaultloaderMessage = "<strong>Loading</strong>...";

var classes = {
	messages: "wf-messages",
	message: "wf-message",
	loader: "wf-loader",
	info: "wf-info",
	success: "wf-success",
	error: "wf-error",
	warning: "wf-warning",
	icon: {
		loader: "loader",
		info: "server",
		success: "check",
		error: "close",
		warning: "speech-bubble"
	}
};

// ------------------- //

var WFNotify = function (_Component) {
	(0, _inherits3.default)(WFNotify, _Component);

	function WFNotify() {
		(0, _classCallCheck3.default)(this, WFNotify);
		return (0, _possibleConstructorReturn3.default)(this, (WFNotify.__proto__ || (0, _getPrototypeOf2.default)(WFNotify)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFNotify, [{
		key: "render",


		// ------------------- //

		value: function render() {
			var _props$visible = this.props.visible,
			    visible = _props$visible === undefined ? false : _props$visible;

			if (!visible) return false;
			return _react2.default.createElement(
				"wf-notify",
				null,
				_react2.default.createElement(
					"div",
					{ className: classes.messages },
					this.getLoader(),
					this.getMessages()
				)
			);
		}

		// ------------------- //

	}, {
		key: "getLoader",
		value: function getLoader() {
			var _props = this.props,
			    _props$loader = _props.loader,
			    loader = _props$loader === undefined ? false : _props$loader,
			    _props$loaderMessage = _props.loaderMessage,
			    loaderMessage = _props$loaderMessage === undefined ? defaultloaderMessage : _props$loaderMessage;

			if (loader === false) return false;
			return _react2.default.createElement(
				"span",
				{ className: classes.message + " " + classes.loader },
				_react2.default.createElement(_WFLoader2.default, null),
				_react2.default.createElement(
					_WFText2.default,
					{ html: true },
					loaderMessage
				)
			);
		}

		// ------------------- //

	}, {
		key: "getInfoMessage",
		value: function getInfoMessage(msg) {
			return _react2.default.createElement(
				"span",
				{ className: classes.message + " " + classes.info },
				_react2.default.createElement(_WFIcon.WFIcon, { icon: classes.icon.info }),
				_react2.default.createElement(
					_WFText2.default,
					{ html: true },
					msg
				)
			);
		}

		// ------------------- //

	}, {
		key: "getSuccessMessage",
		value: function getSuccessMessage(msg) {
			return _react2.default.createElement(
				"span",
				{ className: classes.message + " " + classes.success },
				_react2.default.createElement(_WFIcon.WFIcon, { icon: classes.icon.success }),
				_react2.default.createElement(
					_WFText2.default,
					{ html: true },
					msg
				)
			);
		}

		// ------------------- //

	}, {
		key: "getErrorMessage",
		value: function getErrorMessage(msg) {
			return _react2.default.createElement(
				"span",
				{ className: classes.message + " " + classes.error },
				_react2.default.createElement(_WFIcon.WFIcon, { icon: classes.icon.error }),
				_react2.default.createElement(
					_WFText2.default,
					{ html: true },
					msg
				)
			);
		}

		// ------------------- //

	}, {
		key: "getWarningMessage",
		value: function getWarningMessage(msg) {
			return _react2.default.createElement(
				"span",
				{ className: classes.message + " " + classes.warning },
				_react2.default.createElement(_WFIcon.WFIcon, { icon: classes.icon.warning }),
				_react2.default.createElement(
					_WFText2.default,
					{ html: true },
					msg
				)
			);
		}

		// ------------------- //

	}, {
		key: "getMessages",
		value: function getMessages() {
			var _this2 = this;

			var _props$messages = this.props.messages,
			    messages = _props$messages === undefined ? [] : _props$messages;

			if (messages.length === 0) return false;
			return messages.map(function (message, i) {
				return _react2.default.createElement(
					"wf-message",
					{ key: i },
					_this2.getMessage(message)
				);
			});
		}

		// ------------------- //

	}, {
		key: "getMessage",
		value: function getMessage(message) {
			var _message$type = message.type,
			    type = _message$type === undefined ? NOTIFY_INFO : _message$type,
			    _message$msg = message.msg,
			    msg = _message$msg === undefined ? "" : _message$msg;


			switch (type) {

				case NOTIFY_INFO:
					return this.getInfoMessage(msg);

				case NOTIFY_SUCCESS:
					return this.getSuccessMessage(msg);

				case NOTIFY_ERROR:
					return this.getErrorMessage(msg);

				case NOTIFY_WARNING:
					return this.getWarningMessage(msg);
			}
		}
	}]);
	return WFNotify;
}(_react.Component);

// ------------------- //

exports.default = WFNotify;

// ------------------- //

/***/ }),
/* 356 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF PANEL ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf--container ",
    state: {
        ready: "wf-ready",
        open: " wf-open",
        body: " wf-no-scroll"
    },
    theme: {
        dark: " wf-dark ",
        light: " wf-light "
    },
    size: {
        xs: " wf-xs",
        sm: " wf-sm",
        md: " wf-md",
        lg: " wf-lg"
    },
    head: {
        icon: "wf-head-icon",
        text: "wf-head-title",
        close: "wf-head-close"
    },
    foot: {
        cancel: {
            btn: "wf-btn-cancel",
            icon: "close"
        },
        update: {
            btn: "wf-btn-update",
            icon: "check"
        }
    }
};

// ------------------- //

var WFPanel = function (_Component) {
    (0, _inherits3.default)(WFPanel, _Component);

    function WFPanel(props) {
        (0, _classCallCheck3.default)(this, WFPanel);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFPanel.__proto__ || (0, _getPrototypeOf2.default)(WFPanel)).call(this, props));

        var _props$isReady = props.isReady,
            isReady = _props$isReady === undefined ? true : _props$isReady;

        _this.state = {
            visible: true,
            ready: isReady
        };
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFPanel, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? false : _props$visible,
                _props$zIndex = _props.zIndex,
                zIndex = _props$zIndex === undefined ? 5000 : _props$zIndex;

            if (!visible) return false;
            return _react2.default.createElement(
                "wf-panel-edit",
                null,
                _react2.default.createElement(
                    "div",
                    { className: this.getClasses(),
                        style: { zIndex: zIndex } },
                    this.getHead(),
                    this.getBody(),
                    this.getFoot()
                )
            );
        }

        // ------------------- //

    }, {
        key: "getHead",
        value: function getHead() {
            var _props2 = this.props,
                _props2$icon = _props2.icon,
                icon = _props2$icon === undefined ? "cog" : _props2$icon,
                _props2$title = _props2.title,
                title = _props2$title === undefined ? "Panel Edit" : _props2$title,
                _props2$onCancelCallB = _props2.onCancelCallBack,
                onCancelCallBack = _props2$onCancelCallB === undefined ? null : _props2$onCancelCallB;

            return _react2.default.createElement(
                "wf-panel-head",
                null,
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "10" },
                    _react2.default.createElement(_WFIcon.WFIcon, { className: classes.head.icon, icon: icon }),
                    _react2.default.createElement(
                        _WFText2.default,
                        { className: classes.head.text },
                        title
                    )
                ),
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "2", className: "text-right" },
                    _react2.default.createElement(_WFIcon.WFIClose, {
                        onClick: function onClick() {
                            return (0, _Lodash.isFunction)(onCancelCallBack) ? onCancelCallBack() : "";
                        },
                        className: classes.head.close
                    })
                )
            );
        }

        // ------------------- //

    }, {
        key: "getBody",
        value: function getBody() {
            var _props3 = this.props,
                _props3$scrollBar = _props3.scrollBar,
                scrollBar = _props3$scrollBar === undefined ? true : _props3$scrollBar,
                bodyView = _props3.bodyView,
                _props3$open = _props3.open,
                open = _props3$open === undefined ? false : _props3$open;

            if (scrollBar) {
                return _react2.default.createElement(
                    "wf-panel-body",
                    null,
                    _react2.default.createElement(
                        _WFScrollBars2.default,
                        {
                            style: {
                                width: "100%",
                                height: this.props.height
                            } },
                        open ? bodyView(this) : false
                    )
                );
            } else {
                return _react2.default.createElement(
                    "wf-panel-body",
                    null,
                    open ? bodyView(this) : false
                );
            }
        }

        // ------------------- //

    }, {
        key: "getFoot",
        value: function getFoot() {
            var _props4 = this.props,
                _props4$labelCancel = _props4.labelCancel,
                labelCancel = _props4$labelCancel === undefined ? "Cancel" : _props4$labelCancel,
                _props4$labelValid = _props4.labelValid,
                labelValid = _props4$labelValid === undefined ? "Save" : _props4$labelValid,
                _props4$onValidCallBa = _props4.onValidCallBack,
                onValidCallBack = _props4$onValidCallBa === undefined ? null : _props4$onValidCallBa,
                _props4$onCancelCallB = _props4.onCancelCallBack,
                onCancelCallBack = _props4$onCancelCallB === undefined ? null : _props4$onCancelCallB;
            var ready = this.state.ready;

            return _react2.default.createElement(
                "wf-panel-foot",
                null,
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "6" },
                    _react2.default.createElement(
                        _WFBtn2.default,
                        {
                            onClick: function onClick() {
                                return (0, _Lodash.isFunction)(onCancelCallBack) ? onCancelCallBack() : "";
                            },
                            className: classes.foot.cancel.btn
                            //icon={classes.foot.cancel.icon}
                        },
                        labelCancel
                    )
                ),
                _react2.default.createElement(
                    _WFCol2.default,
                    { xs: "6" },
                    _react2.default.createElement(
                        _WFBtn2.default,
                        {
                            disable: !ready,
                            onClick: function onClick() {
                                return (0, _Lodash.isFunction)(onValidCallBack) ? onValidCallBack() : "";
                            },
                            className: classes.foot.update.btn + " " + (this.state.ready ? classes.state.ready : "")
                            //icon={classes.foot.update.icon}
                        },
                        labelValid
                    )
                )
            );
        }

        // ------------------- //

    }, {
        key: "getClasses",
        value: function getClasses() {
            var _props5 = this.props,
                _props5$scrollBar = _props5.scrollBar,
                scrollBar = _props5$scrollBar === undefined ? true : _props5$scrollBar,
                _props5$className = _props5.className,
                className = _props5$className === undefined ? "" : _props5$className,
                _props5$dark = _props5.dark,
                dark = _props5$dark === undefined ? true : _props5$dark,
                _props5$size = _props5.size,
                size = _props5$size === undefined ? "md" : _props5$size,
                _props5$open = _props5.open,
                open = _props5$open === undefined ? false : _props5$open;


            var clss = void 0;

            clss = classes.wrapper;
            clss += className ? className : "";
            clss += dark ? classes.theme.dark : classes.theme.light;
            clss += size ? classes.size[size] : classes.size.md;
            clss += open ? classes.state.open : "";
            clss += !scrollBar ? classes.state.body : "";

            return clss;
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: "componentWillReceiveProps",
        value: function componentWillReceiveProps(nextProps) {
            if (nextProps.isReady !== this.state.ready) {
                this.setState({
                    ready: nextProps.isReady
                });
            }
        }
    }]);
    return WFPanel;
}(_react.Component);

// ------------------- //

exports.default = WFPanel;

// ------------------- //

/*
	
	<WFPanel 
	visible={}
	/>

*/

/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFPanelSetting = function (_Component) {
  (0, _inherits3.default)(WFPanelSetting, _Component);

  function WFPanelSetting(props) {
    (0, _classCallCheck3.default)(this, WFPanelSetting);
    return (0, _possibleConstructorReturn3.default)(this, (WFPanelSetting.__proto__ || (0, _getPrototypeOf2.default)(WFPanelSetting)).call(this, props));
  }

  (0, _createClass3.default)(WFPanelSetting, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          _props$info = _props.info,
          info = _props$info === undefined ? {} : _props$info,
          _props$panel = _props.panel,
          panel = _props$panel === undefined ? {} : _props$panel,
          _props$isChecked = _props.isChecked,
          isChecked = _props$isChecked === undefined ? null : _props$isChecked;
      var icon = info.icon,
          label = info.label,
          name = info.name;
      var _panel$type = panel.type,
          type = _panel$type === undefined ? "" : _panel$type,
          _panel$legend = panel.legend,
          legend = _panel$legend === undefined ? "" : _panel$legend,
          _panel$options = panel.options,
          options = _panel$options === undefined ? [] : _panel$options,
          _panel$className = panel.className,
          className = _panel$className === undefined ? "" : _panel$className;

      return _react2.default.createElement(
        _WFSection2.default,
        { className: className },
        _react2.default.createElement(_WFSectionTitle2.default, {
          className: "wf-setting-title",
          icon: icon,
          text: label
        }),
        _react2.default.createElement(
          "div",
          { className: "wf-setting-panel" },
          this.getLegend(legend),
          _react2.default.createElement(
            "div",
            { className: "wf-setting-panel-body" },
            _react2.default.createElement(
              "div",
              { className: "wf--table" },
              options.map(function (opt) {
                var key = opt.key,
                    _opt$label = opt.label,
                    label = _opt$label === undefined ? "" : _opt$label,
                    _opt$editable = opt.editable,
                    editable = _opt$editable === undefined ? true : _opt$editable;

                var checked = false;
                var ready = false;
                var value = _this2.props.getValue(opt);
                if ((0, _Lodash.isFunction)(isChecked) && isChecked(opt)) {
                  checked = true;
                }
                if (value) {
                  ready = true;
                }
                if (!label) {
                  return false;
                } else {
                  return _react2.default.createElement(
                    "div",
                    { id: key, key: key, className: "wf--row" },
                    _this2.getCellChecker(type, checked),
                    _this2.getCellAction(opt, editable),
                    _this2.getCellLabel(label, checked, ready),
                    _this2.getCellValue(value)
                  );
                }
              })
            )
          )
        )
      );
    }
    // ready
    // onDeactivate

  }, {
    key: "getCellChecker",
    value: function getCellChecker(type, checked) {
      if (type === "validation") {
        return _react2.default.createElement(
          "div",
          { className: "wf--cell wf--cell-checker" },
          checked ? _react2.default.createElement(_WFIcon.WFIcon, { icon: "check" }) : _react2.default.createElement(_WFIcon.WFIcon, { icon: "close" })
        );
      } else {
        return false;
      }
    }
  }, {
    key: "getLegend",
    value: function getLegend(legend) {
      if (legend) {
        return _react2.default.createElement(
          "div",
          { className: "wf-setting-panel-head" },
          _react2.default.createElement(_WFIcon.WFIcon, { icon: 'help' }),
          _react2.default.createElement(
            _WFText2.default,
            null,
            legend
          )
        );
      } else return false;
    }
  }, {
    key: "getCellAction",
    value: function getCellAction(opt, editable) {
      if (editable) {
        var _props$onEdit = this.props.onEdit,
            onEdit = _props$onEdit === undefined ? null : _props$onEdit;

        return _react2.default.createElement(
          "div",
          { className: "wf--cell wf--cell-actions",
            onClick: function onClick() {
              return (0, _Lodash.isFunction)(onEdit) ? onEdit(opt) : "";
            }
          },
          _react2.default.createElement(_WFIcon.WFIcon, { icon: 'cog' })
        );
      } else {
        return _react2.default.createElement("div", { className: "wf--cell wf--cell-actions" });
      }
    }
  }, {
    key: "getCellLabel",
    value: function getCellLabel() {
      var label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var checked = arguments[1];
      var ready = arguments[2];

      var clss = "";
      if (ready) {
        clss = "ready";
      }
      if (checked) {
        clss = "valid";
      }
      return _react2.default.createElement(
        "div",
        { className: "wf--cell wf--cell-label " + clss },
        label
      );
    }
  }, {
    key: "getCellValue",
    value: function getCellValue(value) {
      return _react2.default.createElement(
        "div",
        { className: "wf--cell wf--cell-value" },
        value
      );
    }
  }]);
  return WFPanelSetting;
}(_react.Component);

exports.default = WFPanelSetting;

/***/ }),
/* 358 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FIELD REQUIRED ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFRequired = function (_Component) {
    (0, _inherits3.default)(WFRequired, _Component);

    function WFRequired() {
        (0, _classCallCheck3.default)(this, WFRequired);
        return (0, _possibleConstructorReturn3.default)(this, (WFRequired.__proto__ || (0, _getPrototypeOf2.default)(WFRequired)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFRequired, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$required = _props.required,
                required = _props$required === undefined ? false : _props$required,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style,
                _props$asterix = _props.asterix,
                asterix = _props$asterix === undefined ? "*" : _props$asterix;

            if (!required) return false;
            return _react2.default.createElement(
                "wf-req",
                { style: style },
                asterix
            );
        }
    }]);
    return WFRequired;
}(_react.Component);

// ------------------- //

exports.default = WFRequired;

// ------------------- //

/***/ }),
/* 359 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TABLE FOREACH ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFTableForEach = function (_Component) {
  (0, _inherits3.default)(WFTableForEach, _Component);

  function WFTableForEach() {
    (0, _classCallCheck3.default)(this, WFTableForEach);
    return (0, _possibleConstructorReturn3.default)(this, (WFTableForEach.__proto__ || (0, _getPrototypeOf2.default)(WFTableForEach)).call(this));
  }

  (0, _createClass3.default)(WFTableForEach, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          table = _props.table,
          _props$start = _props.start,
          start = _props$start === undefined ? 0 : _props$start,
          _props$configs = _props.configs,
          configs = _props$configs === undefined ? [] : _props$configs,
          _props$visible = _props.visible,
          visible = _props$visible === undefined ? true : _props$visible;

      if (!visible) return false;
      return _react2.default.createElement(
        'wf-table-foreach',
        null,
        configs.map(function (config, i) {
          return _react2.default.createElement(
            'span',
            { key: i
            },
            table(start + i, config)
          );
        })
      );
    }
  }]);
  return WFTableForEach;
}(_react.Component);

// ------------------- //

exports.default = WFTableForEach;

// ------------------- //

/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFTableForOption = function (_Component) {
  (0, _inherits3.default)(WFTableForOption, _Component);

  function WFTableForOption() {
    (0, _classCallCheck3.default)(this, WFTableForOption);
    return (0, _possibleConstructorReturn3.default)(this, (WFTableForOption.__proto__ || (0, _getPrototypeOf2.default)(WFTableForOption)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFTableForOption, [{
    key: 'render',
    value: function render() {
      var _props$table = this.props.table,
          table = _props$table === undefined ? null : _props$table;

      if ((0, _Lodash.isFunction)(table)) {
        return table(this);
      } else {
        return false;
      }
    }
  }, {
    key: 'componentWillMount',
    value: function componentWillMount() {
      if (this.props.hasOwnProperty('optionMg')) {
        this.props.optionMg.getViewMgr().willMount(this);
      }
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      if (this.props.hasOwnProperty('optionMg')) {
        this.props.optionMg.getViewMgr().willUnMount(this);
      }
    }
  }]);
  return WFTableForOption;
}(_react.Component);

exports.default = WFTableForOption;

/***/ }),
/* 361 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.WFRowHead = exports.WFRow = undefined;

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTableCell = __webpack_require__(216);

var _WFTableCell2 = _interopRequireDefault(_WFTableCell);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

var classes = {};

// ------------------- //

// WF TABLE HEAD ROW ------------------- //

// ------------------- //

// ------------------- //

var WFRowHead = function (_Component) {
	(0, _inherits3.default)(WFRowHead, _Component);

	function WFRowHead(props) {
		(0, _classCallCheck3.default)(this, WFRowHead);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFRowHead.__proto__ || (0, _getPrototypeOf2.default)(WFRowHead)).call(this, props));

		var _props$colFilter = props.colFilter,
		    colFilter = _props$colFilter === undefined ? [] : _props$colFilter;

		_this.state = {
			colFilter: colFilter
		};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(WFRowHead, [{
		key: 'render',
		value: function render() {
			var _this2 = this;

			var _props = this.props,
			    _props$canSelect = _props.canSelect,
			    canSelect = _props$canSelect === undefined ? false : _props$canSelect,
			    _props$canDelete = _props.canDelete,
			    canDelete = _props$canDelete === undefined ? false : _props$canDelete,
			    _props$canAdd = _props.canAdd,
			    canAdd = _props$canAdd === undefined ? false : _props$canAdd,
			    _props$canOpen = _props.canOpen,
			    canOpen = _props$canOpen === undefined ? false : _props$canOpen,
			    _props$canEdit = _props.canEdit,
			    canEdit = _props$canEdit === undefined ? false : _props$canEdit,
			    _props$hasShortcode = _props.hasShortcode,
			    hasShortcode = _props$hasShortcode === undefined ? false : _props$hasShortcode,
			    _props$rows = _props.rows,
			    rows = _props$rows === undefined ? [] : _props$rows,
			    _props$rowConfig = _props.rowConfig,
			    rowConfig = _props$rowConfig === undefined ? {} : _props$rowConfig,
			    _props$customAction = _props.customAction,
			    customAction = _props$customAction === undefined ? [] : _props$customAction;
			var _rowConfig$types = rowConfig.types,
			    types = _rowConfig$types === undefined ? [] : _rowConfig$types,
			    _rowConfig$labels = rowConfig.labels,
			    labels = _rowConfig$labels === undefined ? [] : _rowConfig$labels,
			    _rowConfig$values = rowConfig.values,
			    values = _rowConfig$values === undefined ? [] : _rowConfig$values;


			return _react2.default.createElement(
				'wf-row',
				null,
				!canSelect ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_ACTION }),
				!canDelete ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_ACTION }),
				!canAdd ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_ACTION }),
				!canOpen ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_ACTION }),
				!canEdit ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_ACTION }),
				customAction.map(function (custom, i) {
					var type = custom.type,
					    value = custom.value;

					return _react2.default.createElement(_WFTableCell2.default, { key: 96969 + i, isHead: true, type: _Constants.CELL_ACTION });
				}),
				types.map(function (type, i) {
					return _react2.default.createElement(_WFTableCell2.default, {
						key: i,
						isHead: true,
						type: type,
						value: _this2.getLabel(i, labels, values),
						filters: _this2.getFilters(values[i]),
						isFiltered: _this2.isFiltered(values[i])
					});
				}),
				!hasShortcode ? "" : _react2.default.createElement(_WFTableCell2.default, { isHead: true, type: _Constants.CELL_SHORTCODE, value: "shortcode" })
			);
		}

		// ------------------- //

	}, {
		key: 'getLabel',
		value: function getLabel(index, labels, values) {
			if (labels.length > 0) {
				return labels[index];
			} else {
				return values[index];
			}
		}

		// ------------------- //

	}, {
		key: 'getFilters',
		value: function getFilters(value) {
			if (!this.hasFilters(value)) return null;
			var colFilters = this.props.colFilters;

			return colFilters[value];
		}

		// ------------------- //

	}, {
		key: 'hasFilters',
		value: function hasFilters(value) {
			var _props$colFilters = this.props.colFilters,
			    colFilters = _props$colFilters === undefined ? false : _props$colFilters;

			return colFilters && colFilters.hasOwnProperty(value);
		}

		// ------------------- //

	}, {
		key: 'isFiltered',
		value: function isFiltered(value) {
			var _state$colFilter = this.state.colFilter,
			    colFilter = _state$colFilter === undefined ? [] : _state$colFilter;

			var flag = false;
			if (colFilter.length === 0) return false;
			if (this.isFilter(value, 'up')) {
				flag = 'up';
			} else if (this.isFilter(value, 'down')) {
				flag = 'down';
			}
			return flag;
		}

		// ------------------- //

	}, {
		key: 'isFilter',
		value: function isFilter(value, filter) {
			var _state$colFilter2 = this.state.colFilter,
			    colFilter = _state$colFilter2 === undefined ? [] : _state$colFilter2;

			return this._toHash(colFilter) === this._toHash([value, filter]);
		}

		// ------------------- //

	}, {
		key: '_toHash',
		value: function _toHash() {
			var filterHash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

			return filterHash.length === 2 ? filterHash.join("-") : "";
		}

		// ------------------- //

	}, {
		key: 'componentWillReceiveProps',
		value: function componentWillReceiveProps(nextProps) {
			if (this._toHash(nextProps.colFilter) !== this._toHash(this.state.colFilter)) {
				this.setState({
					colFilter: nextProps.colFilter
				});
			}
		}
	}]);
	return WFRowHead;
}(_react.Component);

// ------------------- //

// WF TABLE ROW ------------------- //

// ------------------- //

var WFRow = function (_Component2) {
	(0, _inherits3.default)(WFRow, _Component2);

	function WFRow() {
		(0, _classCallCheck3.default)(this, WFRow);
		return (0, _possibleConstructorReturn3.default)(this, (WFRow.__proto__ || (0, _getPrototypeOf2.default)(WFRow)).apply(this, arguments));
	}

	(0, _createClass3.default)(WFRow, [{
		key: 'render',
		value: function render() {
			var _this4 = this;

			var _props2 = this.props,
			    _props2$isVisble = _props2.isVisble,
			    isVisble = _props2$isVisble === undefined ? true : _props2$isVisble,
			    _props2$canSelect = _props2.canSelect,
			    canSelect = _props2$canSelect === undefined ? false : _props2$canSelect,
			    _props2$canDelete = _props2.canDelete,
			    canDelete = _props2$canDelete === undefined ? false : _props2$canDelete,
			    _props2$canAdd = _props2.canAdd,
			    canAdd = _props2$canAdd === undefined ? false : _props2$canAdd,
			    _props2$canOpen = _props2.canOpen,
			    canOpen = _props2$canOpen === undefined ? false : _props2$canOpen,
			    _props2$canEdit = _props2.canEdit,
			    canEdit = _props2$canEdit === undefined ? false : _props2$canEdit,
			    _props2$onAdd = _props2.onAdd,
			    onAdd = _props2$onAdd === undefined ? null : _props2$onAdd,
			    _props2$onEdit = _props2.onEdit,
			    onEdit = _props2$onEdit === undefined ? null : _props2$onEdit,
			    _props2$onOpen = _props2.onOpen,
			    onOpen = _props2$onOpen === undefined ? null : _props2$onOpen,
			    _props2$onSelect = _props2.onSelect,
			    onSelect = _props2$onSelect === undefined ? null : _props2$onSelect,
			    _props2$onDelete = _props2.onDelete,
			    onDelete = _props2$onDelete === undefined ? null : _props2$onDelete,
			    _props2$cellConfig = _props2.cellConfig,
			    cellConfig = _props2$cellConfig === undefined ? {} : _props2$cellConfig,
			    _props2$attributes = _props2.attributes,
			    attributes = _props2$attributes === undefined ? {} : _props2$attributes,
			    _props2$hasShortcode = _props2.hasShortcode,
			    hasShortcode = _props2$hasShortcode === undefined ? false : _props2$hasShortcode,
			    _props2$shortcodeConf = _props2.shortcodeConfig,
			    shortcodeConfig = _props2$shortcodeConf === undefined ? {} : _props2$shortcodeConf,
			    _props2$isChecked = _props2.isChecked,
			    isChecked = _props2$isChecked === undefined ? false : _props2$isChecked,
			    _props2$isOpened = _props2.isOpened,
			    isOpened = _props2$isOpened === undefined ? false : _props2$isOpened,
			    _props2$row = _props2.row,
			    row = _props2$row === undefined ? {} : _props2$row,
			    _props2$rowConfig = _props2.rowConfig,
			    rowConfig = _props2$rowConfig === undefined ? {} : _props2$rowConfig,
			    _props2$customAction = _props2.customAction,
			    customAction = _props2$customAction === undefined ? [] : _props2$customAction;
			var _rowConfig$types2 = rowConfig.types,
			    types = _rowConfig$types2 === undefined ? [] : _rowConfig$types2,
			    _rowConfig$values2 = rowConfig.values,
			    values = _rowConfig$values2 === undefined ? [] : _rowConfig$values2;


			if (!isVisble) return false;

			var hasCellSelected = this.hasCellSelected();
			var _key = (0, _Lodash.now)();
			// previewDirection="bottom",

			return _react2.default.createElement(
				'wf-row',
				null,
				_react2.default.createElement(
					'div',
					{ className: 'wf-r ' + (isChecked ? "_checked" : "") + ' ' + (isOpened ? "_opened" : "") },
					!canSelect ? "" : _react2.default.createElement(_WFTableCell2.default, {
						key: _key + 1,
						row: row,
						type: _Constants.CELL_ACTION,
						action: isOpened ? _Constants.CELL_ACTION_EMPTY : _Constants.CELL_ACTION_CHECK,
						callback: isOpened ? false : onSelect,
						check: isChecked
					}),
					!canDelete ? "" : _react2.default.createElement(_WFTableCell2.default, {
						key: _key + 2,
						row: row,
						type: _Constants.CELL_ACTION,
						action: hasCellSelected ? _Constants.CELL_ACTION_NULL : _Constants.CELL_ACTION_DELETE,
						callback: hasCellSelected ? false : onDelete
					}),
					!canAdd ? "" : _react2.default.createElement(_WFTableCell2.default, {
						key: _key + 3,
						row: row,
						type: _Constants.CELL_ACTION,
						action: hasCellSelected ? _Constants.CELL_ACTION_NULL : _Constants.CELL_ACTION_ADD,
						callback: hasCellSelected ? false : onAdd
					}),
					!canOpen ? "" : _react2.default.createElement(_WFTableCell2.default, {
						key: _key + 4,
						row: row,
						type: _Constants.CELL_ACTION,
						action: hasCellSelected ? _Constants.CELL_ACTION_NULL : _Constants.CELL_ACTION_OPEN,
						callback: hasCellSelected ? false : onOpen,
						open: isOpened
					}),
					!canEdit ? "" : _react2.default.createElement(_WFTableCell2.default, {
						key: _key + 5,
						row: row,
						type: _Constants.CELL_ACTION,
						action: hasCellSelected ? _Constants.CELL_ACTION_NULL : _Constants.CELL_ACTION_EDIT,
						callback: hasCellSelected ? false : onEdit
					}),
					customAction.map(function (custom, i) {
						var type = custom.type,
						    icon = custom.icon,
						    _custom$name = custom.name,
						    name = _custom$name === undefined ? null : _custom$name,
						    _custom$callback = custom.callback,
						    callback = _custom$callback === undefined ? null : _custom$callback;

						return _react2.default.createElement(_WFTableCell2.default, {
							key: _key + 10 + i,
							row: row,
							type: _Constants.CELL_ACTION,
							icon: icon,
							action: hasCellSelected ? _Constants.CELL_ACTION_NULL : _Constants.CELL_ACTION_CUSTOM,
							callback: hasCellSelected ? false : callback
						});
					}),
					types.map(function (type, i) {
						var key = values[i];
						var valAttr = _this4.getAttr(key, attributes);
						var val = _this4.getValue(type, row[key], valAttr);
						var callback = isOpened ? false : hasCellSelected ? false : _this4.getCallbach(key);
						if (_Constants.CELL_FILE === type) {
							callback = false;
						}
						return _react2.default.createElement(_WFTableCell2.default, {
							key: i,
							row: row,
							type: type,
							value: val,
							attributes: valAttr,
							cellConfig: cellConfig,
							callback: callback
						});
					}),
					!hasShortcode ? "" : _react2.default.createElement(_WFTableCell2.default, { key: _key + 6, row: row, type: _Constants.CELL_SHORTCODE, value: this.getShortcode(row) })
				)
			);
		}

		// ------------------- //

	}, {
		key: 'getValue',
		value: function getValue(type, val, attr) {
			if (val) {
				return val;
			} else if ((0, _Lodash.isString)(attr) || (0, _Lodash.isNumber)(attr)) {
				return attr;
			} else {
				return null;
			}
		}

		// ------------------- //

	}, {
		key: 'getAttr',
		value: function getAttr(key, attributes) {
			if ((0, _Lodash.isObject)(attributes) && (0, _keys2.default)(attributes).length > 0 && attributes.hasOwnProperty(key)) {
				return attributes[key];
			} else {
				return null;
			}
		}

		// ------------------- //

	}, {
		key: 'getShortcode',
		value: function getShortcode(row) {
			var _props$shortcodeConfi = this.props.shortcodeConfig,
			    shortcodeConfig = _props$shortcodeConfi === undefined ? {} : _props$shortcodeConfi;
			var _shortcodeConfig$pref = shortcodeConfig.prefix,
			    prefix = _shortcodeConfig$pref === undefined ? "wonderform id=" : _shortcodeConfig$pref,
			    _shortcodeConfig$sufi = shortcodeConfig.sufix,
			    sufix = _shortcodeConfig$sufi === undefined ? "" : _shortcodeConfig$sufi,
			    _shortcodeConfig$prop = shortcodeConfig.prop,
			    prop = _shortcodeConfig$prop === undefined ? "id" : _shortcodeConfig$prop;

			if (!row.hasOwnProperty(prop)) return "";
			return '[' + prefix + row[prop] + sufix + ']';
		}

		// ------------------- //

	}, {
		key: 'getCallbach',
		value: function getCallbach(value) {
			if (!this.hasCallbach(value)) return null;
			var cellCallbacks = this.props.cellCallbacks;

			return cellCallbacks[value];
		}

		// ------------------- //

	}, {
		key: 'hasCallbach',
		value: function hasCallbach(value) {
			var _props$cellCallbacks = this.props.cellCallbacks,
			    cellCallbacks = _props$cellCallbacks === undefined ? false : _props$cellCallbacks;

			return cellCallbacks && cellCallbacks.hasOwnProperty(value);
		}
	}, {
		key: 'hasCellSelected',
		value: function hasCellSelected() {
			var _props$selected = this.props.selected,
			    selected = _props$selected === undefined ? [] : _props$selected;

			return selected.length > 0;
		}
	}]);
	return WFRow;
}(_react.Component);

// ------------------- //

exports.WFRow = WFRow;
exports.WFRowHead = WFRowHead;

// ------------------- //

/***/ }),
/* 362 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF TOOLTIP ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf--container",
    state: {
        ready: ""
    },
    title: "wf--title",
    btn: {
        update: "wf-btn-update",
        cancel: "wf-btn-cancel"
    },
    icon: {
        update: "check",
        cancel: "close"
    }
};

// ------------------- //

var WFTooltip = function (_Component) {
    (0, _inherits3.default)(WFTooltip, _Component);

    function WFTooltip(props) {
        (0, _classCallCheck3.default)(this, WFTooltip);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFTooltip.__proto__ || (0, _getPrototypeOf2.default)(WFTooltip)).call(this, props));

        var _props$isReady = props.isReady,
            isReady = _props$isReady === undefined ? true : _props$isReady;

        _this.state = {
            ready: isReady
        };
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFTooltip, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? false : _props$visible,
                _props$top = _props.top,
                top = _props$top === undefined ? 0 : _props$top,
                _props$left = _props.left,
                left = _props$left === undefined ? 0 : _props$left,
                _props$position = _props.position,
                position = _props$position === undefined ? "fixed" : _props$position;

            if (!visible) return false;
            return _react2.default.createElement(
                "wf-tooltip",
                { style: { position: position } },
                _react2.default.createElement(
                    "div",
                    {
                        className: classes.wrapper,
                        style: {
                            top: top - 31,
                            left: left - 36
                        }
                    },
                    this.getHead(),
                    this.getBody()
                )
            );
        }

        // ------------------- //

    }, {
        key: "getHead",
        value: function getHead() {
            return _react2.default.createElement(
                "wf-tooltip-head",
                null,
                _react2.default.createElement(_WFIcon.WFIAdd, null),
                this.getActions()
            );
        }

        // ------------------- //

    }, {
        key: "getBody",
        value: function getBody() {
            var children = this.props.children;

            return _react2.default.createElement(
                "wf-tooltip-body",
                null,
                this.getTitle(),
                children
            );
        }

        // ------------------- //

    }, {
        key: "getTitle",
        value: function getTitle() {
            var _props$title = this.props.title,
                title = _props$title === undefined ? "" : _props$title;

            return title !== "" ? _react2.default.createElement(
                _WFText2.default,
                { className: classes.title },
                title
            ) : false;
        }

        // ------------------- //

    }, {
        key: "getActions",
        value: function getActions() {
            var _props2 = this.props,
                _props2$onValid = _props2.onValid,
                onValid = _props2$onValid === undefined ? null : _props2$onValid,
                _props2$onCancel = _props2.onCancel,
                onCancel = _props2$onCancel === undefined ? null : _props2$onCancel,
                _props2$loading = _props2.loading,
                loading = _props2$loading === undefined ? false : _props2$loading;
            var ready = this.state.ready;

            if (loading) return false;
            return _react2.default.createElement(
                "wf-tooltip-action",
                null,
                _react2.default.createElement(
                    _WFRow2.default,
                    null,
                    _react2.default.createElement(
                        _WFCol2.default,
                        { xs: "6", reset: true },
                        _react2.default.createElement(_WFBtn2.default, {
                            disable: !ready,
                            onClick: function onClick() {
                                return (0, _Lodash.isFunction)(onValid) ? onValid() : "";
                            },
                            className: classes.btn.update + " " + (ready ? classes.state.ready : ""),
                            icon: classes.icon.update
                        })
                    ),
                    _react2.default.createElement(
                        _WFCol2.default,
                        { xs: "6", reset: true },
                        _react2.default.createElement(_WFBtn2.default, {
                            onClick: function onClick() {
                                return (0, _Lodash.isFunction)(onCancel) ? onCancel() : "";
                            },
                            className: classes.btn.cancel,
                            icon: classes.icon.cancel
                        })
                    )
                )
            );
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: "componentWillReceiveProps",
        value: function componentWillReceiveProps(nextProps) {
            if (nextProps.isReady !== this.state.ready) {
                this.setState({
                    ready: nextProps.isReady
                });
            }
        }
    }]);
    return WFTooltip;
}(_react.Component);

// ------------------- //

exports.default = WFTooltip;

// ------------------- //

/***/ }),
/* 363 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _Constants = __webpack_require__(41);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF VIDEO HTML5 ------------------- //

// ------------------- //

var PLAYER_VIDEO = "PlayerVideo";

// ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf-form-wrapper"
};

// ------------------- //

var WFVideoHTML5 = function (_Component) {
    (0, _inherits3.default)(WFVideoHTML5, _Component);

    function WFVideoHTML5(props) {
        (0, _classCallCheck3.default)(this, WFVideoHTML5);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFVideoHTML5.__proto__ || (0, _getPrototypeOf2.default)(WFVideoHTML5)).call(this, props));

        var _props$loop = props.loop,
            loop = _props$loop === undefined ? true : _props$loop,
            _props$autoPlay = props.autoPlay,
            autoPlay = _props$autoPlay === undefined ? true : _props$autoPlay,
            _props$muted = props.muted,
            muted = _props$muted === undefined ? true : _props$muted,
            _props$preload = props.preload,
            preload = _props$preload === undefined ? "auto" : _props$preload,
            _props$width = props.width,
            width = _props$width === undefined ? "100%" : _props$width,
            _props$hasHeigth = props.hasHeigth,
            hasHeigth = _props$hasHeigth === undefined ? "auto" : _props$hasHeigth;


        _this.state = {

            loop: loop,
            autoPlay: autoPlay,
            muted: muted,
            preload: preload,

            width: width,
            height: hasHeigth
        };

        _this.player;
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFVideoHTML5, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className,
                _props$context = _props.context,
                context = _props$context === undefined ? {} : _props$context;
            var _context$poster = context.poster,
                poster = _context$poster === undefined ? "" : _context$poster,
                _context$mp = context.mp4,
                mp4 = _context$mp === undefined ? "" : _context$mp,
                _context$webm = context.webm,
                webm = _context$webm === undefined ? "" : _context$webm,
                _context$ogv = context.ogv,
                ogv = _context$ogv === undefined ? "" : _context$ogv;

            if (!visible) return false;
            return _react2.default.createElement(
                'wf-video-html5',
                null,
                _react2.default.createElement(
                    'video',
                    (0, _extends3.default)({
                        ref: PLAYER_VIDEO,
                        poster: poster,
                        className: className
                    }, this.state),
                    this.get(mp4, _Constants.TYPE_MP4),
                    this.get(webm, _Constants.TYPE_WEBM),
                    this.get(ogv, _Constants.TYPE_OGV)
                )
            );
        }

        // ------------------- //

    }, {
        key: 'get',
        value: function get(fileURL, fileType) {
            if (this.fileNotValid(fileURL)) return false;
            return _react2.default.createElement('source', { src: fileURL, type: fileType });
        }

        // ------------------- //

    }, {
        key: 'fileNotValid',
        value: function fileNotValid(fileURL) {
            return !fileURL || fileURL === "";
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: 'componentWillReceiveProps',
        value: function componentWillReceiveProps(nextProps) {
            if (nextProps.hasHeigth !== this.state.height) {
                this.setState({
                    height: nextProps.hasHeigth
                });
            }
            if (this.player) {
                !nextProps.isPlaying ? this.player.pause() : this.player.play();
            }
        }

        // -------------- //

    }, {
        key: 'componentDidMount',
        value: function componentDidMount() {
            this.player = _reactDom2.default.findDOMNode(this.refs[PLAYER_VIDEO]);
        }
    }]);
    return WFVideoHTML5;
}(_react.Component);

// ------------------- //

exports.default = WFVideoHTML5;

// ------------------- //

/***/ }),
/* 364 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getContentEditableMenuActions = undefined;

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM STEP ------------------- //

// ------------------- //

var classes = {};

var ACTION_DELETE = 1;
var ACTION_EDIT_CONFIG = 2;
var ACTION_EDIT_OPTIONS = 3;
var ACTION_EDIT_GRID = 4;
var ACTION_EDIT_VALIDATOR = 5;
var ACTION_EDIT_VISIBLE = 6;

var getContentEditableMenuActions = exports.getContentEditableMenuActions = function getContentEditableMenuActions() {
  return {
    ACTION_DELETE: ACTION_DELETE,
    ACTION_EDIT_CONFIG: ACTION_EDIT_CONFIG,
    ACTION_EDIT_OPTIONS: ACTION_EDIT_OPTIONS,
    ACTION_EDIT_GRID: ACTION_EDIT_GRID,
    ACTION_EDIT_VALIDATOR: ACTION_EDIT_VALIDATOR,
    ACTION_EDIT_VISIBLE: ACTION_EDIT_VISIBLE
  };
};

// ------------------- //

var WFieldEditableMenu = function (_Component) {
  (0, _inherits3.default)(WFieldEditableMenu, _Component);

  function WFieldEditableMenu() {
    (0, _classCallCheck3.default)(this, WFieldEditableMenu);
    return (0, _possibleConstructorReturn3.default)(this, (WFieldEditableMenu.__proto__ || (0, _getPrototypeOf2.default)(WFieldEditableMenu)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFieldEditableMenu, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          name = _props.name,
          children = _props.children;

      return _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          'wf-content-editor',
          null,
          _react2.default.createElement(
            'wf-content-tools',
            null,
            this.getActions()
          )
        ),
        children
      );
    }
  }, {
    key: 'getActions',
    value: function getActions() {
      var _props2 = this.props,
          _props2$schema = _props2.schema,
          schema = _props2$schema === undefined ? [] : _props2$schema,
          onDelete = _props2.onDelete,
          onEditConfig = _props2.onEditConfig,
          onEditOption = _props2.onEditOption,
          onEditGrid = _props2.onEditGrid,
          onEditValidator = _props2.onEditValidator,
          onEditVisible = _props2.onEditVisible;

      return schema.map(function (action, i) {
        var _React$createElement;

        var key = i + '_' + action;
        switch (action) {
          case ACTION_DELETE:
            return _react2.default.createElement(_WFIcon.WFIClose, {
              key: key,
              className: "pull-right btn-close",
              onClick: function onClick() {
                return onDelete();
              }
            });
            break;

          case ACTION_EDIT_CONFIG:
            return _react2.default.createElement(_WFIcon.WFIcon, {
              key: key,
              icon: "cog",
              onClick: function onClick() {
                return onEditConfig();
              }
            });
            break;

          case ACTION_EDIT_OPTIONS:
            return _react2.default.createElement(_WFIcon.WFIcon, {
              key: key,
              icon: "menu",
              onClick: function onClick() {
                return onEditOption();
              }
            });
            break;

          case ACTION_EDIT_GRID:
            return _react2.default.createElement(_WFIcon.WFIcon, {
              key: key,
              icon: "equalizer",
              onClick: function onClick() {
                return onEditGrid();
              }
            });
            break;

          case ACTION_EDIT_VALIDATOR:
            return _react2.default.createElement(_WFIcon.WFIcon, {
              key: key,
              icon: "police",
              className: "btn-required",
              onClick: function onClick() {
                return onEditValidator();
              }
            });
            break;

          // todo charly for content
          case ACTION_EDIT_VISIBLE:
            return _react2.default.createElement(_WFIcon.WFIcon, (_React$createElement = {
              key: key,
              icon: "eye2"
            }, (0, _defineProperty3.default)(_React$createElement, 'icon', "eye2"), (0, _defineProperty3.default)(_React$createElement, 'className', 'active pull-right'), (0, _defineProperty3.default)(_React$createElement, 'onClick', function onClick() {
              return onEditVisible();
            }), _React$createElement));
            break;

          default:
            return false;
        }
      });
    }
  }]);
  return WFieldEditableMenu;
}(_react.Component);

// ------------------- //


exports.default = WFieldEditableMenu;
// ------------------- //

/***/ }),
/* 365 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFError = __webpack_require__(212);

var _WFError2 = _interopRequireDefault(_WFError);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFRequired = __webpack_require__(358);

var _WFRequired2 = _interopRequireDefault(_WFRequired);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FIELD LABEL ------------------- //

// ------------------- //

var classes = {
  inline: "wf-inline"
};

// ------------------- //

var WFieldLabel = function (_Component) {
  (0, _inherits3.default)(WFieldLabel, _Component);

  function WFieldLabel() {
    (0, _classCallCheck3.default)(this, WFieldLabel);
    return (0, _possibleConstructorReturn3.default)(this, (WFieldLabel.__proto__ || (0, _getPrototypeOf2.default)(WFieldLabel)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFieldLabel, [{
    key: 'render',
    value: function render() {
      var _props$visible = this.props.visible,
          visible = _props$visible === undefined ? true : _props$visible;

      if (!visible) return false;
      var _props = this.props,
          children = _props.children,
          _props$styles = _props.styles,
          styles = _props$styles === undefined ? {} : _props$styles,
          _props$isInline = _props.isInline,
          isInline = _props$isInline === undefined ? false : _props$isInline,
          _props$isEditable = _props.isEditable,
          isEditable = _props$isEditable === undefined ? false : _props$isEditable,
          _props$required = _props.required,
          required = _props$required === undefined ? false : _props$required,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? false : _props$valid,
          _props$errors = _props.errors,
          errors = _props$errors === undefined ? [] : _props$errors;
      var _styles$label = styles.label,
          label = _styles$label === undefined ? {} : _styles$label,
          _styles$labelText = styles.labelText,
          labelText = _styles$labelText === undefined ? {} : _styles$labelText,
          _styles$labelRequired = styles.labelRequired,
          labelRequired = _styles$labelRequired === undefined ? {} : _styles$labelRequired;

      return _react2.default.createElement(
        'wf-label',
        { style: label },
        _react2.default.createElement(
          'label',
          { className: isInline ? classes.inline : "" },
          _react2.default.createElement(
            _WFText2.default,
            {
              html: true,
              style: labelText
            },
            children
          ),
          _react2.default.createElement(_WFRequired2.default, {
            style: labelRequired,
            required: required
          }),
          this.getCounter(),
          _react2.default.createElement(_WFError2.default, {
            errors: errors
            //errors={isEditable?[]:errors}
          })
        )
      );
    }
  }, {
    key: 'getCounter',
    value: function getCounter() {
      var _props2 = this.props,
          _props2$type = _props2.type,
          type = _props2$type === undefined ? null : _props2$type,
          _props2$focused = _props2.focused,
          focused = _props2$focused === undefined ? false : _props2$focused,
          _props2$required = _props2.required,
          required = _props2$required === undefined ? false : _props2$required,
          _props2$counter = _props2.counter,
          counter = _props2$counter === undefined ? 0 : _props2$counter,
          minLength = _props2.minLength,
          maxLength = _props2.maxLength;

      var min = minLength;
      var max = maxLength;
      if (type === "string" && !focused || type === "text" && !focused) {
        return false;
      }
      if (max === "" || max === 0 || min === 0 && max === 0 || min === 1 && max === 1 || counter === max && type.includes("select")) {
        return false;
      } else {
        return _react2.default.createElement(_WFCounter2.default, {
          visible: required,
          counter: counter,
          min: minLength,
          max: maxLength,
          parenthesis: false
          //all={true}
        });
      }
    }
  }]);
  return WFieldLabel;
}(_react.Component);

// ------------------- //

exports.default = WFieldLabel;

// ------------------- //

/***/ }),
/* 366 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FIELD LEGEND ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFieldLegend = function (_Component) {
    (0, _inherits3.default)(WFieldLegend, _Component);

    function WFieldLegend() {
        (0, _classCallCheck3.default)(this, WFieldLegend);
        return (0, _possibleConstructorReturn3.default)(this, (WFieldLegend.__proto__ || (0, _getPrototypeOf2.default)(WFieldLegend)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFieldLegend, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                children = _props.children,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$style = _props.style,
                style = _props$style === undefined ? {} : _props$style;

            if (!visible) return false;
            return _react2.default.createElement('wf-legend', { style: style, dangerouslySetInnerHTML: { __html: children } });
        }
    }]);
    return WFieldLegend;
}(_react.Component);

// ------------------- //

exports.default = WFieldLegend;

// ------------------- //

/***/ }),
/* 367 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM CONTAINER ------------------- //

// ------------------- //

var classes = {
    wrapper: "wf-form-content",
    vertical: {
        wrapper: "wf-inner",
        container: "wf-inner-container"
    }
};

// ------------------- //

var WFormContainer = function (_Component) {
    (0, _inherits3.default)(WFormContainer, _Component);

    function WFormContainer(props) {
        (0, _classCallCheck3.default)(this, WFormContainer);

        var _this = (0, _possibleConstructorReturn3.default)(this, (WFormContainer.__proto__ || (0, _getPrototypeOf2.default)(WFormContainer)).call(this, props));

        var _props$height = props.height,
            height = _props$height === undefined ? 0 : _props$height;

        _this.state = {
            height: height
        };
        return _this;
    }

    // ------------------- //

    (0, _createClass3.default)(WFormContainer, [{
        key: "render",
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? false : _props$visible,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className;

            if (!visible) return false;
            return _react2.default.createElement(
                "wf-form-container",
                null,
                _react2.default.createElement(
                    "div",
                    { className: classes.wrapper + " " + className + " font" },
                    this.getContent()
                )
            );
        }

        // ------------------- //

    }, {
        key: "getContent",
        value: function getContent() {
            var _props2 = this.props,
                _props2$isActive = _props2.isActive,
                isActive = _props2$isActive === undefined ? true : _props2$isActive,
                _props2$children = _props2.children,
                children = _props2$children === undefined ? "" : _props2$children;

            if (!isActive) {
                return children;
            } else {
                return _react2.default.createElement(
                    "div",
                    { style: { height: this.state.height },
                        className: classes.vertical.wrapper },
                    _react2.default.createElement(
                        "div",
                        { className: classes.vertical.container },
                        this.props.children
                    )
                );
            }
        }

        // ------------------- //


        // COMPONENT LIFECYCLE ------------------- //


        // ------------------- //

    }, {
        key: "componentWillReceiveProps",
        value: function componentWillReceiveProps(nextProps) {
            if (nextProps.height !== this.state.height) {
                this.setState({
                    height: nextProps.height
                });
            }
        }
    }]);
    return WFormContainer;
}(_react.Component);

// ------------------- //

exports.default = WFormContainer;

// ------------------- //

/***/ }),
/* 368 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFClear = __webpack_require__(98);

var _WFClear2 = _interopRequireDefault(_WFClear);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM CONTENT BUILDER  ------------------- //

// ------------------- //

var classes = {};

var WContentBuilder = function (_Component) {
  (0, _inherits3.default)(WContentBuilder, _Component);

  function WContentBuilder(props) {
    (0, _classCallCheck3.default)(this, WContentBuilder);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WContentBuilder.__proto__ || (0, _getPrototypeOf2.default)(WContentBuilder)).call(this, props));

    var _props$current = props.current,
        current = _props$current === undefined ? "" : _props$current,
        _props$schema = props.schema,
        schema = _props$schema === undefined ? [] : _props$schema;

    _this.state = {
      open: false,
      current: current,
      schema: schema
    };
    return _this;
  }

  (0, _createClass3.default)(WContentBuilder, [{
    key: 'render',
    value: function render() {
      var open = this.state.open;

      return _react2.default.createElement(
        'wf-content-builder',
        null,
        _react2.default.createElement(
          'div',
          { className: 'wf-builder-wrapper ' + (open ? 'wf-active' : "") },
          this.getBtnToggle(),
          this.getSelection()
        )
      );
    }
  }, {
    key: 'getBtnToggle',
    value: function getBtnToggle() {
      return _react2.default.createElement(
        'div',
        {
          onClick: this.onToggle.bind(this),
          className: 'wf--toggle-btn' },
        _react2.default.createElement('span', { className: 'wf-icon-close' })
      );
    }
  }, {
    key: 'getSelection',
    value: function getSelection() {
      var _this2 = this;

      return this.state.schema.map(function (ctx, idx) {
        var _ctx$title = ctx.title,
            title = _ctx$title === undefined ? "" : _ctx$title,
            _ctx$name = ctx.name,
            name = _ctx$name === undefined ? "" : _ctx$name,
            _ctx$type = ctx.type,
            type = _ctx$type === undefined ? "" : _ctx$type,
            _ctx$data = ctx.data,
            data = _ctx$data === undefined ? [] : _ctx$data;

        if (name !== _this2.state.current) {
          return false;
        } else {
          if (type === "icon") {
            return _this2.getIconGroup(data, idx);
          } else {
            return _this2.getButtonGroup(data, idx);
          }
        }
      });
    }
    /*
    WFBtn
    WFIcon
    */

  }, {
    key: 'getButtonGroup',
    value: function getButtonGroup(data, idx) {
      var _this3 = this;

      var open = this.state.open;

      return _react2.default.createElement(
        'wf-btn-selection',
        { key: idx },
        data.map(function (val, i) {
          return _react2.default.createElement(
            _WFBtn2.default,
            { key: i,
              className: 'wf-btn-yellow wf-btn-large wf-btn-' + i + ' fade ' + (open ? "in" : ""),
              onClick: function onClick() {
                return _this3.props.onSelect(_this3, val);
              } },
            val.label
          );
        })
      );
    }
  }, {
    key: 'getIconGroup',
    value: function getIconGroup(data, idx) {
      var _this4 = this;

      var open = this.state.open;

      var l = data.length;
      return _react2.default.createElement(
        'wf-icon-selection',
        { key: idx },
        data.map(function (val, i) {
          return _react2.default.createElement(_WFIcon.WFIcon, { key: i,
            className: 'fade ' + (open ? "in" : "") + ' wf-mid-' + i,
            icon: val.icon,
            onClick: function onClick() {
              return _this4.props.onSelect(_this4, val);
            }
          });
        })
      );
    }
  }, {
    key: 'onToggle',
    value: function onToggle() {
      var open = this.state.open;

      this.setState({
        open: !open
      });
    }
  }]);
  return WContentBuilder;
}(_react.Component);

// ------------------- //


exports.default = WContentBuilder;
// ------------------- //

/***/ }),
/* 369 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WFormResultCustom = exports.WFormResultSuccess = exports.WFormResultError = undefined;

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _objectDestructuringEmpty2 = __webpack_require__(507);

var _objectDestructuringEmpty3 = _interopRequireDefault(_objectDestructuringEmpty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFError = __webpack_require__(212);

var _WFError2 = _interopRequireDefault(_WFError);

var _WFLoader = __webpack_require__(99);

var _WFLoader2 = _interopRequireDefault(_WFLoader);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFBtnGroup = __webpack_require__(97);

var _WFBtnGroup2 = _interopRequireDefault(_WFBtnGroup);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM RESULT  ------------------- //

// ------------------- //

var classes = {
  icon: "wf-result-icon",
  title: "wf-result-title",
  message: "wf-result-message",
  messages: "wf-result-messages",
  btn: "wf-result-btn",
  close: "wf-result-close"
};

// ------------------- //

var WFormResult = function (_Component) {
  (0, _inherits3.default)(WFormResult, _Component);

  function WFormResult() {
    (0, _classCallCheck3.default)(this, WFormResult);
    return (0, _possibleConstructorReturn3.default)(this, (WFormResult.__proto__ || (0, _getPrototypeOf2.default)(WFormResult)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFormResult, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          _props$className = _props.className,
          className = _props$className === undefined ? "" : _props$className,
          _props$isError = _props.isError,
          isError = _props$isError === undefined ? false : _props$isError,
          _props$isCustom = _props.isCustom,
          isCustom = _props$isCustom === undefined ? false : _props$isCustom;

      if (isError) {
        return _react2.default.createElement(
          'wf-form-result',
          null,
          _react2.default.createElement(
            'wf-form-error',
            null,
            this.getHeader(),
            this.props.children
          )
        );
      } else if (isCustom) {
        return _react2.default.createElement(
          'div',
          { className: className },
          _react2.default.createElement(
            'wf-form-result',
            null,
            _react2.default.createElement(
              'wf-form-custom',
              null,
              this.getHeader(),
              this.props.children
            )
          )
        );
      } else {
        return _react2.default.createElement(
          'wf-form-result',
          null,
          _react2.default.createElement(
            'wf-form-success',
            null,
            this.getHeader(),
            this.props.children
          )
        );
      }
    }
  }, {
    key: 'getHeader',
    value: function getHeader() {
      var _props2 = this.props,
          _props2$title = _props2.title,
          title = _props2$title === undefined ? "" : _props2$title,
          _props2$message = _props2.message,
          message = _props2$message === undefined ? "" : _props2$message,
          onClose = _props2.onClose,
          _props2$isCustom = _props2.isCustom,
          isCustom = _props2$isCustom === undefined ? false : _props2$isCustom;

      return _react2.default.createElement(
        _WFRow2.default,
        null,
        isCustom ? _react2.default.createElement(_WFIcon.WFIClose, {
          onClick: function onClick() {
            return onClose();
          },
          className: classes.close }) : "",
        _react2.default.createElement(
          _WFCol2.default,
          null,
          this.getIcon()
        ),
        _react2.default.createElement(
          _WFCol2.default,
          null,
          _react2.default.createElement(
            _WFText2.default,
            { className: classes.title },
            title
          ),
          _react2.default.createElement(
            _WFText2.default,
            { className: classes.message },
            message
          )
        )
      );
    }
  }, {
    key: 'getIcon',
    value: function getIcon() {
      var _props3 = this.props,
          _props3$icon = _props3.icon,
          icon = _props3$icon === undefined ? "check" : _props3$icon,
          _props3$loader = _props3.loader,
          loader = _props3$loader === undefined ? false : _props3$loader,
          _props3$isError = _props3.isError,
          isError = _props3$isError === undefined ? false : _props3$isError;

      if (loader) {
        return _react2.default.createElement(_WFLoader2.default, null);
      } else if (isError) {
        return _react2.default.createElement(_WFIcon.WFIClose, { className: classes.icon });
      } else {
        return _react2.default.createElement(_WFIcon.WFIcon, { icon: icon, className: classes.icon });
      }
    }
  }]);
  return WFormResult;
}(_react.Component);

// ------------------- //

// WF RESULT ERROR  ------------------- //

// ------------------- //

var WFormResultError = function (_Component2) {
  (0, _inherits3.default)(WFormResultError, _Component2);

  function WFormResultError() {
    (0, _classCallCheck3.default)(this, WFormResultError);
    return (0, _possibleConstructorReturn3.default)(this, (WFormResultError.__proto__ || (0, _getPrototypeOf2.default)(WFormResultError)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFormResultError, [{
    key: 'render',
    value: function render() {
      (0, _objectDestructuringEmpty3.default)(this.props);

      return _react2.default.createElement(
        WFormResult,
        (0, _extends3.default)({
          isError: true
        }, this.props),
        this.getBody()
      );
    }
  }, {
    key: 'getBody',
    value: function getBody() {
      var _props4 = this.props,
          onEdit = _props4.onEdit,
          btnLabel = _props4.btnLabel,
          _props4$errors = _props4.errors,
          errors = _props4$errors === undefined ? [] : _props4$errors;

      return _react2.default.createElement(
        'span',
        null,
        _react2.default.createElement(_WFError2.default, {
          errors: errors
        }),
        btnLabel ? _react2.default.createElement(
          _WFBtn2.default,
          { onClick: function onClick() {
              return onEdit();
            } },
          btnLabel
        ) : ""
      );
    }
  }]);
  return WFormResultError;
}(_react.Component);

// ------------------- //

// WF RESULT SUCCESS ------------------- //

// ------------------- //

var WFormResultSuccess = function (_Component3) {
  (0, _inherits3.default)(WFormResultSuccess, _Component3);

  function WFormResultSuccess() {
    (0, _classCallCheck3.default)(this, WFormResultSuccess);
    return (0, _possibleConstructorReturn3.default)(this, (WFormResultSuccess.__proto__ || (0, _getPrototypeOf2.default)(WFormResultSuccess)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFormResultSuccess, [{
    key: 'render',
    value: function render() {
      (0, _objectDestructuringEmpty3.default)(this.props);

      return _react2.default.createElement(
        WFormResult,
        this.props,
        this.getMessages(),
        this.getActions()
      );
    }
  }, {
    key: 'getMessages',
    value: function getMessages() {
      var _props$messages = this.props.messages,
          messages = _props$messages === undefined ? [] : _props$messages;

      if (messages.length === 0) {
        return false;
      } else {
        return _react2.default.createElement(
          'wf-form-success-messages',
          null,
          _react2.default.createElement(_WFList2.default, {
            rows: messages,
            view: function view(message) {
              return _react2.default.createElement(
                'span',
                null,
                message
              );
            }
          })
        );
      }
    }
  }, {
    key: 'getActions',
    value: function getActions() {
      var _props$actions = this.props.actions,
          actions = _props$actions === undefined ? [] : _props$actions;

      if (actions.length === 0) {
        return false;
      } else {
        return _react2.default.createElement(
          'wf-form-success-actions',
          null,
          _react2.default.createElement(_WFBtnGroup2.default, {
            visible: true,
            schema: actions
          })
        );
      }
    }
  }]);
  return WFormResultSuccess;
}(_react.Component);

// ------------------- //

// WF RESULT CUSTOM ------------------- //

// ------------------- //

var WFormResultCustom = function (_Component4) {
  (0, _inherits3.default)(WFormResultCustom, _Component4);

  function WFormResultCustom() {
    (0, _classCallCheck3.default)(this, WFormResultCustom);
    return (0, _possibleConstructorReturn3.default)(this, (WFormResultCustom.__proto__ || (0, _getPrototypeOf2.default)(WFormResultCustom)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFormResultCustom, [{
    key: 'render',
    value: function render() {
      var getCustomComponent = this.props.getCustomComponent;

      return _react2.default.createElement(
        WFormResult,
        (0, _extends3.default)({
          isCustom: true
        }, this.props, this.state),
        getCustomComponent(this)
      );
    }
  }]);
  return WFormResultCustom;
}(_react.Component);

// ------------------- //

exports.WFormResultError = WFormResultError;
exports.WFormResultSuccess = WFormResultSuccess;
exports.WFormResultCustom = WFormResultCustom;

// ------------------- //

/***/ }),
/* 370 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFBoxed = __webpack_require__(210);

var _WFBoxed2 = _interopRequireDefault(_WFBoxed);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFChartistGraph = __webpack_require__(211);

var _WFChartistGraph2 = _interopRequireDefault(_WFChartistGraph);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ANALYTICS GLOBAL ------------------- //

// ------------------- //

var WFormResultsAnalytic = function (_Component) {
  (0, _inherits3.default)(WFormResultsAnalytic, _Component);

  function WFormResultsAnalytic(props) {
    (0, _classCallCheck3.default)(this, WFormResultsAnalytic);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFormResultsAnalytic.__proto__ || (0, _getPrototypeOf2.default)(WFormResultsAnalytic)).call(this, props));

    _this.displayName = "WFormResultsAnalytic";
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(WFormResultsAnalytic, [{
    key: "render",
    value: function render() {
      return this.getFieldAnalytics();
    }
  }, {
    key: "getFieldArchive",
    value: function getFieldArchive() {
      var _this2 = this;

      var _state = this.state,
          _state$fields = _state.fields,
          fields = _state$fields === undefined ? [] : _state$fields,
          _state$currentField = _state.currentField,
          currentField = _state$currentField === undefined ? null : _state$currentField;

      return _react2.default.createElement(
        _WFCol2.default,
        { md: 12 },
        _react2.default.createElement(
          "span",
          { className: "wf-select" },
          _react2.default.createElement(
            "select",
            {
              value: currentField,
              onChange: function onChange(e) {
                var field = fields.filter(function (f) {
                  return f.entry_id == e.target.value;
                });
                _this2.props.onSelect(field[0]);
              } },
            fields.map(function (field, i) {
              var entry_id = field.entry_id,
                  _field$label = field.label,
                  label = _field$label === undefined ? "" : _field$label;

              return _react2.default.createElement(
                "option",
                { key: i, value: entry_id },
                label
              );
            })
          ),
          _react2.default.createElement(_WFIcon.WFIDown, null)
        )
      );
    }
  }, {
    key: "getFieldAnalytics",
    value: function getFieldAnalytics() {
      var _state2 = this.state,
          page_loader = _state2.page_loader,
          _state2$fields = _state2.fields,
          fields = _state2$fields === undefined ? [] : _state2$fields,
          currentField = _state2.currentField,
          currentFieldValue = _state2.currentFieldValue,
          currentOptionLabels = _state2.currentOptionLabels,
          currentOptionSeries = _state2.currentOptionSeries;

      var sum = function sum(a, b) {
        return a + b;
      };
      var data = {
        labels: currentOptionLabels, // ['Chrome', 'Firefox', 'Android', 'AppleWebkit', 'Safari', 'MSIE', 'Opera', 'Unknown', 'WhatsApp', 'Opera Next', 'Others' ],
        series: currentOptionSeries // [ 2500, 1600, 1200, 400, 350, 200, 150, 150, 150, 150, 150 ]
      };
      var _currentFieldValue$la = currentFieldValue.label,
          label = _currentFieldValue$la === undefined ? "" : _currentFieldValue$la;

      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFBoxed2.default,
          null,
          this.getFieldArchive(),
          _react2.default.createElement(
            _WFCol2.default,
            { md: 7 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(_WFChartistGraph2.default, {
                data: data,
                type: 'Pie',
                wrapperClassName: "wf--chart-pie",
                options: {
                  height: '500px',
                  donut: true,
                  donutWidth: 120,
                  startAngle: 270,
                  labelInterpolationFnc: function labelInterpolationFnc(value, index) {
                    var num = Math.round(data.series[index] / data.series.reduce(sum) * 100);
                    return num >= 5 ? num + "%" : ''; //`${value} ${num}%`;
                  }
                }
              })
            )
          ),
          _react2.default.createElement(
            _WFCol2.default,
            { md: 5 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                "div",
                { className: "wf--chart wf--chart-pie" },
                _react2.default.createElement(
                  _WFScrollBars2.default,
                  {
                    className: "wf-scrollbar-chart",
                    style: {
                      width: '100%',
                      height: '520px',
                      background: "none !important"
                    }
                  },
                  _react2.default.createElement(_WFList2.default, {
                    rows: data.labels,
                    rowsClassName: "wf-fields-options",
                    view: function view(label, i) {
                      var num = Math.round(data.series[i] / data.series.reduce(sum) * 100);
                      var purcentage = num + "%";
                      return _react2.default.createElement(
                        "div",
                        { className: "wf--chart--option" },
                        _react2.default.createElement("span", { className: "wf--color wf--color-" + i }),
                        _react2.default.createElement("span", { className: "wf--value", dangerouslySetInnerHTML: { __html: purcentage } }),
                        _react2.default.createElement(
                          "span",
                          { className: "wf--label" },
                          label
                        )
                      );
                    }
                  })
                )
              )
            )
          )
        )
      );
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      this.props.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.props.willUnMount(this);
    }
  }]);
  return WFormResultsAnalytic;
}(_react.Component);

// WFCOMPONENT

exports.default = WFormResultsAnalytic;

/***/ }),
/* 371 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FORM STEP ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFormStep = function (_Component) {
    (0, _inherits3.default)(WFormStep, _Component);

    function WFormStep() {
        (0, _classCallCheck3.default)(this, WFormStep);
        return (0, _possibleConstructorReturn3.default)(this, (WFormStep.__proto__ || (0, _getPrototypeOf2.default)(WFormStep)).apply(this, arguments));
    }

    (0, _createClass3.default)(WFormStep, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                _props$visible = _props.visible,
                visible = _props$visible === undefined ? true : _props$visible,
                _props$className = _props.className,
                className = _props$className === undefined ? "" : _props$className;

            if (!visible) return false;
            return _react2.default.createElement(
                'wf-form-step',
                null,
                _react2.default.createElement(
                    _WFRow2.default,
                    { className: className },
                    this.props.children
                )
            );
        }
    }]);
    return WFormStep;
}(_react.Component);

// ------------------- //

exports.default = WFormStep;

// ------------------- //

/***/ }),
/* 372 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormStepHelper = __webpack_require__(221);

var _WFormStepHelper2 = _interopRequireDefault(_WFormStepHelper);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormNavHelper = function () {
  function WFormNavHelper() {
    (0, _classCallCheck3.default)(this, WFormNavHelper);
  }

  (0, _createClass3.default)(WFormNavHelper, null, [{
    key: "getNavState",
    value: function getNavState(wfCpt) {
      var _wfCpt$state$prevBtn = wfCpt.state.prevBtn,
          prevBtn = _wfCpt$state$prevBtn === undefined ? true : _wfCpt$state$prevBtn;

      var _WFormStepHelper$getS = _WFormStepHelper2.default.getStepState(wfCpt),
          _WFormStepHelper$getS2 = _WFormStepHelper$getS.isFirst,
          isFirst = _WFormStepHelper$getS2 === undefined ? true : _WFormStepHelper$getS2,
          _WFormStepHelper$getS3 = _WFormStepHelper$getS.isLast,
          isLast = _WFormStepHelper$getS3 === undefined ? false : _WFormStepHelper$getS3,
          _WFormStepHelper$getS4 = _WFormStepHelper$getS.isUniq,
          isUniq = _WFormStepHelper$getS4 === undefined ? true : _WFormStepHelper$getS4;

      var Grid = {};
      var Btn = {};
      // Set Layout
      if (isUniq || isFirst) {
        Grid.left = 0;
        Grid.right = 12;
      } else {
        Grid.left = 6;
        Grid.right = 6;
      }
      // Toggle Btn
      Btn.prev = prevBtn && !isFirst && !isUniq;
      Btn.next = !isUniq && !isLast;
      Btn.submit = isUniq || isLast;
      return {
        Grid: Grid,
        Btn: Btn
      };
    }
  }]);
  return WFormNavHelper;
}();

exports.default = WFormNavHelper;

/***/ }),
/* 373 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFConstants = __webpack_require__(58);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormStatusHelper = function () {
  function WFormStatusHelper() {
    (0, _classCallCheck3.default)(this, WFormStatusHelper);
  }

  (0, _createClass3.default)(WFormStatusHelper, null, [{
    key: "isLoading",
    value: function isLoading(wfCpt) {
      return wfCpt.state.status === _WFConstants.WF_STATUS_LOADING;
    }
  }, {
    key: "isEditing",
    value: function isEditing(wfCpt) {
      return wfCpt.state.status === _WFConstants.WF_STATUS_EDITING;
    }
  }, {
    key: "isPublished",
    value: function isPublished(wfCpt) {
      return wfCpt.state.status === _WFConstants.WF_STATUS_SUCCESS;
    }
  }, {
    key: "hasError",
    value: function hasError(wfCpt) {
      return wfCpt.state.status === _WFConstants.WF_STATUS_ERROR;
    }
  }, {
    key: "getContent",
    value: function getContent() {
      var contents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var wfCpt = arguments[1];
      var _wfCpt$state$status = wfCpt.state.status,
          status = _wfCpt$state$status === undefined ? _WFConstants.WF_STATUS_LOADING : _wfCpt$state$status;
      var loaderView = contents.loaderView,
          editView = contents.editView,
          resultErrorView = contents.resultErrorView,
          resultSuccessView = contents.resultSuccessView,
          resultCustomView = contents.resultCustomView;

      switch (status) {

        case _WFConstants.WF_STATUS_LOADING:
          return loaderView();

        case _WFConstants.WF_STATUS_EDITING:
          return editView();

        case _WFConstants.WF_STATUS_ERROR:
          return resultErrorView();

        case _WFConstants.WF_STATUS_SUCCESS:
          return resultSuccessView();

        case _WFConstants.WF_STATUS_CUSTOM:
          return resultCustomView();

        default:
          return false;
      }
    }
  }]);
  return WFormStatusHelper;
}(); // FORM CONSTANTS


exports.default = WFormStatusHelper;

/***/ }),
/* 374 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormVideoHelper = function () {
  function WFormVideoHelper() {
    (0, _classCallCheck3.default)(this, WFormVideoHelper);
  }

  (0, _createClass3.default)(WFormVideoHelper, null, [{
    key: "getCtxHTML5",
    value: function getCtxHTML5(wfCpt) {
      var _wfCpt$state = wfCpt.state,
          cover_video_poster = _wfCpt$state.cover_video_poster,
          cover_video_mp4 = _wfCpt$state.cover_video_mp4,
          cover_video_webm = _wfCpt$state.cover_video_webm,
          cover_video_ogv = _wfCpt$state.cover_video_ogv;

      return {
        poster: cover_video_poster,
        mp4: cover_video_mp4,
        webm: cover_video_webm,
        ogv: cover_video_ogv
      };
    }
  }]);
  return WFormVideoHelper;
}();

exports.default = WFormVideoHelper;

/***/ }),
/* 375 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF CHECKBOX ------------------- //
// ------------------- //

var WFCheckbox = function (_Component) {
  (0, _inherits3.default)(WFCheckbox, _Component);

  function WFCheckbox() {
    (0, _classCallCheck3.default)(this, WFCheckbox);
    return (0, _possibleConstructorReturn3.default)(this, (WFCheckbox.__proto__ || (0, _getPrototypeOf2.default)(WFCheckbox)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFCheckbox, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$booleanValue = _props.booleanValue,
          booleanValue = _props$booleanValue === undefined ? false : _props$booleanValue,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "Active option" : _props$placeholder,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$checkedValue = _props.checkedValue,
          checkedValue = _props$checkedValue === undefined ? null : _props$checkedValue,
          _props$uncheckedValue = _props.uncheckedValue,
          uncheckedValue = _props$uncheckedValue === undefined ? null : _props$uncheckedValue;

      var label = placeholder;
      if (checkedValue) {
        if (booleanValue) {
          label = checkedValue;
        } else {
          label = uncheckedValue;
        }
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            'span',
            { className: _this2.getWrapperClass() },
            _react2.default.createElement(
              'wf-checkbox',
              {
                onClick: function onClick() {
                  if (!disabled) {
                    on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_BOOLEAN_VALUE, !booleanValue));
                  }
                } },
              _react2.default.createElement(_WFIcon.WFICheck, { checked: !disabled ? booleanValue : false }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                label
              )
            ),
            _react2.default.createElement(_WFIcon.WFIState, { valid: _this2.props.valid })
          );
        }
      }));
    }
  }, {
    key: 'getWrapperClass',
    value: function getWrapperClass() {
      var _props2 = this.props,
          name = _props2.name,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$booleanValue = _props2.booleanValue,
          booleanValue = _props2$booleanValue === undefined ? false : _props2$booleanValue;

      var clss = _WFCss2.default.checkbox;
      if (!disabled) {
        clss += ' ' + (booleanValue ? _WFCss2.default.checked : _WFCss2.default.unchecked);
      } else {
        clss += ' ' + _WFCss2.default.disabled;
      }
      clss += ' input_' + name;
      return clss;
    }
  }]);
  return WFCheckbox;
}(_react.Component);

// ------------------- //


exports.default = WFCheckbox;
// ------------------- //

/***/ }),
/* 376 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactColor = __webpack_require__(667);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF COLOR ------------------- //
// ------------------- //

var WFColor = function (_Component) {
  (0, _inherits3.default)(WFColor, _Component);

  function WFColor(props) {
    (0, _classCallCheck3.default)(this, WFColor);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFColor.__proto__ || (0, _getPrototypeOf2.default)(WFColor)).call(this, props));

    _this.state = {
      displayColorPicker: false
    };
    return _this;
  }

  (0, _createClass3.default)(WFColor, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var displayColorPicker = this.state.displayColorPicker;
      var _props = this.props,
          on = _props.on,
          _props$stringValue = _props.stringValue,
          stringValue = _props$stringValue === undefined ? "rgb(255, 255, 255)" : _props$stringValue,
          _props$placeholer = _props.placeholer,
          placeholer = _props$placeholer === undefined ? "select color..." : _props$placeholer,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled;

      var label = placeholer;
      if (stringValue) {
        label = stringValue;
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            'wf-input-color',
            null,
            _react2.default.createElement(
              _WFRow2.default,
              {
                className: disabled ? _WFCss2.default.disabled : "",
                onClick: function onClick() {
                  _this2.setState({
                    displayColorPicker: disabled ? false : !displayColorPicker
                  });
                } },
              _react2.default.createElement(
                _WFCol2.default,
                { xs: 12 },
                _react2.default.createElement(
                  'wf-color-btn',
                  null,
                  _react2.default.createElement('span', { style: { background: disabled ? 'rgba(255,255,255,0)' : stringValue } })
                ),
                _react2.default.createElement(
                  _WFText2.default,
                  null,
                  disabled ? 'rgba(255,255,255,0)' : label
                ),
                _react2.default.createElement(_WFIcon.WFIClose, { visible: displayColorPicker })
              )
            ),
            disabled || !displayColorPicker ? "" : _react2.default.createElement(
              'wf-color-picker',
              null,
              _react2.default.createElement(_reactColor.ChromePicker, {
                color: stringValue,
                onChange: function onChange(color) {
                  var _color$rgb = color.rgb,
                      r = _color$rgb.r,
                      g = _color$rgb.g,
                      b = _color$rgb.b,
                      _color$rgb$a = _color$rgb.a,
                      a = _color$rgb$a === undefined ? 1 : _color$rgb$a;

                  var newVal = a === 1 ? 'rgb(' + r + ',' + g + ',' + b + ')' : 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';
                  on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, newVal));
                } })
            )
          );
        }
      }));
    }
  }]);
  return WFColor;
}(_react.Component);

// ------------------- //


exports.default = WFColor;
// ------------------- //

/***/ }),
/* 377 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _JSON = __webpack_require__(17);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _Constants = __webpack_require__(41);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF GRID ------------------- //
// ------------------- //

var defaultValue = _Constants.DEFAULT_COL_CONFIG;
var defaultGrid = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var sizes = [{
  icon: 'desktop',
  name: 'Desktop',
  size: 'lg',
  cols: defaultGrid
}, {
  icon: 'laptop',
  name: 'Laptop',
  size: 'md',
  cols: defaultGrid
}, {
  icon: 'tablet',
  name: 'Tablet',
  size: 'sm',
  cols: defaultGrid
}, {
  icon: 'phone',
  name: 'Mobile',
  size: 'xs',
  cols: defaultGrid
}];

var WFGrid = function (_Component) {
  (0, _inherits3.default)(WFGrid, _Component);

  function WFGrid() {
    (0, _classCallCheck3.default)(this, WFGrid);
    return (0, _possibleConstructorReturn3.default)(this, (WFGrid.__proto__ || (0, _getPrototypeOf2.default)(WFGrid)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFGrid, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          on = _props.on,
          stringValue = _props.stringValue;

      var objectValue = stringValue ? (0, _JSON.parse)(stringValue) : {};
      var value = (0, _assign2.default)({}, defaultValue, objectValue);
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            'wf-input-grid',
            null,
            sizes.map(function (size, i) {
              var icon = size.icon,
                  cols = size.cols;

              return _react2.default.createElement(
                'wf-grid',
                { key: i },
                _react2.default.createElement(
                  'wf-grid-label',
                  null,
                  _react2.default.createElement(_WFIcon.WFIcon, { icon: icon })
                ),
                _react2.default.createElement(
                  'wf-grid-cols',
                  null,
                  cols.map(function (col, index) {
                    var isActive = value[size.size] >= col;
                    return _react2.default.createElement(
                      'span',
                      { key: index,
                        className: isActive ? "wf-active" : "",
                        onClick: function onClick() {
                          var nextObjectValue = (0, _assign2.default)(value, (0, _defineProperty3.default)({}, '' + size.size, col));
                          on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, (0, _JSON.stringify)(nextObjectValue)));
                        } },
                      col
                    );
                  })
                )
              );
            })
          );
        }
      }));
    }
  }]);
  return WFGrid;
}(_react.Component);

// ------------------- //


exports.default = WFGrid;
// ------------------- //

/***/ }),
/* 378 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _datepicker = __webpack_require__(389);

var _datepicker2 = _interopRequireDefault(_datepicker);

var _WFValueTypes = __webpack_require__(22);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputString = __webpack_require__(117);

var _WFInputString2 = _interopRequireDefault(_WFInputString);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF INPUT DATE ------------------- //
// ------------------- //

var WFInputDate = function (_Component) {
  (0, _inherits3.default)(WFInputDate, _Component);

  function WFInputDate() {
    (0, _classCallCheck3.default)(this, WFInputDate);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputDate.__proto__ || (0, _getPrototypeOf2.default)(WFInputDate)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputDate, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "" : _props$placeholder,
          _props$inputClass = _props.inputClass,
          inputClass = _props$inputClass === undefined ? "" : _props$inputClass,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? null : _props$valid,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$displayStateCp = _props.displayStateCpt,
          displayStateCpt = _props$displayStateCp === undefined ? true : _props$displayStateCp,
          _props$dateFormat = _props.dateFormat,
          dateFormat = _props$dateFormat === undefined ? "YYYY/MM/DD" : _props$dateFormat,
          _props$showMonthDropd = _props.showMonthDropdown,
          showMonthDropdown = _props$showMonthDropd === undefined ? false : _props$showMonthDropd,
          _props$showYearDropdo = _props.showYearDropdown,
          showYearDropdown = _props$showYearDropdo === undefined ? false : _props$showYearDropdo,
          _props$showWeekNumber = _props.showWeekNumbers,
          showWeekNumbers = _props$showWeekNumber === undefined ? false : _props$showWeekNumber,
          _props$minDate = _props.minDate,
          minDate = _props$minDate === undefined ? null : _props$minDate,
          _props$maxDate = _props.maxDate,
          maxDate = _props$maxDate === undefined ? null : _props$maxDate,
          _props$monthsShown = _props.monthsShown,
          monthsShown = _props$monthsShown === undefined ? 1 : _props$monthsShown,
          _props$stringValue = _props.stringValue,
          stringValue = _props$stringValue === undefined ? "" : _props$stringValue;

      var startDate = null; //moment();
      if (stringValue) {
        startDate = moment(stringValue, dateFormat);
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            'wf-date-input',
            null,
            _react2.default.createElement(
              'span',
              { className: '' + _WFInputString2.default.getStatus(_this2, stringValue) },
              _react2.default.createElement(_datepicker2.default, {
                disabled: disabled,
                className: _this2.getWrapperClass(_WFInputTypes.INPUT_TEXT),
                calendarClassName: 'wf-datepicker',
                placeholder: placeholder,
                selected: !disabled ? startDate : "",
                dateFormat: dateFormat,
                dropdownMode: 'select',
                showMonthDropdown: showMonthDropdown,
                showYearDropdown: showYearDropdown,
                showWeekNumbers: showWeekNumbers,
                monthsShown: monthsShown,
                minDate: minDate ? moment(minDate) : null,
                maxDate: maxDate ? moment(maxDate) : null,
                onChange: function onChange(date) {
                  return _this2.onChange(date);
                },
                isClearable: true
                // toto charly implement after 
                // filterDate={isWeekday}
                // excludeDates={[moment(), moment().subtract(1, "days")]}
                // highlightDates={[moment().subtract(7, "days"), moment().add(7, "days")]}
              }),
              _react2.default.createElement(_WFIcon.WFIState, {
                visible: displayStateCpt,
                valid: valid
              })
            )
          );
        }
      }));
    }
  }, {
    key: 'onChange',
    value: function onChange(date) {
      var _props2 = this.props,
          on = _props2.on,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$dateFormat = _props2.dateFormat,
          dateFormat = _props2$dateFormat === undefined ? "YYYY/MM/DD" : _props2$dateFormat;

      if (!date) {
        on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, ""));
      } else if (!disabled) {
        this.setState({
          startDate: date
        });
        on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, date.format(dateFormat)));
      }
    }
  }, {
    key: 'getWrapperClass',
    value: function getWrapperClass(type) {
      var _props3 = this.props,
          name = _props3.name,
          _props3$disabled = _props3.disabled,
          disabled = _props3$disabled === undefined ? false : _props3$disabled,
          _props3$valid = _props3.valid,
          valid = _props3$valid === undefined ? null : _props3$valid,
          _props3$inputClass = _props3.inputClass,
          inputClass = _props3$inputClass === undefined ? "" : _props3$inputClass;

      var clss = '' + _WFCss2.default.input + type;
      if (inputClass) {
        clss += ' ' + inputClass;
      }
      if (disabled) {
        clss += ' ' + _WFCss2.default.disabled;
      }
      clss += ' input_' + name;
      return clss;
    }
  }]);
  return WFInputDate;
}(_react.Component);

// ------------------- //


exports.default = WFInputDate;
// ------------------- //

/***/ }),
/* 379 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputString = __webpack_require__(117);

var _WFInputString2 = _interopRequireDefault(_WFInputString);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF INPUT FILE ------------------- //
// ------------------- //

var WFInputFile = function (_Component) {
  (0, _inherits3.default)(WFInputFile, _Component);

  function WFInputFile(props) {
    (0, _classCallCheck3.default)(this, WFInputFile);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputFile.__proto__ || (0, _getPrototypeOf2.default)(WFInputFile)).call(this, props));
  }

  (0, _createClass3.default)(WFInputFile, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$stringValue = _props.stringValue,
          stringValue = _props$stringValue === undefined ? "" : _props$stringValue,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "select file..." : _props$placeholder,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            "wf-input-file",
            null,
            _react2.default.createElement(
              "div",
              { className: "wf-file-wrapper " + (disabled ? _WFCss2.default.disabled : "") + " " + _WFInputString2.default.getStatus(_this2, stringValue) },
              _react2.default.createElement("input", {
                type: _WFInputTypes.INPUT_TEXT,
                readOnly: true,
                value: stringValue
              }),
              _react2.default.createElement(
                "label",
                { className: "wf-file-label" },
                placeholder,
                _react2.default.createElement("input", {
                  type: _WFInputTypes.INPUT_FILE,
                  style: { display: "none" },
                  onChange: function onChange(e) {
                    var _on;

                    return on(_WFEventTypes.WF_EVENT_ONCHANGE, (_on = {}, (0, _defineProperty3.default)(_on, _WFValueTypes.WF_EVENT_FILE_VALUE, e), (0, _defineProperty3.default)(_on, _WFValueTypes.WF_STRING_VALUE, e.target.value), _on));
                  }
                })
              )
            )
          );
        }
      }));
    }
  }]);
  return WFInputFile;
}(_react.Component);

// ------------------- //


exports.default = WFInputFile;
// ------------------- //

/***/ }),
/* 380 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF INPUT MAILER ------------------- //
// ------------------- //

var EMAIL_RE = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

var WFInputMailer = function (_Component) {
  (0, _inherits3.default)(WFInputMailer, _Component);

  function WFInputMailer(props) {
    (0, _classCallCheck3.default)(this, WFInputMailer);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFInputMailer.__proto__ || (0, _getPrototypeOf2.default)(WFInputMailer)).call(this, props));

    var _props$stringValue = props.stringValue,
        stringValue = _props$stringValue === undefined ? "" : _props$stringValue;

    _this.isInit = false;
    _this.state = {
      value: WFInputMailer.from(stringValue)
    };
    return _this;
  }

  (0, _createClass3.default)(WFInputMailer, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "" : _props$placeholder,
          _props$inputClass = _props.inputClass,
          inputClass = _props$inputClass === undefined ? "" : _props$inputClass,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? null : _props$valid,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$displayStateCp = _props.displayStateCpt,
          displayStateCpt = _props$displayStateCp === undefined ? true : _props$displayStateCp;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            'wf-input-number',
            null,
            _react2.default.createElement(
              'span',
              { className: _WFCss2.default.text + ' ' + WFInputMailer.getStatus(_this2, value) },
              _react2.default.createElement('input', {
                type: _WFInputTypes.INPUT_TEXT,
                readOnly: disabled,
                className: _this2.getWrapperClass(_WFInputTypes.INPUT_TEXT),
                placeholder: placeholder,
                onFocus: function onFocus() {
                  return on(_WFEventTypes.WF_EVENT_ONFOCUS);
                },
                onBlur: function onBlur() {
                  return on(_WFEventTypes.WF_EVENT_ONBLUR);
                },
                onChange: function onChange(e) {
                  return _this2.onChange(e);
                },
                value: !disabled ? _this2.state.value : ""
              }),
              _react2.default.createElement(_WFIcon.WFIState, {
                visible: displayStateCpt,
                valid: valid
              })
            )
          );
        }
      }));
    }
  }, {
    key: 'getWrapperClass',
    value: function getWrapperClass(type) {
      var _props2 = this.props,
          name = _props2.name,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$valid = _props2.valid,
          valid = _props2$valid === undefined ? null : _props2$valid,
          _props2$inputClass = _props2.inputClass,
          inputClass = _props2$inputClass === undefined ? "" : _props2$inputClass;

      var clss = '' + _WFCss2.default.input + type;
      if (inputClass) {
        clss += ' ' + inputClass;
      }
      if (disabled) {
        clss += ' ' + _WFCss2.default.disabled;
      }
      clss += ' input_' + name;
      return clss;
    }
  }, {
    key: 'onChange',
    value: function onChange(e) {
      var on = this.props.on;

      var _WFInputComponent$get2 = _WFInputComponent2.default.getStrCfg(this.props),
          key = _WFInputComponent$get2.key;

      this.setState({
        value: e.target.value
      });
      on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, WFInputMailer.to(e.target.value)));
    }
  }, {
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(nextProps) {
      var _nextProps$stringValu = nextProps.stringValue,
          stringValue = _nextProps$stringValu === undefined ? "" : _nextProps$stringValu;

      if (!this.isInit) {
        this.isInit = true;
        var nextValue = WFInputMailer.from(stringValue);
        this.setState({
          value: nextValue
        });
      }
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      this.isInit = false;
    }

    /**
     * Transform JsonValue to StringValue
     * @param jsonValue "{"jean@yahoo.com", "toto@gmail.com": "Tony" }"
     * @return stringValue "jean@yahoo.com: jean, toto@gmail.com: Tony"
     */

  }], [{
    key: 'from',
    value: function from() {
      var jsonValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      var stringValue = "";
      var objectValue = (0, _JSON.parse)(jsonValue);
      if ((0, _Lodash.isObject)(objectValue)) {
        (0, _keys2.default)(objectValue).map(function (key) {
          stringValue += key + ': ' + objectValue[key] + ', ';
        });
      }
      return stringValue;
    }

    /**
     * Transform StringValue to JsonValue
     * @param stringValue "jean@yahoo.com, toto@gmail.com: Tony"
     * @return jsonValue "{"jean@yahoo.com":"jean", "toto@gmail.com": "Tony" }"
     */

  }, {
    key: 'to',
    value: function to() {
      var stringValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      var objectValue = {};
      var arrayValue = stringValue.split(",");
      arrayValue = arrayValue.map(function (el) {
        return el.split(':');
      }).filter(function (el) {
        return el !== "";
      });
      arrayValue.forEach(function (el, i) {
        var email = el[0].trim();
        if (email && EMAIL_RE.test(email) || email && email.indexOf("{{") >= 0 && email.indexOf("}}") >= 0) {
          if (el.length === 1) {
            if (email.indexOf("@") >= 0) {
              objectValue[email] = email.split('@')[0];
            } else {
              objectValue[email] = email;
            }
          } else if (el.length === 2) {
            objectValue[email] = el[1].trim();
          }
        }
      });
      var jsonValue = (0, _JSON.stringify)(objectValue);
      var val = jsonValue.replace(/\"{\"\":\"\"}\"/g, '');
      return val;
    }
  }, {
    key: 'getStatus',
    value: function getStatus(input) {
      var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
      var valid = input.props.valid;

      if (valid === false) {
        return _WFCss2.default.hasError;
      } else if (valid === true && value > 0 || value !== "" && value > 0) {
        return _WFCss2.default.isValid;
      }
    }
  }]);
  return WFInputMailer;
}(_react.Component);

// ------------------- //


exports.default = WFInputMailer;
// ------------------- //

/***/ }),
/* 381 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFValueTypes = __webpack_require__(22);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF INPUT NUMBER ------------------- //
// ------------------- //

var WFInputNumber = function (_Component) {
  (0, _inherits3.default)(WFInputNumber, _Component);

  function WFInputNumber() {
    (0, _classCallCheck3.default)(this, WFInputNumber);
    return (0, _possibleConstructorReturn3.default)(this, (WFInputNumber.__proto__ || (0, _getPrototypeOf2.default)(WFInputNumber)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFInputNumber, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "" : _props$placeholder,
          _props$inputClass = _props.inputClass,
          inputClass = _props$inputClass === undefined ? "" : _props$inputClass,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? null : _props$valid,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$displayStateCp = _props.displayStateCpt,
          displayStateCpt = _props$displayStateCp === undefined ? true : _props$displayStateCp;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            "wf-input-number",
            null,
            _react2.default.createElement(
              "span",
              { className: _WFCss2.default.text + " " + WFInputNumber.getStatus(_this2, value) },
              _react2.default.createElement("input", {
                //type={INPUT_NUMBER} // problem with HTML5 number input the focus return null if digit val includes other chars 
                type: _WFInputTypes.INPUT_TEXT,
                readOnly: disabled,
                className: _this2.getWrapperClass(_WFInputTypes.INPUT_NUMBER),
                placeholder: placeholder,
                onFocus: function onFocus() {
                  return on(_WFEventTypes.WF_EVENT_ONFOCUS);
                },
                onBlur: function onBlur() {
                  return on(_WFEventTypes.WF_EVENT_ONBLUR);
                },
                onChange: function onChange(e) {
                  return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_NUMBER_VALUE, e.target.value));
                },
                value: !disabled ? value : ""
              }),
              _react2.default.createElement(_WFIcon.WFIState, {
                visible: displayStateCpt,
                valid: valid
              })
            )
          );
        }
      }));
    }
  }, {
    key: "getWrapperClass",
    value: function getWrapperClass(type) {
      var _props2 = this.props,
          name = _props2.name,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$valid = _props2.valid,
          valid = _props2$valid === undefined ? null : _props2$valid,
          _props2$inputClass = _props2.inputClass,
          inputClass = _props2$inputClass === undefined ? "" : _props2$inputClass;

      var clss = "" + _WFCss2.default.input + type;
      if (inputClass) {
        clss += " " + inputClass;
      }
      if (disabled) {
        clss += " " + _WFCss2.default.disabled;
      }
      clss += " input_" + name;
      return clss;
    }
  }], [{
    key: "getStatus",
    value: function getStatus(input) {
      var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
      var valid = input.props.valid;

      if (valid === false) {
        return _WFCss2.default.hasError;
      } else if (valid === true && value > 0 || value !== "" && value > 0) {
        return _WFCss2.default.isValid;
      }
    }
  }]);
  return WFInputNumber;
}(_react.Component);

// ------------------- //


exports.default = WFInputNumber;
// ------------------- //

/***/ }),
/* 382 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFMedia = __webpack_require__(447);

var _WFMedia2 = _interopRequireDefault(_WFMedia);

var _GetFileName = __webpack_require__(260);

var _GetFileName2 = _interopRequireDefault(_GetFileName);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF MEDIA FILE ------------------- //
// ------------------- //

var WFMediaFile = function (_Component) {
  (0, _inherits3.default)(WFMediaFile, _Component);

  function WFMediaFile(props) {
    (0, _classCallCheck3.default)(this, WFMediaFile);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFMediaFile.__proto__ || (0, _getPrototypeOf2.default)(WFMediaFile)).call(this, props));

    _this.media = new _WFMedia2.default();
    return _this;
  }

  (0, _createClass3.default)(WFMediaFile, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$stringValue = _props.stringValue,
          stringValue = _props$stringValue === undefined ? "" : _props$stringValue,
          _props$placeholer = _props.placeholer,
          placeholer = _props$placeholer === undefined ? "select file..." : _props$placeholer,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$isFile = _props.isFile,
          isFile = _props$isFile === undefined ? false : _props$isFile,
          _props$btnLabel = _props.btnLabel,
          btnLabel = _props$btnLabel === undefined ? "Media" : _props$btnLabel;

      var _WFMediaFile$getViewC = WFMediaFile.getViewConfig(this.props),
          value = _WFMediaFile$getViewC.value,
          hasValue = _WFMediaFile$getViewC.hasValue,
          hasPreview = _WFMediaFile$getViewC.hasPreview;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            "wf-input-media",
            null,
            _react2.default.createElement(
              _WFRow2.default,
              { className: disabled ? _WFCss2.default.disabled : "" },
              _react2.default.createElement(
                _WFCol2.default,
                null,
                _react2.default.createElement(
                  "wf-media-input",
                  null,
                  _react2.default.createElement("input", {
                    type: _WFInputTypes.INPUT_TEXT,
                    readOnly: disabled,
                    placeholder: placeholer,
                    onFocus: function onFocus() {
                      return on(_WFEventTypes.WF_EVENT_ONFOCUS);
                    },
                    onBlur: function onBlur() {
                      return on(_WFEventTypes.WF_EVENT_ONBLUR);
                    },
                    onChange: function onChange(e) {
                      on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, e.target.value));
                    },
                    value: value
                  }),
                  _react2.default.createElement(_WFIcon.WFIClose, {
                    visible: hasValue,
                    onClick: function onClick() {
                      on(_WFEventTypes.WF_EVENT_ONCLEAR);
                      on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_STRING_VALUE, ""));
                    }
                  }),
                  _react2.default.createElement(
                    _WFBtn2.default,
                    {
                      icon: "server",
                      onClick: function onClick() {
                        if (!disabled) {
                          _this2.media.open({
                            config: { multiple: false },
                            onSelect: function onSelect(data) {
                              if (data.length > 0) {
                                var _on3;

                                var nextObjectValue = data[0];
                                var nextStringValue = nextObjectValue["url"];
                                //console.dir(nextObjectValue);
                                on(_WFEventTypes.WF_EVENT_ONCHANGE, (_on3 = {}, (0, _defineProperty3.default)(_on3, _WFValueTypes.WF_STRING_VALUE, nextStringValue), (0, _defineProperty3.default)(_on3, _WFValueTypes.WF_OBJECT_VALUE, nextObjectValue), _on3));
                              }
                            }
                          });
                        }
                      } },
                    btnLabel
                  )
                )
              ),
              _react2.default.createElement(
                _WFCol2.default,
                { visible: hasPreview },
                _react2.default.createElement(
                  "wf-media-preview",
                  null,
                  _react2.default.createElement(_WFImg2.default, { src: stringValue })
                )
              )
            )
          );
        }
      }));
    }
  }], [{
    key: "getViewConfig",
    value: function getViewConfig(props) {
      var _props$stringValue2 = props.stringValue,
          stringValue = _props$stringValue2 === undefined ? "" : _props$stringValue2,
          _props$placeholer2 = props.placeholer,
          placeholer = _props$placeholer2 === undefined ? "select file..." : _props$placeholer2,
          _props$disabled2 = props.disabled,
          disabled = _props$disabled2 === undefined ? false : _props$disabled2,
          _props$preview = props.preview,
          preview = _props$preview === undefined ? true : _props$preview,
          _props$isFile2 = props.isFile,
          isFile = _props$isFile2 === undefined ? false : _props$isFile2;

      var hasValue = true;
      var hasPreview = true;
      var value = "";
      if (stringValue.length === 0 || stringValue === "" || stringValue === false) {
        hasValue = false;
        hasPreview = false;
      }
      if (disabled) {
        hasValue = false;
        hasPreview = false;
      }
      if (!preview) {
        hasPreview = false;
      }
      if (hasValue) {
        value = isFile ? stringValue : (0, _GetFileName2.default)(stringValue);
      } else {
        value = placeholer;
      }
      return {
        hasValue: hasValue,
        hasPreview: hasPreview,
        value: value
      };
    }
  }]);
  return WFMediaFile;
}(_react.Component);

// ------------------- //


exports.default = WFMediaFile;
// ------------------- //

/***/ }),
/* 383 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFSelect = __webpack_require__(223);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF PANEL ------------------- //
// ------------------- //

var WFPanel = function (_Component) {
  (0, _inherits3.default)(WFPanel, _Component);

  function WFPanel() {
    (0, _classCallCheck3.default)(this, WFPanel);
    return (0, _possibleConstructorReturn3.default)(this, (WFPanel.__proto__ || (0, _getPrototypeOf2.default)(WFPanel)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFPanel, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          disabled = _props.disabled,
          valueBy = _props.valueBy,
          _props$labelBy = _props.labelBy,
          labelBy = _props$labelBy === undefined ? "label" : _props$labelBy,
          _props$data = _props.data,
          data = _props$data === undefined ? [] : _props$data,
          _props$dataDisabled = _props.dataDisabled,
          dataDisabled = _props$dataDisabled === undefined ? [] : _props$dataDisabled,
          _props$grid = _props.grid,
          grid = _props$grid === undefined ? "col-xs-4" : _props$grid;

      var col = grid;
      var counter = data.length;
      if (counter === 4) {
        col = "col-xs-6";
      }
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        willMount: function willMount() {
          _WFSelect2.default.setIntialValue(_this2.props);
        },
        view: function view(input) {
          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            'wf-input-panel',
            null,
            _react2.default.createElement(
              'div',
              { className: 'wf-items row' },
              data.map(function (row, index) {
                if (!row) return false;
                var name = "";
                var label = "";
                var val = null;
                if (row.hasOwnProperty("name")) {
                  name = row["name"];
                }
                if (labelBy && row.hasOwnProperty(labelBy)) {
                  label = row[labelBy];
                }
                if (valueBy && row.hasOwnProperty(valueBy)) {
                  val = row[valueBy];
                } else {
                  return false;
                }
                if (dataDisabled.hasOwnProperty(name)) {
                  return _react2.default.createElement(
                    'div',
                    {
                      key: val,
                      className: col + ' wf-item wf-item-disabled' },
                    label
                  );
                } else {
                  return _react2.default.createElement(
                    'div',
                    {
                      key: val,
                      className: col + ' wf-item ' + (val === value ? "wf-item-selected" : ""),
                      onClick: function onClick() {
                        return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, val));
                      } },
                    label
                  );
                }
              })
            )
          );
        }
      }));
    }
  }]);
  return WFPanel;
}(_react.Component);

// ------------------- //


exports.default = WFPanel;
// ------------------- //

/***/ }),
/* 384 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFSelect = __webpack_require__(83);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF RADIO BUTTON ------------------- //
// ------------------- //

var WFRadioButton = function (_Component) {
  (0, _inherits3.default)(WFRadioButton, _Component);

  function WFRadioButton(props) {
    (0, _classCallCheck3.default)(this, WFRadioButton);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFRadioButton.__proto__ || (0, _getPrototypeOf2.default)(WFRadioButton)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFRadioButton, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          _props$styles = _props.styles,
          styles = _props$styles === undefined ? {} : _props$styles,
          _props$isInlineOption = _props.isInlineOption,
          isInlineOption = _props$isInlineOption === undefined ? false : _props$isInlineOption;
      var _styles$optionLabel = styles.optionLabel,
          optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
          _styles$optionLegend = styles.optionLegend,
          optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "selectWord");
        },
        view: function view(input) {
          return _react2.default.createElement(
            'wf-radio-button',
            null,
            _WFSelect2.default.getOptions(_this2).map(function (option, i) {
              var _option$id = option.id,
                  id = _option$id === undefined ? null : _option$id,
                  _option$label = option.label,
                  label = _option$label === undefined ? "" : _option$label;

              if (id === null) {
                return false;
              } else {
                var isSelected = _WFSelect2.default.has(_this2, id);
                var className = 'wf-option ' + (isSelected ? "wf-selected" : '');
                if (isInlineOption) {
                  className += " wf-inline";
                }
                return _react2.default.createElement(
                  'span',
                  {
                    key: i,
                    className: className,
                    onClick: function onClick() {
                      return _WFSelect2.default.onSelect(_this2, id);
                    },
                    style: {
                      color: optionLabel.color,
                      borderColor: optionLabel.color
                    }
                  },
                  !isSelected ? _react2.default.createElement(_WFIcon.WFIcon, { icon: 'radio-unchecked' }) : _react2.default.createElement(_WFIcon.WFIcon, { icon: 'radio-checked' }),
                  _react2.default.createElement(
                    _WFText2.default,
                    null,
                    label
                  )
                );
              }
            })
          );
        }
      }));
    }
  }]);
  return WFRadioButton;
}(_react.Component);

// ------------------- //


exports.default = WFRadioButton;
// ------------------- //

/***/ }),
/* 385 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactHtml5Slider = __webpack_require__(773);

var _reactHtml5Slider2 = _interopRequireDefault(_reactHtml5Slider);

var _WFEventTypes = __webpack_require__(16);

var _WFValueTypes = __webpack_require__(22);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF RANGE ------------------- //
// ------------------- //

var WFRange = function (_Component) {
  (0, _inherits3.default)(WFRange, _Component);

  function WFRange() {
    (0, _classCallCheck3.default)(this, WFRange);
    return (0, _possibleConstructorReturn3.default)(this, (WFRange.__proto__ || (0, _getPrototypeOf2.default)(WFRange)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFRange, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          on = _props.on,
          _props$numberValue = _props.numberValue,
          numberValue = _props$numberValue === undefined ? 0 : _props$numberValue,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled,
          _props$minimum = _props.minimum,
          minimum = _props$minimum === undefined ? 0 : _props$minimum,
          _props$maximum = _props.maximum,
          maximum = _props$maximum === undefined ? 100 : _props$maximum,
          _props$sufix = _props.sufix,
          sufix = _props$sufix === undefined ? "" : _props$sufix,
          _props$step = _props.step,
          step = _props$step === undefined ? "" : _props$step;

      var grid = WFRange.getGridConfig(this.props);
      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          return _react2.default.createElement(
            "wf-input-range",
            null,
            _react2.default.createElement(
              _WFRow2.default,
              { className: disabled ? _WFCss2.default.disabled : "" },
              _react2.default.createElement(
                _WFCol2.default,
                { xs: grid.input.col, reset: true },
                _react2.default.createElement(_reactHtml5Slider2.default, {
                  disabled: disabled,
                  step: step,
                  min: minimum,
                  max: maximum,
                  value: disabled || !numberValue ? 0 : numberValue,
                  handleChange: function handleChange(e) {
                    return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, _WFValueTypes.WF_NUMBER_VALUE, e.target.value));
                  }
                })
              ),
              _react2.default.createElement(
                _WFCol2.default,
                { xs: grid.value.col, reset: true },
                _react2.default.createElement(_WFCounter2.default, {
                  visible: grid.value.visible,
                  visibleAtZero: true,
                  counter: numberValue,
                  parenthesis: false,
                  sufix: !numberValue || numberValue === 0 ? "" : sufix
                })
              )
            )
          );
        }
      }));
    }
  }], [{
    key: "getGridConfig",
    value: function getGridConfig(props) {
      var _props$disabled2 = props.disabled,
          disabled = _props$disabled2 === undefined ? false : _props$disabled2;

      var input = {};
      var value = {};
      if (disabled) {
        input = {
          col: 12
        };
        value = {
          col: 0,
          visible: false
        };
      } else {
        input = {
          col: 10
        };
        value = {
          col: 2,
          visible: true
        };
      }
      return {
        input: input,
        value: value
      };
    }
  }]);
  return WFRange;
}(_react.Component);

// ------------------- //


exports.default = WFRange;
// ------------------- //

/***/ }),
/* 386 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFInputTypes = __webpack_require__(34);

var _WFEventTypes = __webpack_require__(16);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFInputString = __webpack_require__(117);

var _WFInputString2 = _interopRequireDefault(_WFInputString);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(37);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF TEXTAREA ------------------- //
// ------------------- //

var WFTextarea = function (_Component) {
  (0, _inherits3.default)(WFTextarea, _Component);

  function WFTextarea() {
    (0, _classCallCheck3.default)(this, WFTextarea);
    return (0, _possibleConstructorReturn3.default)(this, (WFTextarea.__proto__ || (0, _getPrototypeOf2.default)(WFTextarea)).apply(this, arguments));
  }

  (0, _createClass3.default)(WFTextarea, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          on = _props.on,
          _props$rows = _props.rows,
          rows = _props$rows === undefined ? 4 : _props$rows,
          placeholder = _props.placeholder,
          _props$isMultiliner = _props.isMultiliner,
          isMultiliner = _props$isMultiliner === undefined ? false : _props$isMultiliner,
          _props$inputClass = _props.inputClass,
          inputClass = _props$inputClass === undefined ? "" : _props$inputClass,
          _props$valid = _props.valid,
          valid = _props$valid === undefined ? null : _props$valid,
          _props$disabled = _props.disabled,
          disabled = _props$disabled === undefined ? false : _props$disabled;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        view: function view(input) {
          var _WFInputComponent$get = _WFInputComponent2.default.getStrCfg(_this2.props),
              key = _WFInputComponent$get.key,
              value = _WFInputComponent$get.value;

          return _react2.default.createElement(
            "span",
            { className: _WFCss2.default.textarea + " " + _WFInputString2.default.getStatus(_this2, value) },
            _react2.default.createElement("textarea", {
              rows: rows,
              readOnly: disabled,
              className: _this2.getWrapperClass(),
              placeholder: placeholder,
              onFocus: function onFocus() {
                return on(_WFEventTypes.WF_EVENT_ONFOCUS);
              },
              onBlur: function onBlur() {
                return on(_WFEventTypes.WF_EVENT_ONBLUR);
              },
              onChange: function onChange(e) {
                return on(_WFEventTypes.WF_EVENT_ONCHANGE, (0, _defineProperty3.default)({}, key, e.target.value));
              },
              value: !disabled ? value : ""
            }),
            _react2.default.createElement(_WFIcon.WFIState, { valid: valid })
          );
        }
      }));
    }
  }, {
    key: "getWrapperClass",
    value: function getWrapperClass() {
      var _props2 = this.props,
          name = _props2.name,
          _props2$disabled = _props2.disabled,
          disabled = _props2$disabled === undefined ? false : _props2$disabled,
          _props2$valid = _props2.valid,
          valid = _props2$valid === undefined ? null : _props2$valid,
          _props2$inputClass = _props2.inputClass,
          inputClass = _props2$inputClass === undefined ? "" : _props2$inputClass,
          isMultiliner = _props2.isMultiliner;

      var clss = "" + _WFCss2.default.input + _WFInputTypes.INPUT_TEXTAREA;
      if (inputClass) {
        clss += " " + inputClass;
      }
      if (isMultiliner) {
        clss += " " + _WFCss2.default.multiliner;
      }
      if (disabled) {
        clss += " " + _WFCss2.default.disabled;
      }
      clss += " input_" + name;
      return clss;
    }
  }]);
  return WFTextarea;
}(_react.Component);

// ------------------- //


exports.default = WFTextarea;
// ------------------- //

/***/ }),
/* 387 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _year_dropdown = __webpack_require__(397);

var _year_dropdown2 = _interopRequireDefault(_year_dropdown);

var _month_dropdown = __webpack_require__(392);

var _month_dropdown2 = _interopRequireDefault(_month_dropdown);

var _month = __webpack_require__(391);

var _month2 = _interopRequireDefault(_month);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(105);

var _classnames2 = _interopRequireDefault(_classnames);

var _date_utils = __webpack_require__(118);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DROPDOWN_FOCUS_CLASSNAMES = ['react-datepicker__year-select', 'react-datepicker__month-select'];

var isDropdownSelect = function isDropdownSelect() {
  var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  var classNames = (element.className || '').split(/\s+/);
  return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) {
    return classNames.indexOf(testClassname) >= 0;
  });
};

var Calendar = _react2.default.createClass({
  displayName: 'Calendar',

  propTypes: {
    className: _react2.default.PropTypes.string,
    children: _react2.default.PropTypes.node,
    dateFormat: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.array]).isRequired,
    dropdownMode: _react2.default.PropTypes.oneOf(['scroll', 'select']).isRequired,
    endDate: _react2.default.PropTypes.object,
    excludeDates: _react2.default.PropTypes.array,
    filterDate: _react2.default.PropTypes.func,
    fixedHeight: _react2.default.PropTypes.bool,
    highlightDates: _react2.default.PropTypes.array,
    includeDates: _react2.default.PropTypes.array,
    inline: _react2.default.PropTypes.bool,
    locale: _react2.default.PropTypes.string,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    monthsShown: _react2.default.PropTypes.number,
    onClickOutside: _react2.default.PropTypes.func.isRequired,
    onMonthChange: _react2.default.PropTypes.func,
    forceShowMonthNavigation: _react2.default.PropTypes.bool,
    onDropdownFocus: _react2.default.PropTypes.func,
    onSelect: _react2.default.PropTypes.func.isRequired,
    openToDate: _react2.default.PropTypes.object,
    peekNextMonth: _react2.default.PropTypes.bool,
    scrollableYearDropdown: _react2.default.PropTypes.bool,
    preSelection: _react2.default.PropTypes.object,
    selected: _react2.default.PropTypes.object,
    selectsEnd: _react2.default.PropTypes.bool,
    selectsStart: _react2.default.PropTypes.bool,
    showMonthDropdown: _react2.default.PropTypes.bool,
    showWeekNumbers: _react2.default.PropTypes.bool,
    showYearDropdown: _react2.default.PropTypes.bool,
    startDate: _react2.default.PropTypes.object,
    todayButton: _react2.default.PropTypes.string,
    utcOffset: _react2.default.PropTypes.number
  },

  defaultProps: {
    onDropdownFocus: function onDropdownFocus() {}
  },

  getDefaultProps: function getDefaultProps() {
    return {
      utcOffset: _WFMoment2.default.utc().utcOffset(),
      monthsShown: 1,
      forceShowMonthNavigation: false
    };
  },
  getInitialState: function getInitialState() {
    return {
      date: this.localizeMoment(this.getDateInView()),
      selectingDate: null
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
    if (nextProps.preSelection && !(0, _date_utils.isSameDay)(nextProps.preSelection, this.props.preSelection)) {
      this.setState({
        date: this.localizeMoment(nextProps.preSelection)
      });
    } else if (nextProps.openToDate && !(0, _date_utils.isSameDay)(nextProps.openToDate, this.props.openToDate)) {
      this.setState({
        date: this.localizeMoment(nextProps.openToDate)
      });
    }
  },
  handleClickOutside: function handleClickOutside(event) {
    this.props.onClickOutside(event);
  },
  handleDropdownFocus: function handleDropdownFocus(event) {
    if (isDropdownSelect(event.target)) {
      this.props.onDropdownFocus();
    }
  },
  getDateInView: function getDateInView() {
    var _props = this.props,
        preSelection = _props.preSelection,
        selected = _props.selected,
        openToDate = _props.openToDate,
        utcOffset = _props.utcOffset;

    var minDate = (0, _date_utils.getEffectiveMinDate)(this.props);
    var maxDate = (0, _date_utils.getEffectiveMaxDate)(this.props);
    var current = _WFMoment2.default.utc().utcOffset(utcOffset);
    var initialDate = preSelection || selected;
    if (initialDate) {
      return initialDate;
    } else if (minDate && maxDate && openToDate && openToDate.isBetween(minDate, maxDate)) {
      return openToDate;
    } else if (minDate && openToDate && openToDate.isAfter(minDate)) {
      return openToDate;
    } else if (minDate && minDate.isAfter(current)) {
      return minDate;
    } else if (maxDate && openToDate && openToDate.isBefore(maxDate)) {
      return openToDate;
    } else if (maxDate && maxDate.isBefore(current)) {
      return maxDate;
    } else if (openToDate) {
      return openToDate;
    } else {
      return current;
    }
  },
  localizeMoment: function localizeMoment(date) {
    return date.clone().locale(this.props.locale || _WFMoment2.default.locale());
  },
  increaseMonth: function increaseMonth() {
    var _this = this;

    this.setState({
      date: this.state.date.clone().add(1, 'month')
    }, function () {
      return _this.handleMonthChange(_this.state.date);
    });
  },
  decreaseMonth: function decreaseMonth() {
    var _this2 = this;

    this.setState({
      date: this.state.date.clone().subtract(1, 'month')
    }, function () {
      return _this2.handleMonthChange(_this2.state.date);
    });
  },
  handleDayClick: function handleDayClick(day, event) {
    this.props.onSelect(day, event);
  },
  handleDayMouseEnter: function handleDayMouseEnter(day) {
    this.setState({ selectingDate: day });
  },
  handleMonthMouseLeave: function handleMonthMouseLeave() {
    this.setState({ selectingDate: null });
  },
  handleMonthChange: function handleMonthChange(date) {
    if (this.props.onMonthChange) {
      this.props.onMonthChange(date);
    }
  },
  changeYear: function changeYear(year) {
    this.setState({
      date: this.state.date.clone().set('year', year)
    });
  },
  changeMonth: function changeMonth(month) {
    var _this3 = this;

    this.setState({
      date: this.state.date.clone().set('month', month)
    }, function () {
      return _this3.handleMonthChange(_this3.state.date);
    });
  },
  header: function header() {
    var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.date;

    var startOfWeek = date.clone().startOf('week');
    var dayNames = [];
    if (this.props.showWeekNumbers) {
      dayNames.push(_react2.default.createElement(
        'div',
        { key: 'W', className: 'react-datepicker__day-name' },
        '#'
      ));
    }
    return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
      var day = startOfWeek.clone().add(offset, 'days');
      return _react2.default.createElement(
        'div',
        { key: offset, className: 'react-datepicker__day-name' },
        day.localeData().weekdaysMin(day)
      );
    }));
  },
  renderPreviousMonthButton: function renderPreviousMonthButton() {
    if (!this.props.forceShowMonthNavigation && (0, _date_utils.allDaysDisabledBefore)(this.state.date, 'month', this.props)) {
      return;
    }
    return _react2.default.createElement('a', {
      className: 'react-datepicker__navigation react-datepicker__navigation--previous',
      onClick: this.decreaseMonth });
  },
  renderNextMonthButton: function renderNextMonthButton() {
    if (!this.props.forceShowMonthNavigation && (0, _date_utils.allDaysDisabledAfter)(this.state.date, 'month', this.props)) {
      return;
    }
    return _react2.default.createElement('a', {
      className: 'react-datepicker__navigation react-datepicker__navigation--next',
      onClick: this.increaseMonth });
  },
  renderCurrentMonth: function renderCurrentMonth() {
    var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.date;

    var classes = ['react-datepicker__current-month'];
    if (this.props.showYearDropdown) {
      classes.push('react-datepicker__current-month--hasYearDropdown');
    }
    if (this.props.showMonthDropdown) {
      classes.push('react-datepicker__current-month--hasMonthDropdown');
    }
    return _react2.default.createElement(
      'div',
      { className: classes.join(' ') },
      date.format(this.props.dateFormat)
    );
  },
  renderYearDropdown: function renderYearDropdown() {
    var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

    if (!this.props.showYearDropdown || overrideHide) {
      return;
    }
    return _react2.default.createElement(_year_dropdown2.default, {
      dropdownMode: this.props.dropdownMode,
      onChange: this.changeYear,
      minDate: this.props.minDate,
      maxDate: this.props.maxDate,
      year: this.state.date.year(),
      scrollableYearDropdown: this.props.scrollableYearDropdown });
  },
  renderMonthDropdown: function renderMonthDropdown() {
    var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

    if (!this.props.showMonthDropdown) {
      return;
    }
    return _react2.default.createElement(_month_dropdown2.default, {
      dropdownMode: this.props.dropdownMode,
      locale: this.props.locale,
      onChange: this.changeMonth,
      month: this.state.date.month() });
  },
  renderTodayButton: function renderTodayButton() {
    var _this4 = this;

    if (!this.props.todayButton) {
      return;
    }
    return _react2.default.createElement(
      'div',
      { className: 'react-datepicker__today-button', onClick: function onClick(event) {
          return _this4.props.onSelect(_WFMoment2.default.utc().utcOffset(_this4.props.utcOffset).startOf('date'), event);
        } },
      this.props.todayButton
    );
  },
  renderMonths: function renderMonths() {
    var monthList = [];
    for (var i = 0; i < this.props.monthsShown; ++i) {
      var monthDate = this.state.date.clone().add(i, 'M');
      var monthKey = 'month-' + i;
      monthList.push(_react2.default.createElement(
        'div',
        { key: monthKey, className: 'react-datepicker__month-container' },
        _react2.default.createElement(
          'div',
          { className: 'react-datepicker__header' },
          this.renderCurrentMonth(monthDate),
          _react2.default.createElement(
            'div',
            {
              className: 'react-datepicker__header__dropdown react-datepicker__header__dropdown--' + this.props.dropdownMode,
              onFocus: this.handleDropdownFocus },
            this.renderMonthDropdown(i !== 0),
            this.renderYearDropdown(i !== 0)
          ),
          _react2.default.createElement(
            'div',
            { className: 'react-datepicker__day-names' },
            this.header(monthDate)
          )
        ),
        _react2.default.createElement(_month2.default, {
          day: monthDate,
          onDayClick: this.handleDayClick,
          onDayMouseEnter: this.handleDayMouseEnter,
          onMouseLeave: this.handleMonthMouseLeave,
          minDate: this.props.minDate,
          maxDate: this.props.maxDate,
          excludeDates: this.props.excludeDates,
          highlightDates: this.props.highlightDates,
          selectingDate: this.state.selectingDate,
          includeDates: this.props.includeDates,
          inline: this.props.inline,
          fixedHeight: this.props.fixedHeight,
          filterDate: this.props.filterDate,
          preSelection: this.props.preSelection,
          selected: this.props.selected,
          selectsStart: this.props.selectsStart,
          selectsEnd: this.props.selectsEnd,
          showWeekNumbers: this.props.showWeekNumbers,
          startDate: this.props.startDate,
          endDate: this.props.endDate,
          peekNextMonth: this.props.peekNextMonth,
          utcOffset: this.props.utcOffset })
      ));
    }
    return monthList;
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: (0, _classnames2.default)('react-datepicker', this.props.className) },
      _react2.default.createElement('div', { className: 'react-datepicker__triangle' }),
      this.renderPreviousMonthButton(),
      this.renderNextMonthButton(),
      this.renderMonths(),
      this.renderTodayButton(),
      this.props.children
    );
  }
});

module.exports = Calendar;

/***/ }),
/* 388 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _objectWithoutProperties2 = __webpack_require__(269);

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _date_utils = __webpack_require__(118);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DateInput = _react2.default.createClass({
  displayName: 'DateInput',

  propTypes: {
    customInput: _react2.default.PropTypes.element,
    date: _react2.default.PropTypes.object,
    dateFormat: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.array]),
    disabled: _react2.default.PropTypes.bool,
    excludeDates: _react2.default.PropTypes.array,
    filterDate: _react2.default.PropTypes.func,
    includeDates: _react2.default.PropTypes.array,
    locale: _react2.default.PropTypes.string,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    onBlur: _react2.default.PropTypes.func,
    onChange: _react2.default.PropTypes.func,
    onChangeRaw: _react2.default.PropTypes.func,
    onChangeDate: _react2.default.PropTypes.func
  },

  getDefaultProps: function getDefaultProps() {
    return {
      dateFormat: 'L'
    };
  },
  getInitialState: function getInitialState() {
    return {
      value: this.safeDateFormat(this.props)
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (!(0, _date_utils.isSameDay)(newProps.date, this.props.date) || !(0, _date_utils.isSameUtcOffset)(newProps.date, this.props.date) || newProps.locale !== this.props.locale || newProps.dateFormat !== this.props.dateFormat) {
      this.setState({
        value: this.safeDateFormat(newProps)
      });
    }
  },
  handleChange: function handleChange(event) {
    if (this.props.onChange) {
      this.props.onChange(event);
    }
    if (this.props.onChangeRaw) {
      this.props.onChangeRaw(event);
    }
    if (!event.defaultPrevented) {
      this.handleChangeDate(event.target.value);
    }
  },
  handleChangeDate: function handleChangeDate(value) {
    if (this.props.onChangeDate) {
      var date = (0, _WFMoment2.default)(value.trim(), this.props.dateFormat, this.props.locale || _WFMoment2.default.locale(), true);
      if (date.isValid() && !(0, _date_utils.isDayDisabled)(date, this.props)) {
        this.props.onChangeDate(date);
      } else if (value === '') {
        this.props.onChangeDate(null);
      }
    }
    this.setState({ value: value });
  },
  safeDateFormat: function safeDateFormat(props) {
    return props.date && props.date.clone().locale(props.locale || _WFMoment2.default.locale()).format(Array.isArray(props.dateFormat) ? props.dateFormat[0] : props.dateFormat) || '';
  },
  handleBlur: function handleBlur(event) {
    this.setState({
      value: this.safeDateFormat(this.props)
    });
    if (this.props.onBlur) {
      this.props.onBlur(event);
    }
  },
  focus: function focus() {
    this.refs.input.focus();
  },
  render: function render() {
    var _props = this.props,
        customInput = _props.customInput,
        date = _props.date,
        locale = _props.locale,
        minDate = _props.minDate,
        maxDate = _props.maxDate,
        excludeDates = _props.excludeDates,
        includeDates = _props.includeDates,
        filterDate = _props.filterDate,
        dateFormat = _props.dateFormat,
        onChangeDate = _props.onChangeDate,
        onChangeRaw = _props.onChangeRaw,
        rest = (0, _objectWithoutProperties3.default)(_props, ['customInput', 'date', 'locale', 'minDate', 'maxDate', 'excludeDates', 'includeDates', 'filterDate', 'dateFormat', 'onChangeDate', 'onChangeRaw']); // eslint-disable-line no-unused-vars

    if (customInput) {
      return _react2.default.cloneElement(customInput, (0, _extends3.default)({}, rest, {
        ref: 'input',
        value: this.state.value,
        onBlur: this.handleBlur,
        onChange: this.handleChange
      }));
    } else {
      return _react2.default.createElement('input', (0, _extends3.default)({
        ref: 'input',
        type: 'text'
      }, rest, {
        value: this.state.value,
        onBlur: this.handleBlur,
        onChange: this.handleChange }));
    }
  }
});

module.exports = DateInput;

/***/ }),
/* 389 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _date_input = __webpack_require__(388);

var _date_input2 = _interopRequireDefault(_date_input);

var _calendar = __webpack_require__(387);

var _calendar2 = _interopRequireDefault(_calendar);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _tether_component = __webpack_require__(394);

var _tether_component2 = _interopRequireDefault(_tether_component);

var _classnames2 = __webpack_require__(105);

var _classnames3 = _interopRequireDefault(_classnames2);

var _date_utils = __webpack_require__(118);

var _reactOnclickoutside = __webpack_require__(196);

var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var outsideClickIgnoreClass = 'react-datepicker-ignore-onclickoutside';
var WrappedCalendar = (0, _reactOnclickoutside2.default)(_calendar2.default);

/**
 * General datepicker component.
 */

var DatePicker = _react2.default.createClass({
  displayName: 'DatePicker',

  propTypes: {
    autoComplete: _react2.default.PropTypes.string,
    autoFocus: _react2.default.PropTypes.bool,
    calendarClassName: _react2.default.PropTypes.string,
    children: _react2.default.PropTypes.node,
    className: _react2.default.PropTypes.string,
    customInput: _react2.default.PropTypes.element,
    dateFormat: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.array]),
    dateFormatCalendar: _react2.default.PropTypes.string,
    disabled: _react2.default.PropTypes.bool,
    disabledKeyboardNavigation: _react2.default.PropTypes.bool,
    dropdownMode: _react2.default.PropTypes.oneOf(['scroll', 'select']).isRequired,
    endDate: _react2.default.PropTypes.object,
    excludeDates: _react2.default.PropTypes.array,
    filterDate: _react2.default.PropTypes.func,
    fixedHeight: _react2.default.PropTypes.bool,
    highlightDates: _react2.default.PropTypes.array,
    id: _react2.default.PropTypes.string,
    includeDates: _react2.default.PropTypes.array,
    inline: _react2.default.PropTypes.bool,
    isClearable: _react2.default.PropTypes.bool,
    locale: _react2.default.PropTypes.string,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    monthsShown: _react2.default.PropTypes.number,
    name: _react2.default.PropTypes.string,
    onBlur: _react2.default.PropTypes.func,
    onChange: _react2.default.PropTypes.func.isRequired,
    onChangeRaw: _react2.default.PropTypes.func,
    onFocus: _react2.default.PropTypes.func,
    onMonthChange: _react2.default.PropTypes.func,
    openToDate: _react2.default.PropTypes.object,
    peekNextMonth: _react2.default.PropTypes.bool,
    placeholderText: _react2.default.PropTypes.string,
    popoverAttachment: _react2.default.PropTypes.string,
    popoverTargetAttachment: _react2.default.PropTypes.string,
    popoverTargetOffset: _react2.default.PropTypes.string,
    readOnly: _react2.default.PropTypes.bool,
    renderCalendarTo: _react2.default.PropTypes.any,
    required: _react2.default.PropTypes.bool,
    scrollableYearDropdown: _react2.default.PropTypes.bool,
    selected: _react2.default.PropTypes.object,
    selectsEnd: _react2.default.PropTypes.bool,
    selectsStart: _react2.default.PropTypes.bool,
    showMonthDropdown: _react2.default.PropTypes.bool,
    showWeekNumbers: _react2.default.PropTypes.bool,
    showYearDropdown: _react2.default.PropTypes.bool,
    forceShowMonthNavigation: _react2.default.PropTypes.bool,
    startDate: _react2.default.PropTypes.object,
    tabIndex: _react2.default.PropTypes.number,
    tetherConstraints: _react2.default.PropTypes.array,
    title: _react2.default.PropTypes.string,
    todayButton: _react2.default.PropTypes.string,
    utcOffset: _react2.default.PropTypes.number,
    withPortal: _react2.default.PropTypes.bool
  },

  getDefaultProps: function getDefaultProps() {
    return {
      dateFormatCalendar: 'MMMM YYYY',
      onChange: function onChange() {},

      disabled: false,
      disabledKeyboardNavigation: false,
      dropdownMode: 'scroll',
      onFocus: function onFocus() {},
      onBlur: function onBlur() {},
      onMonthChange: function onMonthChange() {},

      popoverAttachment: 'top left',
      popoverTargetAttachment: 'bottom left',
      popoverTargetOffset: '10px 0',
      tetherConstraints: [{
        to: 'window',
        attachment: 'together'
      }],
      utcOffset: (0, _WFMoment2.default)().utcOffset(),
      monthsShown: 1,
      withPortal: false
    };
  },
  getInitialState: function getInitialState() {
    var defaultPreSelection = this.props.openToDate ? (0, _WFMoment2.default)(this.props.openToDate) : (0, _WFMoment2.default)();
    return {
      open: false,
      preventFocus: false,
      preSelection: this.props.selected ? (0, _WFMoment2.default)(this.props.selected) : defaultPreSelection
    };
  },
  componentWillUnmount: function componentWillUnmount() {
    this.clearPreventFocusTimeout();
  },
  clearPreventFocusTimeout: function clearPreventFocusTimeout() {
    if (this.preventFocusTimeout) {
      clearTimeout(this.preventFocusTimeout);
    }
  },
  setFocus: function setFocus() {
    this.refs.input.focus();
  },
  setOpen: function setOpen(open) {
    this.setState({
      open: open,
      preSelection: open && this.state.open ? this.state.preSelection : this.getInitialState().preSelection
    });
  },
  handleFocus: function handleFocus(event) {
    if (!this.state.preventFocus) {
      this.props.onFocus(event);
      this.setOpen(true);
    }
  },
  cancelFocusInput: function cancelFocusInput() {
    clearTimeout(this.inputFocusTimeout);
    this.inputFocusTimeout = null;
  },
  deferFocusInput: function deferFocusInput() {
    var _this = this;

    this.cancelFocusInput();
    this.inputFocusTimeout = window.setTimeout(function () {
      return _this.setFocus();
    }, 1);
  },
  handleDropdownFocus: function handleDropdownFocus() {
    this.cancelFocusInput();
  },
  handleBlur: function handleBlur(event) {
    if (this.state.open) {
      this.deferFocusInput();
    } else {
      this.props.onBlur(event);
    }
  },
  handleCalendarClickOutside: function handleCalendarClickOutside(event) {
    this.setOpen(false);
    if (this.props.withPortal) {
      event.preventDefault();
    }
  },
  handleSelect: function handleSelect(date, event) {
    var _this2 = this;

    // Preventing onFocus event to fix issue
    // https://github.com/Hacker0x01/react-datepicker/issues/628
    this.setState({ preventFocus: true }, function () {
      _this2.preventFocusTimeout = setTimeout(function () {
        return _this2.setState({ preventFocus: false });
      }, 50);
      return _this2.preventFocusTimeout;
    });
    this.setSelected(date, event);
    this.setOpen(false);
  },
  setSelected: function setSelected(date, event) {
    var changedDate = date;

    if (changedDate !== null && (0, _date_utils.isDayDisabled)(changedDate, this.props)) {
      return;
    }

    if (!(0, _date_utils.isSameDay)(this.props.selected, changedDate)) {
      if (changedDate !== null) {
        if (this.props.selected) {
          changedDate = (0, _WFMoment2.default)(changedDate).set({
            hour: this.props.selected.hour(),
            minute: this.props.selected.minute(),
            second: this.props.selected.second()
          });
        }
        this.setState({
          preSelection: changedDate
        });
      }

      this.props.onChange(changedDate, event);
    }
  },
  setPreSelection: function setPreSelection(date) {
    var isDateRangePresent = typeof this.props.minDate !== 'undefined' && typeof this.props.maxDate !== 'undefined';
    var isValidDateSelection = isDateRangePresent ? (0, _date_utils.isDayInRange)(date, this.props.minDate, this.props.maxDate) : true;
    if (isValidDateSelection) {
      this.setState({
        preSelection: date
      });
    }
  },
  onInputClick: function onInputClick() {
    if (!this.props.disabled) {
      this.setOpen(true);
    }
  },
  onInputKeyDown: function onInputKeyDown(event) {
    if (!this.state.open && !this.props.inline) {
      if (/^Arrow/.test(event.key)) {
        this.onInputClick();
      }
      return;
    }
    var copy = (0, _WFMoment2.default)(this.state.preSelection);
    if (event.key === 'Enter') {
      event.preventDefault();
      this.handleSelect(copy, event);
    } else if (event.key === 'Escape') {
      event.preventDefault();
      this.setOpen(false);
    } else if (event.key === 'Tab') {
      this.setOpen(false);
    }
    if (!this.props.disabledKeyboardNavigation) {
      var newSelection = void 0;
      switch (event.key) {
        case 'ArrowLeft':
          event.preventDefault();
          newSelection = copy.subtract(1, 'days');
          break;
        case 'ArrowRight':
          event.preventDefault();
          newSelection = copy.add(1, 'days');
          break;
        case 'ArrowUp':
          event.preventDefault();
          newSelection = copy.subtract(1, 'weeks');
          break;
        case 'ArrowDown':
          event.preventDefault();
          newSelection = copy.add(1, 'weeks');
          break;
        case 'PageUp':
          event.preventDefault();
          newSelection = copy.subtract(1, 'months');
          break;
        case 'PageDown':
          event.preventDefault();
          newSelection = copy.add(1, 'months');
          break;
        case 'Home':
          event.preventDefault();
          newSelection = copy.subtract(1, 'years');
          break;
        case 'End':
          event.preventDefault();
          newSelection = copy.add(1, 'years');
          break;
      }
      this.setPreSelection(newSelection);
    }
  },
  onClearClick: function onClearClick(event) {
    event.preventDefault();
    this.props.onChange(null, event);
  },
  renderCalendar: function renderCalendar() {
    if (!this.props.inline && (!this.state.open || this.props.disabled)) {
      return null;
    }
    return _react2.default.createElement(
      WrappedCalendar,
      {
        ref: 'calendar',
        locale: this.props.locale,
        dateFormat: this.props.dateFormatCalendar,
        dropdownMode: this.props.dropdownMode,
        selected: this.props.selected,
        preSelection: this.state.preSelection,
        onSelect: this.handleSelect,
        openToDate: this.props.openToDate,
        minDate: this.props.minDate,
        maxDate: this.props.maxDate,
        selectsStart: this.props.selectsStart,
        selectsEnd: this.props.selectsEnd,
        startDate: this.props.startDate,
        endDate: this.props.endDate,
        excludeDates: this.props.excludeDates,
        filterDate: this.props.filterDate,
        onClickOutside: this.handleCalendarClickOutside,
        highlightDates: this.props.highlightDates,
        includeDates: this.props.includeDates,
        inline: this.props.inline,
        peekNextMonth: this.props.peekNextMonth,
        showMonthDropdown: this.props.showMonthDropdown,
        showWeekNumbers: this.props.showWeekNumbers,
        showYearDropdown: this.props.showYearDropdown,
        forceShowMonthNavigation: this.props.forceShowMonthNavigation,
        scrollableYearDropdown: this.props.scrollableYearDropdown,
        todayButton: this.props.todayButton,
        utcOffset: this.props.utcOffset,
        outsideClickIgnoreClass: outsideClickIgnoreClass,
        fixedHeight: this.props.fixedHeight,
        monthsShown: this.props.monthsShown,
        onDropdownFocus: this.handleDropdownFocus,
        onMonthChange: this.props.onMonthChange,
        className: this.props.calendarClassName },
      this.props.children
    );
  },
  renderDateInput: function renderDateInput() {
    var className = (0, _classnames3.default)(this.props.className, (0, _defineProperty3.default)({}, outsideClickIgnoreClass, this.state.open));
    return _react2.default.createElement(_date_input2.default, {
      ref: 'input',
      id: this.props.id,
      name: this.props.name,
      autoFocus: this.props.autoFocus,
      date: this.props.selected,
      locale: this.props.locale,
      minDate: this.props.minDate,
      maxDate: this.props.maxDate,
      excludeDates: this.props.excludeDates,
      includeDates: this.props.includeDates,
      filterDate: this.props.filterDate,
      dateFormat: this.props.dateFormat,
      onFocus: this.handleFocus,
      onBlur: this.handleBlur,
      onClick: this.onInputClick,
      onChangeRaw: this.props.onChangeRaw,
      onKeyDown: this.onInputKeyDown,
      onChangeDate: this.setSelected,
      placeholder: this.props.placeholderText,
      disabled: this.props.disabled,
      autoComplete: this.props.autoComplete,
      className: className,
      title: this.props.title,
      readOnly: this.props.readOnly,
      required: this.props.required,
      tabIndex: this.props.tabIndex,
      customInput: this.props.customInput });
  },
  renderClearButton: function renderClearButton() {
    if (this.props.isClearable && this.props.selected != null) {
      return _react2.default.createElement('a', { className: 'react-datepicker__close-icon', href: '#', onClick: this.onClearClick });
    } else {
      return null;
    }
  },
  render: function render() {
    var calendar = this.renderCalendar();

    if (this.props.inline && !this.props.withPortal) {
      return calendar;
    }

    if (this.props.withPortal) {
      return _react2.default.createElement(
        'div',
        null,
        !this.props.inline ? _react2.default.createElement(
          'div',
          { className: 'react-datepicker__input-container' },
          this.renderDateInput(),
          this.renderClearButton()
        ) : null,
        this.state.open || this.props.inline ? _react2.default.createElement(
          'div',
          { className: 'react-datepicker__portal' },
          calendar
        ) : null
      );
    }

    return _react2.default.createElement(
      _tether_component2.default,
      {
        classPrefix: 'react-datepicker__tether',
        attachment: this.props.popoverAttachment,
        targetAttachment: this.props.popoverTargetAttachment,
        targetOffset: this.props.popoverTargetOffset,
        renderElementTo: this.props.renderCalendarTo,
        constraints: this.props.tetherConstraints },
      _react2.default.createElement(
        'div',
        { className: 'react-datepicker__input-container' },
        this.renderDateInput(),
        this.renderClearButton()
      ),
      calendar
    );
  }
});

module.exports = DatePicker;

/***/ }),
/* 390 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(105);

var _classnames2 = _interopRequireDefault(_classnames);

var _date_utils = __webpack_require__(118);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Day = _react2.default.createClass({
  displayName: 'Day',

  propTypes: {
    day: _react2.default.PropTypes.object.isRequired,
    endDate: _react2.default.PropTypes.object,
    highlightDates: _react2.default.PropTypes.array,
    inline: _react2.default.PropTypes.bool,
    month: _react2.default.PropTypes.number,
    onClick: _react2.default.PropTypes.func,
    onMouseEnter: _react2.default.PropTypes.func,
    preSelection: _react2.default.PropTypes.object,
    selected: _react2.default.PropTypes.object,
    selectingDate: _react2.default.PropTypes.object,
    selectsEnd: _react2.default.PropTypes.bool,
    selectsStart: _react2.default.PropTypes.bool,
    startDate: _react2.default.PropTypes.object,
    utcOffset: _react2.default.PropTypes.number
  },
  getDefaultProps: function getDefaultProps() {
    return {
      utcOffset: _WFMoment2.default.utc().utcOffset()
    };
  },
  handleClick: function handleClick(event) {
    if (!this.isDisabled() && this.props.onClick) {
      this.props.onClick(event);
    }
  },
  handleMouseEnter: function handleMouseEnter(event) {
    if (!this.isDisabled() && this.props.onMouseEnter) {
      this.props.onMouseEnter(event);
    }
  },
  isSameDay: function isSameDay(other) {
    return (0, _date_utils.isSameDay)(this.props.day, other);
  },
  isKeyboardSelected: function isKeyboardSelected() {
    return !this.props.inline && !this.isSameDay(this.props.selected) && this.isSameDay(this.props.preSelection);
  },
  isDisabled: function isDisabled() {
    return (0, _date_utils.isDayDisabled)(this.props.day, this.props);
  },
  isHighlighted: function isHighlighted() {
    var _props = this.props,
        day = _props.day,
        highlightDates = _props.highlightDates;

    if (!highlightDates) return false;
    return highlightDates.some(function (testDay) {
      return (0, _date_utils.isSameDay)(day, testDay);
    });
  },
  isInRange: function isInRange() {
    var _props2 = this.props,
        day = _props2.day,
        startDate = _props2.startDate,
        endDate = _props2.endDate;

    if (!startDate || !endDate) return false;
    return (0, _date_utils.isDayInRange)(day, startDate, endDate);
  },
  isInSelectingRange: function isInSelectingRange() {
    var _props3 = this.props,
        day = _props3.day,
        selectsStart = _props3.selectsStart,
        selectsEnd = _props3.selectsEnd,
        selectingDate = _props3.selectingDate,
        startDate = _props3.startDate,
        endDate = _props3.endDate;


    if (!(selectsStart || selectsEnd) || !selectingDate || this.isDisabled()) {
      return false;
    }

    if (selectsStart && endDate && selectingDate.isSameOrBefore(endDate)) {
      return (0, _date_utils.isDayInRange)(day, selectingDate, endDate);
    }

    if (selectsEnd && startDate && selectingDate.isSameOrAfter(startDate)) {
      return (0, _date_utils.isDayInRange)(day, startDate, selectingDate);
    }

    return false;
  },
  isSelectingRangeStart: function isSelectingRangeStart() {
    if (!this.isInSelectingRange()) {
      return false;
    }

    var _props4 = this.props,
        day = _props4.day,
        selectingDate = _props4.selectingDate,
        startDate = _props4.startDate,
        selectsStart = _props4.selectsStart;


    if (selectsStart) {
      return (0, _date_utils.isSameDay)(day, selectingDate);
    } else {
      return (0, _date_utils.isSameDay)(day, startDate);
    }
  },
  isSelectingRangeEnd: function isSelectingRangeEnd() {
    if (!this.isInSelectingRange()) {
      return false;
    }

    var _props5 = this.props,
        day = _props5.day,
        selectingDate = _props5.selectingDate,
        endDate = _props5.endDate,
        selectsEnd = _props5.selectsEnd;


    if (selectsEnd) {
      return (0, _date_utils.isSameDay)(day, selectingDate);
    } else {
      return (0, _date_utils.isSameDay)(day, endDate);
    }
  },
  isRangeStart: function isRangeStart() {
    var _props6 = this.props,
        day = _props6.day,
        startDate = _props6.startDate,
        endDate = _props6.endDate;

    if (!startDate || !endDate) return false;
    return (0, _date_utils.isSameDay)(startDate, day);
  },
  isRangeEnd: function isRangeEnd() {
    var _props7 = this.props,
        day = _props7.day,
        startDate = _props7.startDate,
        endDate = _props7.endDate;

    if (!startDate || !endDate) return false;
    return (0, _date_utils.isSameDay)(endDate, day);
  },
  isWeekend: function isWeekend() {
    var weekday = this.props.day.day();
    return weekday === 0 || weekday === 6;
  },
  isOutsideMonth: function isOutsideMonth() {
    return this.props.month !== undefined && this.props.month !== this.props.day.month();
  },
  getClassNames: function getClassNames() {
    return (0, _classnames2.default)('react-datepicker__day', {
      'react-datepicker__day--disabled': this.isDisabled(),
      'react-datepicker__day--selected': this.isSameDay(this.props.selected),
      'react-datepicker__day--keyboard-selected': this.isKeyboardSelected(),
      'react-datepicker__day--highlighted': this.isHighlighted(),
      'react-datepicker__day--range-start': this.isRangeStart(),
      'react-datepicker__day--range-end': this.isRangeEnd(),
      'react-datepicker__day--in-range': this.isInRange(),
      'react-datepicker__day--in-selecting-range': this.isInSelectingRange(),
      'react-datepicker__day--selecting-range-start': this.isSelectingRangeStart(),
      'react-datepicker__day--selecting-range-end': this.isSelectingRangeEnd(),
      'react-datepicker__day--today': this.isSameDay(_WFMoment2.default.utc().utcOffset(this.props.utcOffset)),
      'react-datepicker__day--weekend': this.isWeekend(),
      'react-datepicker__day--outside-month': this.isOutsideMonth()
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      {
        className: this.getClassNames(),
        onClick: this.handleClick,
        onMouseEnter: this.handleMouseEnter,
        'aria-label': 'day-' + this.props.day.date(),
        role: 'option' },
      this.props.day.date()
    );
  }
});

module.exports = Day;

/***/ }),
/* 391 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(105);

var _classnames2 = _interopRequireDefault(_classnames);

var _week = __webpack_require__(395);

var _week2 = _interopRequireDefault(_week);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FIXED_HEIGHT_STANDARD_WEEK_COUNT = 6;

var Month = _react2.default.createClass({
  displayName: 'Month',

  propTypes: {
    day: _react2.default.PropTypes.object.isRequired,
    endDate: _react2.default.PropTypes.object,
    excludeDates: _react2.default.PropTypes.array,
    filterDate: _react2.default.PropTypes.func,
    fixedHeight: _react2.default.PropTypes.bool,
    highlightDates: _react2.default.PropTypes.array,
    includeDates: _react2.default.PropTypes.array,
    inline: _react2.default.PropTypes.bool,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    onDayClick: _react2.default.PropTypes.func,
    onDayMouseEnter: _react2.default.PropTypes.func,
    onMouseLeave: _react2.default.PropTypes.func,
    peekNextMonth: _react2.default.PropTypes.bool,
    preSelection: _react2.default.PropTypes.object,
    selected: _react2.default.PropTypes.object,
    selectingDate: _react2.default.PropTypes.object,
    selectsEnd: _react2.default.PropTypes.bool,
    selectsStart: _react2.default.PropTypes.bool,
    showWeekNumbers: _react2.default.PropTypes.bool,
    startDate: _react2.default.PropTypes.object,
    utcOffset: _react2.default.PropTypes.number
  },

  handleDayClick: function handleDayClick(day, event) {
    if (this.props.onDayClick) {
      this.props.onDayClick(day, event);
    }
  },
  handleDayMouseEnter: function handleDayMouseEnter(day) {
    if (this.props.onDayMouseEnter) {
      this.props.onDayMouseEnter(day);
    }
  },
  handleMouseLeave: function handleMouseLeave() {
    if (this.props.onMouseLeave) {
      this.props.onMouseLeave();
    }
  },
  isWeekInMonth: function isWeekInMonth(startOfWeek) {
    var day = this.props.day;
    var endOfWeek = startOfWeek.clone().add(6, 'days');
    return startOfWeek.isSame(day, 'month') || endOfWeek.isSame(day, 'month');
  },
  renderWeeks: function renderWeeks() {
    var weeks = [];
    var isFixedHeight = this.props.fixedHeight;
    var currentWeekStart = this.props.day.clone().startOf('month').startOf('week');
    var i = 0;
    var breakAfterNextPush = false;

    while (true) {
      weeks.push(_react2.default.createElement(_week2.default, {
        key: i,
        day: currentWeekStart,
        month: this.props.day.month(),
        onDayClick: this.handleDayClick,
        onDayMouseEnter: this.handleDayMouseEnter,
        minDate: this.props.minDate,
        maxDate: this.props.maxDate,
        excludeDates: this.props.excludeDates,
        includeDates: this.props.includeDates,
        inline: this.props.inline,
        highlightDates: this.props.highlightDates,
        selectingDate: this.props.selectingDate,
        filterDate: this.props.filterDate,
        preSelection: this.props.preSelection,
        selected: this.props.selected,
        selectsStart: this.props.selectsStart,
        selectsEnd: this.props.selectsEnd,
        showWeekNumber: this.props.showWeekNumbers,
        startDate: this.props.startDate,
        endDate: this.props.endDate,
        utcOffset: this.props.utcOffset }));

      if (breakAfterNextPush) break;

      i++;
      currentWeekStart = currentWeekStart.clone().add(1, 'weeks');

      // If one of these conditions is true, we will either break on this week
      // or break on the next week
      var isFixedAndFinalWeek = isFixedHeight && i >= FIXED_HEIGHT_STANDARD_WEEK_COUNT;
      var isNonFixedAndOutOfMonth = !isFixedHeight && !this.isWeekInMonth(currentWeekStart);

      if (isFixedAndFinalWeek || isNonFixedAndOutOfMonth) {
        if (this.props.peekNextMonth) {
          breakAfterNextPush = true;
        } else {
          break;
        }
      }
    }

    return weeks;
  },
  getClassNames: function getClassNames() {
    var _props = this.props,
        selectingDate = _props.selectingDate,
        selectsStart = _props.selectsStart,
        selectsEnd = _props.selectsEnd;

    return (0, _classnames2.default)('react-datepicker__month', {
      'react-datepicker__month--selecting-range': selectingDate && (selectsStart || selectsEnd)
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: this.getClassNames(), onMouseLeave: this.handleMouseLeave, role: 'listbox' },
      this.renderWeeks()
    );
  }
});

module.exports = Month;

/***/ }),
/* 392 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _month_dropdown_options = __webpack_require__(393);

var _month_dropdown_options2 = _interopRequireDefault(_month_dropdown_options);

var _reactOnclickoutside = __webpack_require__(196);

var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WrappedMonthDropdownOptions = (0, _reactOnclickoutside2.default)(_month_dropdown_options2.default);

var MonthDropdown = _react2.default.createClass({
  displayName: 'MonthDropdown',

  propTypes: {
    dropdownMode: _react2.default.PropTypes.oneOf(['scroll', 'select']).isRequired,
    locale: _react2.default.PropTypes.string,
    month: _react2.default.PropTypes.number.isRequired,
    onChange: _react2.default.PropTypes.func.isRequired
  },

  getInitialState: function getInitialState() {
    return {
      dropdownVisible: false
    };
  },
  renderSelectOptions: function renderSelectOptions(monthNames) {
    return monthNames.map(function (M, i) {
      return _react2.default.createElement(
        'option',
        { key: i, value: i },
        M
      );
    });
  },
  renderSelectMode: function renderSelectMode(monthNames) {
    var _this = this;

    return _react2.default.createElement(
      'select',
      { value: this.props.month, className: 'react-datepicker__month-select', onChange: function onChange(e) {
          return _this.onChange(e.target.value);
        } },
      this.renderSelectOptions(monthNames)
    );
  },
  renderReadView: function renderReadView(visible, monthNames) {
    return _react2.default.createElement(
      'div',
      { key: 'read', style: { visibility: visible ? 'visible' : 'hidden' }, className: 'react-datepicker__month-read-view', onClick: this.toggleDropdown },
      _react2.default.createElement(
        'span',
        { className: 'react-datepicker__month-read-view--selected-month' },
        monthNames[this.props.month]
      ),
      _react2.default.createElement('span', { className: 'react-datepicker__month-read-view--down-arrow' })
    );
  },
  renderDropdown: function renderDropdown(monthNames) {
    return _react2.default.createElement(WrappedMonthDropdownOptions, {
      key: 'dropdown',
      ref: 'options',
      month: this.props.month,
      monthNames: monthNames,
      onChange: this.onChange,
      onCancel: this.toggleDropdown });
  },
  renderScrollMode: function renderScrollMode(monthNames) {
    var dropdownVisible = this.state.dropdownVisible;

    var result = [this.renderReadView(!dropdownVisible, monthNames)];
    if (dropdownVisible) {
      result.unshift(this.renderDropdown(monthNames));
    }
    return result;
  },
  onChange: function onChange(month) {
    this.toggleDropdown();
    if (month !== this.props.month) {
      this.props.onChange(month);
    }
  },
  toggleDropdown: function toggleDropdown() {
    this.setState({
      dropdownVisible: !this.state.dropdownVisible
    });
  },
  render: function render() {
    var localeData = _WFMoment2.default.localeData(this.props.locale);
    var monthNames = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(function (M) {
      return localeData.months((0, _WFMoment2.default)({ M: M }));
    });

    var renderedDropdown = void 0;
    switch (this.props.dropdownMode) {
      case 'scroll':
        renderedDropdown = this.renderScrollMode(monthNames);
        break;
      case 'select':
        renderedDropdown = this.renderSelectMode(monthNames);
        break;
    }

    return _react2.default.createElement(
      'div',
      {
        className: 'react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--' + this.props.dropdownMode },
      renderedDropdown
    );
  }
});

module.exports = MonthDropdown;

/***/ }),
/* 393 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var MonthDropdownOptions = _react2.default.createClass({
  displayName: 'MonthDropdownOptions',

  propTypes: {
    onCancel: _react2.default.PropTypes.func.isRequired,
    onChange: _react2.default.PropTypes.func.isRequired,
    month: _react2.default.PropTypes.number.isRequired,
    monthNames: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.string.isRequired).isRequired
  },

  renderOptions: function renderOptions() {
    var _this = this;

    var selectedMonth = this.props.month;
    var options = this.props.monthNames.map(function (month, i) {
      return _react2.default.createElement(
        'div',
        { className: 'react-datepicker__month-option',
          key: month,
          ref: month,
          onClick: _this.onChange.bind(_this, i) },
        selectedMonth === i ? _react2.default.createElement(
          'span',
          { className: 'react-datepicker__month-option--selected' },
          '\u2713'
        ) : '',
        month
      );
    });

    return options;
  },
  onChange: function onChange(month) {
    this.props.onChange(month);
  },
  handleClickOutside: function handleClickOutside() {
    this.props.onCancel();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'react-datepicker__month-dropdown' },
      this.renderOptions()
    );
  }
});

module.exports = MonthDropdownOptions;

/***/ }),
/* 394 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _objectWithoutProperties2 = __webpack_require__(269);

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _tether = __webpack_require__(894);

var _tether2 = _interopRequireDefault(_tether);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function childrenPropType(_ref, propName, componentName) {
  var children = _ref.children;

  var childCount = _react.Children.count(children);
  if (childCount <= 0) {
    return new Error(componentName + ' expects at least one child to use as the target element.');
  } else if (childCount > 2) {
    return new Error('Only a max of two children allowed in ' + componentName + '.');
  }
}

var attachmentPositions = ['top left', 'top center', 'top right', 'middle left', 'middle center', 'middle right', 'bottom left', 'bottom center', 'bottom right'];

var TetherComponent = _react2.default.createClass({
  displayName: 'TetherComponent',

  propTypes: {
    attachment: _react.PropTypes.oneOf(attachmentPositions).isRequired,
    children: childrenPropType,
    className: _react.PropTypes.string,
    classPrefix: _react.PropTypes.string,
    classes: _react.PropTypes.object,
    constraints: _react.PropTypes.array,
    enabled: _react.PropTypes.bool,
    id: _react.PropTypes.string,
    offset: _react.PropTypes.string,
    optimizations: _react.PropTypes.object,
    renderElementTag: _react.PropTypes.string,
    renderElementTo: _react.PropTypes.any,
    style: _react.PropTypes.object,
    targetAttachment: _react.PropTypes.oneOf(attachmentPositions),
    targetModifier: _react.PropTypes.string,
    targetOffset: _react.PropTypes.string
  },

  getDefaultProps: function getDefaultProps() {
    return {
      renderElementTag: 'div',
      renderElementTo: null
    };
  },
  componentDidMount: function componentDidMount() {
    this._targetNode = _reactDom2.default.findDOMNode(this);
    this._update();
  },
  componentDidUpdate: function componentDidUpdate() {
    this._update();
  },
  componentWillUnmount: function componentWillUnmount() {
    this._destroy();
  },
  disable: function disable() {
    this._tether.disable();
  },
  enable: function enable() {
    this._tether.enable();
  },
  position: function position() {
    this._tether.position();
  },
  _destroy: function _destroy() {
    if (this._elementParentNode) {
      _reactDom2.default.unmountComponentAtNode(this._elementParentNode);
      this._elementParentNode.parentNode.removeChild(this._elementParentNode);
    }

    if (this._tether) {
      this._tether.destroy();
    }

    this._elementParentNode = null;
    this._tether = null;
  },
  _update: function _update() {
    var _this = this;

    var _props = this.props,
        children = _props.children,
        renderElementTag = _props.renderElementTag,
        renderElementTo = _props.renderElementTo;

    var elementComponent = children[1];

    // if no element component provided, bail out
    if (!elementComponent) {
      // destroy Tether elements if they have been created
      if (this._tether) {
        this._destroy();
      }
      return;
    }

    // create element node container if it hasn't been yet
    if (!this._elementParentNode) {
      // create a node that we can stick our content Component in
      this._elementParentNode = document.createElement(renderElementTag);

      // append node to the end of the body
      var renderTo = renderElementTo || document.body;
      renderTo.appendChild(this._elementParentNode);
    }

    // render element component into the DOM
    _reactDom2.default.unstable_renderSubtreeIntoContainer(this, elementComponent, this._elementParentNode, function () {
      // don't update Tether until the subtree has finished rendering
      _this._updateTether();
    });
  },
  _updateTether: function _updateTether() {
    var _props2 = this.props,
        renderElementTag = _props2.renderElementTag,
        renderElementTo = _props2.renderElementTo,
        options = (0, _objectWithoutProperties3.default)(_props2, ['renderElementTag', 'renderElementTo']); // eslint-disable-line no-unused-vars

    var tetherOptions = (0, _extends3.default)({
      target: this._targetNode,
      element: this._elementParentNode
    }, options);

    if (!this._tether) {
      this._tether = new _tether2.default(tetherOptions);
    } else {
      this._tether.setOptions(tetherOptions);
    }

    this._tether.position();
  },
  render: function render() {
    var children = this.props.children;

    var firstChild = null;

    // we use forEach because the second child could be null
    // causing children to not be an array
    _react.Children.forEach(children, function (child, index) {
      if (index === 0) {
        firstChild = child;
        return false;
      }
    });

    return firstChild;
  }
});

module.exports = TetherComponent;

/***/ }),
/* 395 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _day = __webpack_require__(390);

var _day2 = _interopRequireDefault(_day);

var _week_number = __webpack_require__(396);

var _week_number2 = _interopRequireDefault(_week_number);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Week = _react2.default.createClass({
  displayName: 'Week',

  propTypes: {
    day: _react2.default.PropTypes.object.isRequired,
    endDate: _react2.default.PropTypes.object,
    excludeDates: _react2.default.PropTypes.array,
    filterDate: _react2.default.PropTypes.func,
    highlightDates: _react2.default.PropTypes.array,
    includeDates: _react2.default.PropTypes.array,
    inline: _react2.default.PropTypes.bool,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    month: _react2.default.PropTypes.number,
    onDayClick: _react2.default.PropTypes.func,
    onDayMouseEnter: _react2.default.PropTypes.func,
    preSelection: _react2.default.PropTypes.object,
    selected: _react2.default.PropTypes.object,
    selectingDate: _react2.default.PropTypes.object,
    selectsEnd: _react2.default.PropTypes.bool,
    selectsStart: _react2.default.PropTypes.bool,
    showWeekNumber: _react2.default.PropTypes.bool,
    startDate: _react2.default.PropTypes.object,
    utcOffset: _react2.default.PropTypes.number
  },

  handleDayClick: function handleDayClick(day, event) {
    if (this.props.onDayClick) {
      this.props.onDayClick(day, event);
    }
  },
  handleDayMouseEnter: function handleDayMouseEnter(day) {
    if (this.props.onDayMouseEnter) {
      this.props.onDayMouseEnter(day);
    }
  },
  renderDays: function renderDays() {
    var _this = this;

    var startOfWeek = this.props.day.clone().startOf('week');
    var days = [];
    if (this.props.showWeekNumber) {
      days.push(_react2.default.createElement(_week_number2.default, { key: 'W', weekNumber: parseInt(startOfWeek.format('w'), 10) }));
    }
    return days.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {
      var day = startOfWeek.clone().add(offset, 'days');
      return _react2.default.createElement(_day2.default, {
        key: offset,
        day: day,
        month: _this.props.month,
        onClick: _this.handleDayClick.bind(_this, day),
        onMouseEnter: _this.handleDayMouseEnter.bind(_this, day),
        minDate: _this.props.minDate,
        maxDate: _this.props.maxDate,
        excludeDates: _this.props.excludeDates,
        includeDates: _this.props.includeDates,
        inline: _this.props.inline,
        highlightDates: _this.props.highlightDates,
        selectingDate: _this.props.selectingDate,
        filterDate: _this.props.filterDate,
        preSelection: _this.props.preSelection,
        selected: _this.props.selected,
        selectsStart: _this.props.selectsStart,
        selectsEnd: _this.props.selectsEnd,
        startDate: _this.props.startDate,
        endDate: _this.props.endDate,
        utcOffset: _this.props.utcOffset });
    }));
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'react-datepicker__week' },
      this.renderDays()
    );
  }
});

module.exports = Week;

/***/ }),
/* 396 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WeekNumber = _react2.default.createClass({
  displayName: 'WeekNumber',

  propTypes: {
    weekNumber: _react2.default.PropTypes.number.isRequired
  },

  render: function render() {
    return _react2.default.createElement(
      'div',
      {
        className: 'react-datepicker__week-number',
        'aria-label': 'week-' + this.props.weekNumber },
      this.props.weekNumber
    );
  }
});

module.exports = WeekNumber;

/***/ }),
/* 397 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _year_dropdown_options = __webpack_require__(398);

var _year_dropdown_options2 = _interopRequireDefault(_year_dropdown_options);

var _reactOnclickoutside = __webpack_require__(196);

var _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WrappedYearDropdownOptions = (0, _reactOnclickoutside2.default)(_year_dropdown_options2.default);

var YearDropdown = _react2.default.createClass({
  displayName: 'YearDropdown',

  propTypes: {
    dropdownMode: _react2.default.PropTypes.oneOf(['scroll', 'select']).isRequired,
    maxDate: _react2.default.PropTypes.object,
    minDate: _react2.default.PropTypes.object,
    onChange: _react2.default.PropTypes.func.isRequired,
    scrollableYearDropdown: _react2.default.PropTypes.bool,
    year: _react2.default.PropTypes.number.isRequired
  },

  getInitialState: function getInitialState() {
    return {
      dropdownVisible: false
    };
  },
  renderSelectOptions: function renderSelectOptions() {
    var minYear = this.props.minDate ? this.props.minDate.year() : 1900;
    var maxYear = this.props.maxDate ? this.props.maxDate.year() : 2100;

    var options = [];
    for (var i = minYear; i <= maxYear; i++) {
      options.push(_react2.default.createElement(
        'option',
        { key: i, value: i },
        i
      ));
    }
    return options;
  },
  onSelectChange: function onSelectChange(e) {
    this.onChange(e.target.value);
  },
  renderSelectMode: function renderSelectMode() {
    return _react2.default.createElement(
      'select',
      {
        value: this.props.year,
        className: 'react-datepicker__year-select',
        onChange: this.onSelectChange },
      this.renderSelectOptions()
    );
  },
  renderReadView: function renderReadView(visible) {
    return _react2.default.createElement(
      'div',
      { key: 'read', style: { visibility: visible ? 'visible' : 'hidden' }, className: 'react-datepicker__year-read-view', onClick: this.toggleDropdown },
      _react2.default.createElement('span', { className: 'react-datepicker__year-read-view--down-arrow' }),
      _react2.default.createElement(
        'span',
        { className: 'react-datepicker__year-read-view--selected-year' },
        this.props.year
      )
    );
  },
  renderDropdown: function renderDropdown() {
    return _react2.default.createElement(WrappedYearDropdownOptions, {
      key: 'dropdown',
      ref: 'options',
      year: this.props.year,
      onChange: this.onChange,
      onCancel: this.toggleDropdown,
      scrollableYearDropdown: this.props.scrollableYearDropdown });
  },
  renderScrollMode: function renderScrollMode() {
    var dropdownVisible = this.state.dropdownVisible;

    var result = [this.renderReadView(!dropdownVisible)];
    if (dropdownVisible) {
      result.unshift(this.renderDropdown());
    }
    return result;
  },
  onChange: function onChange(year) {
    this.toggleDropdown();
    if (year === this.props.year) return;
    this.props.onChange(year);
  },
  toggleDropdown: function toggleDropdown() {
    this.setState({
      dropdownVisible: !this.state.dropdownVisible
    });
  },
  render: function render() {
    var renderedDropdown = void 0;
    switch (this.props.dropdownMode) {
      case 'scroll':
        renderedDropdown = this.renderScrollMode();
        break;
      case 'select':
        renderedDropdown = this.renderSelectMode();
        break;
    }

    return _react2.default.createElement(
      'div',
      {
        className: 'react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--' + this.props.dropdownMode },
      renderedDropdown
    );
  }
});

module.exports = YearDropdown;

/***/ }),
/* 398 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(105);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function generateYears(year, noOfYear) {
  var list = [];
  for (var i = 0; i < 2 * noOfYear; i++) {
    list.push(year + noOfYear - i);
  }
  return list;
}

var YearDropdownOptions = _react2.default.createClass({
  displayName: 'YearDropdownOptions',

  propTypes: {
    onCancel: _react2.default.PropTypes.func.isRequired,
    onChange: _react2.default.PropTypes.func.isRequired,
    scrollableYearDropdown: _react2.default.PropTypes.bool,
    year: _react2.default.PropTypes.number.isRequired
  },

  getInitialState: function getInitialState() {
    return {
      yearsList: this.props.scrollableYearDropdown ? generateYears(this.props.year, 10) : generateYears(this.props.year, 5)
    };
  },
  renderOptions: function renderOptions() {
    var _this = this;

    var selectedYear = this.props.year;
    var options = this.state.yearsList.map(function (year) {
      return _react2.default.createElement(
        'div',
        { className: 'react-datepicker__year-option',
          key: year,
          ref: year,
          onClick: _this.onChange.bind(_this, year) },
        selectedYear === year ? _react2.default.createElement(
          'span',
          { className: 'react-datepicker__year-option--selected' },
          '\u2713'
        ) : '',
        year
      );
    });

    options.unshift(_react2.default.createElement(
      'div',
      { className: 'react-datepicker__year-option',
        ref: 'upcoming',
        key: 'upcoming',
        onClick: this.incrementYears },
      _react2.default.createElement('a', { className: 'react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming' })
    ));
    options.push(_react2.default.createElement(
      'div',
      { className: 'react-datepicker__year-option',
        ref: 'previous',
        key: 'previous',
        onClick: this.decrementYears },
      _react2.default.createElement('a', { className: 'react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous' })
    ));
    return options;
  },
  onChange: function onChange(year) {
    this.props.onChange(year);
  },
  handleClickOutside: function handleClickOutside() {
    this.props.onCancel();
  },
  shiftYears: function shiftYears(amount) {
    var years = this.state.yearsList.map(function (year) {
      return year + amount;
    });

    this.setState({
      yearsList: years
    });
  },
  incrementYears: function incrementYears() {
    return this.shiftYears(1);
  },
  decrementYears: function decrementYears() {
    return this.shiftYears(-1);
  },
  render: function render() {
    var dropdownClass = (0, _classnames2.default)({
      'react-datepicker__year-dropdown': true,
      'react-datepicker__year-dropdown--scrollable': this.props.scrollableYearDropdown
    });

    return _react2.default.createElement(
      'div',
      { className: dropdownClass },
      this.renderOptions()
    );
  }
});

module.exports = YearDropdownOptions;

/***/ }),
/* 399 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFCellImg = __webpack_require__(149);

var _WFCellImg2 = _interopRequireDefault(_WFCellImg);

var _WFCellState = __webpack_require__(150);

var _WFCellState2 = _interopRequireDefault(_WFCellState);

var _WFCellIcon = __webpack_require__(148);

var _WFCellIcon2 = _interopRequireDefault(_WFCellIcon);

var _WFCellColor = __webpack_require__(146);

var _WFCellColor2 = _interopRequireDefault(_WFCellColor);

var _WFCellContent = __webpack_require__(147);

var _WFCellContent2 = _interopRequireDefault(_WFCellContent);

var _WFCss = __webpack_require__(101);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// ARCHIVE OPTION ------------------- //
// ------------------- //

var ArchiveOption = function (_Component) {
  (0, _inherits3.default)(ArchiveOption, _Component);

  function ArchiveOption() {
    (0, _classCallCheck3.default)(this, ArchiveOption);
    return (0, _possibleConstructorReturn3.default)(this, (ArchiveOption.__proto__ || (0, _getPrototypeOf2.default)(ArchiveOption)).apply(this, arguments));
  }

  (0, _createClass3.default)(ArchiveOption, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          _props$data = _props.data,
          data = _props$data === undefined ? [] : _props$data,
          _props$isLoading = _props.isLoading,
          isLoading = _props$isLoading === undefined ? false : _props$isLoading,
          _props$searchValue = _props.searchValue,
          searchValue = _props$searchValue === undefined ? "" : _props$searchValue;

      return _react2.default.createElement(
        "div",
        { className: "" + _WFCss2.default.wrapper.optionArchive },
        !isLoading && data.length === 0 ? this.getNotFoundMsg() : this.getOptions()
      );
    }
  }, {
    key: "getNotFoundMsg",
    value: function getNotFoundMsg() {
      return _react2.default.createElement(
        _WFText2.default,
        { className: _WFCss2.default.wrapper.optionNotFound },
        "Option(s) not found..."
      );
    }
  }, {
    key: "getOptions",
    value: function getOptions() {
      var _props2 = this.props,
          _props2$data = _props2.data,
          data = _props2$data === undefined ? [] : _props2$data,
          onSelect = _props2.onSelect,
          isMax = _props2.isMax,
          isMultiple = _props2.isMultiple,
          isSelected = _props2.isSelected,
          _props2$scrollheightM = _props2.scrollheightMin,
          scrollheightMin = _props2$scrollheightM === undefined ? 0 : _props2$scrollheightM,
          _props2$scrollheightM2 = _props2.scrollheightMax,
          scrollheightMax = _props2$scrollheightM2 === undefined ? 340 : _props2$scrollheightM2,
          _props2$scrollAutoHid = _props2.scrollAutoHide,
          scrollAutoHide = _props2$scrollAutoHid === undefined ? true : _props2$scrollAutoHid;

      return _react2.default.createElement(
        _WFScrollBars2.default,
        {
          autoHeight: true,
          autoHide: scrollAutoHide,
          autoHeightMin: scrollheightMin,
          autoHeightMax: scrollheightMax,
          style: { width: "100%" },
          className: "" + _WFCss2.default.scrollbar.optionArchive,
          renderTrackHorizontal: function renderTrackHorizontal(props) {
            return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "track-horizontal" }));
          },
          renderThumbHorizontal: function renderThumbHorizontal(props) {
            return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "thumb-horizontal" }));
          }
        },
        data.map(function (row, i) {
          var _WFValue$getValues = _WFValue2.default.getValues(row),
              _WFValue$getValues$id = _WFValue$getValues.id,
              id = _WFValue$getValues$id === undefined ? null : _WFValue$getValues$id,
              _WFValue$getValues$la = _WFValue$getValues.label,
              label = _WFValue$getValues$la === undefined ? "" : _WFValue$getValues$la,
              _WFValue$getValues$le = _WFValue$getValues.legend,
              legend = _WFValue$getValues$le === undefined ? "" : _WFValue$getValues$le,
              _WFValue$getValues$im = _WFValue$getValues.image,
              image = _WFValue$getValues$im === undefined ? "" : _WFValue$getValues$im,
              _WFValue$getValues$ic = _WFValue$getValues.icon,
              icon = _WFValue$getValues$ic === undefined ? "" : _WFValue$getValues$ic,
              _WFValue$getValues$co = _WFValue$getValues.color,
              color = _WFValue$getValues$co === undefined ? "" : _WFValue$getValues$co;

          if (id === null) {
            return false;
          } else {
            var active = isSelected(id);
            return _react2.default.createElement(
              "div",
              {
                key: id,
                onClick: function onClick() {
                  return onSelect(id);
                },
                className: _WFCss2.default.wrapper.optionOption + " " + (active ? _WFCss2.default.state.active : "") },
              _react2.default.createElement(_WFCellImg2.default, { image: image }),
              _react2.default.createElement(_WFCellState2.default, { checked: active, visible: isMultiple, hiddenNull: isMax }),
              _react2.default.createElement(_WFCellIcon2.default, { image: icon }),
              _react2.default.createElement(_WFCellColor2.default, { color: color }),
              _react2.default.createElement(_WFCellContent2.default, { label: label, legend: legend })
            );
          }
        })
      );
    }
  }]);
  return ArchiveOption;
}(_react.Component);

// ------------------- //


exports.default = ArchiveOption;
// ------------------- //

/***/ }),
/* 400 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFIcon = __webpack_require__(8);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFCss = __webpack_require__(101);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// ARCHIVE SELECTION ------------------- //
// ------------------- //

var ArchiveSelection = function (_Component) {
  (0, _inherits3.default)(ArchiveSelection, _Component);

  function ArchiveSelection() {
    (0, _classCallCheck3.default)(this, ArchiveSelection);
    return (0, _possibleConstructorReturn3.default)(this, (ArchiveSelection.__proto__ || (0, _getPrototypeOf2.default)(ArchiveSelection)).apply(this, arguments));
  }

  (0, _createClass3.default)(ArchiveSelection, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          _props$data = _props.data,
          data = _props$data === undefined ? [] : _props$data,
          onToggle = _props.onToggle,
          onRemove = _props.onRemove;

      return _react2.default.createElement(
        "div",
        { className: "" + _WFCss2.default.wrapper.selectionArchive },
        _react2.default.createElement(
          _WFScrollBars2.default,
          {
            autoHide: true,
            style: { width: "100%", height: 40 },
            className: "" + _WFCss2.default.scrollbar.selectionArchive,
            renderTrackHorizontal: function renderTrackHorizontal(props) {
              return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "track-horizontal" }));
            },
            renderThumbHorizontal: function renderThumbHorizontal(props) {
              return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "thumb-horizontal" }));
            },
            renderTrackVertical: function renderTrackVertical(props) {
              return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "track-vertical" }));
            },
            renderThumbVertical: function renderThumbVertical(props) {
              return _react2.default.createElement("div", (0, _extends3.default)({}, props, { className: "thumb-vertical" }));
            }
          },
          data.map(function (row, i) {
            var _WFValue$getValues = _WFValue2.default.getValues(row),
                _WFValue$getValues$id = _WFValue$getValues.id,
                id = _WFValue$getValues$id === undefined ? null : _WFValue$getValues$id,
                _WFValue$getValues$la = _WFValue$getValues.label,
                label = _WFValue$getValues$la === undefined ? "" : _WFValue$getValues$la,
                _WFValue$getValues$ic = _WFValue$getValues.icon,
                icon = _WFValue$getValues$ic === undefined ? "" : _WFValue$getValues$ic,
                _WFValue$getValues$co = _WFValue$getValues.color,
                color = _WFValue$getValues$co === undefined ? "" : _WFValue$getValues$co;

            if (id === null) {
              return false;
            } else {
              return _react2.default.createElement(
                "div",
                { key: i, className: "" + _WFCss2.default.wrapper.selectionOption },
                _react2.default.createElement(_WFIcon.WFIClose, { onClick: function onClick() {
                    return onRemove(id);
                  } }),
                icon ? _react2.default.createElement(_WFImg2.default, { className: "wf-e-icon", src: icon }) : "",
                !icon && color ? _react2.default.createElement("span", { className: "wf-e-color", style: { background: color } }) : "",
                _react2.default.createElement(
                  _WFText2.default,
                  null,
                  label
                )
              );
            }
          })
        ),
        _react2.default.createElement("span", {
          className: "wf-toggle-bg",
          onClick: function onClick() {
            return onToggle();
          } })
      );
    }
  }]);
  return ArchiveSelection;
}(_react.Component);

// ------------------- //


exports.default = ArchiveSelection;
// ------------------- //

/***/ }),
/* 401 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFIcon = __webpack_require__(8);

var _WFCss = __webpack_require__(101);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// TOGGLE BUTTON ------------------- //
// ------------------- //

var ButtonToggle = function (_Component) {
  (0, _inherits3.default)(ButtonToggle, _Component);

  function ButtonToggle() {
    (0, _classCallCheck3.default)(this, ButtonToggle);
    return (0, _possibleConstructorReturn3.default)(this, (ButtonToggle.__proto__ || (0, _getPrototypeOf2.default)(ButtonToggle)).apply(this, arguments));
  }

  (0, _createClass3.default)(ButtonToggle, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          checked = _props.checked,
          _onClick = _props.onClick;

      return _react2.default.createElement(
        "div",
        { className: "" + _WFCss2.default.wrapper.toggle },
        checked ? _react2.default.createElement(_WFIcon.WFIClose, { onClick: function onClick() {
            return _onClick();
          } }) : _react2.default.createElement(_WFIcon.WFIDown, { onClick: function onClick() {
            return _onClick();
          } })
      );
    }
  }]);
  return ButtonToggle;
}(_react.Component);

// ------------------- //


exports.default = ButtonToggle;
// ------------------- //

/***/ }),
/* 402 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFIcon = __webpack_require__(8);

var _WFLoader = __webpack_require__(99);

var _WFLoader2 = _interopRequireDefault(_WFLoader);

var _WFCss = __webpack_require__(101);

var _WFCss2 = _interopRequireDefault(_WFCss);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// SEARCH INPUT ------------------- //
// ------------------- //

var SearchInput = function (_Component) {
  (0, _inherits3.default)(SearchInput, _Component);

  function SearchInput() {
    (0, _classCallCheck3.default)(this, SearchInput);
    return (0, _possibleConstructorReturn3.default)(this, (SearchInput.__proto__ || (0, _getPrototypeOf2.default)(SearchInput)).apply(this, arguments));
  }

  (0, _createClass3.default)(SearchInput, [{
    key: "render",
    value: function render() {
      var _props = this.props,
          value = _props.value,
          disabled = _props.disabled,
          _props$placeholder = _props.placeholder,
          placeholder = _props$placeholder === undefined ? "Search..." : _props$placeholder,
          searchValue = _props.searchValue,
          isLoading = _props.isLoading,
          _onChange = _props.onChange,
          _onFocus = _props.onFocus;

      return _react2.default.createElement(
        "div",
        { className: "" + _WFCss2.default.wrapper.search },
        isLoading ? _react2.default.createElement(_WFLoader2.default, { color: "#2196F3" }) : _react2.default.createElement(_WFIcon.WFIcon, { icon: "search2" }),
        _react2.default.createElement("input", {
          type: "text",
          readOnly: disabled,
          className: "wf-input-text " + (disabled ? _WFCss2.default.disabled : ""),
          placeholder: placeholder,
          onChange: function onChange(e) {
            return _onChange(e);
          },
          onFocus: function onFocus() {
            return _onFocus();
          },
          value: !disabled ? searchValue : ""
        })
      );
    }
  }]);
  return SearchInput;
}(_react.Component);

// ------------------- //


exports.default = SearchInput;
// ------------------- //

/***/ }),
/* 403 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFormStyleHelper = __webpack_require__(222);

var _WFormStyleHelper2 = _interopRequireDefault(_WFormStyleHelper);

var _WFSelect = __webpack_require__(83);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFCellImg = __webpack_require__(149);

var _WFCellImg2 = _interopRequireDefault(_WFCellImg);

var _WFCellState = __webpack_require__(150);

var _WFCellState2 = _interopRequireDefault(_WFCellState);

var _WFCellIcon = __webpack_require__(148);

var _WFCellIcon2 = _interopRequireDefault(_WFCellIcon);

var _WFCellColor = __webpack_require__(146);

var _WFCellColor2 = _interopRequireDefault(_WFCellColor);

var _WFCellContent = __webpack_require__(147);

var _WFCellContent2 = _interopRequireDefault(_WFCellContent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT IMAGE ------------------- //
// ------------------- //

var WFSelect2Image = function (_Component) {
  (0, _inherits3.default)(WFSelect2Image, _Component);

  function WFSelect2Image(props) {
    (0, _classCallCheck3.default)(this, WFSelect2Image);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect2Image.__proto__ || (0, _getPrototypeOf2.default)(WFSelect2Image)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFSelect2Image, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props = this.props,
          name = _props.name,
          _props$styles = _props.styles,
          styles = _props$styles === undefined ? {} : _props$styles;
      var _styles$optionLabel = styles.optionLabel,
          optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
          _styles$optionLegend = styles.optionLegend,
          optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

      var _WFormStyleHelper$get = _WFormStyleHelper2.default.getOptionStyle(this),
          imageStyle = _WFormStyleHelper$get.imageStyle,
          optionStyle = _WFormStyleHelper$get.optionStyle,
          optionWidth = _WFormStyleHelper$get.optionWidth,
          scrollBarHeight = _WFormStyleHelper$get.scrollBarHeight;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        refId: name,
        didMount: function didMount(wrapper) {
          _WFieldHelper2.default.setSample(_this2, "selectImage");
        }
        //willUnmount={(wrapper) => {}}
        , view: function view(wrapper) {
          return _react2.default.createElement(
            'wf-select-image',
            null,
            _react2.default.createElement(
              _WFScrollBars2.default
              //autoHeight
              ,
              { ref: function ref(c) {
                  return wrapper.scrollbar = c;
                },
                autoHide: false,
                className: 'wf--scrollbar',
                style: { width: "100%", height: parseInt(scrollBarHeight) + 60 },
                renderTrackHorizontal: function renderTrackHorizontal(props) {
                  return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'track-horizontal' }));
                },
                renderThumbHorizontal: function renderThumbHorizontal(props) {
                  return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'thumb-horizontal' }));
                },
                renderTrackVertical: function renderTrackVertical(props) {
                  return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'track-vertical' }));
                },
                renderThumbVertical: function renderThumbVertical(props) {
                  return _react2.default.createElement('div', (0, _extends3.default)({}, props, { className: 'thumb-vertical' }));
                }
              },
              _WFSelect2.default.getOptions(_this2).map(function (option, i) {
                var _WFValue$getValues = _WFValue2.default.getValues(option),
                    _WFValue$getValues$id = _WFValue$getValues.id,
                    id = _WFValue$getValues$id === undefined ? null : _WFValue$getValues$id,
                    _WFValue$getValues$la = _WFValue$getValues.label,
                    label = _WFValue$getValues$la === undefined ? "" : _WFValue$getValues$la,
                    _WFValue$getValues$le = _WFValue$getValues.legend,
                    legend = _WFValue$getValues$le === undefined ? "" : _WFValue$getValues$le,
                    _WFValue$getValues$im = _WFValue$getValues.image,
                    image = _WFValue$getValues$im === undefined ? "" : _WFValue$getValues$im,
                    _WFValue$getValues$ic = _WFValue$getValues.icon,
                    icon = _WFValue$getValues$ic === undefined ? "" : _WFValue$getValues$ic,
                    _WFValue$getValues$co = _WFValue$getValues.color,
                    color = _WFValue$getValues$co === undefined ? "" : _WFValue$getValues$co;

                if (id === null) {
                  return false;
                } else {
                  var isSelected = _WFSelect2.default.has(_this2, id);
                  var className = 'wf-option ' + (isSelected ? "wf-selected" : '');
                  return _react2.default.createElement(
                    'div',
                    {
                      key: i,
                      className: className,
                      onClick: function onClick() {
                        return _WFSelect2.default.onSelect(_this2, id);
                      },
                      style: {
                        width: optionWidth,
                        height: scrollBarHeight
                      } },
                    _react2.default.createElement(_WFCellState2.default, { checked: isSelected }),
                    _react2.default.createElement(_WFCellImg2.default, { image: image, style: imageStyle }),
                    _react2.default.createElement(_WFCellContent2.default, { label: label, legend: legend, styles: styles })
                  );
                }
              })
            )
          );
        }
      }));
    }
  }]);
  return WFSelect2Image;
}(_react.Component);

// ------------------- //


exports.default = WFSelect2Image;
// ------------------- //

/***/ }),
/* 404 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFSelect = __webpack_require__(83);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFCellImg = __webpack_require__(149);

var _WFCellImg2 = _interopRequireDefault(_WFCellImg);

var _WFCellState = __webpack_require__(150);

var _WFCellState2 = _interopRequireDefault(_WFCellState);

var _WFCellIcon = __webpack_require__(148);

var _WFCellIcon2 = _interopRequireDefault(_WFCellIcon);

var _WFCellColor = __webpack_require__(146);

var _WFCellColor2 = _interopRequireDefault(_WFCellColor);

var _WFCellContent = __webpack_require__(147);

var _WFCellContent2 = _interopRequireDefault(_WFCellContent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT LINE ------------------- //
// ------------------- //

var WFSelect2Line = function (_Component) {
  (0, _inherits3.default)(WFSelect2Line, _Component);

  function WFSelect2Line(props) {
    (0, _classCallCheck3.default)(this, WFSelect2Line);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect2Line.__proto__ || (0, _getPrototypeOf2.default)(WFSelect2Line)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFSelect2Line, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props$styles = this.props.styles,
          styles = _props$styles === undefined ? {} : _props$styles;
      var _styles$optionLabel = styles.optionLabel,
          optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
          _styles$optionLegend = styles.optionLegend,
          optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "selectLine");
        },
        view: function view(input) {
          return _react2.default.createElement(
            'wf-select-line',
            null,
            _WFSelect2.default.getOptions(_this2).map(function (option, i) {
              var _WFValue$getValues = _WFValue2.default.getValues(option),
                  _WFValue$getValues$id = _WFValue$getValues.id,
                  id = _WFValue$getValues$id === undefined ? null : _WFValue$getValues$id,
                  _WFValue$getValues$la = _WFValue$getValues.label,
                  label = _WFValue$getValues$la === undefined ? "" : _WFValue$getValues$la,
                  _WFValue$getValues$le = _WFValue$getValues.legend,
                  legend = _WFValue$getValues$le === undefined ? "" : _WFValue$getValues$le,
                  _WFValue$getValues$im = _WFValue$getValues.image,
                  image = _WFValue$getValues$im === undefined ? "" : _WFValue$getValues$im,
                  _WFValue$getValues$ic = _WFValue$getValues.icon,
                  icon = _WFValue$getValues$ic === undefined ? "" : _WFValue$getValues$ic,
                  _WFValue$getValues$co = _WFValue$getValues.color,
                  color = _WFValue$getValues$co === undefined ? "" : _WFValue$getValues$co;

              if (id === null) {
                return false;
              } else {
                var isSelected = _WFSelect2.default.has(_this2, id);
                var className = 'wf-option ' + (isSelected ? "wf-selected" : '');
                return _react2.default.createElement(
                  'div',
                  {
                    key: i,
                    className: className,
                    onClick: function onClick() {
                      return _WFSelect2.default.onSelect(_this2, id);
                    }
                  },
                  _react2.default.createElement(_WFCellImg2.default, { image: image }),
                  _react2.default.createElement(_WFCellIcon2.default, { image: icon }),
                  _react2.default.createElement(_WFCellColor2.default, { color: color }),
                  _react2.default.createElement(_WFCellColor2.default, { image: color }),
                  _react2.default.createElement(_WFCellContent2.default, { label: label, legend: legend, styles: styles }),
                  _react2.default.createElement(_WFCellState2.default, { checked: isSelected })
                );
              }
            })
          );
        }
      }));
    }
  }]);
  return WFSelect2Line;
}(_react.Component);

// ------------------- //


exports.default = WFSelect2Line;
// ------------------- //

/***/ }),
/* 405 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFSelect = __webpack_require__(83);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT NUMBER ------------------- //
// ------------------- //

var WFSelect2Number = function (_Component) {
  (0, _inherits3.default)(WFSelect2Number, _Component);

  function WFSelect2Number(props) {
    (0, _classCallCheck3.default)(this, WFSelect2Number);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect2Number.__proto__ || (0, _getPrototypeOf2.default)(WFSelect2Number)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFSelect2Number, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props$styles = this.props.styles,
          styles = _props$styles === undefined ? {} : _props$styles;
      var _styles$optionLabel = styles.optionLabel,
          optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
          _styles$optionLegend = styles.optionLegend,
          optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "selectBubble");
        },
        view: function view(input) {
          return _react2.default.createElement(
            'wf-select-number',
            null,
            _WFSelect2.default.getOptions(_this2).map(function (option, i) {
              var _option$id = option.id,
                  id = _option$id === undefined ? null : _option$id,
                  _option$label = option.label,
                  label = _option$label === undefined ? "" : _option$label;

              if (id === null) {
                return false;
              } else {
                var isSelected = _WFSelect2.default.has(_this2, id);
                var className = 'wf-option ' + (isSelected ? "wf-selected" : '');
                return _react2.default.createElement(
                  'span',
                  {
                    key: i,
                    className: className,
                    onClick: function onClick() {
                      return _WFSelect2.default.onSelect(_this2, id);
                    },
                    style: {
                      color: optionLabel.color,
                      borderColor: optionLabel.color
                    }
                  },
                  label
                );
              }
            })
          );
        }
      }));
    }
  }]);
  return WFSelect2Number;
}(_react.Component);

// ------------------- //


exports.default = WFSelect2Number;
// ------------------- //

/***/ }),
/* 406 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _WFieldHelper = __webpack_require__(71);

var _WFieldHelper2 = _interopRequireDefault(_WFieldHelper);

var _WFSelect = __webpack_require__(83);

var _WFSelect2 = _interopRequireDefault(_WFSelect);

var _WFInputComponent = __webpack_require__(25);

var _WFInputComponent2 = _interopRequireDefault(_WFInputComponent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SELECT WORD ------------------- // 
// ------------------- //

var WFSelect2Word = function (_Component) {
  (0, _inherits3.default)(WFSelect2Word, _Component);

  function WFSelect2Word(props) {
    (0, _classCallCheck3.default)(this, WFSelect2Word);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFSelect2Word.__proto__ || (0, _getPrototypeOf2.default)(WFSelect2Word)).call(this, props));

    _this.state = {
      sampleData: []
    };
    return _this;
  }

  (0, _createClass3.default)(WFSelect2Word, [{
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _props$styles = this.props.styles,
          styles = _props$styles === undefined ? {} : _props$styles;
      var _styles$optionLabel = styles.optionLabel,
          optionLabel = _styles$optionLabel === undefined ? {} : _styles$optionLabel,
          _styles$optionLegend = styles.optionLegend,
          optionLegend = _styles$optionLegend === undefined ? {} : _styles$optionLegend;

      return _react2.default.createElement(_WFInputComponent2.default, (0, _extends3.default)({}, this.props, {
        didMount: function didMount() {
          _WFieldHelper2.default.setSample(_this2, "selectWord");
        },
        view: function view(input) {
          return _react2.default.createElement(
            'wf-select-word',
            null,
            _WFSelect2.default.getOptions(_this2).map(function (option, i) {
              var _option$id = option.id,
                  id = _option$id === undefined ? null : _option$id,
                  _option$label = option.label,
                  label = _option$label === undefined ? "" : _option$label;

              if (id === null) {
                return false;
              } else {
                var isSelected = _WFSelect2.default.has(_this2, id);
                var className = 'wf-option ' + (isSelected ? "wf-selected" : '');
                return _react2.default.createElement(
                  'span',
                  {
                    key: i,
                    className: className,
                    onClick: function onClick() {
                      return _WFSelect2.default.onSelect(_this2, id);
                    },
                    style: {
                      color: optionLabel.color,
                      borderColor: optionLabel.color
                    }
                  },
                  label
                );
              }
            })
          );
        }
      }));
    }
  }]);
  return WFSelect2Word;
}(_react.Component);

// ------------------- //


exports.default = WFSelect2Word;
// ------------------- //

/***/ }),
/* 407 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFNumber = __webpack_require__(103);

var _WFNumber2 = _interopRequireDefault(_WFNumber);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(72);

var _WFConstants = __webpack_require__(58);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF BAOBAB MONKEY ------------------- // 
// ------------------- //

var WFBaobabMonkey = function () {
  /**
   * Constructor
   * @param name is GroupName (the parent fieldName)
   * @param children collection of monkey field
   * @param formView instance of WFormView
   */
  function WFBaobabMonkey(name, children, formView) {
    (0, _classCallCheck3.default)(this, WFBaobabMonkey);

    this.name = name;
    this.id = new _WFNumber2.default();
    this.map = {};
    this.history = {};
    // init children
    WFBaobabMonkey.init(this, children, formView);
  }

  /**
   * Observe formView's event values change to update monkey
   * @param formView instance of WFormView
   */


  (0, _createClass3.default)(WFBaobabMonkey, [{
    key: "observe",
    value: function observe(formView) {
      var _this = this;

      formView.sub(_WFConstants.WF_VALUES_CHANGE, function (nextValues) {
        // if baobab select is visible apply change
        if (formView.hasCurrentField(_this.name)) {
          _this.change(formView, nextValues);
        }
      });
    }

    /**
     * Update monkey 
     * @param formView
     * @param values
     */

  }, {
    key: "change",
    value: function change(formView, values) {
      var _this2 = this;

      var id = WFBaobabMonkey.getValue(values, this.name);
      if (this.id.get() !== id) {
        this.refreshChildren(formView, id);
      } else {
        var children = (0, _keys2.default)(this.map);

        var _loop = function _loop(i) {
          var fieldName = children[i];
          var prevId = _this2.history[fieldName];
          var nextId = WFBaobabMonkey.getValue(values, fieldName);
          _this2.history[fieldName] = nextId;
          if (prevId !== nextId || prevId !== 0 && nextId === 0) {
            if (fieldName === _this2.name) {
              _this2.refreshChildren(formView, nextId);
            } else {
              _this2.map[fieldName].map(function (fldName) {
                _this2.refreshChild(fieldName, fldName, formView, nextId);
              });
            }
            return "break";
          }
        };

        for (var i = 0; i < children.length; i++) {
          var _ret = _loop(i);

          if (_ret === "break") break;
        }
      }
    }

    /**
     * Update all children
     */

  }, {
    key: "refreshChildren",
    value: function refreshChildren(formView, optionId) {
      var _this3 = this;

      var hasOption = optionId !== 0;
      this.id.set(optionId);
      (0, _keys2.default)(this.map).map(function (fldName) {
        var fld = formView.getField(fldName);
        if (fld) {
          var _fld$getSchema = fld.getSchema(),
              _fld$getSchema$monkey = _fld$getSchema.monkeyBranch,
              monkeyBranch = _fld$getSchema$monkey === undefined ? null : _fld$getSchema$monkey,
              _fld$getSchema$monkey2 = _fld$getSchema.monkeyObserve,
              monkeyObserve = _fld$getSchema$monkey2 === undefined ? null : _fld$getSchema$monkey2;

          fld.clearValue();
          var input = fld.getInputMgr();
          var baobabOptMgr = input.baobabOptMgr;
          input.setData([]);
          _this3.history[fldName] = 0;
          if (monkeyObserve === _this3.name && hasOption) {
            input.setState({ disabled: false });
            baobabOptMgr.optionQueryMgr.clearFilters();
            baobabOptMgr.optionQueryMgr.clearReqFilters();
            baobabOptMgr.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_OPTIONGROUP_ID, optionId, true);
            if (monkeyBranch) {
              baobabOptMgr.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_PARENT_ID, monkeyBranch, true);
            }
          } else {
            input.setState({
              disabled: true
            });
          }
        }
      });
    }

    /**
     * Update child 
     */

  }, {
    key: "refreshChild",
    value: function refreshChild(fieldName, fldName, formView, optionId) {
      var _this4 = this;

      var fld = formView.getField(fldName);
      var hasOption = optionId !== 0;
      if (fld) {
        var _fld$getSchema2 = fld.getSchema(),
            _fld$getSchema2$monke = _fld$getSchema2.monkeyBranch,
            monkeyBranch = _fld$getSchema2$monke === undefined ? null : _fld$getSchema2$monke,
            _fld$getSchema2$monke2 = _fld$getSchema2.monkeyObserve,
            monkeyObserve = _fld$getSchema2$monke2 === undefined ? null : _fld$getSchema2$monke2;

        var input = fld.getInputMgr();
        var baobabOptMgr = input.baobabOptMgr;
        input.setData([]);
        this.history[fldName] = 0;
        if (monkeyObserve === fieldName) {
          if (hasOption) {
            input.setState({ disabled: false });
            baobabOptMgr.optionQueryMgr.clearFilters();
            baobabOptMgr.optionQueryMgr.clearReqFilters();
            baobabOptMgr.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_OPTIONGROUP_ID, optionId, true);
            if (monkeyBranch) {
              baobabOptMgr.optionQueryMgr.setFilter(_Constants.WF_BAOBAB_PARENT_ID, monkeyBranch, true);
            }
          } else {
            fld.clearValue();
            input.setState({
              disabled: true
            });
            this.map[fldName].map(function (fName) {
              _this4.refreshChild(fldName, fName, formView, 0);
            });
          }
        }
      }
    }

    /**
     * Search baobab fields and monkey field to create new WFBaobabMonkey
     * @param name is fieldName
     */

  }], [{
    key: "create",
    value: function create(formView) {
      var schema = formView.getFormState().getAllFieldSelect();
      schema.map(function (fieldSchema) {
        var name = fieldSchema.name,
            _fieldSchema$isBaobab = fieldSchema.isBaobab,
            isBaobab = _fieldSchema$isBaobab === undefined ? false : _fieldSchema$isBaobab;

        if (isBaobab) {
          var children = schema.filter(function (child) {
            var _child$isMonkey = child.isMonkey,
                isMonkey = _child$isMonkey === undefined ? false : _child$isMonkey,
                _child$monkeyGroup = child.monkeyGroup,
                monkeyGroup = _child$monkeyGroup === undefined ? null : _child$monkeyGroup;

            return isMonkey && monkeyGroup === name;
          });
          if (children.length > 0) {
            formView.fieldsMonkey[name] = new WFBaobabMonkey(name, children, formView);
          }
        }
      });
    }

    /**
     * Init 
     */

  }, {
    key: "init",
    value: function init(monkey, children, formView) {

      //console.warn("MONKEY INIT")
      //console.dir(children)

      children.map(function (_ref) {
        var name = _ref.name;

        monkey.history[name] = 0;
        monkey.map[name] = children.filter(function (child) {
          var monkeyObserve = child.monkeyObserve;

          return monkeyObserve === name;
        }).map(function (child) {
          return child.name;
        });
      });
      monkey.observe(formView);
    }

    /**
     * Extract value of field type select2
     * @param values is formState values
     * @param name is fieldName
     */

  }, {
    key: "getValue",
    value: function getValue(values, name) {
      var value = 0;
      if (values.hasOwnProperty(name)) {
        value = values[name];
        if ((0, _Lodash.isString)(value)) {
          value = (0, _JSON.parse)(value);
          if ((0, _Lodash.isObject)(value)) {
            var keys = (0, _keys2.default)(value);
            if (keys.length > 0) {
              value = parseInt(keys[0]);
              return value;
            } else {
              value = 0;
              return value;
            }
          } else return value;
        } else return value;
      } else return value;
    }
  }]);
  return WFBaobabMonkey;
}();

// ------------------- //


exports.default = WFBaobabMonkey;
// ------------------- //

/***/ }),
/* 408 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF BAOBAB OPTION ------------------- //
// ------------------- //
var WFBaobabOptionView = function () {
  function WFBaobabOptionView(option) {
    (0, _classCallCheck3.default)(this, WFBaobabOptionView);

    this.option = option;
    this.isInit = false;
    this.component = null;
  }

  (0, _createClass3.default)(WFBaobabOptionView, [{
    key: "setState",
    value: function setState(obj) {
      if (this.isInit) {
        this.component.setState(obj);
      }
    }
  }, {
    key: "willMount",
    value: function willMount(component) {
      this.isInit = true;
      this.component = component;
      this.setState(this.option.getSchema());
    }
  }, {
    key: "willUnMount",
    value: function willUnMount() {
      this.isInit = false;
      this.component = null;
    }
  }]);
  return WFBaobabOptionView;
}();

// ------------------- //


exports.default = WFBaobabOptionView;
// ------------------- //

/***/ }),
/* 409 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var _arguments = arguments;

var _wfEnv = __webpack_require__(145);

var _wfEnv2 = _interopRequireDefault(_wfEnv);

var _lodash = __webpack_require__(290);

var _lodash2 = _interopRequireDefault(_lodash);

var _es6Promise = __webpack_require__(570);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Use logSep to separate the console message 
 */
var logSep = function logSep() {
  console.log('');
  console.log('%c>>>>>>>>> ------------------- >', 'color:#AAAAAA;');
  console.log('');
};

/**
 * Use logApiError to display error status
 */
var logApiError = function logApiError(state) {
  logSep();
  console.log('%cWF_API' + ('%c' + "->") + ('%c' + "Error(") + ('%c' + state) + '%c)', 'color:000000;', 'color:#3b3b3b;', 'color:red;', 'color:#cf4545;', 'color:red;');
  logSep();
};

/**
 * Use logApiError to display success status
 */
var logApiSuccess = function logApiSuccess(state) {
  logSep();
  console.log('%cWF_API' + ('%c' + "->") + ('%c' + "Success(") + ('%c' + state) + '%c)', 'color:#000000;', 'color:#3b3b3b;', 'color:#1C852A', 'color:#0076d3;', 'color:#1C852A;');
  logSep();
};

/**
 * Use isHtmlAlert if result is HTML display HTML result in alert box
 */
var isHtmlAlert = function isHtmlAlert(res) {
  if (_wfEnv2.default && res && res !== "") {
    if (res.text[0] === "<" || res.text[1] === "<" || res.text.includes("<pre>")) alert(res.text);
  }
};

/**
 * @namespace utils
 * @class Superagent
 */
var superagent = module.exports = __webpack_require__(891);
var Request = superagent.Request;
function SuperagentPromiseError(message) {
  this.name = 'WonderFormAgentPromiseError';
  this.message = message || 'Bad request';
}
/**
 * Create custom error type.
 * Create a new object, that prototypally inherits from the Error constructor.
 */
SuperagentPromiseError.prototype = new Error();
SuperagentPromiseError.prototype.constructor = SuperagentPromiseError;

/**
 *
 * Add promise support for superagent/supertest
 *
 * Call .promise() to return promise for the request
 *
 * @method then
 * @return {Promise}
 */
Request.prototype.promise = function () {
  var req = this;
  var success = void 0;
  var errors = false;
  var error = void 0;
  // PROMISE ------------------------- //
  return new _es6Promise.Promise(function (resolve, reject) {
    req.end(function (err, res) {
      isHtmlAlert(res);
      if (typeof res !== "undefined" && res.status >= 400) {
        var msg = 'cannot ' + req.method + ' ' + req.url + ' (' + res.status + ')';
        error = new SuperagentPromiseError(msg);
        error.status = res.status;
        error.body = res.body;
        error.res = res;
        if (_wfEnv2.default) {
          logApiError(res.status);
          console.error(msg);
          console.log('');
          console.error(error);
          console.log('');
        }
        /*
        resolve({ 
          status:res.status,
          request_error:{ message: msg } 
        });
        */
        reject(new SuperagentPromiseError(err));
      } else if (err) {
        var _ref = new SuperagentPromiseError(err),
            _ref$message = _ref.message,
            message = _ref$message === undefined ? {} : _ref$message;

        var _msg = message.message;
        if (_wfEnv2.default) {
          logApiError(404);
          console.error(_msg);
          console.log('');
        }
        /*
        resolve({ 
          status:600,
          request_error:{ message: msg } 
        });
        */
        reject(new SuperagentPromiseError(err));
      } else {
        if (res.hasOwnProperty('text')) {
          var filtered = [];
          success = JSON.parse(res.text);
          if ((0, _lodash2.default)(success) && success.length > 0) {
            filtered = success.filter(function (item) {
              return item.hasOwnProperty('messages') && item.messages.length > 0;
            });
          } else if (success.hasOwnProperty('row') && success.row === 0) {
            filtered = success.row.filter(function (item) {
              return item.hasOwnProperty('messages') && item.messages.length > 0;
            });
          }
          if (filtered.length > 0) {
            errors = {
              count: filtered.length,
              row: filtered.map(function (item) {
                return {
                  name: item.hasOwnProperty('name') ? item.name : null,
                  messages: item.messages
                };
              })
            };
          }
          if (_wfEnv2.default) {
            logApiSuccess(res.status);
            console.log(success);
            if (errors.length > 0) console.log(errors);
            console.log('');
          }
          //isDevSuccess( success, errors );
          resolve({
            resultset: success,
            request_errors: errors,
            res: res
          });
        }
      }
    });
  });
};

/**
 *
 * Make superagent requests Promises/A+ conformant
 *
 * Call .then([onFulfilled], [onRejected]) to register callbacks
 *
 * @method then
 * @param {function} [onFulfilled]
 * @param {function} [onRejected]
 * @return {Promise}
 */
Request.prototype.then = function () {
  var promise = undefined.promise();
  return promise.then.apply(promise, _arguments);
};

// ---------------------- //
exports.default = Request;
// ---------------------- //

/***/ }),
/* 410 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFConfigEditorViewMgr = __webpack_require__(230);

var _WFConfigEditorViewMgr2 = _interopRequireDefault(_WFConfigEditorViewMgr);

var _WFConstants = __webpack_require__(58);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_CONFIG_EDITOR MANAGER ------------------- //

// ------------------- //

var WFConfigEditorMgr = function () {
  function WFConfigEditorMgr() {
    (0, _classCallCheck3.default)(this, WFConfigEditorMgr);
  }

  (0, _createClass3.default)(WFConfigEditorMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var isSaved = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      _WFConfigEditorViewMgr2.default.setState((0, _assign2.default)({
        wfc_saved: isSaved
      }, obj));
    }

    /**
     * Ready : refresh state
     */

  }, {
    key: "ready",
    value: function ready() {
      _WFConfigEditorViewMgr2.default.setState({
        wfc_saved: true
      });
    }

    /**
     * Restore initial state
     */

  }, {
    key: "init",
    value: function init() {}

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      _WFConfigEditorViewMgr2.default.resetState();
    }

    /**
     * Restore initial state
     */

  }, {
    key: "setPublish",
    value: function setPublish(flag) {
      _WFConfigEditorViewMgr2.default.setState({
        wfc_published: flag
      });
    }

    /**
     * Init : 
     * observe formEntryView and update this state
     */

  }, {
    key: "observe",
    value: function observe(formEntryView) {
      var additionalObserver = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      formEntryView.setEditorObserver(function (state) {
        var nextState = {
          wfc_steps: state.steps,
          wfc_step_order: state.stepOrder,
          wfc_step_current: state.currentStep,
          wfc_step_value: state.currentStepValue,
          wfc_contents: state.contents,
          wfc_fields: formEntryView.getFormState().getFieldSchema()
        };
        _WFConfigEditorViewMgr2.default.setState((0, _assign2.default)(additionalObserver, nextState));
      });
    }
  }]);
  return WFConfigEditorMgr;
}();

// ------------------- //


exports.default = WFConfigEditorMgr;
// ------------------- //

/***/ }),
/* 411 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _Lodash = __webpack_require__(6);

var _WFConfigViewMgr = __webpack_require__(234);

var _WFConfigViewMgr2 = _interopRequireDefault(_WFConfigViewMgr);

var _WFConfigClientMgr = __webpack_require__(229);

var _WFConfigClientMgr2 = _interopRequireDefault(_WFConfigClientMgr);

var _WFConfigQueryMgr = __webpack_require__(155);

var _WFConfigQueryMgr2 = _interopRequireDefault(_WFConfigQueryMgr);

var _WFConfigSelectMgr = __webpack_require__(232);

var _WFConfigSelectMgr2 = _interopRequireDefault(_WFConfigSelectMgr);

var _WFConfigFormStateMgr = __webpack_require__(231);

var _WFConfigFormStateMgr2 = _interopRequireDefault(_WFConfigFormStateMgr);

var _WFConfigCollectionMgr = __webpack_require__(154);

var _WFConfigCollectionMgr2 = _interopRequireDefault(_WFConfigCollectionMgr);

var _WFConfigThemes = __webpack_require__(233);

var _WFConfigThemes2 = _interopRequireDefault(_WFConfigThemes);

var _WFActionMgr = __webpack_require__(237);

var _WFActionMgr2 = _interopRequireDefault(_WFActionMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_CONFIG MANAGER ------------------- //

// ------------------- //

var WFConfigMgr = function () {
  function WFConfigMgr() {
    (0, _classCallCheck3.default)(this, WFConfigMgr);
  }

  (0, _createClass3.default)(WFConfigMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFConfigViewMgr2.default.setState(obj);
    }

    /**
     * Ready : refresh state
     */

  }, {
    key: "ready",
    value: function ready() {
      _WFConfigViewMgr2.default.setState({
        wfconfigs: _WFConfigCollectionMgr2.default.getValue(),
        wfconfigs_selected: _WFConfigSelectMgr2.default.getKeys(),
        wfconfigs_pager: _WFConfigQueryMgr2.default.getPagination()
      });
    }

    /**
     * Init : 
     */

  }, {
    key: "init",
    value: function init() {}

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      _WFConfigQueryMgr2.default.reset();
      _WFConfigSelectMgr2.default.clear();
      _WFConfigViewMgr2.default.resetState();
      _WFConfigCollectionMgr2.default.clear();
      _WFConfigFormStateMgr2.default.clear();
      WFConfigMgr.ready();
    }

    /**
     * Create form
     * @param formConfig {wf_producttype_id}
     * @return formState 
     */

  }, {
    key: "create",
    value: function create() {
      var formConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (!(0, _Lodash.isObject)(formConfig)) {
        throw new Error('WFConfigMgr create => formConfig not an object');
        return null;
      } else {
        var config = (0, _assign2.default)({}, formConfig, { name: "" });
        var formState = _WFConfigFormStateMgr2.default.getOrCreate(config);
        return formState;
      }
    }

    /**
     * Edit form 
     * 1/ find the form by name
     * 2/ Clear WFConfigFormStateMgr
     * 3/ Create all formView
     * 4/ Gerenrate display_fields
     * 5/ return formView in success callback
     * @param name is formName
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "edit",
    value: function edit(name) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr edit => next {onError, onSuccess} is required...');
      } else {
        if ((0, _Lodash.isString)(name) && name !== "") {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFConfigClientMgr2.default.findFormByName(name, onError, function (formConfig, formConfigState, formEntryState) {
            _WFConfigFormStateMgr2.default.clear();
            var formEntryView = WFConfigMgr.createFormView(formEntryState, {
              setDefaultConfig: true
            });
            var formConfigView = WFConfigMgr.createFormView(formConfigState, {
              fields: formConfig.fields,
              defaultValues: formConfig
            });
            formEntryView.generateDisplayFields();
            formConfigView.generateDisplayFields();
            onSuccess(formConfig, formConfigView, formEntryView);
          });
        } else {
          throw new Error('WFConfigMgr edit => name is required...');
        }
      }
    }

    /**
     * Select form
     * @param row
     */

  }, {
    key: "select",
    value: function select(row) {
      if (row.hasOwnProperty('entry_id')) {
        row["id"] = row.entry_id.toString();
      }
      if (!(0, _Lodash.isObject)(row) || !row.hasOwnProperty("id")) {
        throw new Error('WFConfigMgr select => row is not valid...');
      } else {
        _WFConfigSelectMgr2.default.select(row);
        WFConfigMgr.ready();
      }
    }

    /**
     * Find all
     */

  }, {
    key: "find",
    value: function find() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr find => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        _WFConfigClientMgr2.default.find(args, onError, function (res) {
          WFConfigMgr.ready();
          onSuccess(res);
        });
      }
    }

    /**
     * Save form
     * if new form set entries_table
     * @param formState
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "save",
    value: function save(formState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr save => next {onError, onSuccess} is required...');
      } else {
        if (!formState) {
          throw new Error('WFConfigMgr save => formState not valid');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          if (formState.hasEntryId()) {
            _WFConfigClientMgr2.default.save(formState, onError, onSuccess);
          } else {
            var flds = formState.getFields();
            flds.entries_table.setValue(flds.name.getValue());
            flds.entries_table.getValueMgr().toName();
            _WFConfigClientMgr2.default.save(formState, onError, function (formConfig) {
              _WFActionMgr2.default.createActionsByDefault({
                wf_formconfig_id: parseInt(formConfig.entry_id)
              }, function () {
                onSuccess(formConfig);
              });
            });
          }
        }
      }
    }

    /**
     * Publish form
     * @param next callback {flag}
     */

  }, {
    key: "publish",
    value: function publish(formConfigState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr publish => next {onError, onSuccess} is required...');
      } else {
        if (!formConfigState) {
          throw new Error('WFConfigMgr publish => formConfigState not valid...');
          return null;
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFConfigClientMgr2.default.publish(formConfigState, onError, onSuccess);
        }
      }
    }

    /**
     * UnPublish
     * @param next callback {flag}
     */

  }, {
    key: "unpublish",
    value: function unpublish(formConfigState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr unpublish => next {onError, onSuccess} is required...');
      } else {
        if (!formConfigState) {
          throw new Error('WFConfigMgr unpublish => formConfigState not valid...');
          return null;
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFConfigClientMgr2.default.unpublish(formConfigState, onError, onSuccess);
        }
      }
    }

    /**
     * Del selection
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "del",
    value: function del() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFConfigMgr del => next {onError, onSuccess} is required...');
      } else {
        var rows = _WFConfigSelectMgr2.default.getValue();
        if (rows.length === 0) {
          throw new Error('WFConfigMgr del => the rows is empty');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFConfigFormStateMgr2.default.init(rows);
          _WFConfigClientMgr2.default.del(_WFConfigFormStateMgr2.default, onError, function (res) {
            _WFConfigSelectMgr2.default.remove(res, function () {
              WFConfigMgr.ready();
              onSuccess(res);
            });
          });
        }
      }
    }

    /**
     * Create temp formView
     * @param settingState
     * @param options {fields, displayFields, defaultValues, setDefaultConfig}
     * @return formView
     */

  }, {
    key: "createFormView",
    value: function createFormView(formState) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (!formState) {
        throw new Error('WFConfigMgr createFormView => formState not valid...');
        return null;
      } else {
        var _options$fields = options.fields,
            fields = _options$fields === undefined ? [] : _options$fields,
            _options$displayField = options.displayFields,
            displayFields = _options$displayField === undefined ? [] : _options$displayField,
            _options$defaultValue = options.defaultValues,
            defaultValues = _options$defaultValue === undefined ? {} : _options$defaultValue,
            _options$setDefaultCo = options.setDefaultConfig,
            setDefaultConfig = _options$setDefaultCo === undefined ? false : _options$setDefaultCo;

        if (fields.length > 0) {
          formState.addFields(fields);
        }
        if (displayFields.length > 0) {
          formState.setDisplayFields(displayFields);
        } else {
          if (formState.hasEntryId()) {
            formState.setDisplayFields(["title", "description"]);
          } else {
            formState.setDisplayFields(["title", "name", "description"]);
          }
        }
        if ((0, _keys2.default)(defaultValues).length > 0) {
          formState.setValues(defaultValues);
        }
        var defaultConfig = {};
        if (setDefaultConfig) {
          var _WFConfigThemes$get = _WFConfigThemes2.default.get("WFCorporateTheme"),
              info = _WFConfigThemes$get.info,
              settingValues = _WFConfigThemes$get.settingValues;

          var settingConfig = {
            theme: info.name,
            settings: (0, _defineProperty3.default)({}, info.name, settingValues)
          };
          defaultConfig = {
            settingConfig: settingConfig
          };
        }
        var formView = new _WFormView2.default(formState, true, defaultConfig);
        return formView;
      }
    }
  }]);
  return WFConfigMgr;
}();

// ------------------- //


exports.default = WFConfigMgr;
// ------------------- //

/***/ }),
/* 412 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFProductType = __webpack_require__(15);

var custom = {
  icon: "light-bulb", //tools",
  title: "SQL Form Generator", // SQL Table Form
  status: "new",
  wf_producttype_id: _WFProductType.WF_CUSTOM_CUSTOM_ID,
  slogan: "Create Table in MySQL for all value entries, the must-have solution for Modern Web Development", //"Generate dedicate SQL Table for all entries value, the best choice for Modern Web Developpement",
  forms: [{
    label: "Create new Form"
  }]
};

var contact = {
  icon: "envelope",
  title: "Contact Form",
  status: "",
  wf_producttype_id: _WFProductType.WF_CONTACT_SIMPLE_ID,
  slogan: "Quickly build a Beautiful Contact Form for your website. Fast & Easy To Use, add Steps, add Fields and custom your Style",

  //  Fast & Easy To Use

  forms: [
  /*
    {
      label: "Simple Page",
      wf_producttype_id: WF_PAGEBUILDER_SIMPLE_PAGE_ID,
    },
  */
  {
    label: "Simple Contact Form"
  }]
};

var quizz = {
  icon: "piechart",
  title: "Quizz/Survey",
  status: "",
  wf_producttype_id: _WFProductType.WF_QUIZ_QUIZZ_ID,
  slogan: "Quizzes are a fun way to increase user engagement on your website. You can use it for Educational or Marketing purposes",
  forms: [{
    label: "Create Quizz/Survey Form"
  }]
};
/*
const survey = {
  icon    : "flag",
  title   : "Survey",
  wf_producttype_id: WF_QUIZ_QUIZZ_ID,
  slogan  : "Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
  forms : [
    {
      label: "Survey Form",
    }
  ]
};
*/

var signup = {
  icon: "profile-female",
  title: "Signup",
  status: "coming",
  wf_producttype_id: _WFProductType.WF_SIGNUP_PROFILE_ID,
  slogan: "This module inludes User Registration, User Login and User Reset password", //Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
  forms: [{
    label: "Signup Form"
  }]
};
/*
const login = {
  icon    : "key",
  title   : "Login",
  status  : "coming",
  wf_producttype_id: WF_SESSION_LOGIN_ID,
  slogan  : "...",//"Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
  forms : [
  /*
    {
      label: "Login Form"
    }
    */
//  ]
//};

var learning = {
  icon: "tools",
  title: "E-hourglass",
  status: "coming",
  slogan: "...", //"Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
  forms: []
};

var eventsCalendar = {
  icon: "calendar",
  title: "events Calendar",
  status: "coming",
  slogan: "...", //"Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
  forms: []
};

var List = [contact, quizz, custom, signup,
//login,
eventsCalendar, learning];

var getList = function getList() {
  return List;
};

var getAlertContext = function getAlertContext(wf_producttype_id) {
  var context = {};
  if ([_WFProductType.WF_QUIZ_QUIZZ_ID, _WFProductType.WF_SESSION_LOGIN_ID, _WFProductType.WF_SIGNUP_PROFILE_ID, _WFProductType.WF_CUSTOM_CUSTOM_ID].includes(wf_producttype_id)) {
    context = {
      banner: __WF__.ASSETS + "/img/wf-banner2.jpg",
      title: "Purchasse WonderForm Premium",
      message: "...", //"Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum",
      btnLabel: "Purchase license now",
      url: "http://wonderform.net/"
    };
  }
  if (wf_producttype_id === _WFProductType.WF_CUSTOM_CUSTOM_ID) {
    context["title"] = "Purchasse WonderForm Elite";
    context["message"] = "...", //"Il a été popularisé dans les années 1960 grâce à la vente de feuilles Letraset contenant des passages du Lorem Ipsum";
    context["btnLabel"] = "Purchase license now";
  }
  return context;
};

exports.default = {
  getList: getList,
  getAlertContext: getAlertContext
};

/***/ }),
/* 413 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var icon = "cube";
var attrKey = "settings";

// ------------------- //

// WF_ACTION RESOURCES ------------------- //

// ------------------- //

var WF_FORM_ACTION_SELECT_THEME = "wf_form_select_theme";
var WF_FORM_ACTION_TO_EDITOR = "wf_form_to_editor";
var WF_FORM_ACTION_GLOBAL_SETTING = "wf_global_setting";
var WF_FORM_ACTION_COVER_SETTING = "wf_cover_setting";
var WF_FORM_ACTION_VIDEO_SETTING = "wf_video_setting";
var WF_FORM_ACTION_CONTAINER_SETTING = "wf_container_setting";
var WF_FORM_FIELD_ACTIONS_SETTING = "wf_fields_setting";
var WF_FORM_ACTION_WFIELD_SETTING = "wf_wonder_fields_setting";
var WF_FORM_ACTION_CONTROL_SETTING = "wf_control_setting";

var getConstants = function getConstants() {
  return {
    WF_FORM_ACTION_SELECT_THEME: WF_FORM_ACTION_SELECT_THEME,
    WF_FORM_ACTION_TO_EDITOR: WF_FORM_ACTION_TO_EDITOR,
    WF_FORM_ACTION_GLOBAL_SETTING: WF_FORM_ACTION_GLOBAL_SETTING,
    WF_FORM_ACTION_COVER_SETTING: WF_FORM_ACTION_COVER_SETTING,
    WF_FORM_ACTION_VIDEO_SETTING: WF_FORM_ACTION_VIDEO_SETTING,
    WF_FORM_ACTION_CONTAINER_SETTING: WF_FORM_ACTION_CONTAINER_SETTING,
    WF_FORM_FIELD_ACTIONS_SETTING: WF_FORM_FIELD_ACTIONS_SETTING,
    WF_FORM_ACTION_WFIELD_SETTING: WF_FORM_ACTION_WFIELD_SETTING,
    WF_FORM_ACTION_CONTROL_SETTING: WF_FORM_ACTION_CONTROL_SETTING
  };
};

// ------------------- //

// GLOBAL SETTING ------------------- //

// ------------------- //

var globalSetting = {

  info: {
    label: "Global Setting",
    name: WF_FORM_ACTION_GLOBAL_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["use_timeline", "timeline_label", "timeline_color", "timeline_small", "use_progressbar", "progressbar_color", "custom_classes"],

  fields: [{
    "name": "custom_classes",
    "type": "string",
    "input_type": "text",
    "label": "Custom ClassName for Web designer",
    "create_column": true
  },

  // PROGRESS BAR ------------- //   

  {
    "name": "use_progressbar",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "WonderForm Progress Bar",
    "create_column": true,
    "attributes": {
      "placeholder": "Use Progress Bar"
    }
  }, {
    "name": "progressbar_color",
    "type": "string",
    "input_type": "color",
    "label": "",
    "create_column": true,
    "attributes": {
      "condition": {
        action: ["active", "disable"],
        rules: ["use_progressbar", "===", true]
      }
    }
  },

  // TIMELINE ------------- //

  {
    "name": "use_timeline",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "WonderForm Timeline",
    "trueValue": "Use Timeline",
    "create_column": true,
    "attributes": {
      "placeholder": "Use Timeline"
    }
  }, {
    "name": "timeline_label",
    "type": "string",
    "input_type": "text",
    "label": "",
    "create_column": true,
    "attributes": {
      placeholder: "Custom step label...",
      "condition": {
        action: ["active", "disable"],
        rules: ["use_timeline", "===", true]
      }
    }
  }, {
    "name": "timeline_color",
    "type": "string",
    "input_type": "color",
    "label": "",
    "create_column": true,
    "attributes": {
      placeholder: "Timeline Color",
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_timeline", "===", true]
      }
    }
  }, {
    "name": "timeline_small",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "",
    "create_column": true,
    "attributes": {
      "placeholder": "Use Timeline Light",
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_timeline", "===", true]
      }
    }
  }]
};

// ------------------- //

// COVER SETTING ------------------- //

// ------------------- //

var coverSetting = {

  info: {
    label: "Cover Setting",
    name: WF_FORM_ACTION_COVER_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["cover_color", "cover_image", "cover_bg_filter", "cover_bg_blur", "cover_bg_opacity", "cover_texture", "cover_overlay"],

  fields: [{
    "name": "cover_color",
    "type": "string",
    "input_type": "color",
    "label": "Cover Color",
    "create_column": true
  }, {
    "name": "cover_image",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Cover Image",
    "create_column": true
  }, {
    "name": "cover_bg_filter",
    "type": "string",
    "input_type": "select",
    "label": "Cover Image Filter",
    "required": false,
    "create_column": true,
    "attributes": {
      valueBy: "label",
      data: [{
        label: "none"
      }, {
        label: "blur"
      }, {
        label: "grayscale"
      }, {
        label: "sepia"
      }, {
        label: "invert"
      }],
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["cover_image", "===", ""]
      }
    }
  }, {
    "name": "cover_bg_blur",
    "type": "number",
    "input_type": "range",
    "label": "Cover Image Blur",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 20,
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["cover_bg_filter", "!==", "blur"]
      }
    }
  }, {
    "name": "cover_bg_opacity",
    "type": "number",
    "input_type": "range",
    "label": "Cover Image Opacity",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "%",
      "minimum": 0,
      "maximum": 100,
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["cover_image", "===", ""]
      }
    }
  }, {
    "name": "cover_texture",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Cover Texture",
    "create_column": true
  }, {
    "name": "cover_overlay",
    "type": "string",
    "input_type": "color",
    "label": "Cover Overlay",
    "create_column": true
  }]
};

// ------------------- //

// COVER VIDEO HTML5 SETTING ------------------- //

// ------------------- //

var videoHTML5Setting = {

  info: {
    label: "Cover Video HTML5 Setting",
    name: WF_FORM_ACTION_VIDEO_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["use_cover_video", "cover_video_poster", "cover_video_mp4", "cover_video_webm", "cover_video_ogv"],

  fields: [{
    "name": "use_cover_video",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "WonderForm Video HTML5",
    "legend": "<strong>HTML5 introduce the Video</strong>, select files to watch.",
    "create_column": true,
    "attributes": {
      "placeholder": "Use Video HTML5"
    }
  }, {
    "name": "cover_video_poster",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Video Poster (Image)",
    "create_column": true,
    "attributes": {
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_cover_video", "===", true]
      }
    }
  }, {
    "name": "cover_video_mp4",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Select file MP4",
    "create_column": true,
    "attributes": {
      preview: false,
      isFile: true,
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_cover_video", "===", true]
      }
    }
  }, {
    "name": "cover_video_webm",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Select file.webm",
    "create_column": true,
    "attributes": {
      preview: false,
      isFile: true,
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_cover_video", "===", true]
      }
    }
  }, {
    "name": "cover_video_ogv",
    "type": "string",
    "len": 6555,
    "input_type": "media",
    "label": "Select file OGV",
    "create_column": true,
    "attributes": {
      preview: false,
      isFile: true,
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_cover_video", "===", true]
      }
    }
  }]
};

// ------------------- //

// CONTAINER SETTING ------------------- //

// ------------------- //

var containerSetting = {

  info: {
    label: "Container Setting",
    name: WF_FORM_ACTION_CONTAINER_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["container_bg", "container_width", "container_padding", "container_border_radius", "use_vertical_align", "vertical_align_height", "vertical_align_padding"],

  fields: [{
    "name": "container_bg",
    "type": "string",
    "input_type": "color",
    "label": "Background Color",
    "create_column": true
  }, {
    "name": "container_width",
    "type": "number",
    "input_type": "range",
    "label": "Max Width",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 400,
      "maximum": 1480
    }
  }, {
    "name": "container_padding",
    "type": "number",
    "input_type": "range",
    "label": "Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  }, {
    "name": "container_border_radius",
    "type": "number",
    "input_type": "range",
    "label": "Border Radius",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  },

  // VERTICAL ALIGN ------------- //

  {
    "name": "use_vertical_align",
    "type": "boolean",
    "input_type": "",
    "label": "WonderForm Vertical Align",
    "create_column": true,
    "attributes": {
      "placeholder": "Use Vertical Align"
    }
  }, {
    "name": "vertical_align_height",
    "type": "number",
    "input_type": "range",
    "label": "Vertical Align Min Height",
    "create_column": true,
    "attributes": {
      "step": 20,
      "sufix": "px",
      "minimum": 500,
      "maximum": 2000,
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_vertical_align", "===", true]
      }
    }
  }, {
    "name": "vertical_align_padding",
    "type": "number",
    "input_type": "range",
    "label": "Vertical Align Padding",
    "legend": "Distance between container and top/bottom",
    "create_column": true,
    "attributes": {
      "step": 25,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100,
      "condition": {
        "action": ["active", "disable"],
        "rules": ["use_vertical_align", "===", true]
      }
    }
  }]

};

// ------------------- //

// FIELD SETTING ------------------- //

// ------------------- //

var fieldSetting = {

  info: {
    label: "Fields Setting",
    name: WF_FORM_FIELD_ACTIONS_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["field_inline", "field_no_label", "field_color", "field_font_size", "field_padding", "field_legend_color", "field_legend_font_size", "field_legend_padding"],

  fields: [

  // LAYOUT -------------

  {
    "name": "field_inline",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "Field Inline",
    "create_column": true,
    "attributes": {
      "placeholder": "active option"
    }
  },

  // LABEL -------------

  {
    "name": "field_no_label",
    "type": "boolean",
    "input_type": "checkbox",
    "label": "Hidden Label",
    "create_column": true,
    "attributes": {
      "placeholder": "active option"
    }
  }, {
    "name": "field_color",
    "type": "string",
    "input_type": "color",
    "label": "Label Color",
    "create_column": true,
    "attributes": {
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["field_no_label", "===", true]
      }
    }
  }, {
    "name": "field_font_size",
    "type": "number",
    "input_type": "range",
    "label": "Label Size",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 60,
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["field_no_label", "===", true]
      }
    }
  }, {
    "name": "field_padding",
    "type": "number",
    "input_type": "range",
    "label": "Label Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100,
      "condition": {
        "action": ["hidden", "visible"],
        "rules": ["field_no_label", "===", true]
      }
    }
  },

  // LEGEND -------------

  {
    "name": "field_legend_color",
    "type": "string",
    "input_type": "color",
    "label": "Legend Color",
    "create_column": true
  }, {
    "name": "field_legend_font_size",
    "type": "number",
    "input_type": "range",
    "label": "Legend Size",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 60
    }
  }, {
    "name": "field_legend_padding",
    "type": "number",
    "input_type": "range",
    "label": "Legend Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  }]
};

// ------------------- //

// WFIELD SETTING ------------------- //

// ------------------- //

var wfieldSetting = {

  info: {
    label: "Wonder Fields Setting",
    name: WF_FORM_ACTION_WFIELD_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["wf_label_color", "wf_label_font_size", "wf_label_padding", "wf_legend_color", "wf_legend_font_size", "wf_legend_padding", "wf_option_label_color", "wf_option_legend_color"],

  fields: [

  // LABEL -------------

  {
    "name": "wf_label_font_size",
    "type": "number",
    "input_type": "range",
    "label": "Label Size",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 60
    }
  }, {
    "name": "wf_label_color",
    "type": "string",
    "input_type": "color",
    "label": "Label Size",
    "create_column": true
  }, {
    "name": "wf_label_padding",
    "type": "number",
    "input_type": "range",
    "label": "Label Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  },

  // LEGEND -------------

  {
    "name": "wf_legend_color",
    "type": "string",
    "input_type": "color",
    "label": "Legend Color",
    "create_column": true
  }, {
    "name": "wf_legend_font_size",
    "type": "number",
    "input_type": "range",
    "label": "Legend Size",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 60
    }
  }, {
    "name": "wf_legend_padding",
    "type": "number",
    "input_type": "range",
    "label": "Legend Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  },

  // OPTION -------------

  {
    "name": "wf_option_label_color",
    "type": "string",
    "input_type": "color",
    "label": "Option Label Color",
    "create_column": true
  }, {
    "name": "wf_option_legend_color",
    "type": "string",
    "input_type": "color",
    "label": "Option Legend Color",
    "create_column": true
  }]
};

// ------------------- //

// CONTROL SETTING ------------------- //

// ------------------- //

var controlSetting = {

  info: {
    label: "Control Setting",
    name: WF_FORM_ACTION_CONTROL_SETTING,
    version: "1.0.0",
    icon: icon,
    attrKey: attrKey
  },

  displayFields: ["prev_label", "prev_bg", "prev_color", "next_label", "next_bg", "next_color", "submit_label", "submit_bg", "submit_color", "submit_font_size", "submit_padding", "submit_border_radius"],

  fields: [

  // PREV -------------- //

  {
    "name": "prev_label",
    "type": "string",
    "input_type": "text",
    "required": true,
    "label": "Prev Button Label",
    "create_column": true
  }, {
    "name": "prev_color",
    "type": "string",
    "input_type": "color",
    "label": "Prev Button Label Color",
    "create_column": true
  }, {
    "name": "prev_bg",
    "type": "string",
    "input_type": "color",
    "label": "Prev Button Background Color",
    "create_column": true
  },

  // NEXT -------------- //

  {
    "name": "next_label",
    "type": "string",
    "input_type": "text",
    "required": true,
    "label": "Next Button Label",
    "create_column": true
  }, {
    "name": "next_color",
    "type": "string",
    "input_type": "color",
    "label": "Next Button Label Color",
    "create_column": true
  }, {
    "name": "next_bg",
    "type": "string",
    "input_type": "color",
    "label": "Next Button Background Color",
    "create_column": true
  },

  // SUBMIT STYLE -------------- //


  {
    "name": "submit_label",
    "type": "string",
    "input_type": "text",
    "required": true,
    "label": "Submit Button Label",
    "create_column": true
  }, {
    "name": "submit_color",
    "type": "string",
    "input_type": "color",
    "label": "Submit Button Label Color",
    "create_column": true
  }, {
    "name": "submit_bg",
    "type": "string",
    "input_type": "color",
    "label": "Submit Button Background Color",
    "create_column": true
  },

  // BUTTON STYLE -------------- //

  {
    "name": "submit_font_size",
    "type": "number",
    "input_type": "range",
    "label": "Button Label Size",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 60
    }
  }, {
    "name": "submit_padding",
    "type": "number",
    "input_type": "range",
    "label": "Button Padding",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  }, {
    "name": "submit_border_radius",
    "type": "number",
    "input_type": "range",
    "label": "Button Border Radius",
    "create_column": true,
    "attributes": {
      "step": 0,
      "sufix": "px",
      "minimum": 0,
      "maximum": 100
    }
  }]
};

// ------------------- //

// GRID STRATEGY ------------------- //

// ------------------- //

var gridStrategy = {

  info: {
    label: "Bootstrap Grid",
    name: "gridStrategy",
    version: "1.0.0",
    icon: "equalizer"
  },

  displayFields: ["cols"],

  fields: [{
    "name": "cols",
    "type": "string",
    "input_type": "grid",
    "label": "Responsive Strategy",
    "legend": "the <strong>Bootstrap grid</strong> system work across multiple devices. <br><br> documentation :<br> http://getbootstrap.com/css/#grid-options",
    "create_column": true
  }]
};

// ------------------- //

var List = [globalSetting, coverSetting, videoHTML5Setting, containerSetting, fieldSetting, wfieldSetting, controlSetting];

var getList = function getList() {
  return List;
};
var getListInfo = function getListInfo() {
  return List.map(function (s) {
    return s.info;
  });
};
var settings = { gridStrategy: gridStrategy };
List.map(function (a) {
  settings[a.info.name] = a;
});
var getSetting = function getSetting(name) {
  if (settings.hasOwnProperty(name)) {
    return settings[name];
  } else {
    return null;
  }
};

// ----------------- //
exports.default = {
  getList: getList,
  getListInfo: getListInfo,
  getSetting: getSetting,
  getConstants: getConstants
};
// ----------------- //

/***/ }),
/* 414 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _Lodash = __webpack_require__(6);

var _WFAnalyticsClientMgr = __webpack_require__(240);

var _WFAnalyticsClientMgr2 = _interopRequireDefault(_WFAnalyticsClientMgr);

var _WFAnalyticsViewMgr = __webpack_require__(241);

var _WFAnalyticsViewMgr2 = _interopRequireDefault(_WFAnalyticsViewMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ANALYTICS MANAGER ------------------- // findFormStatsByYear

// ------------------- //

var WFAnalyticsMgr = function () {
  function WFAnalyticsMgr() {
    (0, _classCallCheck3.default)(this, WFAnalyticsMgr);
  }

  (0, _createClass3.default)(WFAnalyticsMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFAnalyticsViewMgr2.default.setState(obj);
    }

    /**
     * Change : set state by obj values
     */

  }, {
    key: "getState",
    value: function getState() {
      return _WFAnalyticsViewMgr2.default.getState();
    }

    /**
     * Init : 
     * @warning {moment.js} is global in the browser
     * @param args formEntryState
     */

  }, {
    key: "init",
    value: function init(formEntryState) {
      var createdTms = formEntryState.getCreatedTms();
      if (!formEntryState) {
        throw new Error('WFAnalyticsMgr init => formEntryState not defined');
      } else if (!createdTms) {
        throw new Error('WFAnalyticsMgr init => createdTms not defined');
      } else {
        var fields = formEntryState.getAllFieldSelect();
        _WFAnalyticsClientMgr2.default.setFormName(formEntryState);
        WFAnalyticsMgr.setCurrentFieldByDefault(fields);
        WFAnalyticsMgr.change({
          page_loader: false,
          fields: fields,
          startYear: (0, _WFMoment2.default)(createdTms).year(),
          startMonth: (0, _WFMoment2.default)(createdTms).month(),
          startWeek: (0, _WFMoment2.default)(createdTms).isoWeek()
        });
      }
    }

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      _WFAnalyticsViewMgr2.default.resetState();
    }

    // FORM ANALYTICS ----------- //

    /**
     * Get current week details
     * @param res is collection of stats object result
     */

  }, {
    key: "getCurrentWeek",
    value: function getCurrentWeek() {
      var _WFAnalyticsMgr$getSt = WFAnalyticsMgr.getState(),
          currentWeek = _WFAnalyticsMgr$getSt.currentWeek;

      return currentWeek;
    }

    /**
     * Get current month details
     * @param res is collection of stats object result
     */

  }, {
    key: "getCurrentMonth",
    value: function getCurrentMonth() {
      var _WFAnalyticsMgr$getSt2 = WFAnalyticsMgr.getState(),
          currentMonth = _WFAnalyticsMgr$getSt2.currentMonth;

      return currentMonth;
    }

    /**
     * Get current year details
     * @param res is collection of stats object result
     */

  }, {
    key: "getCurrentYear",
    value: function getCurrentYear() {
      var _WFAnalyticsMgr$getSt3 = WFAnalyticsMgr.getState(),
          currentYear = _WFAnalyticsMgr$getSt3.currentYear;

      return currentYear;
    }

    /**
      * Find form stats by year groupby month
      * @param integer year
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "findFormStatsByYear",
    value: function findFormStatsByYear(year, next) {

      // // console.error("FIND YEAR")
      // // console.log({year})

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFAnalyticsMgr findFormStatsByYear => next {onError, onSuccess} is required...');
      } else {
        if (!year) {
          throw new Error('WFAnalyticsMgr findFormStatsByYear => year is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFAnalyticsClientMgr2.default.findFormStatsByYear(year, function (error) {
            return onError(error);
          }, function (res) {
            WFAnalyticsMgr.change({
              currentYear: year
            });
            if (res.length === 0) {
              onSuccess();
            } else {
              WFAnalyticsMgr.setYearResult(res, next);
            }
          });
        }
      }
    }

    /**
     * Set current year details
     * set current month by default
     * @param res is collection of stats object result
     * @param next callback {onError, onSuccess}
     */

  }, {
    key: "setYearResult",
    value: function setYearResult(res) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;


      // console.warn("SET YEARS")
      // console.log(res)

      if ((0, _Lodash.isArray)(res)) {
        var _WFAnalyticsMgr$getSt4 = WFAnalyticsMgr.getState(),
            endYear = _WFAnalyticsMgr$getSt4.endYear,
            endMonth = _WFAnalyticsMgr$getSt4.endMonth,
            currentYear = _WFAnalyticsMgr$getSt4.currentYear,
            currentMonth = _WFAnalyticsMgr$getSt4.currentMonth;

        var length = res.length > 0;
        var row = length > 0 ? res[0] : {};

        /*
        console.warn("SET YEAR ___ ARGS")
        console.log(`
          endMonth === currentMonth : ${endMonth === currentMonth}
          endYear === currentYear : ${endYear === currentYear}
        `)
        */

        if (length > 0 && endMonth === currentMonth && endYear === currentYear) {
          row = res[length - 1];
        }
        var _row = row,
            _row$date_month = _row.date_month,
            date_month = _row$date_month === undefined ? null : _row$date_month;

        if (date_month) {
          WFAnalyticsMgr.change({
            yearResult: res
          });
          WFAnalyticsMgr.yearToCharts(res);
          WFAnalyticsMgr.findFormStatsByYearMonth(currentYear, _WFAnalyticsClientMgr2.default.fixedMonthIndex(date_month, 'server'), // parseInt(date_month) - 1,
          next, false);
        }
      }
    }

    /**
      * Find form stats by year and month groupby week
      * @param integer year
      * @param integer month
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "findFormStatsByYearMonth",
    value: function findFormStatsByYearMonth(year, month, next) {
      var isWeekCallback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;


      // console.error("FIND MONTH")
      // console.log({year, month, isWeekCallback})

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFAnalyticsMgr findFormStatsByYearMonth => next {onError, onSuccess} is required...');
      } else {
        if (!year) {
          throw new Error('WFAnalyticsMgr findFormStatsByYearMonth => year is required...');
        } else if (!month) {
          throw new Error('WFAnalyticsMgr findFormStatsByYearMonth => month is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFAnalyticsClientMgr2.default.findFormStatsByYearMonth(year, month, // + 1,
          function (error) {
            return onError(error);
          }, function (res) {
            WFAnalyticsMgr.change({
              currentYear: year,
              currentMonth: month
            });
            WFAnalyticsMgr.setMonthResult(res, next, isWeekCallback);
          });
        }
      }
    }

    /**
     * Set current month details
     * set current week by default
     * @param res is collection of stats object result
     * @param next callback {onError, onSuccess}
     * @param isWeekCallback if method call by setWeekResult
     */

  }, {
    key: "setMonthResult",
    value: function setMonthResult(res) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var isWeekCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;


      //console.warn("SET MONTH")
      //console.log({isWeekCallback, res})

      if ((0, _Lodash.isArray)(res)) {
        var _WFAnalyticsMgr$getSt5 = WFAnalyticsMgr.getState(),
            currentWeek = _WFAnalyticsMgr$getSt5.currentWeek,
            currentYear = _WFAnalyticsMgr$getSt5.currentYear,
            currentMonth = _WFAnalyticsMgr$getSt5.currentMonth;

        var length = res.length;
        WFAnalyticsMgr.monthToCharts(res);
        WFAnalyticsMgr.change({
          monthResult: res
        });

        /*
        console.warn("SET MONTH ___ ARGS")
        console.log(`
          isWeekCallback : ${isWeekCallback}
          result count : ${length}
        `)
        */

        if (!isWeekCallback && length > 0) {
          var date_week = res[length - 1].date_week;

          WFAnalyticsMgr.findFormStatsByYearWeek(currentYear, parseInt(date_week), next);
        } else {
          var onSuccess = next.onSuccess;

          if ((0, _Lodash.isFunction)(onSuccess)) {
            onSuccess();
          }
        }
      }
    }

    /**
      * Find form stats by year and week
      * @param integer year
      * @param integer week
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "findFormStatsByYearWeek",
    value: function findFormStatsByYearWeek(year, week, next) {

      // console.error("FIND WEEK")
      // console.log({year, week})

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFAnalyticsMgr findFormStatsByYearWeek => next {onError, onSuccess} is required...');
      } else {
        if (!year) {
          throw new Error('WFAnalyticsMgr findFormStatsByYearWeek => year is required...');
        } else if (!week) {
          throw new Error('WFAnalyticsMgr findFormStatsByYearWeek => week is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFAnalyticsClientMgr2.default.findFormStatsByYearWeek(year, week, function (error) {
            return onError(error);
          }, function (res) {
            WFAnalyticsMgr.change({
              currentYear: year,
              currentWeek: week
            });
            WFAnalyticsMgr.setWeekResult(res, next);
          });
        }
      }
    }

    /**
     * Set current week details
     * Set current month if it !== current week's month
     * @param res is collection of stats object result
     * @param next callback {onError, onSuccess}
     */

  }, {
    key: "setWeekResult",
    value: function setWeekResult(res) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;


      //console.warn("SET WEEK")
      //console.log(res)

      if ((0, _Lodash.isArray)(res)) {
        var _WFAnalyticsMgr$getSt6 = WFAnalyticsMgr.getState(),
            currentWeek = _WFAnalyticsMgr$getSt6.currentWeek,
            currentYear = _WFAnalyticsMgr$getSt6.currentYear,
            currentMonth = _WFAnalyticsMgr$getSt6.currentMonth;

        WFAnalyticsMgr.change({
          weekResult: res
        });
        WFAnalyticsMgr.weekToCharts(res);
        var month = (0, _WFMoment2.default)(currentWeek + "/" + currentYear, "W/YYYY").month();

        /*
        console.warn("SET WEEK ___ ARGS")
        console.log(`
          !== : ${currentMonth !== month}
          month : ${month}
          currentMonth : ${currentMonth}
          date : ${`${currentWeek}/${currentYear}`}
        `)
        */

        if (currentMonth !== month) {
          WFAnalyticsMgr.findFormStatsByYearMonth(currentYear, month, next, true);
        } else {
          var onSuccess = next.onSuccess;

          if ((0, _Lodash.isFunction)(onSuccess)) {
            onSuccess();
          }
        }
      }
    }

    // FIELDS ANALYTICS ----------- //


    /**
     * Get current field
     * @retun field's schema
     */

  }, {
    key: "getCurrentField",
    value: function getCurrentField() {
      var _WFAnalyticsMgr$getSt7 = WFAnalyticsMgr.getState(),
          currentFieldValue = _WFAnalyticsMgr$getSt7.currentFieldValue;

      return currentFieldValue;
    }
  }, {
    key: "setFieldOptions",
    value: function setFieldOptions() {
      var _WFAnalyticsMgr$getCu = WFAnalyticsMgr.getCurrentField(),
          entry_id = _WFAnalyticsMgr$getCu.entry_id;

      var _WFAnalyticsMgr$getSt8 = WFAnalyticsMgr.getState(),
          _WFAnalyticsMgr$getSt9 = _WFAnalyticsMgr$getSt8.optionResults,
          optionResults = _WFAnalyticsMgr$getSt9 === undefined ? [] : _WFAnalyticsMgr$getSt9;

      var labels = [];
      var series = [];
      optionResults.map(function (option) {
        var _option$wf_fieldconfi = option.wf_fieldconfig_id,
            wf_fieldconfig_id = _option$wf_fieldconfi === undefined ? 0 : _option$wf_fieldconfi,
            _option$options_count = option.options_count,
            options_count = _option$options_count === undefined ? 0 : _option$options_count,
            _option$label = option.label,
            label = _option$label === undefined ? "" : _option$label;

        if (wf_fieldconfig_id == entry_id) {
          labels.push(label);
          series.push(options_count);
        }
      });
      WFAnalyticsMgr.change({
        currentOptionLabels: labels,
        currentOptionSeries: series
      });
    }

    /**
     * Set current field
     * @param fields is collection of fieldSchema
     */

  }, {
    key: "setCurrentFieldByDefault",
    value: function setCurrentFieldByDefault(fields) {
      if ((0, _Lodash.isArray)(fields) && fields.length > 0) {
        var fieldSchema = fields[0];
        if (fieldSchema.hasOwnProperty("entry_id")) {
          var entry_id = fieldSchema.entry_id;

          WFAnalyticsMgr.change({
            currentField: entry_id,
            currentFieldValue: fieldSchema
          });
        } else {
          throw new Error('WFAnalyticsMgr setCurrentFieldByDefault => entry_id not define...');
        }
      }
    }

    /**
      * Count option entries
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "countOptionEntries",
    value: function countOptionEntries(next) {
      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFAnalyticsMgr countOptionEntries => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        _WFAnalyticsClientMgr2.default.countOptionEntries(function (error) {
          return onError(error);
        }, function (res) {
          return WFAnalyticsMgr.mapOptionEntries(res, onSuccess);
        }
        /* old version ...
        (res) => {
          let optionResults = res.map(o => {
            return Object.assign(o,{
              wf_fieldconfig_id: parseInt(o.wf_fieldconfig_id),
              options_count: parseInt(o.options_count)
            })
          });
          WFAnalyticsMgr.change({
            optionResults: orderBy(
              optionResults, 
              ['options_count'], 
              ['desc', 'asc']
            )
          })
          WFAnalyticsMgr.setFieldOptions();
          onSuccess()
        }
        */
        );
      }
    }

    /**
      * Map option entries
      * @param opt_count is collection of object
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "mapOptionEntries",
    value: function mapOptionEntries() {
      var opt_count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
      var next = arguments[1];

      var optionResults = opt_count.map(function (o) {
        return (0, _assign2.default)(o, {
          wf_fieldconfig_id: parseInt(o.wf_fieldconfig_id),
          options_count: parseInt(o.options_count)
        });
      });
      WFAnalyticsMgr.change({
        optionResults: (0, _Lodash.orderBy)(optionResults, ['options_count'], ['desc', 'asc'])
      });
      WFAnalyticsMgr.setFieldOptions();
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
      * Find option entries
      * @param integer formEntryId
      * @param next callback {onError, onSuccess}
      */

  }, {
    key: "findOptionEntries",
    value: function findOptionEntries(formEntryId, next) {
      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFAnalyticsMgr findOptionEntries => next {onError, onSuccess} is required...');
      } else {
        if (!formEntryId) {
          throw new Error('WFAnalyticsMgr findOptionEntries => formEntryId is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFAnalyticsClientMgr2.default.countOptionEntries(formEntryId, function (error) {
            return onError(error);
          }, function (res) {
            return onSuccess();
          });
        }
      }
    }

    // STATS HELPERS ----------- //

    /**
      * Format stat values to clean value
      * @param row contains all value
      * @param isOptStat boolean
      * @return object {view, completed, uncompleted}
      */

  }, {
    key: "toStat",
    value: function toStat() {
      var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var isOptStat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      var view = 0;
      var completed = 0;
      var uncompleted = 0;
      if ((0, _Lodash.isObject)(row)) {
        var view_count = row.view_count,
            completed_count = row.completed_count,
            uncompleted_count = row.uncompleted_count;

        view = parseInt(view_count);
        completed = parseInt(completed_count);
        uncompleted = parseInt(uncompleted_count) - completed;
        if (!view || view < 0) {
          view = 0;
        }
        if (!completed || completed < 0) {
          completed = 0;
        }
        if (!uncompleted || uncompleted < 0 || uncompleted > view) {
          uncompleted = 0;
        }
      }
      return {
        view: view,
        completed: completed,
        uncompleted: uncompleted
      };
    }

    /**
      * Create config for Charts Element 
      * @param row contains all values
      * @state viewByYear is array
      * @state completedByYear is array
      * @state uncompletedByYear is array
      */

  }, {
    key: "yearToCharts",
    value: function yearToCharts(rows) {
      var _WFAnalyticsMgr$getSt10 = WFAnalyticsMgr.getState(),
          _WFAnalyticsMgr$getSt11 = _WFAnalyticsMgr$getSt10.months,
          months = _WFAnalyticsMgr$getSt11 === undefined ? [] : _WFAnalyticsMgr$getSt11;

      var viewByYear = [];
      var completedByYear = [];
      var uncompletedByYear = [];
      var count = rows.length;
      var lastMonth = 0;
      if (rows.length === 0) {
        WFAnalyticsMgr.change({
          viewByYear: viewByYear,
          completedByYear: completedByYear,
          uncompletedByYear: uncompletedByYear
        });
      } else {
        if (count > 0) {
          lastMonth = rows[count - 1];
          lastMonth = parseInt(lastMonth.date_month);
        }
        months.map(function (m, i) {
          i++;
          var row = null;
          var values = rows.filter(function (r) {
            return parseInt(r.date_month) === i;
          });
          if (values.length > 0) {
            row = values[0];
          }

          var _WFAnalyticsMgr$toSta = WFAnalyticsMgr.toStat(row),
              view = _WFAnalyticsMgr$toSta.view,
              completed = _WFAnalyticsMgr$toSta.completed,
              uncompleted = _WFAnalyticsMgr$toSta.uncompleted;

          if (i <= lastMonth || i <= lastMonth + 1) {
            viewByYear.push(view);
            completedByYear.push(completed);
            uncompletedByYear.push(uncompleted);
          }
        });
        WFAnalyticsMgr.change({
          viewByYear: viewByYear,
          completedByYear: completedByYear,
          uncompletedByYear: uncompletedByYear
        });
      }
    }

    /**
      * Create config for Charts Element
      * @param row contains all values
      * @state viewByMonth is array
      * @state completedByMonth is array
      * @state uncompletedByMonth is array
      */

  }, {
    key: "monthToCharts",
    value: function monthToCharts(rows) {
      var _WFAnalyticsMgr$getSt12 = WFAnalyticsMgr.getState(),
          currentMonth = _WFAnalyticsMgr$getSt12.currentMonth;

      var monthWeeks = [];
      var viewByMonth = [];
      var completedByMonth = [];
      var uncompletedByMonth = [];
      if (rows.length === 0) {
        WFAnalyticsMgr.change({
          monthWeeks: monthWeeks,
          viewByMonth: viewByMonth,
          completedByMonth: completedByMonth,
          uncompletedByMonth: uncompletedByMonth
        });
      } else {
        rows.map(function (row, i) {
          var _WFAnalyticsMgr$toSta2 = WFAnalyticsMgr.toStat(row),
              view = _WFAnalyticsMgr$toSta2.view,
              completed = _WFAnalyticsMgr$toSta2.completed,
              uncompleted = _WFAnalyticsMgr$toSta2.uncompleted;

          monthWeeks.push(i + 1);
          viewByMonth.push(view);
          completedByMonth.push(completed);
          uncompletedByMonth.push(uncompleted);
        });
        WFAnalyticsMgr.change({
          monthWeeks: monthWeeks,
          viewByMonth: viewByMonth,
          completedByMonth: completedByMonth,
          uncompletedByMonth: uncompletedByMonth
        });
      }
    }

    /**
      * Create config for Charts Element
      * @param row contains all values
      * @state viewByWeek is array
      * @state completedByWeek is array
      * @state uncompletedByWeek is array
      */

  }, {
    key: "weekToCharts",
    value: function weekToCharts(rows) {
      var _WFAnalyticsMgr$getSt13 = WFAnalyticsMgr.getState(),
          _WFAnalyticsMgr$getSt14 = _WFAnalyticsMgr$getSt13.days,
          days = _WFAnalyticsMgr$getSt14 === undefined ? [] : _WFAnalyticsMgr$getSt14,
          currentYear = _WFAnalyticsMgr$getSt13.currentYear,
          currentMonth = _WFAnalyticsMgr$getSt13.currentMonth;

      var weeksLabel = [];
      var viewByWeek = [];
      var completedByWeek = [];
      var uncompletedByWeek = [];
      var getDayStr = function getDayStr(dateDay) {
        var month = _WFAnalyticsClientMgr2.default.fixedMonthIndex(currentMonth, 'client');
        var date = dateDay + "/" + month + "/" + currentYear;
        var format = "D/M/YYYY";
        return (0, _WFMoment2.default)(date, format).format('ddd');
      };
      if (rows.length === 0) {
        WFAnalyticsMgr.change({
          weeksLabel: weeksLabel,
          viewByWeek: viewByWeek,
          completedByWeek: completedByWeek,
          uncompletedByWeek: uncompletedByWeek
        });
      } else {
        console.log(rows);
        days.map(function (day) {
          var result = rows.filter(function (row) {
            var date_day = row.date_day;

            return day === getDayStr(date_day);
          });
          if (result.length > 0) {
            var row = result[0];

            var _WFAnalyticsMgr$toSta3 = WFAnalyticsMgr.toStat(row),
                view = _WFAnalyticsMgr$toSta3.view,
                completed = _WFAnalyticsMgr$toSta3.completed,
                uncompleted = _WFAnalyticsMgr$toSta3.uncompleted;

            weeksLabel.push(getDayStr(row.date_day));
            viewByWeek.push(view);
            completedByWeek.push(completed);
            uncompletedByWeek.push(uncompleted);
          }
        });
        WFAnalyticsMgr.change({
          weeksLabel: weeksLabel,
          viewByWeek: viewByWeek,
          completedByWeek: completedByWeek,
          uncompletedByWeek: uncompletedByWeek
        });
      }
    }
  }]);
  return WFAnalyticsMgr;
}();

// ------------------- //


exports.default = WFAnalyticsMgr;
// ------------------- //

/***/ }),
/* 415 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFContentResources = __webpack_require__(242);

var _WFContentResources2 = _interopRequireDefault(_WFContentResources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_CONTENT MANAGER ------------------- //

// ------------------- //

var WFContentMgr = function WFContentMgr() {
  (0, _classCallCheck3.default)(this, WFContentMgr);
};

;

// ------------------- //
exports.default = WFContentMgr;
// ------------------- //

/***/ }),
/* 416 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFContentMgr = __webpack_require__(415);

var _WFContentMgr2 = _interopRequireDefault(_WFContentMgr);

var _WFContentResources = __webpack_require__(242);

var _WFContentResources2 = _interopRequireDefault(_WFContentResources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFContent = {
  key: "WFContent",
  mgr: _WFContentMgr2.default,
  resources: _WFContentResources2.default
};
// ------------------- //
exports.default = WFContent;
// ------------------- //

window.WFContent = WFContent;

/***/ }),
/* 417 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFEntryViewMgr = __webpack_require__(246);

var _WFEntryViewMgr2 = _interopRequireDefault(_WFEntryViewMgr);

var _WFEntryClientMgr = __webpack_require__(243);

var _WFEntryClientMgr2 = _interopRequireDefault(_WFEntryClientMgr);

var _WFEntryQueryMgr = __webpack_require__(159);

var _WFEntryQueryMgr2 = _interopRequireDefault(_WFEntryQueryMgr);

var _WFEntrySelectMgr = __webpack_require__(245);

var _WFEntrySelectMgr2 = _interopRequireDefault(_WFEntrySelectMgr);

var _WFEntryFormStateMgr = __webpack_require__(244);

var _WFEntryFormStateMgr2 = _interopRequireDefault(_WFEntryFormStateMgr);

var _WFEntryCollectionMgr = __webpack_require__(158);

var _WFEntryCollectionMgr2 = _interopRequireDefault(_WFEntryCollectionMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY MANAGER ------------------- //

// ------------------- //

var WFEntryMgr = function () {
  function WFEntryMgr() {
    (0, _classCallCheck3.default)(this, WFEntryMgr);
  }

  (0, _createClass3.default)(WFEntryMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFEntryViewMgr2.default.setState(obj);
    }

    /**
     * Ready : refresh state
     */

  }, {
    key: "ready",
    value: function ready() {
      _WFEntryViewMgr2.default.setState({
        entries: _WFEntryCollectionMgr2.default.getValue(),
        entries_selected: _WFEntrySelectMgr2.default.getKeys(),
        entries_pager: _WFEntryQueryMgr2.default.getPagination()
      });
    }

    /**
     * Init : 
     * @param args {formState} 
     */

  }, {
    key: "init",
    value: function init(formState) {
      if (!formState) {
        throw new Error('WFEntryMgr init => formState is required...');
      } else {
        _WFEntryClientMgr2.default.setFormName(formState);
        _WFEntryFormStateMgr2.default.init([], formState.getValues());
      }
    }

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      _WFEntryQueryMgr2.default.reset();
      _WFEntrySelectMgr2.default.clear();
      _WFEntryViewMgr2.default.resetState();
      _WFEntryCollectionMgr2.default.clear();
      _WFEntryFormStateMgr2.default.clear();
      WFEntryMgr.ready();
    }

    /**
     * Select entry
     * @param entry
     */

  }, {
    key: "select",
    value: function select(row) {
      if (!(0, _Lodash.isObject)(row) || !row.hasOwnProperty("id")) {
        throw new Error('WFEntryMgr select => row is not valid...');
      } else {
        _WFEntrySelectMgr2.default.select(row);
        WFEntryMgr.ready();
      }
    }

    /**
     * Find all
     */

  }, {
    key: "find",
    value: function find() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFEntryMgr find => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        _WFEntryClientMgr2.default.find(args, onError, function (res) {
          WFEntryMgr.ready();
          onSuccess(res);
        });
      }
    }

    /**
     * Set QueryParams orderBy and orderByDirection
     * @param orderBy {string}
     * @param orderByDirection {desc || asc}
     */

  }, {
    key: "reOrder",
    value: function reOrder() {
      var orderByDirection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var orderBy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "asc";

      if (!orderByDirection || orderByDirection === "") {
        _WFEntryQueryMgr2.default.clearOrderBy();
        _WFEntryQueryMgr2.default.clearOrderbyDirection();
      } else {
        _WFEntryQueryMgr2.default.setOrderBy(orderBy);
        _WFEntryQueryMgr2.default.setOrderByDirection(orderByDirection);
      }
    }

    /**
     * Del selection
     * @param next callback {onSuccess, onError}
     * @return Promise
     */

  }, {
    key: "del",
    value: function del() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFEntryMgr del => next {onError, onSuccess} is required...');
      } else {
        var rows = _WFEntrySelectMgr2.default.getValue();
        if (rows.length === 0) {
          throw new Error('WFEntryMgr del => the rows is empty');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFEntryFormStateMgr2.default.init(rows);
          _WFEntryClientMgr2.default.del(_WFEntryFormStateMgr2.default, onError, function (res) {
            _WFEntrySelectMgr2.default.remove(res, function () {
              WFEntryMgr.ready();
              onSuccess(res);
            });
          });
        }
      }
    }
  }]);
  return WFEntryMgr;
}();

// ------------------- //


exports.default = WFEntryMgr;
// ------------------- //

/***/ }),
/* 418 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFieldConfigClientMgr = __webpack_require__(247);

var _WFieldConfigClientMgr2 = _interopRequireDefault(_WFieldConfigClientMgr);

var _WFieldConfigFormStateMgr = __webpack_require__(248);

var _WFieldConfigFormStateMgr2 = _interopRequireDefault(_WFieldConfigFormStateMgr);

var _WFieldConfigResources = __webpack_require__(161);

var _WFieldConfigResources2 = _interopRequireDefault(_WFieldConfigResources);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_FIELD_CONFIG MANAGER ------------------- //

// ------------------- //

var WFieldConfigMgr = function () {
  function WFieldConfigMgr() {
    (0, _classCallCheck3.default)(this, WFieldConfigMgr);
  }

  (0, _createClass3.default)(WFieldConfigMgr, null, [{
    key: "init",


    /**
     * Init 
     */
    value: function init(formConfig) {
      var _formConfig$fields = formConfig.fields,
          fields = _formConfig$fields === undefined ? [] : _formConfig$fields;

      _WFieldConfigFormStateMgr2.default.init(fields);
    }

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {
      _WFieldConfigFormStateMgr2.default.clear();
    }

    /**
     * Create new fieldConfig
     * @param wf_formconfig_id
     * @return formView 
     */

  }, {
    key: "create",
    value: function create(wf_formconfig_id) {
      var isLimited = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      if (!(0, _Lodash.isNumber)(wf_formconfig_id)) {
        throw new Error('WFieldConfigMgr create => wf_formconfig_id is required...');
        return null;
      } else {
        var formState = _WFieldConfigFormStateMgr2.default.create(wf_formconfig_id);
        formState.setValues({
          visible: true
        });
        var formView = WFieldConfigMgr.createFormView(formState, _WFieldConfigResources2.default.configToCreate(isLimited));
        return formView;
      }
    }

    /**
     * Edit fieldConfig
     * @param fieldName
     * @return formView 
     */

  }, {
    key: "edit",
    value: function edit(fieldName) {
      var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _option$schema = option.schema,
          schema = _option$schema === undefined ? {} : _option$schema;

      if (!(0, _Lodash.isString)(fieldName)) {
        throw new Error('WFieldConfigMgr create => fieldName is required...');
        return null;
      } else {
        var formState = _WFieldConfigFormStateMgr2.default.getOrCreate({
          name: fieldName
        });

        formState.setValues(schema);

        var type = schema.type,
            input_type = schema.input_type;

        var _WFieldConfigResource = _WFieldConfigResources2.default.getField(input_type || "text"),
            _WFieldConfigResource2 = _WFieldConfigResource.displayFields,
            displayFields = _WFieldConfigResource2 === undefined ? [] : _WFieldConfigResource2,
            _WFieldConfigResource3 = _WFieldConfigResource.defaultValues,
            defaultValues = _WFieldConfigResource3 === undefined ? {} : _WFieldConfigResource3;

        var fields = _WFieldConfigResources2.default.configToEdit[type || "string"];
        var formView = WFieldConfigMgr.createFormView(formState, {
          displayFields: displayFields,
          defaultValues: (0, _assign2.default)({}, defaultValues, schema)
        });
        if (type === "string" || type === "text") {
          var len = formView.formState.getField("len");
          var maxLength = formView.formState.getField("maxLength");
          if (len && maxLength) {
            maxLength.setValue(len.getValue());
          }
        }
        if (option.hasOwnProperty("displayFields")) {
          formView.setDisplayFields(option.displayFields);
        }
        var validationSchema = formView.formState.getField("validation_schema");
        if (option.hasOwnProperty("validation_schema") && validationSchema && validationSchema.getValue() === "") {

          //console.error("EDIT")
          //console.dir(option.validation_schema)
          //console.dir(validationSchema.getValue())

          if ((0, _Lodash.isObject)(option.validation_schema)) {
            validationSchema.setValue((0, _JSON.stringify)(option.validation_schema));
          } else if ((0, _Lodash.isString)(option.validation_schema)) {
            validationSchema.setValue(option.validation_schema);
          }
        }

        return formView;
      }
    }

    /**
     * Save fieldConfig
     * if new fieldConfig set type
     * @param formState
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "save",
    value: function save(formState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFieldConfigMgr save => next {onError, onSuccess} is required...');
      } else {
        if (!formState) {
          throw new Error('WFieldConfigMgr save => formState not valid');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          WFieldConfigMgr.controlFieldType(formState);
          WFieldConfigMgr.controlFieldValidationSchema(formState);
          WFieldConfigMgr.controlFieldLen(formState);
          /*
          if (input_type === "select" 
            || type.includes("select")) {
           } 
          */
          _WFieldConfigClientMgr2.default.save(formState, onError, onSuccess);
        }
      }
    }

    /**
     * Del fieldConfig
     * @param formState
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: "del",
    value: function del(formState) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!formState) {
        throw new Error('WFieldConfigMgr del => formState null...');
      } else if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
        throw new Error('WFieldConfigMgr del => next {onError, onSuccess} is required...');
      } else {
        var onError = next.onError,
            onSuccess = next.onSuccess;

        var fieldName = formState.getName();
        _WFieldConfigClientMgr2.default.del(formState, onError, onSuccess);
      }
    }

    /**
     * Create new formView
     * @param formState
     * @return formView 
     */

  }, {
    key: "createFormView",
    value: function createFormView(formState) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (!formState) {
        throw new Error('WFieldConfigMgr createFormView => formState not valid...');
        return null;
      } else {
        var _options$fields = options.fields,
            fields = _options$fields === undefined ? [] : _options$fields,
            _options$displayField = options.displayFields,
            displayFields = _options$displayField === undefined ? [] : _options$displayField,
            _options$defaultValue = options.defaultValues,
            defaultValues = _options$defaultValue === undefined ? {} : _options$defaultValue;

        if (fields.length > 0) {
          formState.addFields(fields);
        }
        if (displayFields.length > 0) {
          formState.setDisplayFields(displayFields);
        }
        if ((0, _keys2.default)(defaultValues).length > 0) {
          formState.setValues(defaultValues);
        }
        var formView = new _WFormView2.default(formState, true);
        return formView;
      }
    }

    /**
     * Before Create a new set type by inputType
     * @param formState
     */

  }, {
    key: "controlFieldType",
    value: function controlFieldType(formState) {
      if (!formState.hasEntryId()) {
        var typeMgr = formState.getField("type");
        var inputTypeMgr = formState.getField("input_type");

        var _WFieldConfigResource4 = _WFieldConfigResources2.default.getField(inputTypeMgr.getValue()),
            info = _WFieldConfigResource4.info,
            defaultValues = _WFieldConfigResource4.defaultValues;

        typeMgr.setValue(info.type);
      }
    }

    /**
     * Before Save set validation_schema if is not defined
     * or update with maxLengthMgr && minLengthMgr
     * @param formState
     */

  }, {
    key: "controlFieldValidationSchema",
    value: function controlFieldValidationSchema(formState) {
      var _formState$getValues = formState.getValues(),
          _formState$getValues$ = _formState$getValues.type,
          type = _formState$getValues$ === undefined ? "" : _formState$getValues$,
          _formState$getValues$2 = _formState$getValues.input_type,
          input_type = _formState$getValues$2 === undefined ? "text" : _formState$getValues$2;

      var validationSchemaMgr = formState.getField("validation_schema");
      if (type !== "select" && type !== "boolean" && input_type !== "file" && input_type !== "date" // (todo charly need found solution for date...)
      && validationSchemaMgr) {
        if (validationSchemaMgr.getValue() === "")
          // create validationSchema ...
          {
            var _WFieldConfigResource5 = _WFieldConfigResources2.default.getField(input_type || "text"),
                validationStrategy = _WFieldConfigResource5.validationStrategy;
            // Set Schema by default


            if (validationStrategy && validationStrategy.hasOwnProperty("validation_schema")) {
              validationSchemaMgr.setValue((0, _JSON.stringify)(validationStrategy.validation_schema));
            }
            var schema = (0, _JSON.parse)(validationSchemaMgr.getValue());
            // For Date (todo charly ignored...)
            if (input_type === "date") {
              var _schema$formatMaximum = schema.formatMaximum,
                  formatMaximum = _schema$formatMaximum === undefined ? "" : _schema$formatMaximum,
                  _schema$formatMinimum = schema.formatMinimum,
                  formatMinimum = _schema$formatMinimum === undefined ? "" : _schema$formatMinimum;

              var formatMaximumMgr = formState.getField("formatMaximum");
              var formatMinimumMgr = formState.getField("formatMinimum");
              formatMaximumMgr.setValue(formatMaximum ? formatMaximum : "");
              formatMinimumMgr.setValue(formatMinimum ? formatMinimum : "");
            }
            // For String/Text
            else if (type === "string" || type === "text") {
                var _schema$maxLength = schema.maxLength,
                    maxLength = _schema$maxLength === undefined ? 0 : _schema$maxLength,
                    _schema$minLength = schema.minLength,
                    minLength = _schema$minLength === undefined ? 0 : _schema$minLength;

                var maxLengthMgr = formState.getField("maxLength");
                var minLengthMgr = formState.getField("minLength");
                maxLengthMgr.setValue(maxLength);
                minLengthMgr.setValue(minLength);
              }
              // For Number
              else if (type === "number") {
                  var _schema$maximum = schema.maximum,
                      maximum = _schema$maximum === undefined ? 0 : _schema$maximum,
                      _schema$minimum = schema.minimum,
                      minimum = _schema$minimum === undefined ? 0 : _schema$minimum;

                  var maximumMgr = formState.getField("maximum");
                  var minimumMgr = formState.getField("minimum");
                  maximumMgr.setValue(maximum ? maximum : 0);
                  minimumMgr.setValue(minimum);
                }
                // For Select2
                else if (type.includes("select")) {
                    var _schema$maxItems = schema.maxItems,
                        maxItems = _schema$maxItems === undefined ? 0 : _schema$maxItems,
                        _schema$minItems = schema.minItems,
                        minItems = _schema$minItems === undefined ? 0 : _schema$minItems;

                    var maxItemsMgr = formState.getField("maxItems");
                    var minItemsMgr = formState.getField("minItems");
                    maxItemsMgr.setValue(maxItems ? maxItems : "");
                    minItemsMgr.setValue(minItems);
                  }
          } else
          // update validationSchema ...
          {
            var newSchema = (0, _JSON.parse)(validationSchemaMgr.getValue());
            if ((0, _Lodash.isObject)(newSchema)) {
              // For Date (todo charly ignored...)
              if (input_type === "date") {
                var _formatMinimumMgr = formState.getField("formatMinimum");
                var _formatMaximumMgr = formState.getField("formatMaximum");
                if (_formatMinimumMgr.getValue() !== "") {
                  newSchema["formatMinimum"] = _formatMinimumMgr.getValue();
                  newSchema["formatExclusiveMinimum"] = true;
                } else if (newSchema.hasOwnProperty("formatMinimum")) {
                  delete newSchema["formatMinimum"];
                  delete newSchema["formatExclusiveMinimum"];
                }
                if (_formatMaximumMgr.getValue() !== "") {
                  newSchema["formatMaximum"] = _formatMaximumMgr.getValue();
                  newSchema["formatExclusiveMaximum"] = true;
                } else if (newSchema.hasOwnProperty("formatMaximum")) {
                  delete newSchema["formatMaximum"];
                  delete newSchema["formatExclusiveMaximum"];
                }
              }
              // For String/Text
              else if (type === "string" || type === "text") {
                  var _minLengthMgr = formState.getField("minLength");
                  var _maxLengthMgr = formState.getField("maxLength");
                  newSchema["minLength"] = _minLengthMgr.getValue();
                  if (_maxLengthMgr.getValue() > 0) {
                    newSchema["maxLength"] = _maxLengthMgr.getValue();
                  } else if (newSchema.hasOwnProperty("maxLength")) {
                    delete newSchema["maxLength"];
                  }
                }
                // For Number
                else if (type === "number") {
                    var _minimumMgr = formState.getField("minimum");
                    var _maximumMgr = formState.getField("maximum");
                    newSchema["minimum"] = _minimumMgr.getValue();
                    newSchema["maximum"] = _maximumMgr.getValue();
                    if (_maximumMgr.getValue() > 0) {
                      newSchema["maximum"] = _maximumMgr.getValue();
                    } else if (newSchema.hasOwnProperty("maximum")) {
                      delete newSchema["maximum"];
                    }
                  }
                  // For Select2
                  else if (type.includes("select")) {
                      var _minItemsMgr = formState.getField("minItems");
                      var _maxItemsMgr = formState.getField("maxItems");
                      newSchema["minItems"] = _minItemsMgr.getValue();
                      if (_maxItemsMgr.getValue() > 0) {
                        newSchema["maxItems"] = _maxItemsMgr.getValue();
                      } else if (newSchema.hasOwnProperty("maxItems")) {
                        delete newSchema["maxItems"];
                      }
                    }
              // Set Schema
              validationSchemaMgr.setValue((0, _JSON.stringify)(newSchema));
            }
          }
      }
    }

    /**
     * Before Save set len by validation_schema for WFApi
     * @param formState
     */

  }, {
    key: "controlFieldLen",
    value: function controlFieldLen(formState) {
      var _formState$getValues2 = formState.getValues(),
          type = _formState$getValues2.type,
          input_type = _formState$getValues2.input_type;

      if (type !== "boolean" && input_type !== "file" && input_type !== "date") {
        if (type === "string" || type === "text") {
          var lenMgr = formState.getField("len");
          var validationSchemaMgr = formState.getField("validation_schema");
          var schema = (0, _JSON.parse)(validationSchemaMgr.getValue());
          if (lenMgr && schema !== "") {
            var _schema$maxLength2 = schema.maxLength,
                maxLength = _schema$maxLength2 === undefined ? 0 : _schema$maxLength2;

            if (maxLength) {
              lenMgr.setValue(maxLength);
            }
          }
        }
      }
    }
  }]);
  return WFieldConfigMgr;
}();

// ------------------- //


exports.default = WFieldConfigMgr;
// ------------------- //

/***/ }),
/* 419 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var WF_SECRET = exports.WF_SECRET = "wonderform team success story 2017";
var WF_LICENSE_STATUS = exports.WF_LICENSE_STATUS = "wf_license_status";
var WF_LICENSE_SITE = exports.WF_LICENSE_SITE = "wf_license_site";
var WF_LICENSE_KEY = exports.WF_LICENSE_KEY = "license_key";
var WF_LICENSE_EXPIRES = exports.WF_LICENSE_EXPIRES = "expires";
var WF_PRODUCT_TYPE_ID = exports.WF_PRODUCT_TYPE_ID = "wf_producttype_id";

/***/ }),
/* 420 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _Lodash = __webpack_require__(6);

var _Crypto = __webpack_require__(445);

var _Constants = __webpack_require__(419);

var _WFLicenseValuesMgr = __webpack_require__(253);

var _WFLicenseValuesMgr2 = _interopRequireDefault(_WFLicenseValuesMgr);

var _WFLicenseClientMgr = __webpack_require__(250);

var _WFLicenseClientMgr2 = _interopRequireDefault(_WFLicenseClientMgr);

var _WFLicenseFormStateMgr = __webpack_require__(251);

var _WFLicenseFormStateMgr2 = _interopRequireDefault(_WFLicenseFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Private license store ------------------- // 

var licenses = new _WFObject2.default();

// ------------------- // 

// CLASS WF_LICENSE MANAGER ------------------- //

// ------------------- // 

var WFLicenseMgr = function () {
  function WFLicenseMgr() {
    (0, _classCallCheck3.default)(this, WFLicenseMgr);
  }

  (0, _createClass3.default)(WFLicenseMgr, null, [{
    key: "find",


    /**
     * Find licenses 
     * @param next {onSuccess, onError} callback
     */
    value: function find() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      _WFLicenseClientMgr2.default.find(args, function (err) {
        return console.error(err);
      }, function (rows) {
        WFLicenseMgr.setValues(rows);
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      });
    }

    /**
     * Edit license
     * @param setting 
     * @return formState
     */

  }, {
    key: "edit",
    value: function edit(wf_producttype_id) {
      if (!wf_producttype_id) {
        throw new Error('WFLicenseMgr edit => wf_producttype_id not valid...');
        return null;
      } else {
        var formState = _WFLicenseFormStateMgr2.default.getOrCreate({
          wf_producttype_id: wf_producttype_id
        });
        return formState;
      }
    }

    /**
     * Active License
     * @param formState
     * @return formState
     */

  }, {
    key: "activate",
    value: function activate() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var item_name = args.item_name,
          license_key = args.license_key,
          wf_producttype_id = args.wf_producttype_id,
          onInvalid = args.onInvalid,
          onValid = args.onValid;

      if (!license_key) {
        throw new Error('WFLicenseMgr activate => license_key is required...');
      } else {
        var urlArgs = {
          license: license_key,
          item_name: item_name,
          edd_action: "activate_license"
        };
        _WFLicenseClientMgr2.default.getLicenseInfo(urlArgs, function (result) {
          var _result$response = result.response,
              response = _result$response === undefined ? null : _result$response;

          if (response) {
            var _response$success = response.success,
                success = _response$success === undefined ? false : _response$success,
                _response$license = response.license,
                license = _response$license === undefined ? "invalid" : _response$license;

            if (license === "invalid" && success === false) {
              onInvalid();
            } else if (license === "valid" && success === true) {
              var formState = WFLicenseMgr.edit(wf_producttype_id);
              var data = WFLicenseMgr.addOrUpdateLicense(response, {
                license_key: license_key,
                wf_producttype_id: wf_producttype_id
              });
              formState.setValues({ data: data });
              onValid();
            }
          } else {
            console.error("err... no response");
          }
        });
      }
    }

    /**
     * Save license
     * @param formState 
     * @param next {onSuccess, onError} callback
     */

  }, {
    key: "save",
    value: function save(formState, next) {
      if (!formState) {
        throw new Error('WFLicenseMgr save => formState not valid...');
      } else {
        if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
          throw new Error('WFLicenseMgr save => next {onError, onSuccess} is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFLicenseClientMgr2.default.save(formState, onError, onSuccess);
        }
      }
    }

    /**
     * Create temp formView
     * @param wf_producttype_id
     * @return formState
     */

  }, {
    key: "createFormView",
    value: function createFormView(wf_producttype_id) {
      if (!wf_producttype_id) {
        throw new Error('WFLicenseMgr createFormView => wf_producttype_id not valid...');
        return null;
      } else {
        var formState = WFLicenseMgr.edit(wf_producttype_id);
        formState.addFields([{
          "name": "license_key",
          "type": "string",
          "input_type": "text",
          "label": "",
          "required": true,
          "create_column": true
        }]);
        formState.setDisplayFields(["license_key"]);
        if (_WFLicenseValuesMgr2.default.has(wf_producttype_id)) {
          var values = _WFLicenseValuesMgr2.default.get(wf_producttype_id);
          formState.setValues(values);
        }
        var formView = new _WFormView2.default(formState, true);
        return formView;
      }
    }

    /**
     * Set Values
     * @param rows is collection of license value
     */

  }, {
    key: "setValues",
    value: function setValues() {
      var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      rows.forEach(function (row) {
        var license_key = row.license_key,
            _row$wf_producttype_i = row.wf_producttype_id,
            wf_producttype_id = _row$wf_producttype_i === undefined ? null : _row$wf_producttype_i;

        if (wf_producttype_id) {
          var formState = _WFLicenseFormStateMgr2.default.getOrCreate({ wf_producttype_id: wf_producttype_id });
          formState.setValues(row);
          var flds = formState.getFields();
          var data = flds.data.getValue();
          var status = WFLicenseMgr.checkLicenseValidity(data, row);
          _WFLicenseValuesMgr2.default.set(wf_producttype_id, {
            status: status,
            license_key: license_key
          });
        }
      });
    }

    /**
     * Set license
     * @param obj values
     * @param args {license_key, wf_producttype_id}
     * @return encryptedData string contains obj
     */

  }, {
    key: "addOrUpdateLicense",
    value: function addOrUpdateLicense() {
      var _Object$assign2;

      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _args$license_key = args.license_key,
          license_key = _args$license_key === undefined ? "" : _args$license_key,
          _args$wf_producttype_ = args.wf_producttype_id,
          wf_producttype_id = _args$wf_producttype_ === undefined ? "" : _args$wf_producttype_;

      var data = (0, _assign2.default)((_Object$assign2 = {}, (0, _defineProperty3.default)(_Object$assign2, _Constants.WF_PRODUCT_TYPE_ID, wf_producttype_id), (0, _defineProperty3.default)(_Object$assign2, _Constants.WF_LICENSE_KEY, license_key), (0, _defineProperty3.default)(_Object$assign2, _Constants.WF_LICENSE_STATUS, true), (0, _defineProperty3.default)(_Object$assign2, _Constants.WF_LICENSE_SITE, _WFUrl2.default.getHost()), _Object$assign2), obj);
      // todo charly remove...
      //console.dir(data);
      var encryptedData = (0, _Crypto.encryptJSON)(data, (0, _Crypto.getSecret)(_Constants.WF_SECRET));
      return encryptedData;
    }

    /**
     * Check license
     * @param encryptedData string contains object
     * @param args {license_key, wf_producttype_id}
     * @return boolean
     */

  }, {
    key: "checkLicenseValidity",
    value: function checkLicenseValidity(encryptedData) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _args$license_key2 = args.license_key,
          license_key = _args$license_key2 === undefined ? "" : _args$license_key2,
          _args$wf_producttype_2 = args.wf_producttype_id,
          wf_producttype_id = _args$wf_producttype_2 === undefined ? "" : _args$wf_producttype_2;

      if ((0, _Lodash.isString)(encryptedData)) {
        var data = (0, _Crypto.decryptJSON)(encryptedData, (0, _Crypto.getSecret)(_Constants.WF_SECRET));
        if ((0, _Lodash.isObject)(data) && data.hasOwnProperty(_Constants.WF_LICENSE_STATUS) && (0, _Lodash.isBoolean)(data[_Constants.WF_LICENSE_STATUS]) && data.hasOwnProperty(_Constants.WF_LICENSE_SITE) && data.hasOwnProperty(_Constants.WF_LICENSE_EXPIRES)) {
          // 1 Check license key 
          if (data[_Constants.WF_LICENSE_KEY] === "" || data[_Constants.WF_LICENSE_KEY] !== license_key) {
            return false;
          }
          // 2 Check wf_product_type_id
          if (data[_Constants.WF_PRODUCT_TYPE_ID] === "" || data[_Constants.WF_PRODUCT_TYPE_ID] !== parseInt(wf_producttype_id)) {
            return false;
          }
          // 3 Check date expires
          var nowDate = (0, _WFMoment2.default)();
          var expiresDate = (0, _WFMoment2.default)(data[_Constants.WF_LICENSE_EXPIRES]);
          if (!expiresDate.isValid() || nowDate.isAfter(expiresDate)) {
            return false;
          }
          // 4 Check site url
          if (data[_Constants.WF_LICENSE_SITE] !== _WFUrl2.default.getHost()) {
            return _WFUrl2.default.getBaseUrl().includes(data[_Constants.WF_LICENSE_SITE]);
          }
          return true;
        } else {
          return false;
        }
      } else {
        return false;
      }
    }
  }]);
  return WFLicenseMgr;
}();

exports.default = WFLicenseMgr;

/***/ }),
/* 421 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// field config schema
var formFields = [{
  "name": "data",
  "type": "text",
  "len": 64,
  "label": "Data",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true,
  "ref_form_config": ""
}, {
  "name": "license_key",
  "type": "string",
  "len": 255,
  "label": "LicenseKey",
  "legend": "",
  "required": true,
  "uniq": true,
  "searchable": true,
  "editable": true,
  "create_column": true,
  "ref_form_config": ""
}, {
  "name": "wf_producttype_id",
  "type": "integer",
  "len": 11,
  "label": "ProductType",
  "legend": "",
  "required": false,
  "uniq": true,
  "searchable": true,
  "editable": true,
  "create_column": true,
  "ref_form_config": "product-type"
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['license_key', 'data', 'wf_producttype_id'];

/**
 * Factory to create new license
 */

var WFLicenseFactory = function () {
  function WFLicenseFactory() {
    (0, _classCallCheck3.default)(this, WFLicenseFactory);
  }

  (0, _createClass3.default)(WFLicenseFactory, null, [{
    key: "create",

    /**
     * Create a license form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'license',
        type: _WFProductType.WF_CORE_LICENSE_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };

      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFLicenseFactory;
}();

;

exports.default = WFLicenseFactory;

/***/ }),
/* 422 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// option schema
var formFields = [{
  "name": "attributes",
  "type": "text",
  "len": 6555,
  "label": "Attributes",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": false,
  "create_column": true
}, {
  "name": "is_private",
  "type": "boolean",
  "len": 1,
  "label": "Is Private",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "label",
  "type": "string",
  "input_type": "textarea",
  "len": 500,
  "label": "Label",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "name",
  "type": "string",
  "len": 32,
  "label": "Name",
  "legend": "",
  "required": true,
  "uniq": true,
  "searchable": true,
  "editable": false,
  "create_column": true
}, {
  "name": "parent_id",
  "type": "integer",
  "len": 11,
  "label": "Parent",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "wf_optiongroup_id",
  "type": "integer",
  "label": "OptionGroup",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "legend",
  "type": "string",
  "input_type": "textarea",
  "len": 6555,
  "label": "Option Legend",
  "legend": "",
  "required": false,
  "uniq": true,
  "searchable": true,
  "editable": true,
  "create_column": false
}, {
  "name": "color",
  "type": "color",
  "len": 64,
  "label": "Option Color",
  "description": null,
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": false,
  "ref_form_config": ""
}, {
  "name": "icon",
  "type": "media",
  "len": 6555,
  "label": "Option Icon",
  "description": null,
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": false,
  "ref_form_config": ""
}, {
  "name": "image",
  "type": "media",
  "len": 6555,
  "label": "Option Image",
  "description": null,
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": false,
  "ref_form_config": ""
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['label'];

/**
 * Factory to create new option
 */

var WFOptionFactory = function () {
  function WFOptionFactory() {
    (0, _classCallCheck3.default)(this, WFOptionFactory);
  }

  (0, _createClass3.default)(WFOptionFactory, null, [{
    key: "create",

    /**
     * Create a option config form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'option',
        type: _WFProductType.WF_CORE_OPTION_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };

      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFOptionFactory;
}();

;

exports.default = WFOptionFactory;

/***/ }),
/* 423 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// field config schema
var formFields = [{
  "name": "attributes",
  "type": "text",
  "len": 65555,
  "label": "Attributes",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": false,
  "create_column": true
}, {
  "name": "is_private",
  "type": "boolean",
  "len": 1,
  "label": "Is Private",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "label",
  "type": "string",
  "len": 64,
  "label": "Label",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "name",
  "type": "string",
  "len": 32,
  "label": "Name",
  "legend": "",
  "required": true,
  "uniq": true,
  "searchable": true,
  "editable": false,
  "create_column": true
}, {
  "name": "parent_id",
  "type": "integer",
  "len": 11,
  "label": "Parent",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['label'];

/**
 * Factory to create new option group
 */

var WFOptionGroupFactory = function () {
  function WFOptionGroupFactory() {
    (0, _classCallCheck3.default)(this, WFOptionGroupFactory);
  }

  (0, _createClass3.default)(WFOptionGroupFactory, null, [{
    key: "create",

    /**
     * Create a option group form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'option-group',
        type: _WFProductType.WF_CORE_OPTION_GROUP_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };
      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFOptionGroupFactory;
}();

;

exports.default = WFOptionGroupFactory;

/***/ }),
/* 424 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// field config schema
var formFields = [{
  "name": "group_id",
  "type": "integer",
  "len": 11,
  "label": "GroupId",
  "required": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "param_name",
  "type": "string",
  "len": 64,
  "label": "ParamName",
  "required": true,
  "uniq": true,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "param_value",
  "type": "text",
  "len": 64,
  "label": "ParamValue",
  "required": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['group_id', 'param_name', 'param_value'];

/**
 * Factory to create new setting
 */

var WFSettingFactory = function () {
  function WFSettingFactory() {
    (0, _classCallCheck3.default)(this, WFSettingFactory);
  }

  (0, _createClass3.default)(WFSettingFactory, null, [{
    key: "create",

    /**
     * Create a setting form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'setting',
        type: _WFProductType.WF_CORE_SETTING_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };

      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFSettingFactory;
}();

;

exports.default = WFSettingFactory;

/***/ }),
/* 425 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _ref, _ref2;

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// field config schema
var formFields = [{
  "name": "attributes",
  "type": "text",
  "len": 6555,
  "label": "Attributes",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": false,
  "create_column": true
}, {
  "name": "action_id",
  "type": "integer",
  "len": 11,
  "required": true,
  "uniq": false,
  "searchable": false,
  "editable": false,
  "create_column": false
}, {
  "name": "return_url",
  "type": "string",
  "len": 65555,
  "label": "Return Url",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "template_name",
  "type": "string",
  "len": 64,
  "label": "TemplateName",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "title",
  "type": "string",
  "len": 32,
  "label": "title",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "url",
  "type": "string",
  "len": 1000,
  "label": "Url",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "wf_formactiontype_id",
  "type": "integer",
  "len": 11,
  "label": "ActionType",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
}, {
  "name": "wf_formconfig_id",
  "type": "integer",
  "len": 11,
  "label": "FormConfig",
  "legend": "",
  "required": true,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": true
},

// ------------------- //
// SUCCESS_MESSAGE     ------------------- //
// ------------------- //

{
  "name": "success_title",
  "type": "string",
  "len": 1000,
  "input_type": "text",
  "label": "Success title",
  "create_column": false
}, {
  "name": "success_message",
  "len": 65555,
  "type": "text",
  "input_type": "textarea",
  "label": "Success message",
  "create_column": false
},

// ------------------- //
// ERROR_MESSAGE     ------------------- //
// ------------------- //

{
  "name": "err404_title",
  "type": "string",
  "len": 1000,
  "input_type": "text",
  "label": "Error 404 title",
  "required": true,
  "create_column": false
}, {
  "name": "err404_message",
  "type": "text",
  "len": 65555,
  "input_type": "textarea",
  "label": "Error 404  message",
  "required": true,
  "create_column": false
}, {
  "name": "maintenance_title",
  "type": "string",
  "len": 1000,
  "input_type": "text",
  "label": "Maintenance title",
  "required": true,
  "create_column": false
}, {
  "name": "maintenance_message",
  "type": "text",
  "len": 65555,
  "input_type": "textarea",
  "label": "Maintenance message",
  "required": true,
  "create_column": false
},

// ------------------- //
// FIELDS_ANALYTICS     ------------------- //
// ------------------- //

{
  "name": "singleResultIsPublic",
  "type": "boolean",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": false,
  "attributes": {
    placeholder: "User can view our results"
  }
}, {
  "name": "btnLabelSingle",
  "type": "string",
  "label": "Label button for our results",
  "input_type": "text",
  "create_column": false,
  "len": 255,
  "required": true,
  "attributes": {
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["singleResultIsPublic", "===", true]
    }
  }
}, {
  "name": "globalResultIsPublic",
  "type": "boolean",
  "len": 1,
  "label": "",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": true,
  "editable": true,
  "create_column": false,
  "attributes": {
    placeholder: "User can view global results"
  }
}, {
  "name": "btnLabelGlobal",
  "type": "string",
  "label": "Global results button label",
  "input_type": "text",
  "create_column": false,
  "len": 255,
  "required": true,
  "attributes": {
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["globalResultIsPublic", "===", true]
    }
  }
}, {
  "name": "globalResultsTitle",
  "type": "string",
  "len": 255,
  "input_type": "text",
  "label": "Global results title",
  "required": true,
  "create_column": false,
  "attributes": {
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["globalResultIsPublic", "===", true]
    }
  }
}, {
  "name": "globalResultsMessage",
  "type": "text",
  "len": 65555,
  "input_type": "textarea",
  "label": "Global results message",
  "required": false,
  "create_column": false,
  "attributes": {
    "condition": {
      "action": ["visible", "hidden"],
      "rules": ["globalResultIsPublic", "===", true]
    }
  }
},

// ------------------- //
// REDIRECT     ------------------- //
// ------------------- //

{
  "name": "to",
  "type": "string",
  "input_type": "text",
  "label": "End point url",
  "create_column": false,
  "len": 65555,
  "required": true
}, {
  "name": "delay",
  "type": "number",
  "input_type": "range",
  "label": "Delay before redirection",
  "legend": "milli-second ex: 1000ms => 1s",
  "create_column": false,
  "attributes": {
    "step": 1000,
    "sufix": "ms",
    "minimum": 0,
    "maximum": 10000
  }
}, {
  "name": "message",
  "len": 65555,
  "type": "text",
  "input_type": "textarea",
  "label": "Message before redirection",
  "create_column": false
},

// ------------------- //
// FILE_DOWNLOAD     ------------------- //
// ------------------- //

{
  "name": "files",
  "type": "string",
  "len": 1000,
  "input_type": "media",
  "label": "Select file or file url",
  "required": true,
  "create_column": false,
  "attributes": {
    preview: false,
    isFile: true
  }
}, {
  "name": "message",
  "len": 65555,
  "type": "text",
  "input_type": "textarea",
  "label": "Message",
  "create_column": false
}, {
  "name": "btnLabel",
  "type": "string",
  "input_type": "text",
  "label": "Button label",
  "create_column": false
},

// ------------------- //
// MAIL_NOTIFICATION     ------------------- //
// ------------------- //

{
  "name": "use_mail_cc",
  "type": "boolean",
  "input_type": "checkbox",
  "create_column": false,
  "attributes": {
    "placeholder": "CC Option"
  }
}, {
  "name": "use_mail_bcc",
  "type": "boolean",
  "input_type": "checkbox",
  "create_column": false,
  "attributes": {
    "placeholder": "BCC Option"
  }
}, (_ref = {
  "name": "mail_cc",
  "type": "mailer",
  "len": 6555,
  "required": false,
  "label": "Cc",
  "legend": "enter the email addresses of the people you want to know about the email (remember that everyone will see their names)"
}, (0, _defineProperty3.default)(_ref, "required", false), (0, _defineProperty3.default)(_ref, "uniq", false), (0, _defineProperty3.default)(_ref, "searchable", false), (0, _defineProperty3.default)(_ref, "editable", true), (0, _defineProperty3.default)(_ref, "create_column", true), (0, _defineProperty3.default)(_ref, "attributes", {
  "condition": {
    "action": ["visible", "hidden"],
    "rules": ["use_mail_cc", "===", true]
  }
}), _ref), (_ref2 = {
  "name": "mail_bcc",
  "type": "mailer",
  "len": 6555,
  "required": false,
  "label": "Bcc",
  "legend": "enter the email addresses of the people you want to know about the email but not announce to everyone else that they are getting a copy"
}, (0, _defineProperty3.default)(_ref2, "required", false), (0, _defineProperty3.default)(_ref2, "uniq", false), (0, _defineProperty3.default)(_ref2, "searchable", false), (0, _defineProperty3.default)(_ref2, "editable", true), (0, _defineProperty3.default)(_ref2, "create_column", true), (0, _defineProperty3.default)(_ref2, "attributes", {
  "condition": {
    "action": ["visible", "hidden"],
    "rules": ["use_mail_bcc", "===", true]
  }
}), _ref2), {
  "name": "mail_from",
  "type": "mailer",
  "len": 65555,
  "label": "From",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "mail_subject",
  "type": "string",
  "len": 65555,
  "label": "Subject",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "mail_to",
  "type": "mailer",
  "len": 65555,
  "label": "To",
  "legend": '<strong>Format :</strong> "contact@exemple.com" <strong>or</strong> "john@exemple.com : John Doe". <strong>Separate :</strong> ","',
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true
}, {
  "name": "mail_body",
  "type": "html",
  "input_type": "textarea",
  "len": 65555,
  "label": "Message (Body)",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true,
  "attributes": {
    rows: 14
  }
}, {
  "name": "mail_attachments",
  "type": "text",
  "len": 65555,
  "label": "Mail Attachments",
  "legend": "",
  "required": false,
  "uniq": false,
  "searchable": false,
  "editable": true,
  "create_column": true,
  "attributes": {
    preview: false,
    isFile: true
  }
}];

// ordered fields that will be displayed in views
var formDisplayFields = ['mail_from', 'mail_to', 'mail_subject', 'mail_body'];

/**
 * Factory to create form action
 */

var WFormActionFactory = function () {
  function WFormActionFactory() {
    (0, _classCallCheck3.default)(this, WFormActionFactory);
  }

  (0, _createClass3.default)(WFormActionFactory, null, [{
    key: "create",

    /**
     * Create a fieldConfig form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'action',
        type: _WFProductType.WF_CORE_ACTION_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };

      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFormActionFactory;
}();

;

exports.default = WFormActionFactory;

/***/ }),
/* 426 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFormField = __webpack_require__(43);

var _WFormField2 = _interopRequireDefault(_WFormField);

var _WFormProp = __webpack_require__(47);

var _WFormProp2 = _interopRequireDefault(_WFormProp);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// form config schema
var formFields = [{
  "name": "attributes",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "Attributes",
  "required": false,
  "searchable": false,
  "editable": false,
  "create_column": true
}, {
  "name": "name",
  "type": "string",
  "input_type": "text",
  "len": 32,
  "label": "Name",
  "required": true,
  "editable": false,
  "searchable": true,
  "create_column": true,
  "attributes": {
    "transformable": true,
    "transform": "toSlug"
  }
}, {
  "name": "entries_table",
  "type": "string",
  "input_type": "",
  "len": 64,
  "label": "Entries Table",
  "required": true,
  "editable": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "title",
  "type": "string",
  "input_type": "text",
  "len": 64,
  "label": "Title",
  "required": true,
  "searchable": true,
  "create_column": true,
  "attributes": {
    "transformable": true,
    "transform": "toCapital"
  }
}, {
  "name": "description",
  "type": "text",
  "input_type": "textarea",
  "len": 64,
  "label": "Description",
  "required": false,
  "searchable": true,
  "create_column": true
}, {
  "name": "display_fields",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "DisplayFields",
  "required": false,
  "searchable": false,
  "create_column": true
}, {
  "name": "wf_optiongroup_id",
  "type": "integer",
  "input_type": "",
  "len": 11,
  "label": "OptionGroup",
  "required": false,
  "searchable": true,
  "create_column": true
}, {
  "name": "wf_producttype_id",
  "type": "integer",
  "input_type": "",
  "len": 11,
  "label": "ProductType",
  "required": true,
  "searchable": true,
  "create_column": true
}, {
  "name": "theme",
  "type": "string",
  "input_type": "",
  "len": 64,
  "label": "Theme",
  "required": true,
  "searchable": true,
  "create_column": false
}, {
  "name": "settings",
  "type": "text",
  "input_type": "",
  "len": 65555,
  "label": "Settings",
  "required": false,
  "searchable": false,
  "create_column": false
}];

// order fields that will be displayed in views
var formDisplayFields = ['title', 'description'];

/**
 * Factory to create new form-config
 */

var WFormConfigFactory = function () {
  function WFormConfigFactory() {
    (0, _classCallCheck3.default)(this, WFormConfigFactory);
  }

  (0, _createClass3.default)(WFormConfigFactory, null, [{
    key: "create",

    /**
     * Create a formConfig form state
     * @return instanceof WFormState
     */
    value: function create() {
      var config = {
        name: 'form-config',
        type: _WFProductType.WF_CORE_FORM_CONFIG_ID,
        display_fields: formDisplayFields,
        fields: formFields
      };
      var formState = new _WFormState2.default(config);
      return formState;
    }
  }]);
  return WFormConfigFactory;
}();

;

exports.default = WFormConfigFactory;

/***/ }),
/* 427 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Use for create global formView
 */
var WFormMgr = function () {
  /**
   * Constructor
   */
  function WFormMgr() {
    (0, _classCallCheck3.default)(this, WFormMgr);

    this.formState = null;
    this.formView = null;
    this.initialConfig = null;
  }
  /**
   * Get
   * @return {formState, formView}
   */


  (0, _createClass3.default)(WFormMgr, [{
    key: "get",
    value: function get() {
      return {
        formState: this.formState,
        formView: this.formView
      };
    }
    /**
     * Set
     * @param formView
     */

  }, {
    key: "set",
    value: function set(formView) {
      if (formView) {
        this.formView = formView;
        this.formState = formView.getFormState();
      }
    }
    /**
     * Get config
     * @return {formState, formView}
     */

  }, {
    key: "getConfig",
    value: function getConfig() {
      if (this.formState) {
        var config = this.formState.getAsDbRow();
        return (0, _assign2.default)(this.initialConfig, config);
      }
    }
    /**
     * Set the initialConfig
     * @param formView
     */

  }, {
    key: "setInitialConfig",
    value: function setInitialConfig(config) {
      if (config) {
        this.initialConfig = config;
      }
    }
    /**
     * Check if formView exist
     * @return boolean
     */

  }, {
    key: "isReady",
    value: function isReady() {
      if (this.formView) {
        return true;
      } else {
        return false;
      }
    }
    /**
     * Clear all attributes
     */

  }, {
    key: "clear",
    value: function clear() {
      this.formState = null;
      this.formView = null;
      this.initialConfig = null;
    }
  }]);
  return WFormMgr;
}();

exports.default = WFormMgr;

/***/ }),
/* 428 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFInitialState;

var _WFConstants = __webpack_require__(58);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFInitialState = (_WFInitialState = {}, (0, _defineProperty3.default)(_WFInitialState, _WFConstants.WF_RESULTS, {}), (0, _defineProperty3.default)(_WFInitialState, _WFConstants.WF_STATUS, _WFConstants.WF_STATUS_LOADING), (0, _defineProperty3.default)(_WFInitialState, _WFConstants.HEIGHT, 0), (0, _defineProperty3.default)(_WFInitialState, _WFConstants.WIDTH, 0), (0, _defineProperty3.default)(_WFInitialState, _WFConstants.WF_DISPLAY_FIELDS, []), _WFInitialState);

exports.default = WFInitialState;

/***/ }),
/* 429 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _get2 = __webpack_require__(125);

var _get3 = _interopRequireDefault(_get2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFieldView2 = __webpack_require__(102);

var _WFieldView3 = _interopRequireDefault(_WFieldView2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS BOOLEAN FIELD VIEW ------------------- //

// ------------------- //

var WFieldBooleanView = function (_WFieldView) {
  (0, _inherits3.default)(WFieldBooleanView, _WFieldView);

  /**
   * Constructor
   * @param value instance of WFBoolean
   */
  function WFieldBooleanView(value) {
    (0, _classCallCheck3.default)(this, WFieldBooleanView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldBooleanView.__proto__ || (0, _getPrototypeOf2.default)(WFieldBooleanView)).call(this, value));

    _this.initialState = (0, _defineProperty3.default)({}, value.getKey(), value.get());
    return _this;
  }

  /**
   * Before init set default value
   * @next super.init()
   */


  (0, _createClass3.default)(WFieldBooleanView, [{
    key: 'init',
    value: function init(args) {
      var field = args.field,
          _args$schema = args.schema,
          schema = _args$schema === undefined ? {} : _args$schema;

      if (!this.isInit && !field.hasValue() && schema.hasOwnProperty(this.value.getKey())) {
        this.value.set(schema[this.value.getKey()]);
        this.change({ eventArgs: (0, _defineProperty3.default)({}, this.value.getKey(), this.value.get()) });
      }
      (0, _get3.default)(WFieldBooleanView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldBooleanView.prototype), 'init', this).call(this, args);
    }
  }]);
  return WFieldBooleanView;
}(_WFieldView3.default);
// ------------------- //


exports.default = WFieldBooleanView;
// ------------------- //

/***/ }),
/* 430 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFieldView2 = __webpack_require__(102);

var _WFieldView3 = _interopRequireDefault(_WFieldView2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS DATE FIELD VIEW ------------------- //

// ------------------- //

var WFieldDateView = function (_WFieldView) {
  (0, _inherits3.default)(WFieldDateView, _WFieldView);

  /**
   * Constructor
   * @param value instance of WFDate
   */
  function WFieldDateView(value) {
    (0, _classCallCheck3.default)(this, WFieldDateView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldDateView.__proto__ || (0, _getPrototypeOf2.default)(WFieldDateView)).call(this, value));

    _this.initialState = (0, _defineProperty3.default)({}, value.key, value.get());
    return _this;
  }

  return WFieldDateView;
}(_WFieldView3.default);
// ------------------- //


exports.default = WFieldDateView;
// ------------------- //

/***/ }),
/* 431 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _get2 = __webpack_require__(125);

var _get3 = _interopRequireDefault(_get2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFieldView2 = __webpack_require__(102);

var _WFieldView3 = _interopRequireDefault(_WFieldView2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS STRING FIELD VIEW ------------------- //

// ------------------- //

var WFieldNumberView = function (_WFieldView) {
  (0, _inherits3.default)(WFieldNumberView, _WFieldView);

  /**
   * Constructor
   * @param value instance of WFNumber
   */
  function WFieldNumberView(value) {
    (0, _classCallCheck3.default)(this, WFieldNumberView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldNumberView.__proto__ || (0, _getPrototypeOf2.default)(WFieldNumberView)).call(this, value));

    _this.initialState = (0, _defineProperty3.default)({}, value.key, value.get());
    return _this;
  }

  /**
   * Before init set default value
   * @next super.init()
   */


  (0, _createClass3.default)(WFieldNumberView, [{
    key: 'init',
    value: function init(args) {
      var field = args.field,
          _args$schema = args.schema,
          schema = _args$schema === undefined ? {} : _args$schema;
      var _schema$isFloat = schema.isFloat,
          isFloat = _schema$isFloat === undefined ? false : _schema$isFloat;

      if (!this.isInit && !field.hasValue() && schema.hasOwnProperty(this.value.getKey())) {
        //this.value.isFloat = isFloat;
        this.value.set(schema[this.value.getKey()]);
        this.change({ eventArgs: (0, _defineProperty3.default)({}, this.value.getKey(), this.value.get()) });
      }
      (0, _get3.default)(WFieldNumberView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldNumberView.prototype), 'init', this).call(this, args);
    }
  }]);
  return WFieldNumberView;
}(_WFieldView3.default);
// ------------------- //


exports.default = WFieldNumberView;
// ------------------- //

/***/ }),
/* 432 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _get2 = __webpack_require__(125);

var _get3 = _interopRequireDefault(_get2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _WFBaobabOption = __webpack_require__(226);

var _WFBaobabOption2 = _interopRequireDefault(_WFBaobabOption);

var _WFieldView2 = __webpack_require__(102);

var _WFieldView3 = _interopRequireDefault(_WFieldView2);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(72);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS SELECT FIELD VIEW ------------------- // 

// ------------------- //

var WFieldSelectView = function (_WFieldView) {
  (0, _inherits3.default)(WFieldSelectView, _WFieldView);

  /**
   * Constructor
   * @param value instance of WFSelect
   */
  function WFieldSelectView(value) {
    var _this$initialState;

    (0, _classCallCheck3.default)(this, WFieldSelectView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldSelectView.__proto__ || (0, _getPrototypeOf2.default)(WFieldSelectView)).call(this, value));

    _this.baobabOptMgr = null;
    _this.isMonkey = false;
    _this.isLoaded = false;
    _this.initialState = (_this$initialState = {}, (0, _defineProperty3.default)(_this$initialState, value.key, value.get()), (0, _defineProperty3.default)(_this$initialState, 'min', 0), (0, _defineProperty3.default)(_this$initialState, 'max', 0), (0, _defineProperty3.default)(_this$initialState, 'focus', ""), (0, _defineProperty3.default)(_this$initialState, 'searchValue', ""), (0, _defineProperty3.default)(_this$initialState, 'resultData', []), (0, _defineProperty3.default)(_this$initialState, 'isLoading', false), (0, _defineProperty3.default)(_this$initialState, 'isOpen', false), _this$initialState);
    return _this;
  }

  /**
   * Call method by Eventype
   * @param evenType string 
   * @param args object params
   */


  (0, _createClass3.default)(WFieldSelectView, [{
    key: 'on',
    value: function on(evenType) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      var _args$eventArgs = args.eventArgs,
          eventArgs = _args$eventArgs === undefined ? {} : _args$eventArgs;


      switch (evenType) {

        case _WFEventTypes.WF_EVENT_ONINIT:
          this.init(args);
          break;

        case _WFEventTypes.WF_EVENT_ONSELECT:
          this.select(eventArgs);
          break;

        case _WFEventTypes.WF_EVENT_ONTOGGLE:
          this.toggle(eventArgs);
          break;

        case _WFEventTypes.WF_EVENT_ONOPEN:
          this.open(eventArgs);
          break;

        case _WFEventTypes.WF_EVENT_ONCLOSE:
          this.close();
          break;

        case _WFEventTypes.WF_EVENT_ONFIND:
          this.find(eventArgs);
          break;

        case _WFEventTypes.WF_EVENT_ONSEARCH:
          this.search(eventArgs);
          break;

        case _WFEventTypes.WF_EVENT_ONDIDMOUNT:
          var _ctx$isEditEntry = ctx.isEditEntry,
              isEditEntry = _ctx$isEditEntry === undefined ? false : _ctx$isEditEntry;

          //console.error("SELECT STATUS")
          //console.log("this.isLoaded", this.isLoaded)
          //console.log("isEditEntry", isEditEntry)

          if (isEditEntry) {
            /*!this.isLoaded && */
            this.isLoaded = true;
            (0, _get3.default)(WFieldSelectView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldSelectView.prototype), 'on', this).call(this, evenType, args, ctx);
          } else {
            if (this.isInit && this.field.hasValue()) {
              var prevValue = this.value.getValue();
              if (!(0, _Lodash.isNull)(prevValue) && (0, _Lodash.isArray)(prevValue) && prevValue.length > 0) {
                this.change({ eventArgs: (0, _defineProperty3.default)({}, this.value.getKey(), prevValue) });
                this.validate(true, true);
              }
            }
            this.ready(_WFEventTypes.WF_EVENT_ONDIDMOUNT);
          }
          break;

        default:
          (0, _get3.default)(WFieldSelectView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldSelectView.prototype), 'on', this).call(this, evenType, args);
      }
    }

    /**
     * When the component initialize
     * Set value manager
     * @args {schema}
     */

  }, {
    key: 'init',
    value: function init(args) {
      if (this.isInit) {
        return;
      } else {
        var field = args.field,
            _args$schema = args.schema,
            schema = _args$schema === undefined ? {} : _args$schema;
        var required = schema.required,
            _schema$data = schema.data,
            data = _schema$data === undefined ? [] : _schema$data,
            _schema$labelBy = schema.labelBy,
            labelBy = _schema$labelBy === undefined ? "label" : _schema$labelBy,
            _schema$minItems = schema.minItems,
            minItems = _schema$minItems === undefined ? 1 : _schema$minItems,
            _schema$maxItems = schema.maxItems,
            maxItems = _schema$maxItems === undefined ? 0 : _schema$maxItems,
            _schema$isBaobab = schema.isBaobab,
            isBaobab = _schema$isBaobab === undefined ? false : _schema$isBaobab,
            _schema$isMonkey = schema.isMonkey,
            isMonkey = _schema$isMonkey === undefined ? false : _schema$isMonkey,
            _schema$isMultiple = schema.isMultiple,
            isMultiple = _schema$isMultiple === undefined ? false : _schema$isMultiple,
            _schema$optionType = schema.optionType,
            optionType = _schema$optionType === undefined ? null : _schema$optionType,
            _schema$wf_optiongrou = schema.wf_optiongroup_id,
            wf_optiongroup_id = _schema$wf_optiongrou === undefined ? 0 : _schema$wf_optiongrou,
            _schema$wf_optiongrou2 = schema.wf_optiongroup,
            wf_optiongroup = _schema$wf_optiongrou2 === undefined ? null : _schema$wf_optiongrou2,
            _schema$monkeyBranch = schema.monkeyBranch,
            monkeyBranch = _schema$monkeyBranch === undefined ? null : _schema$monkeyBranch,
            _schema$monkeyFilterB = schema.monkeyFilterBy,
            monkeyFilterBy = _schema$monkeyFilterB === undefined ? "option" : _schema$monkeyFilterB,
            _schema$monkeyGroup = schema.monkeyGroup,
            monkeyGroup = _schema$monkeyGroup === undefined ? null : _schema$monkeyGroup,
            _schema$monkeyObserve = schema.monkeyObserve,
            monkeyObserve = _schema$monkeyObserve === undefined ? null : _schema$monkeyObserve;

        this.setState({ data: data });
        this.value.labelBy = labelBy;
        //this.value.canBeEmpty = (required === false);
        this.value.min = parseInt(minItems);
        this.value.max = parseInt(maxItems);
        this.value.multiple = isMultiple == true;
        this.value.labelBy = labelBy;
        this.value.canBeEmpty = true;
        if (wf_optiongroup_id && isBaobab && optionType) {
          var optiongroup = wf_optiongroup;
          if (!wf_optiongroup) {
            optiongroup = {
              id: parseInt(wf_optiongroup_id)
            };
          }
          this.setBaobabOptionMgr(optionType, optiongroup);
        } else if (isMonkey && monkeyGroup !== "") {
          if (monkeyFilterBy === "option") {
            this.setBaobabOptionMgr(_Constants.WF_BAOBAB_OPTION, { id: 0 });
          } else if (monkeyFilterBy === "branch" && monkeyBranch) {
            this.setBaobabOptionMgr(_Constants.WF_BAOBAB_BRANCH, {
              id: monkeyBranch
            });
          }
          this.isMonkey = true;
          this.setData([], true);
          this.setState({
            disabled: true
          });
        }
        (0, _get3.default)(WFieldSelectView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldSelectView.prototype), 'init', this).call(this, args);
      }
    }

    /**
     * create new Baobab Option 
     */

  }, {
    key: 'setBaobabOptionMgr',
    value: function setBaobabOptionMgr(optionType, optiongroup) {
      var _this2 = this;

      this.baobabOptMgr = new _WFBaobabOption2.default(optionType, optiongroup, null, {
        treeLimitOption: 200,
        branchLimitOption: 200
      });
      this.baobabOptMgr.observer = {
        change: function change() {
          _this2.setState({
            isLoading: true
          });
        },
        ready: function ready() {
          var _getState = _this2.getState(),
              _getState$data = _getState.data,
              data = _getState$data === undefined ? [] : _getState$data;

          if (data.length === 0) {
            _this2.setState({
              isLoading: false,
              data: _this2.baobabOptMgr.getOptionMgr().getValue()
            });
          } else {
            _this2.setState({
              isLoading: false,
              resultData: _this2.baobabOptMgr.getOptionMgr().getValue()
            });
          }
        }
      };
    }

    /**
     * Toggle the component loader
     * Update the component
     * Save new values
     * @param selectState is object values
     */

  }, {
    key: 'change',
    value: function change(values, state) {

      //console.error("SELECT CHANGE")
      //console.log(values)

      if (this.isInit) {
        this.setState(state);
        this.setState(values);
        this.setState({ focus: "" });
      }
      (0, _get3.default)(WFieldSelectView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldSelectView.prototype), 'change', this).call(this, {
        eventArgs: values
      });
    }

    /**
     * Select/Unselect value
     */

  }, {
    key: 'select',
    value: function select(id) {
      var _this3 = this;

      var _getState2 = this.getState(),
          data = _getState2.data;

      this.value.setData(data);
      this.value.select(id, {
        select: function select(values, state) {
          return _this3.change(values, state);
        },
        unselect: function unselect(values, state) {
          return _this3.change(values, state);
        }
      });
    }

    /**
     * Toggle the component
     */

  }, {
    key: 'toggle',
    value: function toggle() {
      var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      if (this.isInit) {
        var _getState3 = this.getState(),
            isOpen = _getState3.isOpen,
            isUnfold = _getState3.isUnfold,
            disabled = _getState3.disabled;

        if (disabled) {
          return;
        }
        if (isOpen === false) {
          this.open(focus);
          this.find();
        } else {
          this.close();
        }
      }
    }

    /**
     * Open the component
     */

  }, {
    key: 'open',
    value: function open() {
      var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      if (this.isInit) {
        this.setState({
          focus: focus,
          isOpen: true
        });
      }
    }

    /**
     * Close the component
     */

  }, {
    key: 'close',
    value: function close() {
      if (this.isInit) {
        this.setState({
          focus: "",
          isOpen: false,
          searchValue: "",
          resultData: []
        });
      }
    }

    /**
     * Search options
     */

  }, {
    key: 'search',
    value: function search() {
      var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
      var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label";


      //console.log("SEARCH", string, this.isInit )

      if (this.isInit) {
        var length = string.length;

        var _getState4 = this.getState(),
            _getState4$data = _getState4.data,
            data = _getState4$data === undefined ? [] : _getState4$data;

        //console.log("searchValue", string)

        this.setState({
          searchValue: string
        });
        //window.input = this;
        //console.log("searchValue", string)

        if (length === 0) {
          this.setState({
            searchValue: "",
            resultData: []
          });
        } else if (this.baobabOptMgr) {
          if (length < 2) {
            return;
          } else {
            this.baobabOptMgr.search(string);
          }
        } else {
          var resultData = data.filter(function (elem) {
            if (elem.hasOwnProperty(key)) {
              var k = elem[key].toLowerCase(),
                  v = string.toLowerCase();
              if (k.includes(v)) {
                return elem;
              }
            }
          });
          this.setState({
            resultData: resultData
          });
        }
      }
    }

    /**
     * Find options in db
     */

  }, {
    key: 'find',
    value: function find() {
      if (this.baobabOptMgr) {
        var _getState5 = this.getState(),
            _getState5$data = _getState5.data,
            data = _getState5$data === undefined ? [] : _getState5$data;

        if (data.length === 0) {
          this.baobabOptMgr.find();
        }
      }
    }
  }]);
  return WFieldSelectView;
}(_WFieldView3.default);

// ------------------- //


exports.default = WFieldSelectView;
// ------------------- //

/***/ }),
/* 433 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _get2 = __webpack_require__(125);

var _get3 = _interopRequireDefault(_get2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _Lodash = __webpack_require__(6);

var _WFieldView2 = __webpack_require__(102);

var _WFieldView3 = _interopRequireDefault(_WFieldView2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS STRING FIELD VIEW ------------------- //

// ------------------- //

var WFieldStringView = function (_WFieldView) {
  (0, _inherits3.default)(WFieldStringView, _WFieldView);

  /**
   * Constructor
   * @param value instance of WFString
   */
  function WFieldStringView(value) {
    (0, _classCallCheck3.default)(this, WFieldStringView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFieldStringView.__proto__ || (0, _getPrototypeOf2.default)(WFieldStringView)).call(this, value));

    _this.initialState = (0, _defineProperty3.default)({}, value.key, value.get());
    return _this;
  }

  /**
   * Before init set default value
   * @next super.init()
   */


  (0, _createClass3.default)(WFieldStringView, [{
    key: 'init',
    value: function init(args) {
      var field = args.field,
          _args$schema = args.schema,
          schema = _args$schema === undefined ? {} : _args$schema;

      if (!this.isInit && !field.hasValue() && schema.hasOwnProperty(this.value.getKey())) {
        this.value.set(schema[this.value.getKey()]);
        this.change({ eventArgs: (0, _defineProperty3.default)({}, this.value.getKey(), this.value.get()) });
      }
      (0, _get3.default)(WFieldStringView.prototype.__proto__ || (0, _getPrototypeOf2.default)(WFieldStringView.prototype), 'init', this).call(this, args);
    }
  }]);
  return WFieldStringView;
}(_WFieldView3.default);
// ------------------- //


exports.default = WFieldStringView;
// ------------------- //

/***/ }),
/* 434 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFormResultsAnalytic = __webpack_require__(370);

var _WFormResultsAnalytic2 = _interopRequireDefault(_WFormResultsAnalytic);

var _wfanalytics = __webpack_require__(120);

var _wfanalytics2 = _interopRequireDefault(_wfanalytics);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFValue = __webpack_require__(54);

var _WFValue2 = _interopRequireDefault(_WFValue);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFActionConstants = __webpack_require__(236);

var _WFActionConstants2 = _interopRequireDefault(_WFActionConstants);

var _Lodash = __webpack_require__(6);

var _WFConstants = __webpack_require__(58);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _getConstants = (0, _WFActionConstants2.default)(),
    WF_PUBLISH_ENTRY_ID = _getConstants.WF_PUBLISH_ENTRY_ID,
    WF_SUCCESS_MESSAGE_ID = _getConstants.WF_SUCCESS_MESSAGE_ID,
    WF_ERROR_MESSAGE_ID = _getConstants.WF_ERROR_MESSAGE_ID,
    WF_MAIL_NOTIFICATION_ID = _getConstants.WF_MAIL_NOTIFICATION_ID,
    WF_REDIRECT_ID = _getConstants.WF_REDIRECT_ID,
    WF_FILE_DOWNLOAD_ID = _getConstants.WF_FILE_DOWNLOAD_ID,
    WF_NEXUS_STRATEGY_ID = _getConstants.WF_NEXUS_STRATEGY_ID,
    WF_FORM_ANALYTICS_ID = _getConstants.WF_FORM_ANALYTICS_ID,
    WF_FIELDS_ANALYTICS_ID = _getConstants.WF_FIELDS_ANALYTICS_ID,
    WF_PUBLISH_ENTRY_NAME = _getConstants.WF_PUBLISH_ENTRY_NAME,
    WF_SUCCESS_MESSAGE_NAME = _getConstants.WF_SUCCESS_MESSAGE_NAME,
    WF_ERROR_MESSAGE_NAME = _getConstants.WF_ERROR_MESSAGE_NAME,
    WF_MAIL_NOTIFICATION_NAME = _getConstants.WF_MAIL_NOTIFICATION_NAME,
    WF_REDIRECT_NAME = _getConstants.WF_REDIRECT_NAME,
    WF_FILE_DOWNLOAD_NAME = _getConstants.WF_FILE_DOWNLOAD_NAME,
    WF_NEXUS_STRATEGY_NAME = _getConstants.WF_NEXUS_STRATEGY_NAME,
    WF_FORM_ANALYTICS_NAME = _getConstants.WF_FORM_ANALYTICS_NAME,
    WF_FIELDS_ANALYTICS_NAME = _getConstants.WF_FIELDS_ANALYTICS_NAME;

var SUCCESS = "success";
var ERROR_404 = "error404";
var ERROR_403 = "error403";
var FIELD_ANALYTICS_SINGLE = "fieldAnalyticsSingle";
var FIELD_ANALYTICS_GLOBAL = "fieldAnalyticsGlobal";

var WFormViewAction = function () {
  /**
   * Constructor
   * this.messages is object contains all success and all error message 
   * this.values is object contains all actions
   */
  function WFormViewAction() {
    var actions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    (0, _classCallCheck3.default)(this, WFormViewAction);


    this.messages = new _WFObject2.default();
    this.context = new _WFObject2.default();
    this.init(actions);
  }

  /**
   * Add actions
   * @param actions the array of action to add
   */


  (0, _createClass3.default)(WFormViewAction, [{
    key: 'init',
    value: function init(actions) {
      if ((0, _Lodash.isArray)(actions)) {
        var l = actions.length;
        for (var i = 0; i < l; i++) {
          this.createOrUpdate(actions[i]);
        }
      }
    }

    /**
     * Create or update form action
     * @param config the action schema
     */

  }, {
    key: 'createOrUpdate',
    value: function createOrUpdate(config) {
      var configValues = _WFValue2.default.getValues(config);
      var action_id = configValues.action_id,
          _configValues$message = configValues.message,
          message = _configValues$message === undefined ? "" : _configValues$message,
          _configValues$btnLabe = configValues.btnLabel,
          btnLabel = _configValues$btnLabe === undefined ? "" : _configValues$btnLabe;

      switch (config.action_id) {

        case WF_SUCCESS_MESSAGE_ID:
          var success_title = configValues.success_title,
              success_message = configValues.success_message;

          this.setMessage(SUCCESS, {
            title: success_title,
            message: success_message
          });
          break;

        case WF_ERROR_MESSAGE_ID:
          var err404_title = configValues.err404_title,
              err404_message = configValues.err404_message,
              maintenance_title = configValues.maintenance_title,
              maintenance_message = configValues.maintenance_message;

          this.setMessage(ERROR_404, {
            title: err404_title,
            message: err404_message
          });
          this.setMessage(ERROR_403, {
            title: maintenance_title,
            message: maintenance_message
          });
          break;

        case WF_FIELDS_ANALYTICS_ID:
          var _configValues$btnLabe2 = configValues.btnLabelSingle,
              btnLabelSingle = _configValues$btnLabe2 === undefined ? "" : _configValues$btnLabe2,
              _configValues$btnLabe3 = configValues.btnLabelGlobal,
              btnLabelGlobal = _configValues$btnLabe3 === undefined ? "" : _configValues$btnLabe3,
              _configValues$globalR = configValues.globalResultsTitle,
              globalResultsTitle = _configValues$globalR === undefined ? "" : _configValues$globalR,
              _configValues$globalR2 = configValues.globalResultsMessage,
              globalResultsMessage = _configValues$globalR2 === undefined ? "" : _configValues$globalR2,
              _configValues$singleR = configValues.singleResultIsPublic,
              singleResultIsPublic = _configValues$singleR === undefined ? false : _configValues$singleR,
              _configValues$globalR3 = configValues.globalResultIsPublic,
              globalResultIsPublic = _configValues$globalR3 === undefined ? false : _configValues$globalR3;

          if (globalResultIsPublic) {
            this.setContext(FIELD_ANALYTICS_GLOBAL, {
              btnLabel: btnLabelGlobal,
              title: globalResultsTitle,
              message: globalResultsMessage
            });
          }
          break;

        case WF_REDIRECT_ID:
          var to = configValues.to,
              delay = configValues.delay;

          this.setMessage(WF_REDIRECT_ID, message);
          this.setContext(WF_REDIRECT_ID, { delay: delay, to: to });
          break;

        case WF_FILE_DOWNLOAD_ID:
          var files = configValues.files;

          this.setMessage(WF_FILE_DOWNLOAD_ID, message);
          this.setContext(WF_FILE_DOWNLOAD_ID, { fileURL: files, btnLabel: btnLabel });
          break;

        case WF_NEXUS_STRATEGY_ID:
          break;
      }
    }

    /**
     * Create new message
     * @param msgKey is message key 
     * @param msgValues is object contains {title, message}
     */

  }, {
    key: 'setMessage',
    value: function setMessage(msgKey, msgValues) {
      this.messages.set((0, _defineProperty3.default)({}, msgKey, msgValues));
    }

    /**
     * Get message
     * @param msgKey is message key 
     * @return msgValues is object contains {title, message}
     */

  }, {
    key: 'getMessage',
    value: function getMessage(msgKey) {
      return this.messages.get(msgKey);
    }

    /**
     * Create new context
     * @param key is context key 
     * @param ctx is object contains {...args}
     */

  }, {
    key: 'setContext',
    value: function setContext(key, ctx) {
      this.context.set((0, _defineProperty3.default)({}, key, ctx));
    }

    /**
     * Get context
     * @param key is context key 
     * @return ctx is object contains {...args}
     */

  }, {
    key: 'getContext',
    value: function getContext(key) {
      return this.context.get(key);
    }

    /**
     * Execute the mass actions
     * @param formView 
     * @param entry 
     * @param values
     * @param err
     * @param next callback {onSuccess, onError}
     */

  }, {
    key: 'execute',
    value: function execute(formView, entry, values, err) {
      var next = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
      var onError = next.onError,
          onSuccess = next.onSuccess;

      var context = {};
      if ((0, _Lodash.isObject)(err)) {

        // ERRORS ACTIONS --------- //

        var hasErr = err.hasErr,
            _err$res = err.res,
            res = _err$res === undefined ? [] : _err$res;
        // 1/ Entry Errors

        if ((0, _Lodash.isArray)(res) && res.length > 0) {
          WFormViewAction.getEntryErrors(context, formView, err);
        }
        // 2/ Maintenance Mode
        /*
        else if () {
          context = this.getMessage(ERROR_403);
        }
        */
        // 3/ Error 404
        else {
            context = this.getMessage(ERROR_404);
          }

        //results = this.getMessage(ERROR_403);
        onError(context);
      } else {

        // SUCCESS ACTIONS --------- //

        context = this.getMessage(SUCCESS);
        var messages = [];
        var actions = [];

        // 1/ Redirect
        if (this.context.has(WF_FILE_DOWNLOAD_ID)) {
          var _getContext = this.getContext(WF_FILE_DOWNLOAD_ID),
              fileURL = _getContext.fileURL,
              btnLabel = _getContext.btnLabel;

          messages.push(this.getMessage(WF_FILE_DOWNLOAD_ID));
          actions.push({
            label: btnLabel,
            onClick: function onClick() {
              WFormViewAction.onFileDownload(fileURL);
            }
          });
        }

        // 2/ File Upload
        if (this.context.has(WF_REDIRECT_ID)) {
          var _getContext2 = this.getContext(WF_REDIRECT_ID),
              delay = _getContext2.delay,
              to = _getContext2.to;

          if (!delay) {
            WFormViewAction.onRedirect(to);
            return;
          } else {
            WFormViewAction.onRedirect(to, delay);
            messages.push(this.getMessage(WF_REDIRECT_ID));
          }
        }

        // 3/ Fields Analytics 
        /*
        if (this.context.has(FIELD_ANALYTICS_SINGLE)) {
          const {
            btnLabel = ""
          } = this.getContext(FIELD_ANALYTICS_SINGLE);
          actions.push({
            label: btnLabel,
            onClick: () => {
              console.error(btnLabel);
               // formView
            }
          });
        }*/
        if (this.context.has(FIELD_ANALYTICS_GLOBAL)) {
          var _entry$opt_count = entry.opt_count,
              opt_count = _entry$opt_count === undefined ? [] : _entry$opt_count;

          var _getContext3 = this.getContext(FIELD_ANALYTICS_GLOBAL),
              title = _getContext3.title,
              message = _getContext3.message,
              _btnLabel = _getContext3.btnLabel;

          actions.push({
            label: _btnLabel,
            onClick: function onClick() {
              WFormViewAction.onCustomResults(formView, {
                title: title,
                message: message,
                className: "wf-results-analytics",
                icon: "piechart",
                getCustomComponent: function getCustomComponent(component) {
                  return WFormViewAction.onAnalyticsResults(formView, component, opt_count);
                }
              });
            }
          });
        }

        if (formView.isAdmin || formView.isDemo) {
          actions.push({
            label: "Edit form",
            onClick: function onClick() {
              return formView.onEdit();
            }
          });
        }

        // 4/ ...

        context["messages"] = messages;
        context["actions"] = actions;

        // DEBUG

        console.warn("SUCCESS.... test");
        console.dir(context);
        console.dir(entry);
        console.error(values);
        onSuccess(context);
      }
    }

    /**
     * Get entry errors
     */

  }], [{
    key: 'getEntryErrors',
    value: function getEntryErrors(context, formView, err) {
      var _err$res2 = err.res,
          res = _err$res2 === undefined ? [] : _err$res2;
      var _res$0$messages = res[0].messages,
          messages = _res$0$messages === undefined ? {} : _res$0$messages;

      context['title'] = "Error";
      context['message'] = "Field(s) is required";
      context['btnLabel'] = "Edit form";
      context['onEdit'] = function () {
        return formView.onEdit();
      };
      context['errors'] = (0, _keys2.default)(messages).map(function (key) {
        return messages[key]["msg"];
      });
    }

    /**
     * Redirect to url
     */

  }, {
    key: 'onRedirect',
    value: function onRedirect(to) {
      var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      if (!delay) {
        _WFUrl2.default.redirect(to);
      } else {
        setTimeout(function () {
          return _WFUrl2.default.redirect(to);
        }, parseInt(delay));
      }
    }

    /**
     * File download
     */

  }, {
    key: 'onFileDownload',
    value: function onFileDownload(fileURL) {
      if (fileURL) {
        _WFUrl2.default.download(fileURL);
      }
    }

    /**
     * Custom ResultComponent with custom component
     */

  }, {
    key: 'onCustomResults',
    value: function onCustomResults(formView) {
      var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      formView.changeCustomResults((0, _assign2.default)({
        onClose: function onClose() {
          formView.changeCustomResults({});
          formView.setStatus(_WFConstants.WF_STATUS_SUCCESS);
        }
      }, context));
      formView.setStatus(_WFConstants.WF_STATUS_CUSTOM);
    }

    /**
     * Analytics Results
     */

  }, {
    key: 'onAnalyticsResults',
    value: function onAnalyticsResults(formView, parentComponent) {
      var opt_count = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];


      var onLoad = function onLoad() {
        var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

        parentComponent.setState({
          loader: flag
        });
      };

      var setLabel = function setLabel() {
        var _WFAnalytics$mgr$getC = _wfanalytics2.default.mgr.getCurrentField(),
            _WFAnalytics$mgr$getC2 = _WFAnalytics$mgr$getC.label,
            label = _WFAnalytics$mgr$getC2 === undefined ? "" : _WFAnalytics$mgr$getC2;

        if (label) {
          parentComponent.setState({
            message: label
          });
        }
      };

      return _react2.default.createElement(_WFormResultsAnalytic2.default, {
        willMount: function willMount(c) {
          _wfanalytics2.default.mgr.init(formView.getFormState());
          _wfanalytics2.default.viewMgr.willMount(c);
          _wfanalytics2.default.mgr.mapOptionEntries(opt_count, function () {
            onLoad(false);
            setLabel();
          });
        },
        didMount: function didMount(c) {
          _wfanalytics2.default.viewMgr.didMount(c);
          c.props.onSelect(_wfanalytics2.default.mgr.getCurrentField());
        },
        willUnMount: function willUnMount(c) {
          _wfanalytics2.default.mgr.clear();
          _wfanalytics2.default.viewMgr.willUnMount(c);
        },
        onSelect: function onSelect(fieldSchema) {
          var _WFAnalytics$mgr$getS = _wfanalytics2.default.mgr.getState(),
              _WFAnalytics$mgr$getS2 = _WFAnalytics$mgr$getS.optionResults,
              optionResults = _WFAnalytics$mgr$getS2 === undefined ? [] : _WFAnalytics$mgr$getS2;

          var entry_id = fieldSchema.entry_id;

          _wfanalytics2.default.mgr.change({
            currentField: entry_id,
            currentFieldValue: fieldSchema
          });
          _wfanalytics2.default.mgr.setFieldOptions();
          setLabel();
          /*
          if (optionResults.length === 0) {
            onLoad();
            WFAnalytics.mgr.countOptionEntries({
              onError: (err) => {
                onLoad(false)
                console.error(err)
              }, 
              onSuccess: () => {
                onLoad(false)
                setLabel()
              }
            })
          } else {
           
            WFAnalytics.mgr.setFieldOptions();
            setLabel()
          }*/
        }
      });
    }
  }]);
  return WFormViewAction;
}();

exports.default = WFormViewAction;

/***/ }),
/* 435 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFResponse = __webpack_require__(39);

var _WFResponse2 = _interopRequireDefault(_WFResponse);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormViewClient = function () {
  function WFormViewClient() {
    (0, _classCallCheck3.default)(this, WFormViewClient);
  }

  (0, _createClass3.default)(WFormViewClient, null, [{
    key: "save",

    /**   
    * Save formState's values in db. Create it if not exists
    * @param formState
    * @param next {onSuccess, onError}
    **/
    value: function save(formState, isAppAdmin) {
      var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      var urlArgs = {
        isAppAdmin: isAppAdmin,
        apiBaseUrl: _WFUrl2.default.getBaseUrl()
      };
      var _next$onError = next.onError,
          onError = _next$onError === undefined ? null : _next$onError,
          _next$onSuccess = next.onSuccess,
          onSuccess = _next$onSuccess === undefined ? null : _next$onSuccess;

      formState.save(urlArgs).then(function (res) {
        var wfRes = _WFResponse2.default.getSaveResponse(res);
        if (wfRes.getHasLogicErrors()) {
          if ((0, _Lodash.isFunction)(onError)) {
            onError({
              hasErr: wfRes.getHasLogicErrors(),
              err: wfRes.getLogicErrors(),
              res: wfRes.getResultset()
            });
          }
        } else {
          formState.setValues(wfRes.getResultset()[0]);
          if ((0, _Lodash.isFunction)(onSuccess)) {
            onSuccess(wfRes.getResultset()[0]);
          }
        }
      }).catch(function (error) {
        //Pub(WF_LOADER, false);
        console.error(error);
      });
    }
  }]);
  return WFormViewClient;
}();

exports.default = WFormViewClient;

/***/ }),
/* 436 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _Constants = __webpack_require__(41);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormViewContent = function () {
  function WFormViewContent() {
    var contents = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFormViewContent);

    this.key = "contentConfig";
    this.value = new _WFObject2.default({ value: contents });
  }

  (0, _createClass3.default)(WFormViewContent, [{
    key: 'getKey',
    value: function getKey() {
      return this.key;
    }

    /**
     * Get content by name
     * @param name
     * @return object
     */

  }, {
    key: 'get',
    value: function get(name) {
      return this.value.get(name);
    }

    /**
     * Create new content
     * @param args is object {name,cols}
     * @param attributes is object {...} 
     */

  }, {
    key: 'create',
    value: function create() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _args$name = args.name,
          name = _args$name === undefined ? null : _args$name,
          _args$cols = args.cols,
          cols = _args$cols === undefined ? _Constants.DEFAULT_COL_CONFIG : _args$cols,
          _args$isField = args.isField,
          isField = _args$isField === undefined ? false : _args$isField,
          _args$isIgnored = args.isIgnored,
          isIgnored = _args$isIgnored === undefined ? false : _args$isIgnored;

      var content = {
        name: name,
        cols: cols,
        isField: isField,
        isIgnored: isIgnored,
        attributes: attributes
      };
      if (!name) {
        content.name = (0, _Lodash.now)().toString();
      }
      this.value.set((0, _defineProperty3.default)({}, content.name, content));
      return content;
    }

    /**
     * Update new values or new attributes
     * @param name
     * @param obj is object
     * @param attributes is object {...} 
     */

  }, {
    key: 'assign',
    value: function assign(name) {
      var obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (this.value.has(name)) {
        this.value.assign(name, obj);
      }
    }

    /**
     * Toggle content.isIgnored by name
     * @param name
     */

  }, {
    key: 'ignore',
    value: function ignore(name) {
      var _get = this.get(name),
          _get$isIgnored = _get.isIgnored,
          isIgnored = _get$isIgnored === undefined ? false : _get$isIgnored;

      this.assign(name, {
        isIgnored: !isIgnored
      });
    }

    /**
     * Delete content by name
     * @param name
     */

  }, {
    key: 'del',
    value: function del(name) {
      this.value.unset(name);
    }

    /**
     * Get all content
     * @return object
     */

  }, {
    key: 'getValue',
    value: function getValue() {
      return this.value.getValue();
    }

    /**
     * Export config
     * @return object
     */

  }, {
    key: 'toConfig',
    value: function toConfig() {
      return this.value.getValue();
    }
  }]);
  return WFormViewContent;
}();

exports.default = WFormViewContent;

/*

/*
CLASSIC_FIELD
EXTRA_FIELD
CLASSIC_CONTENT
EXTRA_CONTENT
*/

/***/ }),
/* 437 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormViewSetting = function () {
  /**
   * Constructor
   * this.values is object contains all settings
   * this.current is setting key alias theme
   */
  function WFormViewSetting() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFormViewSetting);
    var _config$theme = config.theme,
        theme = _config$theme === undefined ? null : _config$theme,
        _config$settings = config.settings,
        settings = _config$settings === undefined ? {} : _config$settings;

    this.key = "settingConfig";
    this.values = new _WFObject2.default({ value: settings });
    this.current = new _WFString2.default();
    this.cache = {};
    if (theme) {
      this.select(theme);
    }
  }

  (0, _createClass3.default)(WFormViewSetting, [{
    key: "getKey",
    value: function getKey() {
      return this.key;
    }

    /**
     * Get current setting
     * @return object
     */

  }, {
    key: "get",
    value: function get() {
      return this.values.get(this.getCurrent());
    }

    /**
     * Select
     * Check if has not setting assign
     * Set Current theme
     * @param string
     */

  }, {
    key: "select",
    value: function select(theme) {
      var setting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      this.setCurrent(theme);
      if (!this.values.has(theme)) {
        this.assign(setting);
      }
    }

    /**
     * Get all settings
     * @return object
     */

  }, {
    key: "getValues",
    value: function getValues() {
      return this.values.getValue();
    }

    /**
     * Get current theme
     * @return string
     */

  }, {
    key: "getCurrent",
    value: function getCurrent() {
      return this.current.get();
    }

    /**
     * Set current theme
     * @param string
     */

  }, {
    key: "setCurrent",
    value: function setCurrent(theme) {
      this.current.set(theme);
    }

    /**
     * Set/Update current theme
     * @param string
     */

  }, {
    key: "assign",
    value: function assign() {
      var setting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.values.assign(this.getCurrent(), setting);
    }

    /**
     * Export config
     * @return object
     */

  }, {
    key: "toConfig",
    value: function toConfig() {
      return {
        theme: this.getCurrent(),
        settings: this.getValues()
      };
    }
  }]);
  return WFormViewSetting;
}();

exports.default = WFormViewSetting;

/***/ }),
/* 438 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFString = __webpack_require__(85);

var _WFString2 = _interopRequireDefault(_WFString);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFormViewStep = function () {
  /**
   * Constructor
   * this.value is object contains all steps
   * this.current is current step.id
   * this.order is steps order
   */
  function WFormViewStep() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFormViewStep);
    var _config$current = config.current,
        current = _config$current === undefined ? '0' : _config$current,
        _config$steps = config.steps,
        steps = _config$steps === undefined ? (0, _defineProperty3.default)({}, '0', { id: '0' }) : _config$steps,
        _config$order = config.order,
        order = _config$order === undefined ? ['0'] : _config$order;

    this.key = "stepConfig";
    this.value = new _WFObject2.default({ value: steps });
    this.current = new _WFString2.default({ value: current });
    this.order = new _WFArray2.default({ value: order });
  }

  (0, _createClass3.default)(WFormViewStep, [{
    key: "getKey",
    value: function getKey() {
      return this.key;
    }

    // STEP ------------ //

    /**
     * Create new step
     * @return object
     */

  }, {
    key: "create",
    value: function create() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var step = {
        id: (0, _Lodash.now)().toString(),
        type: null,
        order: []
      };
      this.value.set((0, _defineProperty3.default)({}, step.id, step));
      this.order.insert(step.id);
      this.select(step.id, next);
    }

    /**
     * Update current step
     * @return object
     */

  }, {
    key: "assign",
    value: function assign(obj) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      this.value.assign(this.getCurrent(), obj);
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Delete step
     * @param stepId
     */

  }, {
    key: "del",
    value: function del() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var id = this.getCurrent();
      this.prev();
      this.value.unset(id);
      this.order.delete(id);
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    // NAVIGATION ------------ //

    /**
     * Select step by id
     * Check if has not setting assign
     * Set Current theme
     * @param stepId string
     */

  }, {
    key: "select",
    value: function select(stepId) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (this.value.has(stepId)) {
        this.setCurrent(stepId);
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      }
    }

    /**
     * Select step by index
     * Check if has not setting assign
     * Set Current theme
     * @param stepIndex number
     */

  }, {
    key: "selectByIndex",
    value: function selectByIndex(stepIndex) {
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var stepId = this.order.get(stepIndex);
      if (stepId) {
        this.select(stepId, next);
      } else {
        var firstStepId = this.order.get(0);
        this.select(firstStepId, next);
      }
    }

    /**
     * Get next step
     * @param next is callback
     */

  }, {
    key: "next",
    value: function next() {
      var _next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var stepId = this.order.getNext(this.getCurrent());
      this.select(stepId, _next);
    }

    /**
     * Get next step
     * @param next is callback
     */

  }, {
    key: "prev",
    value: function prev() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var stepId = this.order.getPrev(this.getCurrent());
      this.select(stepId, next);
    }

    // EDIT STEP ------------ //

    /**
     * Set Step type
     * @param type string
     */

  }, {
    key: "setCurrentType",
    value: function setCurrentType() {
      var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      this.assign({
        type: type
      });
    }

    /**
     * Get Step type
     * @param type string
     */

  }, {
    key: "getCurrentType",
    value: function getCurrentType() {
      return this.get().type || null;
    }

    /**
     * Set Step order
     * if empty reset type
     * @param order array
     */

  }, {
    key: "setCurrentOrder",
    value: function setCurrentOrder(order) {
      this.assign({
        order: order
      });
      if (order.length === 0) {
        this.setCurrentType();
      }
    }

    /**
     * Get Step order
     * @param order array
     */

  }, {
    key: "getCurrentOrder",
    value: function getCurrentOrder() {
      return this.get().order || [];
    }

    /**
     * Current Step has elem
     * @param order array
     */

  }, {
    key: "currentIsEmpty",
    value: function currentIsEmpty() {
      var _get = this.get(),
          _get$order = _get.order,
          order = _get$order === undefined ? [] : _get$order;

      return order.length === 0;
    }

    /**
     * Add new content
     * @param name string
     */

  }, {
    key: "addElem",
    value: function addElem(name) {
      if (!name) {
        return false;
      }
      var order = this.getCurrentOrder();
      var newValue = (0, _concat2.default)([], order);
      newValue.push(name);
      this.setCurrentOrder(newValue);
    }

    /**
     * Delete new content
     * @param name string
     */

  }, {
    key: "delElem",
    value: function delElem(name) {
      if (!name) {
        return false;
      }
      var order = this.getCurrentOrder();
      var newValue = (0, _concat2.default)([], order);
      newValue = newValue.filter(function (n) {
        return n !== name;
      });
      this.setCurrentOrder(newValue);
    }

    // UTILS ------------ //

    /**
     * Get collection values
     * @return array
     */

  }, {
    key: "getSchema",
    value: function getSchema() {
      var _this = this;

      var schema = this.order.map(function (id) {
        return _this.value.get(id);
      });
      return schema;
    }

    /**
     * Get the steps order
     * @return array
     */

  }, {
    key: "getOrder",
    value: function getOrder() {
      return this.order.getValue();
    }

    /**
     * Set the steps order
     * @param array
     */

  }, {
    key: "setOrder",
    value: function setOrder(order) {
      return this.order.set(order);
    }

    /**
     * Get current step value
     * @return object
     */

  }, {
    key: "get",
    value: function get() {
      return this.value.get(this.getCurrent());
    }

    /**
     * Get current step 
     * @return string
     */

  }, {
    key: "getCurrent",
    value: function getCurrent() {
      return this.current.get();
    }

    /**
     * Get current step index
     * @return number
     */

  }, {
    key: "getCurrentIndex",
    value: function getCurrentIndex() {
      return this.order.indexOf(this.current.get());
    }
    /**
     * Set current step
     * @param stepId string
     */

  }, {
    key: "setCurrent",
    value: function setCurrent(stepId) {
      this.current.set(stepId);
    }

    /**
     * Get all steps
     * @return object
     */

  }, {
    key: "getValue",
    value: function getValue() {
      return this.value.getValue();
    }

    /**
     * Export config
     * @return object
     */

  }, {
    key: "toConfig",
    value: function toConfig() {
      return {
        current: this.getCurrent(),
        steps: this.getValue(),
        order: this.getOrder()
      };
    }
  }]);
  return WFormViewStep;
}();

exports.default = WFormViewStep;

/*

  // STEPS ------------- //

  getSteps() {
    return this.steps.getValue();
  }
  
  getStepsOrder() {
    return this.stepsOrder.getValue();
  }
  
  getCurrentStep() {
    return this.currentStep.getValue();
  }

  setCurrentStep() {}

  static addStep(formView) {}
  static editStep(formView) {}
  static deleteStep(formView) {}

*/

/***/ }),
/* 439 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SCHEMA CONDITION ------------------- //
// ------------------- //

var WFSchemaCondition = function () {
  /**
   * Constructor
   * @param Object schema
   * @code
   * let condition = {
   *   action : ["visible","hidden"],
   *   rules  : [
   *     ["title", "===", ["mickey","mario"]],
   *     ["name", "!==", ["",0]]
   *   ]
   * }
   * let fieldCondition = new WFSchemaCondition(condition);
   * fieldCondition.watch(
   *   {...values}, 
   *   (action) => ...
   * )
   * @code
   */
  function WFSchemaCondition(schema) {
    (0, _classCallCheck3.default)(this, WFSchemaCondition);

    if (!(0, _Lodash.isObject)(schema) && schema.hasOwnProperty("action") && schema.hasOwnProperty("rules")) {
      throw new Error('WFSchemaCondition => schema is not valid');
    }
    if (!(0, _Lodash.isArray)(schema.rules)) {
      throw new Error('WFSchemaCondition => rules is not an array');
    }
    if (schema.rules.length === 0) {
      throw new Error('WFSchemaCondition => rules is empty');
    }
    var action = schema.action,
        rules = schema.rules,
        _schema$args = schema.args,
        args = _schema$args === undefined ? {} : _schema$args;

    this.args = args;
    this.action = action;
    this.checker = WFSchemaCondition.compile(rules);
  }

  /**
   * Check values and return action
   * @param values is object
   * @param callback
   * return callback(action)
   */


  (0, _createClass3.default)(WFSchemaCondition, [{
    key: "watch",
    value: function watch(values, callback) {
      var action = this.checker(values, this.action);
      callback(action, this.args);
    }

    /**
     * Create function validator
     * @param schema array 
     * Exemple : [] || [...array]
     */

  }], [{
    key: "compile",
    value: function compile(schema) {
      var rules = [];
      if ((0, _Lodash.isArray)(schema[0])) {
        schema.forEach(function (rule) {
          rules.push(WFSchemaCondition.buildRule(rule));
        });
      } else {
        rules.push(WFSchemaCondition.buildRule(schema));
      }
      return WFSchemaCondition.buildChecker(rules);
    }

    /**
     * Build rules 
     * @param array [entry, operator, value]
     * Exemple : ['fieldName', "!==", ""]
     */

  }, {
    key: "buildRule",
    value: function buildRule(arr) {
      if (arr.length === 3) {
        var rule = [];
        var entry = arr[0];
        var operator = arr[1];
        var values = arr[2];
        if ((0, _Lodash.isBoolean)(values) || (0, _Lodash.isNumber)(values) || (0, _Lodash.isString)(values)) {
          var callback = WFSchemaCondition.getRule(entry, operator, values);
          if (rule) {
            rule.push(callback);
          }
        } else if ((0, _Lodash.isArray)(values)) {
          values.forEach(function (value) {
            var callback = WFSchemaCondition.getRule(entry, operator, value);
            if (rule) {
              rule.push(callback);
            }
          });
        }
        return rule;
      }
    }

    /**
     * Get Rule by 
     * schema => object.key + operator + object.value
     * @param k is string 
     * @param operator string
     * @param data value
     * @return function
     */

  }, {
    key: "getRule",
    value: function getRule(k, operator) {
      var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;


      var has = function has(obj) {
        return obj && obj.hasOwnProperty(k);
      };

      switch (operator) {

        case '!=':
          return function (obj) {
            return has(obj) && obj[k] != data;
          };
        case '!==':
          return function (obj) {
            return has(obj) && obj[k] !== data;
          };
        case '===':
          return function (obj) {
            return has(obj) && obj[k] === data;
          };
        case '==':
          return function (obj) {
            return has(obj) && obj[k] == data;
          };
        case '>':
          return function (obj) {
            return has(obj) && obj[k] > data;
          };
        case '<':
          return function (obj) {
            return has(obj) && obj[k] < data;
          };
        case '<=':
          return function (obj) {
            return has(obj) && obj[k] <= data;
          };
        case '>=':
          return function (obj) {
            return has(obj) && obj[k] >= data;
          };
        case 'change':
          return function (obj) {
            return has(obj) && obj[k] !== "";
          };
        /**
         * for array value
         **/
        case 'min':
          return function (obj) {
            return has(obj) && obj[k].length >= data;
          };
        case 'max':
          return function (obj) {
            return has(obj) && obj[k].length <= data;
          };
        /**
         * for string and array value
         **/
        case 'includes':
          return function (obj) {
            return has(obj) && obj[k].includes(data);
          };
        default:
          return false;
      }
    }

    /**
     * Build Checker
     * @param rules arrays
     * @return function
     */

  }, {
    key: "buildChecker",
    value: function buildChecker(rules) {
      // Check if (rule isArray || function)
      var checker = function checker(values, action) {
        var l = rules.length;
        var flag = l;
        rules.forEach(function (rule) {
          if ((0, _Lodash.isFunction)(rule)) {
            if (rule(values)) {
              flag--;
            }
          } else if ((0, _Lodash.isArray)(rule)) {
            for (var i = 0; i < rule.length; i++) {
              if (rule[i](values)) {
                flag--;
                break;
              }
            }
          }
        });
        if ((0, _Lodash.isArray)(action) && action.length === 2) {
          if (flag === 0) {
            return action[0];
          } else {
            return action[1];
          }
        } else {
          return action[0];
        }
      };
      return checker;
    }
  }]);
  return WFSchemaCondition;
}();

// ------------------- //


exports.default = WFSchemaCondition;
// ------------------- //

/*
// hidden, visible, copy, clear,
var condition = {
  action : ["visible","hidden"],
  rules  : [
    ["title", "===", ["titi","toto","tata"]],
    ["name", "!==", ["",0]]
  ]
}
var test = new WFSchemaCondition(condition)
test.watch({title:"titi", name:0}, (action) => { console.log(action) }) // hidden
test.watch({title:"titi", name:1}, (action) => { console.log(action) }) // visible
test.watch({title:"titi"}, (action) => { console.log(action) }) // hidden
// test includes --------- //
var condition = {
  action : ["hidden","visible"],
  rules  : [
    ["title", "includes", ["titi","toto","tata"]],
  ]
}
var test = new WFSchemaCondition(condition)
test.watch({title:["titi"]}, (action) => { console.log(action) }) // null
*/

/***/ }),
/* 440 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

var _WFInputTypes = __webpack_require__(34);

var _WFAjv = __webpack_require__(256);

var _WFAjv2 = _interopRequireDefault(_WFAjv);

var _WFValueResult = __webpack_require__(441);

var _WFValueResult2 = _interopRequireDefault(_WFValueResult);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF SCHEMA VALIDATOR ------------------- //
// ------------------- //

var WFSchemaValidator = function () {
  /**
   * Constructor
   * @param JSON schema
   */
  function WFSchemaValidator() {
    var schema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFSchemaValidator);

    if (!(0, _Lodash.isObject)(schema)) {
      throw new Error('WFSchemaValidator => schema is not valid');
    }
    this.schema = schema;
    this.validator = _WFAjv2.default.compile(schema);
  }

  /**
   * Get prop in this schema
   * @param value
   */


  (0, _createClass3.default)(WFSchemaValidator, [{
    key: "get",
    value: function get(key) {
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (this.schema.hasOwnProperty(key)) {
        return this.schema[key];
      } else {
        return defaultValue;
      }
    }

    /**
     * Validate
     * @param value
     */

  }, {
    key: "validate",
    value: function validate(value) {
      return new _WFValueResult2.default(this.validator, value);
    }

    /**
     * Get Shema by value type
     * @param value
     */

  }], [{
    key: "getDefaultSchema",
    value: function getDefaultSchema(valueType) {
      var inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      switch (valueType) {

        case _WFValueTypes.WF_STRING_VALUE:
          return WFSchemaValidator.getStringSchema(inputType, args);

        case _WFValueTypes.WF_NUMBER_VALUE:
          return WFSchemaValidator.getNumberSchema();

        case _WFValueTypes.WF_BOOLEAN_VALUE:
          return WFSchemaValidator.getBooleanSchema();

        case _WFValueTypes.WF_SELECT_VALUE:
          return WFSchemaValidator.getSelectSchema();

        default:
          return false;
      }
    }

    /**
     * Get string schema
     */

  }, {
    key: "getStringSchema",
    value: function getStringSchema() {
      var inputType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _args$len = args.len,
          len = _args$len === undefined ? 0 : _args$len;


      var schema = {};
      switch (inputType) {

        case _WFInputTypes.INPUT_EMAIL:
          schema = {
            "type": "string",
            "format": "email"
          };
          break;

        case _WFInputTypes.INPUT_TEL:
          schema = {
            "type": "string",
            "format": "phone"
          };
          break;

        case _WFInputTypes.INPUT_URL:
          schema = {
            "type": "string",
            "format": "url"
          };

        case _WFInputTypes.INPUT_FILE:
        case _WFInputTypes.INPUT_MEDIA:
          schema = {
            "type": "string",
            "format": "uri"
          };
          break;

        case _WFInputTypes.INPUT_SELECT:
          schema = {
            "type": "string",
            "minLength": 1
          };
          break;

        case _WFInputTypes.INPUT_TEXT:
        case _WFInputTypes.INPUT_TEXTAREA:
        default:
          schema = {
            "type": "string",
            "minLength": 1
          };
      }

      if (len && !schema.hasOwnProperty('maxLength')) {
        schema['maxLength'] = len;
      }

      return schema;
    }

    /**
     * Get number schema
     */

  }, {
    key: "getNumberSchema",
    value: function getNumberSchema() {
      return {
        "type": "number",
        "minimum": 0
      };
    }

    /**
     * Get boolean schema
     */

  }, {
    key: "getBooleanSchema",
    value: function getBooleanSchema() {
      return {
        "type": "boolean",
        "enum": [true]
      };
    }

    /**
     * Get select schema
     */

  }, {
    key: "getSelectSchema",
    value: function getSelectSchema() {
      return {
        "type": "array",
        "minItems": 1
      };
    }
  }]);
  return WFSchemaValidator;
}();

// ------------------- //


exports.default = WFSchemaValidator;
// ------------------- //

/*

  https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#type

  NUMBER 

  { 
    "type": "number",
    "minLength": 1,
    "minimum": 2,
    "maximum": 5,
  }

  STRING

  { 
    "type": "string",
    "minLength": 1,
    "maxLength": 32,
  }

  { 
    "type": "string",
    "format": "email"
  }
  { 
    "type": "string",
    "format": "phone"
  }
  { 
    "type": "string",
    "format": "uri"
  }

  ARRAY

  { 
    "type": "array",
    "minItems": 1,
    "maxItems": 3,
  }


  "date", "time" and `"date-time".
  
  DATE 
  {
      "format": "date",
      "formatMaximum": "2016-02-06",
      "formatExclusiveMaximum": true
  }

*/

/***/ }),
/* 441 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFAjv = __webpack_require__(256);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //
// WF VALIDATE VALUE ------------------- //
// ------------------- //

var WFValueResult = function () {
  /**
   * Constructor
   * @param validator instance of WFSchemaValidator
   * @param value 
   */
  function WFValueResult(validator, value) {
    (0, _classCallCheck3.default)(this, WFValueResult);

    this.validator = validator;
    this.test = this.validator(value);
  }

  /**
   * Check test is valid
   * @return boolean
   */


  (0, _createClass3.default)(WFValueResult, [{
    key: "isValid",
    value: function isValid() {
      return this.test === true;
    }

    /**
     * Check test has error
     * @return boolean
     */

  }, {
    key: "hasErr",
    value: function hasErr() {
      return this.test === false;
    }

    /**
     * Get error collection
     * @return array || null
     */

  }, {
    key: "getErr",
    value: function getErr() {
      var errors = this.validator.errors;
      if ((0, _Lodash.isArray)(errors) && errors.length > 0) {
        return errors;
      } else {
        return null;
      }
    }

    /**
     * Get all messages in error collection
     * @return array 
     */

  }, {
    key: "getErrMsg",
    value: function getErrMsg() {
      var errors = this.getErr();
      if (errors) {
        return (0, _WFAjv.toLocaleErr)(errors);
      } else {
        return [];
      }
    }
  }]);
  return WFValueResult;
}();

// ------------------- //


exports.default = WFValueResult;
// ------------------- //

/***/ }),
/* 442 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFormState = __webpack_require__(44);

var _WFormState2 = _interopRequireDefault(_WFormState);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _WFSettingViewMgr = __webpack_require__(258);

var _WFSettingViewMgr2 = _interopRequireDefault(_WFSettingViewMgr);

var _WFSettingQueryMgr = __webpack_require__(166);

var _WFSettingQueryMgr2 = _interopRequireDefault(_WFSettingQueryMgr);

var _WFSettingClientMgr = __webpack_require__(257);

var _WFSettingClientMgr2 = _interopRequireDefault(_WFSettingClientMgr);

var _WFSettingFormStateMgr = __webpack_require__(165);

var _WFSettingFormStateMgr2 = _interopRequireDefault(_WFSettingFormStateMgr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF_ENTRY MANAGER ------------------- //

// ------------------- //

var WFSettingMgr = function () {
  function WFSettingMgr() {
    (0, _classCallCheck3.default)(this, WFSettingMgr);
  }

  (0, _createClass3.default)(WFSettingMgr, null, [{
    key: "change",


    /**
     * Change : set state by obj values
     */
    value: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFSettingViewMgr2.default.setState(obj);
    }

    /**
     * Ready : refresh state
     */

  }, {
    key: "ready",
    value: function ready() {
      WFSettingMgr.change({
        setting_values: WFSettingMgr.getValues()
      });
      _WFSettingViewMgr2.default.ready();
    }

    /**
     * Init : 
     */

  }, {
    key: "init",
    value: function init() {}

    /**
     * Restore initial state
     */

  }, {
    key: "clear",
    value: function clear() {}
    //WFSettingQueryMgr.reset();
    //WFSettingViewMgr.resetState();
    //WFSettingFormStateMgr.clear();
    //WFSettingMgr.ready();


    /**
     * Get Values
     * @return object {...param_name:{...}}
     */

  }, {
    key: "getValues",
    value: function getValues() {
      var values = _WFSettingFormStateMgr2.default.getAllFieldsValues("param_value");
      return values;
    }

    /**
     * Get Value by param_name
     * @return object 
     */

  }, {
    key: "getValue",
    value: function getValue(param_name) {
      return _WFSettingFormStateMgr2.default.getValues(param_name);
    }

    /**
     * Find all
     */

  }, {
    key: "find",
    value: function find() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _next$onError = next.onError,
          onError = _next$onError === undefined ? null : _next$onError,
          _next$onSuccess = next.onSuccess,
          onSuccess = _next$onSuccess === undefined ? null : _next$onSuccess;

      _WFSettingClientMgr2.default.find(args, onError, function (res) {
        WFSettingMgr.ready();
        if ((0, _Lodash.isFunction)(onSuccess)) {
          onSuccess(res);
        }
      });
    }

    /**
     * Save setting
     * @param formState 
     * @param next {onSuccess, onError} callback
     */

  }, {
    key: "save",
    value: function save(formState, next) {
      if (!formState) {
        throw new Error('WFSettingMgr save => formState not valid...');
      } else {
        if (!(0, _Lodash.isObject)(next) || !next.hasOwnProperty('onError') || !next.hasOwnProperty('onSuccess')) {
          throw new Error('WFSettingMgr save => next {onError, onSuccess} is required...');
        } else {
          var onError = next.onError,
              onSuccess = next.onSuccess;

          _WFSettingClientMgr2.default.save(formState, onError, function (res) {
            WFSettingMgr.ready();
            onSuccess(res);
          });
        }
      }
    }

    /**
     * Edit setting
     * @param setting 
     * @return formState
     */

  }, {
    key: "edit",
    value: function edit(param_name) {
      if (!(0, _Lodash.isString)(param_name) || param_name === "") {
        throw new Error('WFSettingMgr edit => param_name not valid...');
        return null;
      } else {
        var formState = _WFSettingFormStateMgr2.default.getOrCreate({
          param_name: param_name
        });
        return formState;
      }
    }

    /**
     * Create temp formView
     * @param settingState
     * @return formView
     */

  }, {
    key: "createFormView",
    value: function createFormView(settingState) {
      if (!settingState) {
        throw new Error('WFSettingMgr createFormView => formState not valid...');
        return null;
      } else {
        var formState = new _WFormState2.default();
        formState.addFields([{
          "name": "param_value",
          "type": "string",
          "input_type": "text",
          "label": "",
          "required": true,
          "create_column": true
        }]);
        formState.setDisplayFields(["param_value"]);
        var values = settingState.getValues();
        formState.setValues(values);
        var formView = new _WFormView2.default(formState, true);
        return formView;
      }
    }
  }]);
  return WFSettingMgr;
}();

// ------------------- //


exports.default = WFSettingMgr;
// ------------------- //

/***/ }),
/* 443 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFProductType = __webpack_require__(15);

// ------------------- //
// GLOBAL    ------------------- //
// ------------------- //

var wfglobal = {

  info: {
    icon: "tools-2",
    name: "wfglobal",
    label: "WonderForm General Setting",
    short: "WF_General Setting"
  },

  panel: {
    legend: "Je suis une legend ....",
    options: [{
      // is hidden
      key: "wf_timezone",
      label: "Timezone"
    }]
  }
};

// ------------------- //
// MAILER    ------------------- //
// ------------------- //

var wfmailer = {

  info: {
    icon: "envelope",
    name: "wfmailer",
    label: "WonderForm Mailer Setting",
    short: "WF_Mailer Setting"
  },

  panel: {
    legend: "",
    options: [{
      key: "wf_mailer_host",
      label: "Mail Server smtp"
    }, {
      key: "wf_mailer_port",
      label: "Mail Server Port"
    }, {
      key: "wf_mailer_security",
      label: ""
    }, {
      key: "wf_mailer_username",
      label: "Mail Server Login"
    }, {
      key: "wf_mailer_password",
      label: "Mail Server Password"
    }
    /*
    ,{
      key:"wf_test_sendmail_from",     
      label: "Test mailer : send mail_from"
    },{
      key:"wf_test_sendmail_to",       
      label: "Test mailer : send to"
    },{
      key:"wf_test_sendmail_subject",  
      label: "Test mailer : send subject"
    },{
      key:"wf_test_sendmail_body",     
      label: "Test mailer : send body"
    }
    */
    ]
  },

  fields: [],
  displayFields: []

};

// ------------------- //
// LICENCES    ------------------- //
// ------------------- //

var wflicenses = {

  info: {
    icon: "key",
    name: "wflicenses",
    label: "WonderForm Licenses Setting",
    short: "WF_Licenses Setting"
  },

  panel: {
    type: "validation",
    legend: "All modules required - WF Contact Advanced - includes in WonderForm Premium and Elite version.",
    options: [{
      key: "wf_lite",
      label: "WF Contact Simple",
      wf_producttype_id: _WFProductType.WF_CONTACT_SIMPLE_ID,
      editable: false
    }, {
      type: 'license',
      key: _WFProductType.WF_CONTACT_STR,
      item_name: "WF contact",
      wf_producttype_id: _WFProductType.WF_CONTACT_ADVANCED_ID,
      label: "WF Contact Advanced"
    }, {
      type: 'license',
      key: _WFProductType.WF_QUIZ_STR,
      item_name: "WF quiz",
      wf_producttype_id: _WFProductType.WF_QUIZ_QUIZZ_ID,
      label: "WF Quizz/Survey"
    }, {
      type: 'license',
      key: _WFProductType.WF_CUSTOM_STR,
      item_name: "WF custom",
      wf_producttype_id: _WFProductType.WF_CUSTOM_CUSTOM_ID,
      label: "WF SQL Form Generator"
    }, {
      type: 'license',
      key: _WFProductType.WF_SIGNUP_STR,
      item_name: "WF signup",
      wf_producttype_id: _WFProductType.WF_SIGNUP_PROFILE_ID,
      label: "WF Sign Up"
    }] }
};

// ------------------- //
// SETTING ARCHIVE     ------------------- //
// ------------------- //

var List = [
//wfglobal,
wfmailer];

if (window.hasOwnProperty('__WF__ADVANCED__')) {
  List.push(wflicenses);
}

var getList = function getList() {
  return List;
};
var getListInfo = function getListInfo() {
  return List.map(function (s) {
    return s.info;
  });
};

// ------------------- //
exports.default = {
  getList: getList,
  getListInfo: getListInfo
};

/***/ }),
/* 444 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFMoment = __webpack_require__(48);

var _WFMoment2 = _interopRequireDefault(_WFMoment);

var _Lodash = __webpack_require__(6);

var _WFValueTypes = __webpack_require__(22);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS NUMBER ------------------- //

// ------------------- //

var WFDate = function () {

  /**
   * Constructor
   */
  function WFDate() {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFDate);
    var _config$format = config.format,
        format = _config$format === undefined ? 'YYYY/MM/DD' : _config$format,
        _config$value = config.value,
        value = _config$value === undefined ? null : _config$value;


    this.format = format;
    this.key = _WFValueTypes.WF_DATE_VALUE;

    this.dateObject = null;
    this.dateValue = "";

    this.set(value);
  }

  /**
   * Test if obj is instance Of this class
   * @param obj the object to test
   * @return boolean
   */


  (0, _createClass3.default)(WFDate, [{
    key: "on",


    /**
     * Forward call
     * @param evenType string 
     * @param args object params
     */
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (this.input) {
        this.input.on(evenType, eventArgs);
      }
    }

    /**
     * Get this.key
     * @return string
     */

  }, {
    key: "getKey",
    value: function getKey() {
      return this.key;
    }

    /**
     * Get value
     * @return this.dateValue
     */

  }, {
    key: "get",
    value: function get() {
      return this.dateValue;
    }

    /**
     * Set value 
     * @param val the value to set
     */

  }, {
    key: "set",
    value: function set(val) {
      if ((0, _Lodash.isString)(val)) {
        this.dateObject = (0, _WFMoment2.default)(val, this.format);
      } else {
        this.dateObject = (0, _WFMoment2.default)(val);
      }

      if (this.dateObject.isValid()) {
        this.dateValue = this.dateObject.format(this.format);
      } else {
        this.dateValue = "";
      }
    }

    /**
     * Check if n is null
     * @return boolean
     */

  }, {
    key: "isNull",
    value: function isNull() {
      return this.get() === "";
    }

    /**
     * clear value
     */

  }, {
    key: "clear",
    value: function clear() {
      this.dateObject = null;
      this.dateValue = "";
      if (this.input) {
        this.input.setState((0, _defineProperty3.default)({}, this.getKey(), this.get()));
      }
    }

    /**
     * Show current value in console
     */

  }, {
    key: "toConsole",
    value: function toConsole() {
      console.log("");
      console.warn("WFDate");
      console.log("value =>", this.dateValue);
      if (this.dateValue !== "") {
        console.log("string =>", this.dateValue);
      }
      console.log("");
    }
  }], [{
    key: "instanceOf",
    value: function instanceOf(obj) {
      return obj instanceof WFDate;
    }
  }]);
  return WFDate;
}();
// ------------------- //


exports.default = WFDate;
// ------------------- //

/***/ }),
/* 445 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});
exports.decryptJSON = exports.encryptJSON = exports.getSecret = undefined;

var _encUtf = __webpack_require__(564);

var _encUtf2 = _interopRequireDefault(_encUtf);

var _sha = __webpack_require__(569);

var _sha2 = _interopRequireDefault(_sha);

var _aes = __webpack_require__(561);

var _JSON = __webpack_require__(17);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CRYPTOJS MODULES  	---------------- //

//import CryptoJS from "crypto-js/core" ;
var getSecret = exports.getSecret = function getSecret(string) {
	var length = string.length;
	if (length < 4) return string;
	var ciphertext = (0, _sha2.default)(string);
	return ciphertext.toString().split("").reverse().join("");
},


// ----------------- //

encryptJSON = exports.encryptJSON = function encryptJSON(data, secret) {
	var ciphertext = (0, _aes.encrypt)((0, _JSON.stringify)(data), secret);
	return ciphertext.toString();
},


// ----------------- //

decryptJSON = exports.decryptJSON = function decryptJSON(encryptedData, secret) {
	var bytes = (0, _aes.decrypt)(encryptedData, secret);
	return (0, _JSON.parse)(bytes.toString(_encUtf2.default));
};

/***/ }),
/* 446 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _Slugify = __webpack_require__(169);

var _Slugify2 = _interopRequireDefault(_Slugify);

var _MaxStr = __webpack_require__(123);

var _MaxStr2 = _interopRequireDefault(_MaxStr);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// NAMIFY ---------------- //

exports.default = function () {
	var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
	var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
	var _args$sep = args.sep,
	    sep = _args$sep === undefined ? "_" : _args$sep,
	    _args$prefix = args.prefix,
	    prefix = _args$prefix === undefined ? "wf_" : _args$prefix,
	    _args$sufix = args.sufix,
	    sufix = _args$sufix === undefined ? "" : _args$sufix,
	    _args$limit = args.limit,
	    limit = _args$limit === undefined ? 32 : _args$limit;

	var priv = "wf_";
	var length = string.length;
	var str = length > 0 ? string.replace(priv, "") : "";
	if (str === "") return "";
	var slug = (0, _Slugify2.default)((0, _MaxStr2.default)(str, limit), sep);
	var count = slug.length;
	var last = slug[count - 1];
	var name = last === sep ? slug.substring(0, count - 1) : slug;
	return ("" + priv + name + sufix).replace(/\-/g, "_");
};

/***/ }),
/* 447 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFMedia = function () {
  function WFMedia() {
    (0, _classCallCheck3.default)(this, WFMedia);

    this.data = [];
    this.frame = null;
  }

  (0, _createClass3.default)(WFMedia, [{
    key: 'open',
    value: function open() {
      var _this = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _args$config = args.config,
          config = _args$config === undefined ? {} : _args$config,
          onSelect = args.onSelect;

      if (this.frame) {
        this.frame.open();
      } else {
        this.frame = WFMedia.createWPMedia(config);
        // When an image is selected in the media frame setData
        this.frame.on('select', function () {
          var attachment = _this.frame.state().get('selection').toJSON();
          _this.setData(attachment);
          _this.close();
          onSelect(_this.getData());
        });
        // When the media frame close return data;
        this.frame.on('close', function () {
          if (args.hasOwnProperty('next')) {
            setTimeout(function () {
              return args.next(_this.getData());
            }, 200);
          }
        });
        // Finally, open the modal on click
        this.frame.open();
      }
    }
  }, {
    key: 'close',
    value: function close() {
      this.frame.close();
    }
  }, {
    key: 'setData',
    value: function setData(data) {
      if (data && data.length > 0) {
        this.data = data.map(function (item) {
          return {
            id: item.id,
            name: item.name,
            subtype: item.subtype,
            type: item.type,
            url: item.url
          };
        });
      }
    }
  }, {
    key: 'getData',
    value: function getData() {
      var values = this.data;
      this.data = [];
      return values;
    }
  }], [{
    key: 'createWPMedia',
    value: function createWPMedia() {
      var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var configByDefault = (0, _assign2.default)({
        multiple: true
      }, config);
      if (wp && wp.hasOwnProperty("media")) {
        return new wp.media(configByDefault);
      } else {
        throw new Error('WFMedia createWPMedia => wp.media is undefined');
        return null;
      }
    }
  }]);
  return WFMedia;
}();

exports.default = WFMedia;

/*

// WordPress Media config ex.
 
this.config   = {

  //title: '', // Modal title
  multiple: true, // Multiple select
  // Library WordPress query arguments.
  /*
  library: {
    order: 'ASC',

    // [ 'name', 'author', 'date', 'title', 'modified', 'uploadedTo',
    // 'id', 'post__in', 'menuOrder' ]
    orderby: 'title',

    // mime type. e.g. 'image', 'image/jpeg'
    type: 'image',

    // Searches the attachment title.
    search: null,

    // Attached to a specific post (ID).
    uploadedTo: null
  },
  button: {
    text: '' // Button select
  }
*/

/***/ }),
/* 448 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(51);

var _windowWatcher = __webpack_require__(347);

var _windowWatcher2 = _interopRequireDefault(_windowWatcher);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFEvents = __webpack_require__(263);

var _WFEvents2 = _interopRequireDefault(_WFEvents);

var _WFViewConfig = __webpack_require__(449);

var _WFViewConfig2 = _interopRequireDefault(_WFViewConfig);

var _WFConsole = __webpack_require__(75);

var _WFConsole2 = _interopRequireDefault(_WFConsole);

var _Screen = __webpack_require__(168);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS WF MASTER VIEW ------------------- // renderMasterComponent

// ------------------- //
var WFMasterView = function () {
  /**
   * Constructor
   * this.id is view id or name (string || number)
   * this.masterComponentClass is high order component class (React)
   * this.masterComponent is the main view instance of high order component
   * this.childComponents is the children of main view
   * this.DOMNode is the react entry point to display view with the DOM
   * this.viewConfigs is object contains all page
   * this.currentViewConfig is string contains page name
   * this.events is the mediator events
   * this.store caching masterComponent.state && childComponents.state
   * @param config object
   */
  function WFMasterView() {
    var _context;

    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (0, _classCallCheck3.default)(this, WFMasterView);
    var _config$id = config.id,
        id = _config$id === undefined ? null : _config$id,
        _config$DOMNode = config.DOMNode,
        DOMNode = _config$DOMNode === undefined ? null : _config$DOMNode,
        _config$initialState = config.initialState,
        initialState = _config$initialState === undefined ? {} : _config$initialState,
        _config$masterCompone = config.masterComponentClass,
        masterComponentClass = _config$masterCompone === undefined ? null : _config$masterCompone;

    this.id = id;
    this.isInit = false;
    this.events = new _WFEvents2.default(id);
    this.viewConfigs = {};
    this.currentViewConfig = null;
    this.currentChildComponents = [];
    this.masterComponent = null;
    this.masterComponentClass = masterComponentClass;
    this.childComponents = new _WFObject2.default();
    this.store = new _WFObject2.default({ value: initialState });
    this.DOMNode = document.querySelector(DOMNode);
    /**
     * Subscribe to an evenType (Listner)
     * Set callback in evenType's queue
     * exemple : this.sub("say_msg",(msg) => alert(msg)) 
     * bind method in EC6 : this.sub = this.events.sub.bind(this)
     * bind method in EC7 : this.pub = ::this.events.pub
     * @param evenType string 
     * @param fn callback
     */
    this.sub = (_context = this.events).sub.bind(_context);
    /**
     * Publish an evenType (Emiter)
     * exemple : this.pub("say_msg","Hello world...") 
     * bind method in EC6 : this.pub = this.events.pub.bind(this)
     * bind method in EC7 : this.pub = ::this.events.pub
     * @param evenType string 
     */
    this.pub = (_context = this.events).pub.bind(_context);
  }

  // ----------------- //

  // FACADE ----------------- //

  // ----------------- //

  /**
   * Forward call
   * @param evenType string 
   * @param args *
   */


  (0, _createClass3.default)(WFMasterView, [{
    key: 'on',
    value: function on(evenType) {
      var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if (evenType) {
        switch (evenType) {

          case _WFEventTypes.WF_EVENT_ONVIEW:
            this.changeView(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONCHANGE:
            this.change(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONREADY:
            this.ready(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONSTART:
            this.start(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONSTOP:
            this.stop(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONSTARTUP:
            this.startup(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONINIT:
            this.init(eventArgs);
            break;

          case _WFEventTypes.WF_EVENT_ONRESIZE:
            this.onResize(eventArgs);
            break;

          default:
            this.pub(evenType, eventArgs);
        }
      }
    }

    // ----------------- //

    // ACTIONS ----------------- //

    // ----------------- //

    /**
     * Use startup to call event when this View initialise
     * @param callback function
     */

  }, {
    key: 'startup',
    value: function startup(callback) {
      this.sub(_WFEventTypes.WF_EVENT_ONSTARTUP, callback);
    }

    /**
     * Update View's store
     * @param nextState object
     * @param forMasterComponent boolean
     */

  }, {
    key: 'change',
    value: function change() {
      var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      this.pub(_WFEventTypes.WF_EVENT_ONCHANGE, nextState);
      if ((0, _Lodash.isObject)(nextState)) {
        this.store.set(nextState);
      }
    }

    /**
     * Update MasterComponent State with View's state
     * or share next state at the subscriber
     */

  }, {
    key: 'ready',
    value: function ready(next) {
      var nextState = this.store.getValue();
      this.pub(_WFEventTypes.WF_EVENT_ONREADY, nextState);
      if (this.masterComponent) {
        this.setState(nextState);
      }
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }

    /**
     * Initialise this View
     * if component define this one
     * call WF_EVENT_ONREADY channel At the end of the WF_EVENT_ONSTARTUP channel
     * if start is true display this View and add Resize Event Listner
     * @param config object
     */

  }, {
    key: 'init',
    value: function init() {
      var _this = this;

      var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _config$start = config.start,
          start = _config$start === undefined ? false : _config$start,
          _config$masterCompone2 = config.masterComponentClass,
          masterComponentClass = _config$masterCompone2 === undefined ? null : _config$masterCompone2;

      this.setViewByDefault();
      this.sub(_WFEventTypes.WF_EVENT_ONSTARTUP, function () {
        _this.changeView({ name: _this.currentViewConfig });
      });
      if (masterComponentClass) {
        this.masterComponentClass = masterComponentClass;
      }
      if (start) {
        this.sub(_WFEventTypes.WF_EVENT_ONREADY, function () {
          return _this.start();
        });
      }
      this.pub(_WFEventTypes.WF_EVENT_ONSTARTUP);
    }

    /**
     * Display this View
     * @param next callback
     */

  }, {
    key: 'start',
    value: function start() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      (0, _Screen.scrollTop)();
      if (!this.masterComponent) {
        this.addResizeEventsListner();
      }
      this.renderMasterComponent(function () {
        return next;
      });
    }

    /**
     * Hidden this View
     * @param next callback
     */

  }, {
    key: 'stop',
    value: function stop() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      this.removeMasterComponent(function () {
        return next;
      });
      this.isInit = false;
    }

    // ----------------- //

    // VIEW ----------------- //

    // ----------------- //

    /**
     * Load/Refresh view by name
     * caching masterComponent state before change
     * @param pageName string
     * @param tabName string
     */

  }, {
    key: 'changeView',
    value: function changeView() {
      var _this2 = this;

      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var _args$next = args.next,
          next = _args$next === undefined ? null : _args$next,
          _args$name = args.name,
          name = _args$name === undefined ? null : _args$name,
          _args$tabName = args.tabName,
          tabName = _args$tabName === undefined ? null : _args$tabName;
      /*
      if (this.masterComponent) {
        let prevState = this.masterComponent.state;
        this.change(prevState);
      }
      */

      (0, _Screen.scrollTop)();
      if (!this.isInit) {
        this.loadView(name, tabName, function () {
          return _this2.ready(next);
        });
        this.isInit = true;
      } else {
        this.loadView(name, tabName, function () {
          return next ? next() : "";
        });
      }
    }

    /**
     * Create new view by name
     * view has name string
     * view has config object
     * view has store object
     * Find/Format view's childComponentClass
     * @param name string
     * @param config object
     * @return view instance of WFObject
     */

  }, {
    key: 'createView',
    value: function createView(name) {
      var _this3 = this;

      var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      var validTabs = [];
      if ((0, _Lodash.isString)(name) && !this.hasView(name) && (0, _Lodash.isObject)(config)) {
        if (config.hasOwnProperty("tabs") && (0, _Lodash.isArray)(config.tabs) && config.tabs.length > 0) {
          validTabs = config.tabs.map(function (tab) {
            var i = 0;
            var l = (0, _keys2.default)(tab).length;
            var tabName = tab["name"];
            var components = [];
            for (var x in tab) {
              i++;
              if ((0, _Lodash.isFunction)(tab[x])) {
                components.push(x);
                _this3.connectChildComponentClass(tab[x], tabName);
              }
              if (i === l) {
                return (0, _assign2.default)(tab, { components: components });
              }
            }
          });
          if (config.hasOwnProperty("elements")) {
            for (var x in config.elements) {
              if ((0, _Lodash.isFunction)(config.elements[x])) {
                this.connectChildComponentClass(config.elements[x]);
              }
            }
          }
        }
        var viewConfig = new _WFViewConfig2.default(name, config);
        this.viewConfigs[name] = viewConfig;
        return viewConfig;
      } else {
        return null;
      }
    }

    /**
     * Load view by name
     * @param pageName string
     * @param tabName string
     * @param next callback
     */

  }, {
    key: 'loadView',
    value: function loadView() {
      var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var tabName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

      if ((0, _Lodash.isString)(name) && this.hasView(name)) {
        this.currentViewConfig = name;
        if ((0, _Lodash.isString)(tabName)) {
          this.viewConfigs[name].select(tabName);
        }
        this.currentChildComponents = this.getCurrentViewComponent();
        var currentViewState = this.getCurrentViewState();
        this.change(currentViewState, true);
        if (this.masterComponent) {
          this.setState(currentViewState);
        }
        if ((0, _Lodash.isFunction)(next)) {
          next();
        }
      } else {
        return null;
      }
    }

    /**
     * Get view by name
     * @param name string
     * @return view instance of WFObject
     */

  }, {
    key: 'getView',
    value: function getView(name) {
      if ((0, _Lodash.isString)(name) && this.hasView(name)) {
        return this.viewConfigs[name];
      } else {
        return null;
      }
    }

    /**
     * Get current view
     * @return string
     */

  }, {
    key: 'getCurrentView',
    value: function getCurrentView() {
      if (this.countView() > 0) {
        return this.currentViewConfig;
      } else {
        return null;
      }
    }

    /**
     * Get current view
     * @return string
     */

  }, {
    key: 'getCurrentViewState',
    value: function getCurrentViewState() {
      if (this.countView() > 0 && this.currentViewConfig) {
        return this.viewConfigs[this.currentViewConfig].getState();
      } else {
        return null;
      }
    }

    /**
     * Get current view
     * @return string
     */

  }, {
    key: 'getCurrentViewComponent',
    value: function getCurrentViewComponent() {
      if (this.countView() > 0 && this.currentViewConfig) {
        return this.viewConfigs[this.currentViewConfig].getComponent();
      } else {
        return [];
      }
    }

    /**
     * Check if view exist
     * @param name string
     * @return boolean 
     */

  }, {
    key: 'hasView',
    value: function hasView(name) {
      return this.viewConfigs.hasOwnProperty(name);
    }

    /**
     * Check if view exist
     * @return integer 
     */

  }, {
    key: 'countView',
    value: function countView() {
      return this.getViewKeys().length;
    }

    /**
     * Get view keys
     * @return array 
     */

  }, {
    key: 'getViewKeys',
    value: function getViewKeys() {
      return (0, _keys2.default)(this.viewConfigs);
    }

    /**
     * Set view by default
     * @return object
     */

  }, {
    key: 'setViewByDefault',
    value: function setViewByDefault() {
      if (this.countView() > 0) {
        var keys = this.getViewKeys();
        this.currentViewConfig = this.viewConfigs[keys[0]]["name"];
      }
    }

    // ----------------- //

    // STATE ----------------- //

    // ----------------- //

    /**
     * Set the Master Component or Child Component state 
     * @param args object
     */

  }, {
    key: 'setState',
    value: function setState() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if (this.masterComponent) {
        var currentState = this.masterComponent.state;
        if ((0, _Lodash.isObject)(args)) {
          for (var x in args) {
            if (!currentState.hasOwnProperty(x) || currentState.hasOwnProperty(x) && currentState[x] !== args[x]) {
              this.masterComponent.setState((0, _defineProperty3.default)({}, x, args[x]));
            }
          }
        }
      }
    }

    /**
     * Get the component state
     * @param args object
     */

  }, {
    key: 'getState',
    value: function getState() {
      var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      if (!key) {
        if (this.masterComponent) {
          return this.masterComponent.state;
        } else {
          return this.store.getValue();
        }
      } else {
        if (this.masterComponent) {
          var value = this.masterComponent.state.hasOwnProperty(key);
          return value ? this.masterComponent.state[key] : defaultValue;
        } else {
          var _value = this.store.has(key);
          return _value ? this.store.get(key) : defaultValue;
        }
      }
    }

    /**
     * Get store values
     * @return object
     */

  }, {
    key: 'getStoreValue',
    value: function getStoreValue() {
      return this.store.getValue();
    }

    // ----------------- //

    // MASTER COMPONENT LIFECYCLE ----------------- //

    // ----------------- //

    /**
     * Mount Master Component // if null
     * @param next callback 
     */

  }, {
    key: 'renderMasterComponent',
    value: function renderMasterComponent() {
      var _this4 = this;

      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      if (this.masterComponentClass) {
        var View = this.masterComponentClass;
        View.prototype.on = this.on.bind(this);
        View.prototype.changeView = this.changeView.bind(this);
        // Mediator Pub/Sub
        View.prototype.pub = this.pub.bind(this);
        View.prototype.sub = this.sub.bind(this);
        // Screen Helper
        View.prototype.onResize = this.onResize.bind(this);
        View.prototype.getSize = this.getSize.bind(this);
        View.prototype.getDiff = this.getDiff.bind(this);
        View.prototype.willMount = function (c) {
          _this4.masterComponent = c;
        };
        (0, _reactDom.render)(_react2.default.createElement(View, { id: this.id }), this.DOMNode);
        setTimeout(function () {
          var size = _this4.getSize();
          _this4.setState(size);
        }, 100);
        if ((0, _Lodash.isFunction)(next)) {
          setTimeout(next, 100);
        }
      }
    }

    /**
     * Unmounted Master Component 
     * @param next callback 
     */

  }, {
    key: 'removeMasterComponent',
    value: function removeMasterComponent() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      (0, _reactDom.render)(_react2.default.createElement('div', null), this.DOMNode);
      if ((0, _Lodash.isFunction)(next)) {
        setTimeout(next, 1);
      }
    }

    // ----------------- //

    // CHILD COMPONENT LIFECYCLE ----------------- //

    // ----------------- //

    /**
     * Set child component state by name
     * @param name string
     * @param state object
     * @return React Component 
     */

  }, {
    key: 'setChildComponentState',
    value: function setChildComponentState(name) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      if ((0, _Lodash.isString)(name) && (0, _Lodash.isObject)(args)) {
        var childComponent = this.getChildComponent(name);
        if (childComponent) {
          for (var x in args) {
            childComponent.setState((0, _defineProperty3.default)({}, x, args[x]));
          }
        }
      }
    }

    /**
     * Get child component by name
     * @param name string
     * @return React Component 
     */

  }, {
    key: 'getChildComponent',
    value: function getChildComponent(name) {
      return this.childComponents.get(name);
    }

    /**
     * Check if childComponent exist by name
     * @param name string
     * @return React Component 
     */

  }, {
    key: 'hasChildComponent',
    value: function hasChildComponent(name) {
      return this.childComponents.has(name);
    }

    /**
     * When the child component will mount 
     * Set it in the childComponents object
     * @param component React Component 
     */

  }, {
    key: 'childComponentWillMount',
    value: function childComponentWillMount(Component) {
      if (this.isValidComponent(Component)) {
        var key = Component.displayName;
        this.childComponents.set((0, _defineProperty3.default)({}, key, Component));
      }
    }

    /**
     * When the child component will unmount 
     * Unset it in the childComponents object
     * @param component React Component 
     */

  }, {
    key: 'childComponentWillUnmount',
    value: function childComponentWillUnmount(Component) {
      if (this.isValidComponent(Component)) {
        var key = Component.displayName;
        this.childComponents.unset(key);
      }
    }

    /**
     * Check if component is a valid component 
     * Valid component has a displayName
     * @param component React Component 
     */

  }, {
    key: 'isValidComponent',
    value: function isValidComponent(Component) {
      return (0, _Lodash.isFunction)(Component) && Component.hasOwnProperty("displayName");
    }

    /**
     * Sync High Order Component's Child
     * @param React Component 
     * @return WFComponent 
     */

  }, {
    key: 'connectChildComponentClass',
    value: function connectChildComponentClass(ComponentClass) {
      var _this5 = this;

      var tabName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      ComponentClass.prototype.willMount = function (c) {
        return _this5.childComponentWillMount(c);
      };
      ComponentClass.prototype.willUnmount = function (c) {
        return _this5.childComponentWillUnmount(c);
      };
      if (tabName) {
        ComponentClass.prototype.tabName = tabName;
      }
      ComponentClass.prototype.getState = this.getState.bind(this);
      // Mediator Pub/Sub
      ComponentClass.prototype.on = this.on.bind(this);
      ComponentClass.prototype.pub = this.pub.bind(this);
      ComponentClass.prototype.sub = this.sub.bind(this);
      // Screen Helper
      ComponentClass.prototype.onResize = this.onResize.bind(this);
      ComponentClass.prototype.getSize = this.getSize.bind(this);
      ComponentClass.prototype.getDiff = this.getDiff.bind(this);
      return ComponentClass;
    }

    // ----------------- //

    // SCREEN HELPERS ----------------- //

    // ----------------- //

    /**
     * Get Difference between n and x
     * @param n number
     * @param x number
     * @return number 
     */

  }, {
    key: 'getDiff',
    value: function getDiff(n) {
      var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      return n - x;
    }

    /**
     * Get current screen's size (width and height)
     * @return object 
     */

  }, {
    key: 'getSize',
    value: function getSize() {
      return {
        width: _windowWatcher2.default.width,
        height: _windowWatcher2.default.height
      };
    }

    /**
     * Subcribe to resize event
     * @param callback is event
     */

  }, {
    key: 'onResize',
    value: function onResize(callback) {
      this.sub(_WFEventTypes.WF_EVENT_ONRESIZE, callback, false);
    }

    /**
     * When Screen on resize 
     * Publish the new screen's size
     */

  }, {
    key: 'addResizeEventsListner',
    value: function addResizeEventsListner() {
      var _this6 = this;

      _windowWatcher2.default.on('resize', function () {
        var size = _this6.getSize();
        _this6.pub(_WFEventTypes.WF_EVENT_ONRESIZE, size);
        _this6.setState(size);
      });
    }

    // DEBUG ----------------- //

    /**
     * Show current state in console
     */

  }, {
    key: 'toConsole',
    value: function toConsole() {
      console.log("");
      console.warn('WFMasterView : ' + this.id);
      console.warn('DOMNode : ' + this.DOMNode);
      console.log('pages =>', (0, _JSON.stringify)(this.viewConfigs.getValue()));
      console.log('store =>', (0, _JSON.stringify)(this.store.getValue()));
      console.log('components =>', (0, _JSON.stringify)(this.childComponents.getValue()));
      console.log("");
    }
  }]);
  return WFMasterView;
}();

// ---------------------- //


exports.default = WFMasterView;
// ---------------------- //

/***/ }),
/* 449 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _Lodash = __webpack_require__(6);

var _WFObject = __webpack_require__(27);

var _WFObject2 = _interopRequireDefault(_WFObject);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// CLASS WF VIEW CONFIG ------------------- //

// ------------------- //
var WFViewConfig = function () {
  /**
   * Constructor
   * @param name string
   * @param config object
   */
  function WFViewConfig(name) {
    var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    (0, _classCallCheck3.default)(this, WFViewConfig);
    var _config$visible = config.visible,
        visible = _config$visible === undefined ? false : _config$visible,
        _config$current = config.current,
        current = _config$current === undefined ? null : _config$current,
        _config$elements = config.elements,
        elements = _config$elements === undefined ? {} : _config$elements;

    this.name = name;
    this.visible = visible;
    this.current = current;
    this.tabs = new _WFArray2.default({ isCollection: true, findBy: "name" });
    this.elements = elements;
    this.init(config);
  }

  /**
   * Initialize View
   * set tabs in this.tabs
   * if current is null define default tab 
   * @param config object
   */


  (0, _createClass3.default)(WFViewConfig, [{
    key: "init",
    value: function init(config) {
      var _this = this;

      var _config$tabs = config.tabs,
          tabs = _config$tabs === undefined ? [] : _config$tabs;

      this.tabs.insert(tabs, function () {
        if (!_this.tabs.isEmpty()) {
          var defaultTab = _this.tabs.getByIndex(0);
          _this.select(defaultTab.name);
        }
      });
    }

    /**
     * Check if Tab exist by name
     * @param tab name
     * @return boolean
     */

  }, {
    key: "has",
    value: function has(tabName) {
      return this.tabs.has(tabName);
    }

    /**
     * Select Tab by name
     * @param tab name
     */

  }, {
    key: "select",
    value: function select(tabName) {
      if (this.has(tabName)) {
        this.current = tabName;
      }
    }

    /**
     * Get view state
     * @return object
     */

  }, {
    key: "getState",
    value: function getState() {
      return {
        view_name: this.name,
        view_tabs: this.tabs.getValue(),
        view_tab: this.tabs.get(this.current),
        view_tabs_count: this.tabs.getCounter(),
        view_tab_current: this.current,
        view_tab_visible: this.visible,
        view_elements: this.elements
      };
    }

    /**
     * Get view components
     * @return array
     */

  }, {
    key: "getComponent",
    value: function getComponent() {
      var tab = this.tabs.get(this.current);
      var _tab$components = tab.components,
          components = _tab$components === undefined ? [] : _tab$components;

      return components;
    }
  }]);
  return WFViewConfig;
}();

exports.default = WFViewConfig;

/*

let home = 

*/

/***/ }),
/* 450 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var position = {
  x: 0,
  y: 0
};

var WFViewOffset = function () {
  function WFViewOffset() {
    (0, _classCallCheck3.default)(this, WFViewOffset);
  }

  (0, _createClass3.default)(WFViewOffset, null, [{
    key: "set",
    value: function set(e) {
      position = {
        x: e.clientX,
        y: e.clientY
      };
      //console.error(position)
    }
  }, {
    key: "get",
    value: function get() {
      return position;
    }
  }, {
    key: "getElemPosition",
    value: function getElemPosition(id) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      var parent = document.querySelector("#" + id);
      var tooltipPosition = parent.getBoundingClientRect();
      var scrollY = window.scrollY !== undefined ? window.scrollY : window.pageYOffset;
      var scrollX = window.scrollX !== undefined ? window.scrollX : window.pageXOffset;
      var top = scrollY + tooltipPosition.top;
      var left = scrollX + tooltipPosition.left;
      var position = "absolute";
      if (args.hasOwnProperty("top")) {
        top = top + args.top;
      }
      if (args.hasOwnProperty("left")) {
        left = left + args.left;
      }
      return {
        top: top,
        left: left,
        position: position
      };
    }
  }, {
    key: "addEventListener",
    value: function addEventListener() {
      window.addEventListener('click', WFViewOffset.set);
    }
  }, {
    key: "removeEventListener",
    value: function removeEventListener() {
      window.removeEventListener('click', WFViewOffset.set);
    }
  }]);
  return WFViewOffset;
}();

exports.default = WFViewOffset;

/***/ }),
/* 451 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _regenerator = __webpack_require__(271);

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = __webpack_require__(268);

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// WFRessources.getFields().then(fields => ...);
var getFields = function () {
  var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() {
    return _regenerator2.default.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            _context.next = 2;
            return __webpack_require__.e/* import() */(0).then(__webpack_require__.bind(null, 914));

          case 2:
            return _context.abrupt("return", _context.sent);

          case 3:
          case "end":
            return _context.stop();
        }
      }
    }, _callee, undefined);
  }));

  return function getFields() {
    return _ref.apply(this, arguments);
  };
}();
exports.default = {
  getFields: getFields
};

/***/ }),
/* 452 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFAdminState;

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var WFAdminState = (_WFAdminState = {}, (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PRODUCTTYPE_STATUS, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.HEIGHT, 0), (0, _defineProperty3.default)(_WFAdminState, _Constants.WIDTH, 0), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_NAME, ""), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_TABS, []), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_TAB, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_TABS_COUNT, 0), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_TAB_CURRENT, ""), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_VIEW_TAB_VISIBLE, false), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PAGE_TITLE, null), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_REDIRECT, null), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_LOADER, false), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_ALERT, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_NOTIFY, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_COMFIRM, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_OVERLAY, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PLAYER, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PANEL, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_MODAL, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_TOOLTIP, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_LIVEPLAYER, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_EDITOR, false), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_EDITOR_READY, false), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_EDITOR_ERROR, []), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_EDITOR_CUSTOM_VIEW, null), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_EDITOR_CUSTOM_VIEW_ARGS, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PANELS, {}), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PANELS_CUSTOM, null), (0, _defineProperty3.default)(_WFAdminState, _Constants.WF_PANELS_CUSTOM_ARGS, {}), _WFAdminState);

exports.default = WFAdminState;

/***/ }),
/* 453 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _wfsetting = __webpack_require__(121);

var _wfsetting2 = _interopRequireDefault(_wfsetting);

var _wflicense = __webpack_require__(162);

var _wflicense2 = _interopRequireDefault(_wflicense);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

__webpack_require__(30);

__webpack_require__(489);

__webpack_require__(482);

__webpack_require__(486);

__webpack_require__(487);

__webpack_require__(483);

__webpack_require__(488);

__webpack_require__(490);

__webpack_require__(484);

__webpack_require__(485);

var _WFPageHomeConfig = __webpack_require__(481);

var _WFPageHomeConfig2 = _interopRequireDefault(_WFPageHomeConfig);

var _WFPageFormEditorConfig = __webpack_require__(480);

var _WFPageFormEditorConfig2 = _interopRequireDefault(_WFPageFormEditorConfig);

var _Constants = __webpack_require__(12);

var _WFProductType = __webpack_require__(15);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------- //

/*
 * Find all setting
 */


// WF ADMIN VIEW CONFIG  ----------- //


// WF GLOBAL FORM MANAGER  ----------- //
_wfsetting2.default.mgr.find();

/*
 * Find all license
 */


// WF ADMIN VIEW HELPER  ----------- //


// WF ADMIN VIEW  ----------- //
_wflicense2.default.mgr.find({}, function () {
  return _wfsetting2.default.mgr.ready();
});

/*
 * Create all admin views
 */
_WFAdminView2.default.createView(_Constants.PAGE_HOME, _WFPageHomeConfig2.default);

_WFAdminView2.default.createView(_Constants.PAGE_FORM_EDITOR, _WFPageFormEditorConfig2.default);

/*
 * Initialize and Display admin view 
 */
_WFAdminView2.default.init({
  start: true
});

// ----------- //

/***/ }),
/* 454 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function () {
  var setting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var _setting$info = setting.info,
      info = _setting$info === undefined ? {} : _setting$info,
      _setting$fields = setting.fields,
      fields = _setting$fields === undefined ? [] : _setting$fields,
      _setting$displayField = setting.displayFields,
      displayFields = _setting$displayField === undefined ? [] : _setting$displayField;
  var icon = info.icon,
      label = info.label,
      _info$attrKey = info.attrKey,
      attrKey = _info$attrKey === undefined ? null : _info$attrKey;

  config['icon'] = icon;
  config['label'] = label;
  config['fields'] = fields;
  config['displayFields'] = displayFields;
  config['attrKey'] = attrKey;
};

/***/ }),
/* 455 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _SetEditorConfig = __webpack_require__(454);

var _SetEditorConfig2 = _interopRequireDefault(_SetEditorConfig);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

var Utils = {
  setEditorConfig: _SetEditorConfig2.default
};

// ----------------- //
exports.default = Utils;
// ----------------- //

/***/ }),
/* 456 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFIcon = __webpack_require__(8);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var logo = __WF__.ASSETS + "/img/wf-light.png";

// ------------------- //

// WF HEADER ------------------- //

// ------------------- //

// ------------------- //

var classes = {
	logo: "wf-logo pull-left",
	pages: "wf-list-pages",
	title: "wf-page-title"
};

// ------------------- //

var WFHeader = function (_Component) {
	(0, _inherits3.default)(WFHeader, _Component);

	// ------------------- //

	function WFHeader(props) {
		(0, _classCallCheck3.default)(this, WFHeader);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFHeader.__proto__ || (0, _getPrototypeOf2.default)(WFHeader)).call(this, props));

		_this.displayName = "WFHeader";
		_this.state = {};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(WFHeader, [{
		key: "render",
		value: function render() {
			var _props$loading = this.props.loading,
			    loading = _props$loading === undefined ? false : _props$loading;

			return _react2.default.createElement(
				"wf-header",
				null,
				this.getPageTitle(),
				this.getLogo(),
				_react2.default.createElement(
					"span",
					{ style: {
							opacity: loading ? 0 : 1,
							visibility: loading ? "hidden" : "visible"
						} },
					this.props.children
				)
			);
		}

		// ------------------- //

	}, {
		key: "getLogo",
		value: function getLogo() {
			var _props = this.props,
			    _props$loading2 = _props.loading,
			    loading = _props$loading2 === undefined ? false : _props$loading2,
			    _props$onClick = _props.onClick,
			    _onClick = _props$onClick === undefined ? null : _props$onClick;

			return _react2.default.createElement(
				"div",
				{
					onClick: function onClick() {
						return loading || !(0, _Lodash.isFunction)(_onClick) ? "" : _onClick();
					},
					className: classes.logo
				},
				_react2.default.createElement(_WFImg2.default, { src: logo })
			);
		}

		// ------------------- //

	}, {
		key: "getPageTitle",
		value: function getPageTitle() {
			var title = this.props.title;

			return _react2.default.createElement(
				"div",
				{ className: classes.title },
				_react2.default.createElement(
					"span",
					null,
					title
				)
			);
		}

		// ------------------- //


		// COMPONENT LIFECYCLE ------------------- //


		// ------------------- //

	}, {
		key: "componentWillMount",
		value: function componentWillMount() {
			if ((0, _Lodash.isFunction)(this.willMount)) this.willMount(this);
		}
	}, {
		key: "componentDidMount",
		value: function componentDidMount() {
			if ((0, _Lodash.isFunction)(this.didMount)) this.didMount(this);
		}
	}, {
		key: "componentWillUnmount",
		value: function componentWillUnmount() {
			if ((0, _Lodash.isFunction)(this.willUnmount)) this.willUnmount(this);
			this.setState = function () {
				return false;
			};
		}

		// ------------------- //

	}]);
	return WFHeader;
}(_react.Component);

// ------------------- //

exports.default = WFHeader;

// ------------------- //

/***/ }),
/* 457 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFMain = __webpack_require__(354);

var _WFMain2 = _interopRequireDefault(_WFMain);

var _WFTabs = __webpack_require__(116);

var _WFTabs2 = _interopRequireDefault(_WFTabs);

var _WFTab = __webpack_require__(151);

var _WFTab2 = _interopRequireDefault(_WFTab);

var _WFBody = __webpack_require__(113);

var _WFBody2 = _interopRequireDefault(_WFBody);

var _WFSidebar = __webpack_require__(115);

var _WFSidebar2 = _interopRequireDefault(_WFSidebar);

var _WFModal = __webpack_require__(214);

var _WFModal2 = _interopRequireDefault(_WFModal);

var _WFPanel = __webpack_require__(356);

var _WFPanel2 = _interopRequireDefault(_WFPanel);

var _WFTooltip = __webpack_require__(362);

var _WFTooltip2 = _interopRequireDefault(_WFTooltip);

var _WFOverlay = __webpack_require__(215);

var _WFOverlay2 = _interopRequireDefault(_WFOverlay);

var _WFNotify = __webpack_require__(355);

var _WFNotify2 = _interopRequireDefault(_WFNotify);

var _WFAlert = __webpack_require__(351);

var _WFAlert2 = _interopRequireDefault(_WFAlert);

var _WFComfirm = __webpack_require__(352);

var _WFComfirm2 = _interopRequireDefault(_WFComfirm);

var _WFLivePlayer = __webpack_require__(213);

var _WFLivePlayer2 = _interopRequireDefault(_WFLivePlayer);

var _WFormComponent = __webpack_require__(219);

var _WFormComponent2 = _interopRequireDefault(_WFormComponent);

var _WFInputFactoryForAdmin = __webpack_require__(217);

var _WFInputFactoryForAdmin2 = _interopRequireDefault(_WFInputFactoryForAdmin);

var _WFooter = __webpack_require__(458);

var _WFooter2 = _interopRequireDefault(_WFooter);

var _WFHeader = __webpack_require__(456);

var _WFHeader2 = _interopRequireDefault(_WFHeader);

var _WFBaobabView = __webpack_require__(460);

var _WFBaobabView2 = _interopRequireDefault(_WFBaobabView);

var _WFBaobabBranchView = __webpack_require__(459);

var _WFBaobabBranchView2 = _interopRequireDefault(_WFBaobabBranchView);

var _WFMailerView = __webpack_require__(461);

var _WFMailerView2 = _interopRequireDefault(_WFMailerView);

var _WFNexusStrategyView = __webpack_require__(462);

var _WFNexusStrategyView2 = _interopRequireDefault(_WFNexusStrategyView);

var _WFAdminView = __webpack_require__(18);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(41);

var _Constants2 = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF LAYOUT ------------------- //

// ------------------- //

var WFLayout = function (_Component) {
  (0, _inherits3.default)(WFLayout, _Component);

  function WFLayout(props) {
    (0, _classCallCheck3.default)(this, WFLayout);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFLayout.__proto__ || (0, _getPrototypeOf2.default)(WFLayout)).call(this, props));

    _this.displayName = "WFLayout";
    _this.state = {};
    return _this;
  }

  // ------------------- //

  (0, _createClass3.default)(WFLayout, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _state = this.state,
          view_name = _state.view_name,
          view_tabs = _state.view_tabs,
          view_tab_visible = _state.view_tab_visible,
          view_tab_current = _state.view_tab_current,
          height = _state.height,
          width = _state.width,
          is_editing = _state.is_editing,
          _state$wf_loader = _state.wf_loader,
          wf_loader = _state$wf_loader === undefined ? {} : _state$wf_loader,
          _state$wf_alert = _state.wf_alert,
          wf_alert = _state$wf_alert === undefined ? {} : _state$wf_alert,
          _state$wf_notify = _state.wf_notify,
          wf_notify = _state$wf_notify === undefined ? {} : _state$wf_notify,
          _state$wf_overlay = _state.wf_overlay,
          wf_overlay = _state$wf_overlay === undefined ? {} : _state$wf_overlay,
          _state$wf_panels = _state.wf_panels,
          wf_panels = _state$wf_panels === undefined ? {} : _state$wf_panels,
          _state$wf_comfirm = _state.wf_comfirm,
          wf_comfirm = _state$wf_comfirm === undefined ? {} : _state$wf_comfirm,
          _state$wf_tooltip = _state.wf_tooltip,
          wf_tooltip = _state$wf_tooltip === undefined ? {} : _state$wf_tooltip,
          _state$wf_modal = _state.wf_modal,
          wf_modal = _state$wf_modal === undefined ? {} : _state$wf_modal,
          _state$wf_panel = _state.wf_panel,
          wf_panel = _state$wf_panel === undefined ? {} : _state$wf_panel,
          wf_editor_ready = _state.wf_editor_ready,
          wf_editor_custom_view = _state.wf_editor_custom_view,
          _state$wf_live_player = _state.wf_live_player,
          wf_live_player = _state$wf_live_player === undefined ? {} : _state$wf_live_player,
          _state$wf_redirect = _state.wf_redirect,
          wf_redirect = _state$wf_redirect === undefined ? null : _state$wf_redirect,
          _state$wf_page_title = _state.wf_page_title,
          wf_page_title = _state$wf_page_title === undefined ? null : _state$wf_page_title;


      return (
        // --------- //

        // WF ADMIN PAGE  --------- //

        // --------- //
        _react2.default.createElement(
          "wf-layout",
          null,
          _react2.default.createElement(
            _WFHeader2.default,
            {
              loading: wf_loader || is_editing,
              title: wf_page_title,
              onClick: function onClick() {
                if ((0, _Lodash.isFunction)(wf_redirect)) {
                  wf_redirect();
                } else {
                  (0, _WFAdminView.Pub)(_Constants2.WF_PAGE);
                }
              } },
            this.page(_Constants.HEADER)
          ),
          _react2.default.createElement(
            _WFMain2.default,
            null,
            _react2.default.createElement(_WFTabs2.default, {
              view: true,
              editable: false,
              tabId: view_tab_current,
              visible: view_tab_visible,
              selectedBy: _Constants.SELECT_BY_NAME,
              selected: [view_tab_current],
              schema: view_tabs,
              onSelect: function onSelect(item, tabs) {
                var tabName = item[_Constants.SELECT_BY_NAME];
                tabs.setState({ selected: tabName });
                _this2.changeView({
                  name: view_name,
                  tabName: tabName
                });
              }
            }),
            _react2.default.createElement(
              _WFSidebar2.default,
              {
                visible: true },
              this.tab(_Constants.SIDEBAR)
            ),
            _react2.default.createElement(
              _WFBody2.default,
              {
                visible: true,
                height: this.getDiff(height || 0, _Constants.BODY_H) },
              this.tab(_Constants.BODY)
            )
          ),
          _react2.default.createElement(
            _WFooter2.default,
            null,
            this.page(_Constants.FOOTER)
          ),
          _react2.default.createElement(_WFAlert2.default, {
            overlayColor: _Constants.OVERLAY_DARK,
            context: wf_alert,
            onCancel: function onCancel() {
              return (0, _WFAdminView.Pub)(_Constants2.WF_ALERT);
            }
          }),
          _react2.default.createElement(_WFComfirm2.default, {
            overlayColor: _Constants.OVERLAY_DARK,
            context: wf_comfirm,
            onChange: function onChange(next) {
              _this2.setState({ wf_comfirm: {} });
              if ((0, _Lodash.isFunction)(next)) next();
            }
          }),
          _react2.default.createElement(_WFNotify2.default, (0, _extends3.default)({
            visible: true,
            loader: wf_loader,
            loaderMessage: '<strong>Loading</strong>...'
          }, wf_notify)),
          _react2.default.createElement(_WFPanel2.default, (0, _extends3.default)({}, wf_panels, {
            loading: wf_loader,
            visible: true,
            isReady: true,
            zIndex: 4000,
            scrollBar: false,
            height: this.getDiff(height || 0, _Constants.PANEL_BODY_H),
            bodyView: function bodyView(panel) {
              return _this2.panelBody(panel);
            }
          })),
          _react2.default.createElement(
            _WFTooltip2.default,
            (0, _extends3.default)({}, wf_tooltip, {
              loading: wf_loader,
              isReady: wf_editor_ready
            }),
            this.getEditor((0, _keys2.default)(wf_tooltip).length > 0)
          ),
          _react2.default.createElement(_WFPanel2.default, (0, _extends3.default)({}, wf_panel, {
            visible: true,
            loading: wf_loader,
            isReady: wf_editor_ready,
            height: this.getDiff(height || 0, _Constants.PANEL_BODY_H),
            scrollBar: !wf_editor_custom_view ? true : false,
            bodyView: function bodyView(panel) {
              var isVisible = (0, _keys2.default)(wf_panel).length > 0;
              return _this2.getEditor(isVisible, panel);
            }
          })),
          _react2.default.createElement(
            _WFModal2.default,
            (0, _extends3.default)({}, wf_modal, {
              loading: wf_loader,
              isReady: wf_editor_ready,
              onChange: function onChange() {
                var callBack = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
                return callBack();
              }
            }),
            this.getEditor((0, _keys2.default)(wf_modal).length > 0)
          ),
          _react2.default.createElement(_WFLivePlayer2.default, (0, _extends3.default)({}, wf_live_player, {
            src: _WFUrl2.default.getPlayerUrl(),
            onClose: function onClose() {
              return (0, _WFAdminView.Pub)(_Constants2.WF_LIVEPLAYER);
            }
          })),
          _react2.default.createElement(_WFOverlay2.default, wf_overlay),
          wf_loader ? _react2.default.createElement("wf-root-overlay", null) : ""
        )
      );
    }

    // ------------------- //

    // PAGE CONTENT ------------------- //

    // ------------------- //

  }, {
    key: "page",
    value: function page(name) {
      var _state2 = this.state,
          _state2$view_tab = _state2.view_tab,
          view_tab = _state2$view_tab === undefined ? {} : _state2$view_tab,
          view_tab_current = _state2.view_tab_current,
          _state2$view_elements = _state2.view_elements,
          view_elements = _state2$view_elements === undefined ? {} : _state2$view_elements;

      var View = "";
      if (view_elements.hasOwnProperty(name)) {
        View = view_elements[name];
      } else if (view_tab.hasOwnProperty(name)) {
        View = view_tab[name];
      }
      return (0, _Lodash.isFunction)(View) ? _react2.default.createElement(View, null) : View;
    }
  }, {
    key: "tab",
    value: function tab(name) {
      var _state3 = this.state,
          view_tabs = _state3.view_tabs,
          view_tabs_count = _state3.view_tabs_count,
          view_tab_current = _state3.view_tab_current;

      if (view_tabs_count === 0 || !view_tab_current) {
        return false;
      } else {
        return view_tabs.map(function (tab, i) {
          var Tab = tab[name];
          var tab_name = tab[_Constants.SELECT_BY_NAME];
          if (view_tab_current !== tab_name || !Tab) {
            return false;
          } else {
            return _react2.default.createElement(
              _WFTab2.default,
              {
                key: i,
                id: tab_name,
                visible: true },
              _react2.default.createElement(Tab, { tab: name })
            );
          }
        });
      }
    }
  }, {
    key: "panelBody",
    value: function panelBody(panel) {
      var _state4 = this.state,
          wf_panels_custom = _state4.wf_panels_custom,
          _state4$wf_panels_cus = _state4.wf_panels_custom_args,
          wf_panels_custom_args = _state4$wf_panels_cus === undefined ? {} : _state4$wf_panels_cus;


      switch (wf_panels_custom) {

        case "WFNexusStrategy":
          return _react2.default.createElement(
            "div",
            { className: "wf_panels_custom_body" },
            _react2.default.createElement(_WFNexusStrategyView2.default, (0, _extends3.default)({}, wf_panels_custom_args, {
              height: panel.props.height
            }))
          );
          break;

        case "WFBaobab":
          return _react2.default.createElement(
            "div",
            { className: "wf_panels_custom_body" },
            _react2.default.createElement(_WFBaobabView2.default, (0, _extends3.default)({}, wf_panels_custom_args, {
              height: panel.props.height
            }))
          );
          break;

        case "WFBaobabBranch":
          return _react2.default.createElement(
            "div",
            { className: "wf_panels_custom_body" },
            _react2.default.createElement(_WFBaobabBranchView2.default, (0, _extends3.default)({}, wf_panels_custom_args, {
              height: panel.props.height
            }))
          );
          break;

        //case "WFBaobabPortable":  
        //case "WFBaobabPortable":

        default:
          return false;
      }
    }
  }, {
    key: "getEditor",
    value: function getEditor() {
      var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var _state5 = this.state,
          wf_editor = _state5.wf_editor,
          wf_editor_custom_view = _state5.wf_editor_custom_view,
          _state5$wf_editor_cus = _state5.wf_editor_custom_view_args,
          wf_editor_custom_view_args = _state5$wf_editor_cus === undefined ? {} : _state5$wf_editor_cus;

      if (visible && wf_editor && _WFormManagers.formEditorMgr.isReady()) {
        var _formEditorMgr$get = _WFormManagers.formEditorMgr.get(),
            formView = _formEditorMgr$get.formView;

        return _react2.default.createElement(_WFormComponent2.default, {
          isAdmin: true,
          hasSteps: false,
          navigation: false
          // Hook formView with formComponent
          , onPrev: function onPrev() {
            return formView.prev();
          },
          onNext: function onNext() {
            return formView.next();
          },
          onSubmit: function onSubmit() {
            return formView.submit();
          },
          on: function on(evenType) {
            var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

            formView.on(evenType, eventArgs);
          },
          onField: function onField(name, evenType) {
            var eventArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

            formView.onField(name, evenType, eventArgs, {
              isEditEntry: formView.formState.hasEntryId()
            });
          },
          onGetInput: function onGetInput(type, input_type, isAdminForm) {
            return _WFInputFactoryForAdmin2.default.get(type, input_type, isAdminForm);
          }
          // Overide current content with custom view
          , hasCustomView: wf_editor_custom_view ? true : false,
          customView: function customView(form) {
            switch (wf_editor_custom_view) {

              case "WFMailer":
                return _react2.default.createElement(_WFMailerView2.default, (0, _extends3.default)({}, wf_editor_custom_view_args, {
                  form: form,
                  height: parent.props.height,
                  getField: function getField(fieldName) {
                    return formView.getField(fieldName);
                  }
                }));
                break;

              default:
                return false;
            }
          }
        });
      } else {
        return false;
      }
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      if ((0, _Lodash.isFunction)(this.willMount)) {
        this.willMount(this);
      }
      if ((0, _Lodash.isFunction)(this.getSize)) {
        var _getSize = this.getSize(),
            _getSize$height = _getSize.height,
            height = _getSize$height === undefined ? 0 : _getSize$height,
            _getSize$width = _getSize.width,
            width = _getSize$width === undefined ? 0 : _getSize$width;

        this.setState({ height: height, width: width });
      }
    }
    // ------------------- //

  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      if ((0, _Lodash.isFunction)(this.willMount)) {
        this.willMount(this);
      }
    }
    // ------------------- //

  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if ((0, _Lodash.isFunction)(this.willUnMount)) {
        this.willUnMount(this);
      }
    }
  }]);
  return WFLayout;
}(_react.Component);

// ------------------- //


exports.default = WFLayout;
// ------------------- //

/***/ }),
/* 458 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF FOOTER ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var WFooter = function (_Component) {
	(0, _inherits3.default)(WFooter, _Component);

	// ------------------- //

	function WFooter(props) {
		(0, _classCallCheck3.default)(this, WFooter);

		var _this = (0, _possibleConstructorReturn3.default)(this, (WFooter.__proto__ || (0, _getPrototypeOf2.default)(WFooter)).call(this, props));

		_this.displayName = "WFooter";
		_this.state = {};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(WFooter, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement("wf-footer", null);
		}

		// ------------------- //

		// COMPONENT LIFECYCLE ------------------- //

		// ------------------- //

	}, {
		key: "componentWillMount",
		value: function componentWillMount() {
			if ((0, _Lodash.isFunction)(this.willMount)) this.willMount(this);
		}
		// ------------------- //

	}, {
		key: "componentDidMount",
		value: function componentDidMount() {
			if ((0, _Lodash.isFunction)(this.didMount)) this.didMount(this);
		}
		// ------------------- //

	}, {
		key: "componentWillUnmount",
		value: function componentWillUnmount() {
			if ((0, _Lodash.isFunction)(this.willUnmount)) this.willUnmount(this);
		}
	}]);
	return WFooter;
}(_react.Component);

// ------------------- //


exports.default = WFooter;
// ------------------- //

/***/ }),
/* 459 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

var _WFBody = __webpack_require__(113);

var _WFBody2 = _interopRequireDefault(_WFBody);

var _WFSidebar = __webpack_require__(115);

var _WFSidebar2 = _interopRequireDefault(_WFSidebar);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFPagination = __webpack_require__(100);

var _WFPagination2 = _interopRequireDefault(_WFPagination);

var _WFCustomView = __webpack_require__(124);

var _WFCustomView2 = _interopRequireDefault(_WFCustomView);

var _WFConfigBaobabMgr = __webpack_require__(228);

var _WFConfigBaobabMgr2 = _interopRequireDefault(_WFConfigBaobabMgr);

var _WFBaobabObserver = __webpack_require__(225);

var _WFBaobabObserver2 = _interopRequireDefault(_WFBaobabObserver);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(72);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SELECT FORM ------------------- //

// ------------------- //

// WFCOMPONENT
var classes = {};

var WFBaobabBranchView = function (_Component) {
  (0, _inherits3.default)(WFBaobabBranchView, _Component);

  function WFBaobabBranchView(props) {
    (0, _classCallCheck3.default)(this, WFBaobabBranchView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFBaobabBranchView.__proto__ || (0, _getPrototypeOf2.default)(WFBaobabBranchView)).call(this, props));

    _this.displayName = "WFBaobabBranchView";
    // State
    _this.state = {
      page_loader: false,
      isInit: false
    };
    return _this;
  }

  (0, _createClass3.default)(WFBaobabBranchView, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      return _react2.default.createElement(_WFCustomView2.default, {
        sidebarVisible: false,
        sidebarPosition: "left",
        height: this.props.height,
        className: "wf-custom-view-baobab",
        bodyView: function bodyView() {
          return _this2.getBody();
        },
        sidebarView: function sidebarView() {
          return _this2.getSidebar();
        }
      });
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var _state = this.state,
          page_loader = _state.page_loader,
          _state$wf_baobab_sele = _state.wf_baobab_selection,
          wf_baobab_selection = _state$wf_baobab_sele === undefined ? [] : _state$wf_baobab_sele,
          _state$wf_baobab_sche = _state.wf_baobab_schema,
          wf_baobab_schema = _state$wf_baobab_sche === undefined ? [] : _state$wf_baobab_sche,
          wf_baobab_is_branch_archive = _state.wf_baobab_is_branch_archive;

      var _WFUi$baobab$getWFSec = _wfui2.default.baobab.getWFSectionTitleConfig(this),
          counter = _WFUi$baobab$getWFSec.counter,
          counterMax = _WFUi$baobab$getWFSec.counterMax,
          shortTitle = _WFUi$baobab$getWFSec.shortTitle;

      var countSelection = wf_baobab_selection.length;
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFSectionTitle2.default,
          {
            icon: "layers",
            text: shortTitle,
            counter: counter,
            counterMax: counterMax,
            loader: page_loader
          },
          _react2.default.createElement(
            _WFBtn2.default,
            {
              visible: countSelection === 0,
              className: "wf-btn-title wf-btn-yellow-dark",
              active: false,
              onClick: function onClick() {
                _wfui2.default.baobab.option.onCreate(_WFConfigBaobabMgr2.default);
              }
            },
            "Add Option(s)"
          ),
          _react2.default.createElement(
            _WFBtn2.default,
            {
              visible: countSelection > 0,
              className: "wf-btn-title wf-btn-red",
              active: false,
              onClick: function onClick() {
                _wfui2.default.baobab.option.onDel(_WFConfigBaobabMgr2.default);
              }
            },
            "Delete (",
            countSelection,
            ")"
          )
        ),
        this.getBranchArchive()
      );
    }
  }, {
    key: "getSidebar",
    value: function getSidebar() {
      return _react2.default.createElement(_WFSection2.default, null);
    }
  }, {
    key: "getBranchArchive",
    value: function getBranchArchive() {
      var _state2 = this.state,
          _state2$wf_baobab_sel = _state2.wf_baobab_selection,
          wf_baobab_selection = _state2$wf_baobab_sel === undefined ? [] : _state2$wf_baobab_sel,
          wf_baobab_is_branch_archive = _state2.wf_baobab_is_branch_archive,
          _state2$wf_baobab_cur = _state2.wf_baobab_current_branch,
          wf_baobab_current_branch = _state2$wf_baobab_cur === undefined ? {} : _state2$wf_baobab_cur;
      var _wf_baobab_current_br = wf_baobab_current_branch.id,
          id = _wf_baobab_current_br === undefined ? null : _wf_baobab_current_br,
          _wf_baobab_current_br2 = wf_baobab_current_branch.label,
          label = _wf_baobab_current_br2 === undefined ? "" : _wf_baobab_current_br2,
          _wf_baobab_current_br3 = wf_baobab_current_branch.options_count,
          options_count = _wf_baobab_current_br3 === undefined ? 0 : _wf_baobab_current_br3,
          _wf_baobab_current_br4 = wf_baobab_current_branch.branches,
          branches = _wf_baobab_current_br4 === undefined ? [] : _wf_baobab_current_br4,
          _wf_baobab_current_br5 = wf_baobab_current_branch.options,
          options = _wf_baobab_current_br5 === undefined ? [] : _wf_baobab_current_br5,
          _wf_baobab_current_br6 = wf_baobab_current_branch.branchPager,
          branchPager = _wf_baobab_current_br6 === undefined ? {} : _wf_baobab_current_br6,
          _wf_baobab_current_br7 = wf_baobab_current_branch.optionPager,
          optionPager = _wf_baobab_current_br7 === undefined ? {} : _wf_baobab_current_br7;
      var _optionPager$total = optionPager.total,
          total = _optionPager$total === undefined ? 0 : _optionPager$total,
          _optionPager$countRow = optionPager.countRow,
          countRow = _optionPager$countRow === undefined ? 0 : _optionPager$countRow;

      if (!wf_baobab_is_branch_archive) {
        return false;
      } else {
        return _react2.default.createElement(
          _WFTable2.default,
          (0, _extends3.default)({
            rows: options,
            selected: wf_baobab_selection
          }, _wfui2.default.baobab.getWFTableConfigForBranchArchive(2), {
            onSelect: function onSelect(val, optionConfig) {
              _WFConfigBaobabMgr2.default.select(optionConfig);
            },
            cellCallbacks: {
              label: function label(val, optionConfig) {
                _wfui2.default.baobab.option.onEdit(_WFConfigBaobabMgr2.default, optionConfig);
              }
            } }),
          _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
            visible: total > 1 && countRow > 0
          }, optionPager, {
            onClick: function onClick(page) {
              _WFConfigBaobabMgr2.default.find({ page: page });
            }
          }))
        );
      }
    }
  }, {
    key: "getField",
    value: function getField(name) {
      return this.props.getField(name);
    }
  }, {
    key: "init",
    value: function init(props) {
      var _props$optionConfig = props.optionConfig,
          optionConfig = _props$optionConfig === undefined ? null : _props$optionConfig;

      if (optionConfig) {
        _WFConfigBaobabMgr2.default.explore(optionConfig, _Constants.WF_BAOBAB_BRANCH);
        this.setState({
          isInit: true
        });
      }
    }

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillReceiveProps",
    value: function componentWillReceiveProps(nextProps) {
      if (!this.state.isInit) {
        this.init(nextProps);
      }
    }

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      var _this3 = this;

      _WFConfigBaobabMgr2.default.viewMgr.willMount(this);
      _WFBaobabObserver2.default.observe(_WFConfigBaobabMgr2.default, {
        change: function change() {
          _this3.setState({
            page_loader: true
          });
        },
        ready: function ready() {
          _this3.setState({
            page_loader: false
          });
        }
      });
      this.init(this.props);
    }
    // ------------------- //

  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      var optionConfig = this.props.optionConfig;

      _WFConfigBaobabMgr2.default.viewMgr.willUnMount(this);
      _WFBaobabObserver2.default.unObserve(_WFConfigBaobabMgr2.default);
      _WFConfigBaobabMgr2.default.explore(optionConfig, _Constants.WF_BAOBAB_BRANCH);
    }
  }]);
  return WFBaobabBranchView;
}(_react.Component);

// ------------------- //


exports.default = WFBaobabBranchView;
// ------------------- //

/***/ }),
/* 460 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _JSON = __webpack_require__(17);

var _Lodash = __webpack_require__(6);

var _WFBody = __webpack_require__(113);

var _WFBody2 = _interopRequireDefault(_WFBody);

var _WFSidebar = __webpack_require__(115);

var _WFSidebar2 = _interopRequireDefault(_WFSidebar);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFSectionSearch = __webpack_require__(114);

var _WFSectionSearch2 = _interopRequireDefault(_WFSectionSearch);

var _WFPagination = __webpack_require__(100);

var _WFPagination2 = _interopRequireDefault(_WFPagination);

var _WFCustomView = __webpack_require__(124);

var _WFCustomView2 = _interopRequireDefault(_WFCustomView);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SELECT FORM ------------------- //

// ------------------- //

// WFCOMPONENT

var TREE_SELECTED = "tree_selected";
var BRANCH_SELECTED = "branch_selected";

var classes = {};

var WFBaobabView = function (_Component) {
  (0, _inherits3.default)(WFBaobabView, _Component);

  function WFBaobabView(props) {
    (0, _classCallCheck3.default)(this, WFBaobabView);

    //console.error("WFBaobabView")
    //console.dir(props)

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFBaobabView.__proto__ || (0, _getPrototypeOf2.default)(WFBaobabView)).call(this, props));

    var _props$tree_selected = props.tree_selected,
        tree_selected = _props$tree_selected === undefined ? "" : _props$tree_selected,
        _props$branch_selecte = props.branch_selected,
        branch_selected = _props$branch_selecte === undefined ? "" : _props$branch_selecte;

    _this.displayName = "WFBaobabView";
    // State
    _this.state = {
      page_loader: false,
      page_search: false,
      tree_selected: tree_selected,
      branch_selected: branch_selected
    };
    return _this;
  }

  (0, _createClass3.default)(WFBaobabView, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      return _react2.default.createElement(_WFCustomView2.default, {
        sidebarVisible: false,
        sidebarPosition: "left",
        height: this.props.height,
        className: "wf-custom-view-baobab",
        bodyView: function bodyView() {
          return _this2.getBody();
        },
        sidebarView: function sidebarView() {
          return _this2.getSidebar();
        }
      });
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var _state = this.state,
          tree_selected = _state.tree_selected,
          branch_selected = _state.branch_selected;

      if ((0, _Lodash.isObject)(tree_selected) || (0, _Lodash.isObject)(branch_selected)) {
        return this.getCurrentSelection();
      } else {
        return this.getBaobab();
      }
    }
  }, {
    key: "getBaobab",
    value: function getBaobab() {
      var _this3 = this;

      var _state2 = this.state,
          page_loader = _state2.page_loader,
          page_search = _state2.page_search,
          tree_selected = _state2.tree_selected,
          branch_selected = _state2.branch_selected,
          _state2$wf_baobab_sch = _state2.wf_baobab_schema,
          wf_baobab_schema = _state2$wf_baobab_sch === undefined ? [] : _state2$wf_baobab_sch,
          wf_baobab_is_branch_archive = _state2.wf_baobab_is_branch_archive;

      var _WFUi$baobab$getWFSec = _wfui2.default.baobab.getWFSectionTitleConfig(this),
          title = _WFUi$baobab$getWFSec.title,
          counter = _WFUi$baobab$getWFSec.counter,
          counterMax = _WFUi$baobab$getWFSec.counterMax;
      //let title = "Select tree or Branch";


      var cout = counter;
      var coutMax = counterMax;
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFSectionTitle2.default,
          {
            icon: "layers",
            text: title,
            counter: cout,
            counterMax: coutMax,
            loader: page_loader,
            search: page_search
          },
          _react2.default.createElement(_WFSectionSearch2.default, {
            placeholder: "search...",
            onSearch: function onSearch(value) {
              _this3.setState({
                page_search: value === "" ? false : true
              });
              _wfui2.default.baobab.onSearch(value);
            }
          })
        ),
        _react2.default.createElement(
          "tree-archive",
          null,
          this.getTreeArchive(1)
        ),
        _react2.default.createElement(
          "branch-archive",
          null,
          this.getBranchArchive(3)
        )
      );
    }
  }, {
    key: "getCurrentSelection",
    value: function getCurrentSelection() {
      var _this4 = this;

      var _state3 = this.state,
          tree_selected = _state3.tree_selected,
          branch_selected = _state3.branch_selected;

      var title = null;
      if ((0, _Lodash.isObject)(tree_selected)) {
        var label = tree_selected.label;

        title = "tree selected \u2192 " + label;
      }
      if ((0, _Lodash.isObject)(branch_selected)) {
        var _label = branch_selected.label;

        title = "branch selected \u2192 " + _label;
      }
      return _react2.default.createElement(
        "div",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFSectionTitle2.default,
            {
              icon: "paperclip",
              text: title },
            _react2.default.createElement(_WFIcon.WFIcon, {
              icon: "cog",
              visible: false,
              className: "wf-icon-title wf-icon-title-edit"
            }),
            _react2.default.createElement(_WFIcon.WFIClose, {
              active: false,
              className: "wf-icon-title wf-icon-title-delete",
              onClick: function onClick() {
                _this4.setState({
                  tree_selected: null,
                  branch_selected: null
                });
              } })
          )
        )
      );
    }
  }, {
    key: "getTreeArchive",
    value: function getTreeArchive() {
      var _this5 = this;

      var _state4 = this.state,
          tree_selected = _state4.tree_selected,
          _state4$wf_baobab_his = _state4.wf_baobab_history,
          wf_baobab_history = _state4$wf_baobab_his === undefined ? [] : _state4$wf_baobab_his,
          _state4$wf_baobab_tre = _state4.wf_baobab_tree_rows,
          wf_baobab_tree_rows = _state4$wf_baobab_tre === undefined ? [] : _state4$wf_baobab_tre,
          _state4$wf_baobab_tre2 = _state4.wf_baobab_tree_pager,
          wf_baobab_tree_pager = _state4$wf_baobab_tre2 === undefined ? {} : _state4$wf_baobab_tre2,
          _state4$wf_baobab_cur = _state4.wf_baobab_current_tree,
          wf_baobab_current_tree = _state4$wf_baobab_cur === undefined ? {} : _state4$wf_baobab_cur;
      var _wf_baobab_tree_pager = wf_baobab_tree_pager.total,
          total = _wf_baobab_tree_pager === undefined ? 0 : _wf_baobab_tree_pager,
          _wf_baobab_tree_pager2 = wf_baobab_tree_pager.countRow,
          countRow = _wf_baobab_tree_pager2 === undefined ? 0 : _wf_baobab_tree_pager2;
      var _wf_baobab_current_tr = wf_baobab_current_tree.label,
          label = _wf_baobab_current_tr === undefined ? "" : _wf_baobab_current_tr,
          _wf_baobab_current_tr2 = wf_baobab_current_tree.options_count,
          options_count = _wf_baobab_current_tr2 === undefined ? 0 : _wf_baobab_current_tr2;

      var selected = [];
      if ((0, _Lodash.isObject)(tree_selected)) {
        var _tree_selected$id = tree_selected.id,
            id = _tree_selected$id === undefined ? null : _tree_selected$id;

        selected = [id];
      }
      return _react2.default.createElement(
        _WFTable2.default

        // Config Table -- //
        ,
        (0, _extends3.default)({
          rows: wf_baobab_tree_rows,
          opened: wf_baobab_history
        }, _wfui2.default.baobab.getWFTableConfigForTreeArchive(), {
          canDelete: false,
          canSelect: true
          // Capabilities Hook -- //
          , onSelect: function onSelect(val, optionConfig) {
            _this5.onSelect(TREE_SELECTED, optionConfig);
          },
          selected: selected
        }),
        _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
          visible: total > 1 && countRow > 0
        }, wf_baobab_tree_pager, {
          onClick: function onClick(page) {
            _wfui2.default.baobab.onFind({ page: page });
          }
        }))
      );
    }
  }, {
    key: "getBranchArchive",
    value: function getBranchArchive(level) {
      var _this6 = this;

      var branch_selected = this.state.branch_selected;

      var _WFUi$baobab$getWFLis = _wfui2.default.baobab.getWFListBranchArchiveConfig(this),
          rows = _WFUi$baobab$getWFLis.rows,
          active = _WFUi$baobab$getWFLis.active,
          visible = _WFUi$baobab$getWFLis.visible;

      var selected = [];
      if ((0, _Lodash.isObject)(branch_selected)) {
        var _branch_selected$id = branch_selected.id,
            id = _branch_selected$id === undefined ? null : _branch_selected$id;

        selected = [id];
      }
      return _react2.default.createElement(_WFTable2.default, { level: level,
        visible: visible,
        head: false

        // Config ScrollBar -- //
        , scrollAutoHide: false,
        scrollheightMax: 685,
        scrollheightMin: 0

        // Capabilities -- //
        , canSelect: true

        // Capabilities Hook -- //
        , onSelect: function onSelect(val, optionConfig) {
          _this6.onSelect(BRANCH_SELECTED, optionConfig);
        }

        // Config Cell -- //
        , cellConfig: {
          preview: true,
          previewSplit: ",",
          limit: {
            string: 25,
            text: 45,
            select: 40
          }
        }

        // Config Row -- //
        , rowConfig: {
          values: ["label", "name", "subgroups_count"],
          types: ["text", "string", "number"]
        }

        // Select Hook -- //
        , selectBy: "id",
        selected: selected

        // Rows Hook -- //
        , rows: rows
      });
    }
  }, {
    key: "getSidebar",
    value: function getSidebar() {
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement("div", { className: "dv" })
      );
    }
  }, {
    key: "onSelect",
    value: function onSelect(key, optionConfig) {
      var selected = this.state[key];
      var currentId = 0;
      var newVal = {};
      if (key === BRANCH_SELECTED) {
        newVal[TREE_SELECTED] = null;
      } else {
        newVal[BRANCH_SELECTED] = null;
      }
      if ((0, _Lodash.isObject)(selected)) {
        var _selected$id = selected.id,
            id = _selected$id === undefined ? null : _selected$id;

        currentId = id;
      }
      if (currentId === optionConfig.id) {
        newVal[key] = null;
      } else {
        newVal[key] = optionConfig;
      }
      this.setState(newVal);
      _wfui2.default.wfc.editor.onCaching(newVal);
    }
  }, {
    key: "getField",
    value: function getField(name) {
      return this.props.getField(name);
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.baobab.willMount(this);
      _wfui2.default.baobab.onInit();
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.baobab.onClear();
      _wfui2.default.baobab.willUnMount(this);
    }
  }]);
  return WFBaobabView;
}(_react.Component);

// ------------------- //


exports.default = WFBaobabView;
// ------------------- //

/***/ }),
/* 461 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

var _WFormContent = __webpack_require__(220);

var _WFormContent2 = _interopRequireDefault(_WFormContent);

var _WFCustomView = __webpack_require__(124);

var _WFCustomView2 = _interopRequireDefault(_WFCustomView);

var _WFEventTypes = __webpack_require__(16);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// WFCOMPONENT
var GLOBAL_HELPERS = ["site_name", "site_url", "admin_email", "form_title", "entry_id", "entry_created_tms", "default_message | raw", "nexus_message | raw"];

// ------------------- //

// WF MAILER FORM ------------------- //

// ------------------- //

var classes = {};

var WFMailerView = function (_Component) {
  (0, _inherits3.default)(WFMailerView, _Component);

  function WFMailerView(props) {
    (0, _classCallCheck3.default)(this, WFMailerView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFMailerView.__proto__ || (0, _getPrototypeOf2.default)(WFMailerView)).call(this, props));

    _this.displayName = "WFieldAnalyticsView";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(WFMailerView, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      return _react2.default.createElement(_WFCustomView2.default, {
        sidebarVisible: true
        //sidebarPosition={"right"}
        , height: this.props.height,
        className: "wf-custom-view-wfmailer",
        bodyView: function bodyView() {
          return _this2.getBody();
        },
        sidebarView: function sidebarView() {
          return _this2.getSidebar();
        }
      });
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var form = this.props.form;

      return _react2.default.createElement(
        "div",
        null,
        this.getMailOptions(),
        this.props.form.getDefaultContent()
      );
    }
  }, {
    key: "getMailOptions",
    value: function getMailOptions() {
      var form = this.props.form;

      var fldMailCC = this.getField("use_mail_cc");
      var fldMailBCC = this.getField("use_mail_bcc");
      return _react2.default.createElement(
        "div",
        { className: "wf-mail-options" },
        _react2.default.createElement(_WFormContent2.default, {
          key: fldMailCC.getName(),
          hidden: false,
          fieldSchema: fldMailCC.getSchema(),
          onGetInput: form.props.onGetInput,
          onField: function onField(evenType, eventArgs) {
            form.props.onField(fldMailCC.getName(), evenType, eventArgs);
          },
          customComponent: function customComponent(_ref) {
            var fieldComponent = _ref.fieldComponent,
                on = _ref.on;
            var booleanValue = fieldComponent.state.booleanValue;

            var clss = "wf-btn-toggle btn-cc ";
            if (booleanValue) {
              clss += "active";
            } else {
              clss += "not";
            }
            return _react2.default.createElement(
              "span",
              {
                className: clss,
                onClick: function onClick() {
                  on(_WFEventTypes.WF_EVENT_ONCHANGE, {
                    booleanValue: !booleanValue
                  });
                } },
              "CC"
            );
          }
        }),
        _react2.default.createElement(_WFormContent2.default, {
          key: fldMailBCC.getName(),
          hidden: false,
          fieldSchema: fldMailBCC.getSchema(),
          onGetInput: form.props.onGetInput,
          onField: function onField(evenType, eventArgs) {
            form.props.onField(fldMailBCC.getName(), evenType, eventArgs);
          },
          customComponent: function customComponent(_ref2) {
            var fieldComponent = _ref2.fieldComponent,
                on = _ref2.on;
            var booleanValue = fieldComponent.state.booleanValue;

            var clss = "wf-btn-toggle btn-bcc ";
            if (booleanValue) {
              clss += "active";
            } else {
              clss += "not";
            }
            return _react2.default.createElement(
              "span",
              {
                className: clss,
                onClick: function onClick() {
                  on(_WFEventTypes.WF_EVENT_ONCHANGE, {
                    booleanValue: !booleanValue
                  });
                } },
              "BCC"
            );
          }
        })
      );
    }
  }, {
    key: "getSidebar",
    value: function getSidebar() {
      var _props$rows = this.props.rows,
          rows = _props$rows === undefined ? [] : _props$rows;

      return _react2.default.createElement(
        "div",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            "div",
            { className: "wf-mail-helpers" },
            _react2.default.createElement(
              _WFTitle2.default,
              null,
              "Global Helpers"
            ),
            GLOBAL_HELPERS.map(function (helper, i) {
              return _react2.default.createElement(
                "span",
                { key: i },
                _react2.default.createElement("input", {
                  type: "text",
                  style: { color: "#000" },
                  readOnly: true,
                  defaultValue: "{{" + helper + "}}"
                })
              );
            })
          ),
          _react2.default.createElement(
            "div",
            { className: "wf-mail-helpers" },
            _react2.default.createElement(
              _WFTitle2.default,
              null,
              "Fields Helpers"
            ),
            rows.map(function (fieldName, i) {
              return _react2.default.createElement(
                "span",
                { key: i },
                _react2.default.createElement("input", {
                  type: "text",
                  style: { color: "#000" },
                  readOnly: true,
                  defaultValue: "{{" + fieldName + "}}"
                })
              );
            })
          )
        )
      );
    }
  }, {
    key: "getField",
    value: function getField(name) {
      return this.props.getField(name);
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {}
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {}
  }]);
  return WFMailerView;
}(_react.Component);

// ------------------- //


exports.default = WFMailerView;
// ------------------- //

/***/ }),
/* 462 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFCustomView = __webpack_require__(124);

var _WFCustomView2 = _interopRequireDefault(_WFCustomView);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var validatorTypeList = [{
  icon: "streetsign",
  name: "boolean",
  label: "Boolean Validator"
}, {
  icon: "flag",
  name: "score",
  label: "Score Validator"
}, {
  icon: "wallet",
  name: "price",
  label: "Price Validator"
}];

// WFCOMPONENT


var rowsDemo = [{
  id: 12,
  name: "pizza",
  label: "Select Your Pizza Menu"
}, {
  id: 13,
  name: "burger",
  label: "Select Your Burger Menu"
}, {
  id: 14,
  name: "fries",
  label: "Select Your French Fries"
}, {
  id: 15,
  name: "cola",
  label: "Select Your CocaCola 33cl"
}, {
  id: 16,
  name: "dessert",
  label: "Select Your Dessert Menu"
}];

/*

Display Option's Price & Total
Save Result by User's Entries
Hidden Prev Button
User can view our results

Define Fields Timer ( Chrono => second )
Define Results Strategy ( rule by result )

*/

// ------------------- //

// WF MAILER FORM ------------------- //

// ------------------- //

var classes = {};

var WFNexusStrategyView = function (_Component) {
  (0, _inherits3.default)(WFNexusStrategyView, _Component);

  function WFNexusStrategyView(props) {
    (0, _classCallCheck3.default)(this, WFNexusStrategyView);

    var _this = (0, _possibleConstructorReturn3.default)(this, (WFNexusStrategyView.__proto__ || (0, _getPrototypeOf2.default)(WFNexusStrategyView)).call(this, props));

    console.error("WFNexusStrategyView");
    console.dir(props);

    _this.displayName = "WFNexusStrategyView";
    //this.fields = props.form.formState.getFields();
    // State
    _this.state = {
      validator_type: "boolean"
    };
    return _this;
  }

  (0, _createClass3.default)(WFNexusStrategyView, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      return _react2.default.createElement(_WFCustomView2.default, {
        height: this.props.height,
        className: "wf-custom-view-nexus",
        defaultTab: 0,
        tabs: [{
          id: 0,
          label: "Global Setting",
          viewConfig: {
            sidebarVisible: true,
            className: "wf-global-setting",
            bodyView: function bodyView() {
              return _this2.getBody();
            },
            sidebarView: function sidebarView() {
              return _this2.getSidebar();
            }
          }
        }
        /* 
        ,{
          id: 1,
          label: "Chrono Setting",
          viewConfig: {
            sidebarVisible: true,
            className: "wf-chrono-setting",
          }
        },{
          id: 2,
          label: "Results strategy",
          viewConfig: {
            className: "wf-results-strategy",
          }
        }
        */
        ]
      });
    }
  }, {
    key: "getSidebar",
    value: function getSidebar() {
      var _this3 = this;

      var validator_type = this.state.validator_type;

      return _react2.default.createElement(
        "div",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(_WFSectionTitle2.default, {
            icon: "police",
            text: "Validator Type"
          }),
          _react2.default.createElement(
            "div",
            { className: "wf-section-boxed wf-list-validator" },
            _react2.default.createElement(_WFList2.default, {
              rows: validatorTypeList,
              selected: [validator_type],
              selectedBy: "name",
              selectedClassName: "wf-selected",
              onSelect: function onSelect(item) {
                _this3.setState({
                  validator_type: item.name
                });
              },
              view: function view(item, i) {
                var name = item.name,
                    icon = item.icon,
                    _item$label = item.label,
                    label = _item$label === undefined ? "" : _item$label;

                return _react2.default.createElement(
                  "span",
                  { className: "item-content" },
                  _react2.default.createElement(_WFIcon.WFIcon, { icon: icon }),
                  _react2.default.createElement(
                    _WFText2.default,
                    null,
                    label
                  )
                );
              }
            })
          )
        ),
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(_WFSectionTitle2.default, {
            icon: "cog",
            text: "Validator Settings"
          }),
          _react2.default.createElement(
            "div",
            { className: "wf-section-boxed wf-list-option" },
            _react2.default.createElement(
              "div",
              { className: "wf-item active" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-checked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "Display Option's Price & Total"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-unchecked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "Save Result by User's Entries"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-unchecked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "Hidden Prev Button"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-unchecked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "User can view our results"
              )
            )
          )
        ),
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(_WFSectionTitle2.default, {
            icon: "equalizer",
            text: "Select Fields"
          }),
          _react2.default.createElement(
            "div",
            { className: "wf-section-boxed wf-list-option" },
            _react2.default.createElement(
              "div",
              { className: "wf-item active" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-checked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "wf_simple_select"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item not" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-close" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "wf_select_baobab"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-unchecked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "wf_select_pizza"
              )
            ),
            _react2.default.createElement(
              "div",
              { className: "wf-item" },
              _react2.default.createElement(_WFIcon.WFIcon, { icon: "checkbox-unchecked" }),
              _react2.default.createElement(
                _WFText2.default,
                null,
                "wf_select_burger"
              )
            )
          )
        )
      );
    }
  }, {
    key: "getBody",
    value: function getBody() {
      var counter = 1;
      var counterMax = rowsDemo.length;
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(_WFSectionTitle2.default, {
          icon: "flag",
          text: "Explore Field to format options " + (counter > 0 ? "|" : ""),
          counter: counter,
          counterMax: counterMax
        }),
        _react2.default.createElement(
          "div",
          { className: "wf-table-fields" },
          _react2.default.createElement(_WFTable2.default, {
            level: 1,
            visible: true,
            rows: rowsDemo,
            head: false

            // Config ScrollBar -- //
            , scrollAutoHide: false
            //scrollheightMax={685}
            //scrollheightMin={0}

            // Capabilities -- //
            , canOpen: true,
            onOpen: function onOpen(val, row) {
              console.error("onOpen...");
              console.dir(row);
            }

            // Select Hook -- //
            , selectBy: "name",
            selected: []

            // Config Row -- //
            , rowConfig: {
              values: ["label"],
              types: ["text"]
            }

            // Config Cell -- //
            , cellConfig: {
              preview: true,
              previewSplit: ",",
              limit: {
                string: 25,
                text: 60,
                select: 40
              }
            }
          })
        )
      );
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {}
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {}
  }]);
  return WFNexusStrategyView;
}(_react.Component);

// ------------------- //


exports.default = WFNexusStrategyView;
// ------------------- //

/***/ }),
/* 463 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFRow = __webpack_require__(29);

var _WFRow2 = _interopRequireDefault(_WFRow);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFClear = __webpack_require__(98);

var _WFClear2 = _interopRequireDefault(_WFClear);

var _WFIcon = __webpack_require__(8);

var _wfaction = __webpack_require__(157);

var _wfaction2 = _interopRequireDefault(_wfaction);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ACTIONS BODY ------------------- //

// ------------------- //

// WFCOMPONENT
var classes = {};

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _state$actions = this.state.actions,
          actions = _state$actions === undefined ? [] : _state$actions;

      return _react2.default.createElement(
        "wf-body-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(_WFSectionTitle2.default, {
            icon: "global",
            text: "Form Actions",
            counter: actions.length
          }),
          _react2.default.createElement(_WFSep2.default, { style: { marginBottom: "60px" } }),
          _react2.default.createElement(
            _WFRow2.default,
            null,
            _react2.default.createElement(
              "div",
              { className: "wf_action_archive" },
              actions.map(function (config, i) {
                return _this2.getAction(config, i);
              }),
              _react2.default.createElement(_WFClear2.default, null)
            )
          ),
          _react2.default.createElement(_WFSep2.default, null)
        )
      );
    }
  }, {
    key: "getAction",
    value: function getAction(row, i) {
      var _id = row._id,
          action_id = row.action_id;

      if (_id && action_id) {
        var setting = _wfaction2.default.resources.get(action_id);
        var _setting$info = setting.info,
            info = _setting$info === undefined ? {} : _setting$info;
        var _info$id = info.id,
            id = _info$id === undefined ? null : _info$id,
            _info$label = info.label,
            label = _info$label === undefined ? "Publish Entry" : _info$label,
            _info$icon = info.icon,
            icon = _info$icon === undefined ? "layers" : _info$icon,
            _info$className = info.className,
            className = _info$className === undefined ? "wf_action_publish" : _info$className,
            _info$level = info.level,
            level = _info$level === undefined ? 1 : _info$level;

        var clss = className;
        if (level > 1) {
          if (i % 2) {
            clss += " left";
          } else {
            clss += " right";
          }
        }
        return _react2.default.createElement(
          _WFCol2.default,
          { key: i, md: this.getLevel(level), className: clss },
          _react2.default.createElement(
            "div",
            { className: "wf_action_tip wf_action_tip_" + level },
            _react2.default.createElement(
              "div",
              { className: "wf_action_tip_wrapper" },
              _react2.default.createElement(
                "div",
                { className: "wf_action_tip_content" },
                _react2.default.createElement(_WFIcon.WFIcon, { icon: icon }),
                _react2.default.createElement(
                  _WFText2.default,
                  null,
                  label
                )
              ),
              _react2.default.createElement(
                "div",
                { className: "wf_action_tip_actions" },
                this.getButtonDelete(row, setting),
                this.getButtonEdit(row, setting)
              )
            )
          )
        );
      } else return false;
    }
  }, {
    key: "getButtonDelete",
    value: function getButtonDelete(row, setting) {
      var _setting$info$removab = setting.info.removable,
          removable = _setting$info$removab === undefined ? false : _setting$info$removab;

      if (removable) {
        return _react2.default.createElement(
          "span",
          {
            onClick: function onClick() {
              _wfui2.default.wfc.action.onDel(row, setting);
            },
            className: "btn-delete transition" },
          _react2.default.createElement(_WFIcon.WFIClose, null)
        );
      } else {
        return false;
      }
    }
  }, {
    key: "getButtonEdit",
    value: function getButtonEdit(row, setting) {
      var _setting$info$editabl = setting.info.editable,
          editable = _setting$info$editabl === undefined ? false : _setting$info$editabl;

      if (editable) {
        return _react2.default.createElement(
          "span",
          {
            onClick: function onClick() {
              _wfui2.default.wfc.action.onEdit(row, setting);
            },
            className: "btn-edit transition" },
          _react2.default.createElement(_WFIcon.WFIEdit, null)
        );
      } else {
        return false;
      }
    }
  }, {
    key: "getLevel",
    value: function getLevel(level) {
      switch (level) {
        case 1:
          return 12;
        case 2:
          return 6;
        case 3:
          return 4;
      }
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfaction2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfaction2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfaction2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 464 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfaction = __webpack_require__(157);

var _wfaction2 = _interopRequireDefault(_wfaction);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ACTIONS SIDEBAR ------------------- //

// ------------------- //

// WFCOMPONENT
var classes = {};

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFTitle2.default,
            { top: 10 },
            "Form Actions"
          ),
          _react2.default.createElement(_WFList2.default, {
            rowsClassName: "wf-action",
            rows: _wfaction2.default.resources.getList(),
            view: function view(row, i) {
              var _row$info = row.info,
                  info = _row$info === undefined ? {} : _row$info;
              var _info$label = info.label,
                  label = _info$label === undefined ? "" : _info$label,
                  _info$icon = info.icon,
                  icon = _info$icon === undefined ? "" : _info$icon,
                  _info$selectable = info.selectable,
                  selectable = _info$selectable === undefined ? true : _info$selectable;

              var clss = "item-content";
              if (!selectable) {
                clss += " not";
              }
              return _react2.default.createElement(
                "span",
                {
                  className: clss,
                  onClick: function onClick() {
                    if (selectable) {
                      _wfui2.default.wfc.action.onCreate(row);
                    }
                  }
                },
                _react2.default.createElement(_WFIcon.WFIcon, { icon: icon, className: "first" }),
                _react2.default.createElement(
                  "span",
                  { className: "item-top left" },
                  _react2.default.createElement(
                    _WFText2.default,
                    null,
                    label
                  ),
                  _react2.default.createElement(_WFIcon.WFIAdd, null)
                )
              );
            }
          })
        )
      );
    }
    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.wfc.action.onInit();
      _wfaction2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfaction2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      //WFUi.wfc.action.onClear();
      _wfaction2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 465 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFClear = __webpack_require__(98);

var _WFClear2 = _interopRequireDefault(_WFClear);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFTabs = __webpack_require__(116);

var _WFTabs2 = _interopRequireDefault(_WFTabs);

var _WFBoxed = __webpack_require__(210);

var _WFBoxed2 = _interopRequireDefault(_WFBoxed);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFScrollBars = __webpack_require__(33);

var _WFScrollBars2 = _interopRequireDefault(_WFScrollBars);

var _WFChartistGraph = __webpack_require__(211);

var _WFChartistGraph2 = _interopRequireDefault(_WFChartistGraph);

var _WFIcon = __webpack_require__(8);

var _wfanalytics = __webpack_require__(120);

var _wfanalytics2 = _interopRequireDefault(_wfanalytics);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// WFCOMPONENT
var WEEK = 1;
var MONTH = 2;
var YEAR = 3;

// ------------------- //

// WF ANALYTICS BODY ------------------- //

// ------------------- //

var classes = {};

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    var _this$state;

    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    _this.state = (_this$state = {}, (0, _defineProperty3.default)(_this$state, WEEK, false), (0, _defineProperty3.default)(_this$state, MONTH, false), (0, _defineProperty3.default)(_this$state, YEAR, false), _this$state);
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        "wf-body-data",
        null,
        this.getTabs(),
        this.getFormAnalytics(),
        this.getFieldAnalytics()
      );
    }

    // FIELDS ANALYTICS ----------- //

  }, {
    key: "getFieldAnalytics",
    value: function getFieldAnalytics() {
      var _state = this.state,
          page_loader = _state.page_loader,
          _state$fields = _state.fields,
          fields = _state$fields === undefined ? [] : _state$fields,
          currentField = _state.currentField,
          currentFieldValue = _state.currentFieldValue,
          currentOptionLabels = _state.currentOptionLabels,
          currentOptionSeries = _state.currentOptionSeries;

      var sum = function sum(a, b) {
        return a + b;
      };
      var data = {
        labels: currentOptionLabels, // ['Chrome', 'Firefox', 'Android', 'AppleWebkit', 'Safari', 'MSIE', 'Opera', 'Unknown', 'WhatsApp', 'Opera Next', 'Others' ],
        series: currentOptionSeries // [ 2500, 1600, 1200, 400, 350, 200, 150, 150, 150, 150, 150 ]
      };
      var _currentFieldValue$la = currentFieldValue.label,
          label = _currentFieldValue$la === undefined ? "" : _currentFieldValue$la;

      return _react2.default.createElement(
        _WFSection2.default,
        {
          visible: this.isTab(_Constants.TAB_ANALYTICS_FIELDS)
        },
        _react2.default.createElement(_WFSectionTitle2.default, {
          icon: "piechart",
          text: "field : " + label,
          loader: page_loader,
          loaderText: "Chargement en cours..."
        }),
        _react2.default.createElement(_WFSep2.default, null),
        _react2.default.createElement(
          _WFBoxed2.default,
          null,
          _react2.default.createElement(
            _WFCol2.default,
            { md: 7 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                _WFTitle2.default,
                null,
                "field'options stats"
              ),
              _react2.default.createElement(_WFChartistGraph2.default, {
                data: data,
                type: 'Pie',
                wrapperClassName: "wf--chart-pie",
                options: {
                  height: '500px',
                  donut: true,
                  donutWidth: 120,
                  startAngle: 270,
                  labelInterpolationFnc: function labelInterpolationFnc(value, index) {
                    var num = Math.round(data.series[index] / data.series.reduce(sum) * 100);
                    return num >= 5 ? num + "%" : ''; //`${value} ${num}%`;
                  }
                }
              })
            )
          ),
          _react2.default.createElement(
            _WFCol2.default,
            { md: 5 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                "div",
                { className: "wf--chart wf--chart-pie" },
                _react2.default.createElement(
                  _WFScrollBars2.default,
                  {
                    className: "wf-scrollbar-chart",
                    style: {
                      width: '100%',
                      height: '562px',
                      background: "none !important"
                    }
                  },
                  _react2.default.createElement(_WFList2.default, {
                    rows: data.labels,
                    rowsClassName: "wf-fields-options",
                    view: function view(label, i) {
                      var num = Math.round(data.series[i] / data.series.reduce(sum) * 100);
                      var purcentage = num + "%";
                      return _react2.default.createElement(
                        "div",
                        { className: "wf--chart--option" },
                        _react2.default.createElement("span", { className: "wf--color wf--color-" + i }),
                        _react2.default.createElement("span", { className: "wf--value", dangerouslySetInnerHTML: { __html: purcentage } }),
                        _react2.default.createElement(
                          "span",
                          { className: "wf--label" },
                          label
                        )
                      );
                    }
                  })
                )
              )
            )
          )
        )
      );
    }

    // FORM ANALYTICS ----------- //

  }, {
    key: "getFormAnalytics",
    value: function getFormAnalytics() {
      var _state2 = this.state,
          page_loader = _state2.page_loader,
          days = _state2.days,
          months = _state2.months,
          monthWeeks = _state2.monthWeeks,
          currentYear = _state2.currentYear,
          currentMonth = _state2.currentMonth,
          currentWeek = _state2.currentWeek,
          yearResult = _state2.yearResult,
          monthResult = _state2.monthResult,
          weekResult = _state2.weekResult,
          viewByYear = _state2.viewByYear,
          completedByYear = _state2.completedByYear,
          uncompletedByYear = _state2.uncompletedByYear,
          viewByMonth = _state2.viewByMonth,
          completedByMonth = _state2.completedByMonth,
          uncompletedByMonth = _state2.uncompletedByMonth,
          weeksLabel = _state2.weeksLabel,
          viewByWeek = _state2.viewByWeek,
          completedByWeek = _state2.completedByWeek,
          uncompletedByWeek = _state2.uncompletedByWeek;


      var monthWeekRows = monthWeeks.map(function (n) {
        return "Week " + n;
      });

      return _react2.default.createElement(
        _WFSection2.default,
        {
          visible: this.isTab(_Constants.TAB_ANALYTICS_FORM)
        },
        _react2.default.createElement(_WFSectionTitle2.default, {
          icon: "linegraph",
          text: "Form Monitoring",
          loader: page_loader,
          loaderText: "Chargement en cours..."
        }),
        _react2.default.createElement(_WFSep2.default, null),
        _react2.default.createElement(
          _WFBoxed2.default,
          { className: "wf-analytics-form" },
          _react2.default.createElement(
            _WFCol2.default,
            null,
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                _WFTitle2.default,
                null,
                "stats for year ",
                currentYear
              ),
              _react2.default.createElement(_WFChartistGraph2.default, {
                type: 'Line',
                options: {
                  height: '250px',
                  seriesBarDistance: 20,
                  low: 0,
                  showArea: true
                },
                data: {
                  labels: months,
                  series: [viewByYear, completedByYear]
                }
              }),
              this.getToggleButton(YEAR),
              this.getChartLegend(YEAR, months, [viewByYear, completedByYear, uncompletedByYear])
            )
          ),
          _react2.default.createElement(
            _WFCol2.default,
            { lg: 6 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                _WFTitle2.default,
                null,
                "stats for month ",
                months[currentMonth]
              ),
              _react2.default.createElement(_WFChartistGraph2.default, {
                type: 'Bar',
                options: {
                  height: '240px',
                  seriesBarDistance: 10
                },
                data: {
                  labels: monthWeekRows,
                  series: [viewByMonth, completedByMonth]
                }
              }),
              this.getToggleButton(MONTH),
              this.getChartLegend(MONTH, monthWeekRows, [viewByMonth, completedByMonth, uncompletedByMonth])
            )
          ),
          _react2.default.createElement(
            _WFCol2.default,
            { lg: 6 },
            _react2.default.createElement(
              _WFSection2.default,
              null,
              _react2.default.createElement(
                _WFTitle2.default,
                null,
                "stats for week ",
                currentWeek
              ),
              _react2.default.createElement(_WFChartistGraph2.default, {
                type: 'Bar',
                wrapperClassName: "wf--chart-horizontale",
                options: {
                  height: '240px',
                  seriesBarDistance: 6,
                  reverseData: false,
                  horizontalBars: true
                },
                data: {
                  labels: weeksLabel,
                  series: [viewByWeek, completedByWeek]
                }
              }),
              this.getToggleButton(WEEK),
              this.getChartLegend(WEEK, weeksLabel, [viewByWeek, completedByWeek, uncompletedByWeek])
            )
          ),
          _react2.default.createElement(_WFSep2.default, { type: 1 })
        )
      );
    }
  }, {
    key: "getChartData",
    value: function getChartData(labels, view, completed, uncompleted) {
      return {
        labels: labels,
        series: [view, completed, uncompleted]
      };
    }
  }, {
    key: "getToggleButton",
    value: function getToggleButton(key) {
      var _this2 = this;

      var status = this.state[key];
      return _react2.default.createElement(
        "div",
        {
          className: "wf-analytics-toggle-btn " + (status ? "active" : ""),
          onClick: function onClick() {
            _this2.setState((0, _defineProperty3.default)({}, key, !status));
          }
        },
        _react2.default.createElement(_WFIcon.WFIAdd, null)
      );
    }
  }, {
    key: "getChartLegend",
    value: function getChartLegend(key, labels) {
      var series = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];

      var status = this.state[key];
      if (!status) {
        return false;
      } else {
        var viewRows = series[0];
        var completedRows = series[1];
        var uncompletedRows = series[2];
        var view = { label: "View / visit" };
        var completed = { label: "Completed / visit" };
        var uncompleted = { label: "Uncompleted / visit" };
        labels.map(function (key, i) {
          view[key] = viewRows[i] ? viewRows[i] : "";
          completed[key] = completedRows[i] ? completedRows[i] : "";
          //uncompleted[key] = uncompletedRows[i] ? uncompletedRows[i] : "";
        });
        return _react2.default.createElement(_WFTable2.default
        // Config Table -- //
        , { visible: true,
          head: true,
          level: 0
          // Rows Hook -- //
          , rows: [view, completed],
          rowConfig: {
            labels: (0, _concat2.default)(["label"], labels),
            values: (0, _concat2.default)(["label"], labels),
            types: (0, _concat2.default)(["string"], labels.map(function (r) {
              return "number";
            }))
          }

          // Config Cell -- //
          , cellConfig: {
            preview: true,
            previewSplit: ",",
            limit: {
              string: 25,
              text: 40,
              select: 40
            }
          }
        });
      }
    }

    // ------------------- //

    // TAB NAV ------------------- //

    // ------------------- //

  }, {
    key: "getTabs",
    value: function getTabs() {
      return _react2.default.createElement(_WFTabs2.default, {
        view: true,
        visible: true,
        tabId: this.state.tab_id,
        editable: false,
        selectedBy: _Constants.WF_SELECT_BY_NAME,
        selected: [this.getCurrentTab()],
        onSelect: function onSelect(_ref, tabs) {
          var name = _ref.name;

          tabs.setState({
            selected: [name]
          });
          _wfui2.default.wfc.analytics.onSelectTab(name);
        },
        schema: [{
          name: _Constants.TAB_ANALYTICS_FORM,
          label: _Constants.TAB_ANALYTICS_FORM_LABEL
        }, {
          name: _Constants.TAB_ANALYTICS_FIELDS,
          label: _Constants.TAB_ANALYTICS_FIELDS_LABEL
        }]
      });
    }

    // ------------------- //

  }, {
    key: "isTab",
    value: function isTab(tabName) {
      return this.getCurrentTab() === tabName;
    }

    // ------------------- //

  }, {
    key: "getCurrentTab",
    value: function getCurrentTab() {
      var _state$tabName = this.state.tabName,
          tabName = _state$tabName === undefined ? _Constants.TAB_ANALYTICS_FORM : _state$tabName;

      return tabName;
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfanalytics2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfanalytics2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfanalytics2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 466 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _stringify = __webpack_require__(104);

var _stringify2 = _interopRequireDefault(_stringify);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFMoment = __webpack_require__(48);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfanalytics = __webpack_require__(120);

var _wfanalytics2 = _interopRequireDefault(_wfanalytics);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ANALYTICS SIDEBAR ------------------- //

// ------------------- //

var classes = {
  visible: "",
  hidden: "hidden"
};

// WFCOMPONENT

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        this.getDebug(),
        _react2.default.createElement(
          "span",
          { className: "" + this.isTab(_Constants.TAB_ANALYTICS_FIELDS) },
          this.getFieldArchive()
        ),
        _react2.default.createElement(
          "span",
          { className: "" + this.isTab(_Constants.TAB_ANALYTICS_FORM) },
          this.getListYears(),
          this.getListMonths(),
          this.getListWeeks(),
          this.getListLegend()
        ),
        this.getDebugState()
      );
    }

    // ------------------- //

    // TAB FORM ----------- //

    // ------------------- //

  }, {
    key: "getListYears",
    value: function getListYears() {
      var _state = this.state,
          year = _state.year,
          startYear = _state.startYear,
          endYear = _state.endYear,
          currentYear = _state.currentYear;

      var years = [];
      var yearSelectable = [];
      var countYears = 1;
      if (startYear !== endYear) {
        countYears = endYear - startYear;
      }
      for (var i = 0; i < countYears; i++) {
        var value = startYear + i;
        years.push({ value: value });
        yearSelectable.push(value);
      }
      if (countYears <= 2) {
        years.unshift({ value: startYear - 1 });
      }
      if (countYears === 1) {
        years.push({ value: endYear + 1 });
      }
      if (countYears <= 2) {
        years.push({ value: endYear + 2 });
      }
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFTitle2.default,
          { top: 10 },
          "Select Year"
        ),
        _react2.default.createElement(_WFList2.default, {
          rows: years,
          className: "list-date list-years",
          selected: [currentYear],
          selectedBy: "value",
          selectable: true,
          selectableRows: yearSelectable,
          onSelect: function onSelect(_ref, i) {
            var value = _ref.value;

            if (yearSelectable.includes(value)) {
              _wfui2.default.wfc.analytics.onSelectYear(value);
            }
          },
          view: function view(_ref2, i) {
            var value = _ref2.value;

            return _react2.default.createElement(
              "span",
              { className: "item-text" },
              value
            );
          }
        })
      );
    }

    // ------------------- //

  }, {
    key: "getListMonths",
    value: function getListMonths() {
      var _state2 = this.state,
          months = _state2.months,
          startMonth = _state2.startMonth,
          endMonth = _state2.endMonth,
          currentMonth = _state2.currentMonth;

      var monthSelectable = [];
      var rows = months.map(function (m, i) {
        if (i >= startMonth && i <= endMonth) {
          monthSelectable.push(i);
        }
        return {
          value: i,
          label: m
        };
      });
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFTitle2.default,
          null,
          "Select Month"
        ),
        _react2.default.createElement(_WFList2.default, {
          className: "list-date list-month",
          selected: [currentMonth],
          selectedBy: "value",
          selectable: true,
          selectableRows: monthSelectable,
          rows: rows,
          view: function view(_ref3, i) {
            var label = _ref3.label;

            return _react2.default.createElement(
              "span",
              { className: "item-text" },
              label
            );
          },
          onSelect: function onSelect(_ref4) {
            var value = _ref4.value;

            if (monthSelectable.includes(value)) {
              _wfui2.default.wfc.analytics.onSelectMonth(value);
            }
          }
        })
      );
    }

    // ------------------- //

  }, {
    key: "getListWeeks",
    value: function getListWeeks() {
      var _state3 = this.state,
          startWeek = _state3.startWeek,
          endWeek = _state3.endWeek,
          currentWeek = _state3.currentWeek,
          currentYear = _state3.currentYear;

      var weekSelectable = [];
      var ISOWeekRows = (0, _WFMoment.getISOWeekRows)(currentYear);
      var rows = ISOWeekRows.map(function (n) {
        var value = n;
        if (startWeek <= n && endWeek >= n) {
          weekSelectable.push(n);
        }
        return { value: value };
      });
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFTitle2.default,
          null,
          "Select Weeks"
        ),
        _react2.default.createElement(_WFList2.default, {
          rows: rows,
          className: "list-date list-week",
          selected: [currentWeek],
          selectedBy: "value",
          selectable: true,
          selectableRows: weekSelectable,
          view: function view(_ref5, i) {
            var value = _ref5.value;

            return _react2.default.createElement(
              "span",
              { className: "item-text" },
              value
            );
          },
          onSelect: function onSelect(_ref6) {
            var value = _ref6.value;

            if (weekSelectable.includes(value)) {
              _wfui2.default.wfc.analytics.onSelectWeek(value);
            }
          }
        })
      );
    }

    // ------------------- //

  }, {
    key: "getListLegend",
    value: function getListLegend() {
      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFTitle2.default,
          { top: 10 },
          "Legend List"
        ),
        _react2.default.createElement(_WFList2.default, {
          view: function view(item, i) {
            var _item$label = item.label,
                label = _item$label === undefined ? "" : _item$label;

            return _react2.default.createElement(
              "span",
              { className: "item-content" },
              _react2.default.createElement(
                "span",
                { className: "item-marker" },
                _react2.default.createElement("span", null)
              ),
              _react2.default.createElement(
                "span",
                { className: "item-text" },
                label
              )
            );
          },
          rowsClassName: "wf-legend",
          rows: [{ label: "View by Visitor", className: "wf-legend-visitor" }, { label: "Form completed", className: "wf-legend-completed" }]
        })
      );
    }

    // ------------------- //

    // TAB FIELDS ----------- //

    // ------------------- //

  }, {
    key: "getFieldArchive",
    value: function getFieldArchive() {
      var _state4 = this.state,
          _state4$fields = _state4.fields,
          fields = _state4$fields === undefined ? [] : _state4$fields,
          _state4$currentField = _state4.currentField,
          currentField = _state4$currentField === undefined ? null : _state4$currentField;

      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          _WFTitle2.default,
          { top: 10 },
          "Select Field"
        ),
        _react2.default.createElement(_WFList2.default, {
          rows: fields,
          rowsClassName: "wf-table-col",
          onSelect: function onSelect(field) {
            _wfui2.default.wfc.analytics.onSelectField(field);
          },
          view: function view(field, i) {
            var entry_id = field.entry_id,
                _field$label = field.label,
                label = _field$label === undefined ? "" : _field$label;

            var visible = currentField === entry_id;
            return _react2.default.createElement(
              "span",
              { className: "item-content" },
              _react2.default.createElement("span", { className: "item-visible " + (!visible ? "not" : "") }),
              _react2.default.createElement(
                "span",
                { className: "item-top left" },
                _react2.default.createElement(
                  _WFText2.default,
                  null,
                  label
                ),
                _react2.default.createElement(_WFIcon.WFIVisible, { visible: visible })
              )
            );
          }
        })
      );
    }

    // ------------------- //

  }, {
    key: "isTab",
    value: function isTab(tabName) {
      return this.getCurrentTab() === tabName ? classes.visible : classes.hidden;
    }

    // ------------------- //

  }, {
    key: "getCurrentTab",
    value: function getCurrentTab() {
      var _state$tabName = this.state.tabName,
          tabName = _state$tabName === undefined ? _Constants.TAB_ANALYTICS_FORM : _state$tabName;

      return tabName;
    }

    // DEBUG ------------------- //

  }, {
    key: "getDebug",
    value: function getDebug() {
      return false;
      var _state5 = this.state,
          _state5$endYear = _state5.endYear,
          endYear = _state5$endYear === undefined ? null : _state5$endYear,
          _state5$endMonth = _state5.endMonth,
          endMonth = _state5$endMonth === undefined ? null : _state5$endMonth,
          _state5$endWeek = _state5.endWeek,
          endWeek = _state5$endWeek === undefined ? null : _state5$endWeek,
          _state5$currentYear = _state5.currentYear,
          currentYear = _state5$currentYear === undefined ? null : _state5$currentYear,
          _state5$currentMonth = _state5.currentMonth,
          currentMonth = _state5$currentMonth === undefined ? null : _state5$currentMonth,
          _state5$currentWeek = _state5.currentWeek,
          currentWeek = _state5$currentWeek === undefined ? null : _state5$currentWeek,
          _state5$yearResult = _state5.yearResult,
          yearResult = _state5$yearResult === undefined ? null : _state5$yearResult,
          _state5$monthResult = _state5.monthResult,
          monthResult = _state5$monthResult === undefined ? null : _state5$monthResult,
          _state5$weekResult = _state5.weekResult,
          weekResult = _state5$weekResult === undefined ? null : _state5$weekResult,
          _state5$startMonth = _state5.startMonth,
          startMonth = _state5$startMonth === undefined ? null : _state5$startMonth,
          _state5$days = _state5.days,
          days = _state5$days === undefined ? null : _state5$days,
          _state5$viewByWeek = _state5.viewByWeek,
          viewByWeek = _state5$viewByWeek === undefined ? null : _state5$viewByWeek,
          _state5$completedByWe = _state5.completedByWeek,
          completedByWeek = _state5$completedByWe === undefined ? null : _state5$completedByWe,
          _state5$uncompletedBy = _state5.uncompletedByWeek,
          uncompletedByWeek = _state5$uncompletedBy === undefined ? null : _state5$uncompletedBy,
          _state5$weeksLabel = _state5.weeksLabel,
          weeksLabel = _state5$weeksLabel === undefined ? null : _state5$weeksLabel;


      return _react2.default.createElement(
        _WFSection2.default,
        {
          visible: true
        },
        _react2.default.createElement(
          _WFTitle2.default,
          null,
          "DEBUG"
        ),
        _react2.default.createElement(
          "wf-debugger",
          null,
          _react2.default.createElement(
            "div",
            null,
            _react2.default.createElement(
              "pre",
              null,
              (0, _stringify2.default)({ startMonth: startMonth, endMonth: endMonth }, 0, 2)
            )
          )
        )
      );
    }
  }, {
    key: "getDebugState",
    value: function getDebugState() {
      return false;
      return _react2.default.createElement(
        _WFSection2.default,
        {
          visible: true
        },
        _react2.default.createElement(
          _WFTitle2.default,
          null,
          "DEBUG"
        ),
        _react2.default.createElement(
          "wf-debugger",
          null,
          _react2.default.createElement(
            "div",
            null,
            _react2.default.createElement(
              "pre",
              null,
              "analytics : ",
              (0, _stringify2.default)(this.state, 0, 2)
            )
          )
        )
      );
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.wfc.analytics.onInit();
      _wfanalytics2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfanalytics2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.wfc.analytics.onClear();
      _wfanalytics2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 467 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFSectionSearch = __webpack_require__(114);

var _WFSectionSearch2 = _interopRequireDefault(_WFSectionSearch);

var _WFPagination = __webpack_require__(100);

var _WFPagination2 = _interopRequireDefault(_WFPagination);

var _wfentry = __webpack_require__(160);

var _wfentry2 = _interopRequireDefault(_wfentry);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF ENTRIES BODY ------------------- // 

// ------------------- //

var classes = {};

// WFCOMPONENT

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    // State
    _this.state = {
      page_search: false,
      page_loader: false,
      page_search_filter: null
    };
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _state = this.state,
          page_loader = _state.page_loader,
          page_search = _state.page_search,
          page_search_filter = _state.page_search_filter,
          _state$entries = _state.entries,
          entries = _state$entries === undefined ? [] : _state$entries,
          _state$entries_select = _state.entries_selected,
          entries_selected = _state$entries_select === undefined ? [] : _state$entries_select,
          _state$entries_pager = _state.entries_pager,
          entries_pager = _state$entries_pager === undefined ? {} : _state$entries_pager,
          _state$fields_name = _state.fields_name,
          fields_name = _state$fields_name === undefined ? [] : _state$fields_name;
      var _entries_pager$totalR = entries_pager.totalRow,
          totalRow = _entries_pager$totalR === undefined ? 0 : _entries_pager$totalR,
          _entries_pager$countC = entries_pager.countCursor,
          countCursor = _entries_pager$countC === undefined ? 0 : _entries_pager$countC;

      var counter = countCursor;
      var title = "Entries Archives";
      var countSelected = entries_selected.length;
      if (countSelected > 0) {
        counter = countSelected;
        title = "Entries selected";
      }

      return _react2.default.createElement(
        "wf-body-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFSectionTitle2.default,
            {
              icon: "layers",
              text: title + " " + (counter > 0 ? "|" : ""),
              counter: counter,
              counterMax: totalRow,
              loader: page_loader,
              search: page_search
            },
            _react2.default.createElement(_WFSectionSearch2.default, {
              visible: _wfui2.default.wfc.entry.canFilterCols(),
              placeholder: "search...",
              filters: fields_name,
              onFilter: function onFilter(filter) {
                _this2.setState({
                  page_search_filter: filter
                });
                _wfentry2.default.queryMrg.setOrderBy(filter);
              },
              onSearch: function onSearch(value) {
                _this2.setState({
                  page_search: value === "" ? false : true
                });
                _wfui2.default.wfc.entry.onSearch(value, page_search_filter);
              }
            })
          ),
          _react2.default.createElement(_WFSep2.default, null),
          this.getArchive()
        )
      );
    }
  }, {
    key: "getArchive",
    value: function getArchive() {
      var _state2 = this.state,
          _state2$entries = _state2.entries,
          entries = _state2$entries === undefined ? [] : _state2$entries,
          _state2$entries_selec = _state2.entries_selected,
          entries_selected = _state2$entries_selec === undefined ? [] : _state2$entries_selec,
          _state2$entries_pager = _state2.entries_pager,
          entries_pager = _state2$entries_pager === undefined ? {} : _state2$entries_pager,
          _state2$fields_search = _state2.fields_searchable,
          fields_searchable = _state2$fields_search === undefined ? [] : _state2$fields_search,
          _state2$fields_name = _state2.fields_name,
          fields_name = _state2$fields_name === undefined ? [] : _state2$fields_name,
          _state2$fields_type = _state2.fields_type,
          fields_type = _state2$fields_type === undefined ? [] : _state2$fields_type,
          _state2$current_filte = _state2.current_filter,
          current_filter = _state2$current_filte === undefined ? [] : _state2$current_filte;
      var _entries_pager$total = entries_pager.total,
          total = _entries_pager$total === undefined ? 0 : _entries_pager$total,
          _entries_pager$countR = entries_pager.countRow,
          countRow = _entries_pager$countR === undefined ? 0 : _entries_pager$countR;

      var options = {};

      // Filterable Cols
      if (_wfui2.default.wfc.entry.canFilterCols()) {
        options = (0, _assign2.default)({
          colFilter: current_filter,
          colFilters: _wfui2.default.wfc.entry.getColFilterableSchema(fields_name, current_filter)
        });
      }

      return _react2.default.createElement(
        _WFTable2.default
        // Config Table -- //
        ,
        (0, _extends3.default)({ visible: true,
          head: true,
          level: 0

          // Rows Hook -- //
          , rows: entries

          // Select Hook -- //
          , selectBy: "id",
          selected: entries_selected

          // Capabilities -- //
          , canEdit: true,
          canSelect: true

          // Capabilities Hook -- //
          , onEdit: function onEdit(val, row) {
            _wfui2.default.wfc.entry.onEdit(row);
          },
          onSelect: function onSelect(val, row) {
            _wfui2.default.wfc.entry.onSelect(row);
          }

          // Config Cell -- //
          , cellConfig: {
            preview: true,
            previewSplit: ",",
            limit: {
              string: 25,
              text: 40,
              select: 40
            }
          }

          // Filterable Cols
          //colFilter={current_filter}
          //colFilters={WFUi.wfc.entry.getColFilterableSchema(fields_name, current_filter)}

          // Editable Cells
          , cellCallbacks: _wfui2.default.wfc.entry.getColEditableSchema(fields_name),
          rowConfig: {
            labels: (0, _concat2.default)(["id", "modified"], fields_name),
            values: (0, _concat2.default)(["id", "modified_tms"], fields_name),
            types: (0, _concat2.default)(["id", "date"], fields_type)
          }

        }, options),
        _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
          visible: total > 1 && countRow > 0
        }, entries_pager, {
          onClick: function onClick(page) {
            _wfui2.default.wfc.entry.onFind({ page: page });
          }
        }))
      );
    }
    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfentry2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfentry2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfentry2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 468 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfentry = __webpack_require__(160);

var _wfentry2 = _interopRequireDefault(_wfentry);

var _WFormManagers = __webpack_require__(30);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// SIDEBAR ------------------- //

// ------------------- //

// WFCOMPONENT
var classes = {
  action: {
    delete: "wf-btn-red wf-btn-large",
    import: "wf-btn-yellow wf-btn-large",
    export: "wf-btn-yellow wf-btn-large"
  }
};

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        this.getSectionFilter(),
        this.getSectionActions()
      );
    }
  }, {
    key: "getSectionActions",
    value: function getSectionActions() {
      var _state = this.state,
          _state$entries = _state.entries,
          entries = _state$entries === undefined ? [] : _state$entries,
          _state$entries_select = _state.entries_selected,
          entries_selected = _state$entries_select === undefined ? [] : _state$entries_select,
          _state$has_entries = _state.has_entries,
          has_entries = _state$has_entries === undefined ? false : _state$has_entries,
          _state$has_entries_se = _state.has_entries_selected,
          has_entries_selected = _state$has_entries_se === undefined ? false : _state$has_entries_se,
          _state$count_entries_ = _state.count_entries_selected,
          count_entries_selected = _state$count_entries_ === undefined ? 0 : _state$count_entries_;

      var countSelected = entries_selected.length;
      if (entries.length === 0) {
        return false;
      } else {
        return _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFTitle2.default,
            {
              top: 10 },
            "Entries Actions",
            _react2.default.createElement(_WFCounter2.default, { counter: countSelected })
          ),
          _react2.default.createElement(
            _WFBtn2.default,
            {
              visible: countSelected > 0,
              className: classes.action.delete,
              onClick: function onClick() {
                _wfui2.default.wfc.entry.onDel();
              }
            },
            "Delete"
          ),
          _react2.default.createElement(
            _WFBtn2.default,
            {
              visible: false,
              className: classes.action.import,
              onClick: function onClick() {
                return console.error('Import');
              }
            },
            "CSV Import"
          ),
          _react2.default.createElement(
            _WFBtn2.default,
            {
              visible: false
              //visible={countSelected === 0}
              , className: classes.action.export,
              onClick: function onClick() {
                return console.error('CSV Export');
              }
            },
            "CSV Export"
          )
        );
      }
    }
  }, {
    key: "getSectionFilter",
    value: function getSectionFilter() {
      var _state2 = this.state,
          _state2$entries = _state2.entries,
          entries = _state2$entries === undefined ? [] : _state2$entries,
          _state2$entries_selec = _state2.entries_selected,
          entries_selected = _state2$entries_selec === undefined ? [] : _state2$entries_selec,
          _state2$fields_name = _state2.fields_name,
          fields_name = _state2$fields_name === undefined ? [] : _state2$fields_name,
          _state2$fields_search = _state2.fields_searchable,
          fields_searchable = _state2$fields_search === undefined ? [] : _state2$fields_search;

      if (entries.length === 0 || entries_selected.length > 0) {
        return false;
      } else {
        return _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFTitle2.default,
            { top: 10 },
            "Filter Column"
          ),
          _react2.default.createElement(_WFList2.default, {
            selected: [10],
            selectedBy: "label",
            selectable: true,
            rowsClassName: "wf-table-col",
            rows: fields_searchable,
            onSelect: function onSelect(fieldName, i) {
              _wfui2.default.wfc.entry.onFilterFieldSearchable(fieldName);
            },
            view: function view(fieldName, i) {
              var visible = fields_name.includes(fieldName);
              return _react2.default.createElement(
                "span",
                { className: "item-content" },
                _react2.default.createElement("span", { className: "item-visible " + (!visible ? "not" : "") }),
                _react2.default.createElement(
                  "span",
                  { className: "item-top left" },
                  _react2.default.createElement(
                    _WFText2.default,
                    null,
                    fieldName
                  ),
                  _react2.default.createElement(_WFIcon.WFIVisible, { visible: visible }),
                  _react2.default.createElement(_WFIcon.WFIcon, {
                    icon: visible ? "eye2" : "eye-blocked",
                    className: visible ? "active" : "not"
                  })
                )
              );
            }
          })
        );
      }
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.wfc.entry.onInit();
      _wfentry2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfentry2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.wfc.entry.onClear();
      _wfentry2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 469 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFBtnGroup = __webpack_require__(97);

var _WFBtnGroup2 = _interopRequireDefault(_WFBtnGroup);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF HEADER ------------------- //

// ------------------- // 

var classes = {
	services: "wf-list-services",
	actions: "wf-list-actions pull-right"
};

// ------------------- //

var Header = function (_Component) {
	(0, _inherits3.default)(Header, _Component);

	// ------------------- //

	function Header(props) {
		(0, _classCallCheck3.default)(this, Header);

		var _this = (0, _possibleConstructorReturn3.default)(this, (Header.__proto__ || (0, _getPrototypeOf2.default)(Header)).call(this, props));

		_this.displayName = "Header";
		_this.state = {};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(Header, [{
		key: "render",
		value: function render() {
			return _react2.default.createElement(
				"wf-header-data",
				null,
				this.getServices(),
				this.getActions()
			);
		}

		// ------------------- //

	}, {
		key: "getServices",
		value: function getServices() {
			var _state$wfc_published = this.state.wfc_published,
			    wfc_published = _state$wfc_published === undefined ? false : _state$wfc_published;

			var _getServicesConfig = this.getServicesConfig(),
			    schema1 = _getServicesConfig.schema1,
			    schema2 = _getServicesConfig.schema2;

			return _react2.default.createElement(
				"div",
				{ className: classes.services },
				_react2.default.createElement(_WFBtnGroup2.default, {
					visible: true,
					selected: this.getState(_Constants.WF_VIEW_TAB_CURRENT),
					selectedBy: _Constants.WF_SELECT_BY_NAME,
					selectedClassName: _Constants.WF_SELECT_CLASS,
					schema: schema1
				}),
				_react2.default.createElement(_WFBtnGroup2.default, {
					visible: wfc_published,
					selected: this.getState(_Constants.WF_VIEW_TAB_CURRENT),
					selectedBy: _Constants.WF_SELECT_BY_NAME,
					selectedClassName: _Constants.WF_SELECT_CLASS,
					schema: schema2
				})
			);
		}

		// ------------------- //

	}, {
		key: "getActions",
		value: function getActions() {
			var _getActionsConfig = this.getActionsConfig(),
			    schema = _getActionsConfig.schema;

			return _react2.default.createElement(
				"div",
				{ className: classes.actions },
				_react2.default.createElement(_WFBtnGroup2.default, {
					visible: true,
					schema: schema
				})
			);
		}

		// ------------------- //

	}, {
		key: "getActionsConfig",
		value: function getActionsConfig() {
			var _action;

			var _state = this.state,
			    _state$wfc_saved = _state.wfc_saved,
			    wfc_saved = _state$wfc_saved === undefined ? true : _state$wfc_saved,
			    _state$wfc_published2 = _state.wfc_published,
			    wfc_published = _state$wfc_published2 === undefined ? false : _state$wfc_published2;

			var canPublish = _wfui2.default.setting.hasLicense(_wfui2.default.wfc.editor.getProductTypeId());
			var schema = [];
			var action = (_action = {}, (0, _defineProperty3.default)(_action, "delete", {
				label: "delete",
				icon: "close",
				className: "wf-btn-red",
				onClick: function onClick() {
					return _wfui2.default.wfc.onDel();
				}
			}), (0, _defineProperty3.default)(_action, "cancel", {
				label: "cancel",
				icon: "close",
				className: "wf-btn-orange",
				onClick: function onClick() {
					return _wfui2.default.wfc.editor.onCancel();
				}
			}), (0, _defineProperty3.default)(_action, "save", {
				label: "save",
				icon: "check",
				className: "wf-btn-green",
				onClick: function onClick() {
					return _wfui2.default.wfc.onSave();
				}
			}), (0, _defineProperty3.default)(_action, "publish", {
				label: canPublish ? "publish" : "Upgrade to Premium",
				icon: canPublish ? "loop" : "check",
				className: "wf-btn-blue",
				onClick: function onClick() {
					if (canPublish) {
						_wfui2.default.wfc.onPublish();
					} else {
						_WFUrl2.default.purchase();
						//WFUi.setting.alertLicenseRequired(productTypeId)
					}
					/*
     let productTypeId = WFUi.wfc.editor.getProductTypeId();
     if (WFUi.setting.hasLicense(productTypeId)) {
     	WFUi.wfc.onPublish()
     } else {
     	WFUi.setting.alertLicenseRequired(productTypeId)
     }
     */
				}
			}), (0, _defineProperty3.default)(_action, "unpublish", {
				label: "unpublish",
				icon: "loop",
				className: "wf-btn-yellow",
				onClick: function onClick() {
					return _wfui2.default.wfc.onUnPublish();
				}
			}), _action);

			if (!wfc_saved) {
				schema = [action["delete"], action["save"]];
			} else {
				schema = [action["delete"], action["cancel"]];
				if (!wfc_published) {
					schema.push(action["publish"]);
				} else {
					schema.push(action["unpublish"]);
				}
			}

			return {
				schema: schema
			};
		}

		// ------------------- //

	}, {
		key: "getServicesConfig",
		value: function getServicesConfig() {
			var schema1 = [{
				icon: "adjustments",
				name: "setting",
				label: "Setting",
				onClick: function onClick() {
					_wfui2.default.wfc.onEditConfig();
				}
			}, {
				icon: "tools",
				name: _Constants.TAB_EDITOR_STUDIO,
				label: _Constants.TAB_EDITOR_STUDIO_LABEL,
				onClick: function onClick() {
					(0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_FORM_EDITOR, _Constants.TAB_EDITOR_STUDIO]);
				}
			}, {
				icon: "global",
				name: _Constants.TAB_EDITOR_ACTIONS,
				label: _Constants.TAB_EDITOR_ACTIONS_LABEL,
				onClick: function onClick() {
					(0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_FORM_EDITOR, _Constants.TAB_EDITOR_ACTIONS]);
				}
			}];
			var schema2 = [{
				name: _Constants.TAB_EDITOR_ENTRIES,
				label: _Constants.TAB_EDITOR_ENTRIES_LABEL,
				icon: "layers",
				onClick: function onClick() {
					(0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_FORM_EDITOR, _Constants.TAB_EDITOR_ENTRIES]);
				}
			}, {
				name: _Constants.TAB_EDITOR_ANALYTICS,
				label: _Constants.TAB_EDITOR_ANALYTICS_LABEL,
				icon: "piechart",
				onClick: function onClick() {
					(0, _WFAdminView.Pub)(_Constants.WF_PAGE, [_Constants.PAGE_FORM_EDITOR, _Constants.TAB_EDITOR_ANALYTICS]);
				}
			}];
			return {
				schema1: schema1,
				schema2: schema2
			};
		}
		// ------------------- //

		// COMPONENT LIFECYCLE ------------------- //

		// ------------------- //

	}, {
		key: "componentWillMount",
		value: function componentWillMount() {
			_wfui2.default.wfc.editor.onInit();
			_wfconfig2.default.editor.viewMgr.willMount(this);
		}
	}, {
		key: "componentDidMount",
		value: function componentDidMount() {
			_wfconfig2.default.editor.viewMgr.didMount(this);
		}
	}, {
		key: "componentWillUnmount",
		value: function componentWillUnmount() {
			_wfui2.default.wfc.editor.onClear();
			_wfconfig2.default.editor.viewMgr.willUnMount(this);
		}
		// ------------------- //

	}]);
	return Header;
}(_react.Component);

// ------------------- //

exports.default = Header;

// ------------------- //

/***/ }),
/* 470 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFTabs = __webpack_require__(116);

var _WFTabs2 = _interopRequireDefault(_WFTabs);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFBtnGroup = __webpack_require__(97);

var _WFBtnGroup2 = _interopRequireDefault(_WFBtnGroup);

var _WFLivePreview = __webpack_require__(353);

var _WFLivePreview2 = _interopRequireDefault(_WFLivePreview);

var _WFormComponent = __webpack_require__(219);

var _WFormComponent2 = _interopRequireDefault(_WFormComponent);

var _WFInputFactoryForAdmin = __webpack_require__(217);

var _WFInputFactoryForAdmin2 = _interopRequireDefault(_WFInputFactoryForAdmin);

var _WFormContentBuilder = __webpack_require__(368);

var _WFormContentBuilder2 = _interopRequireDefault(_WFormContentBuilder);

var _WFContentEditableMenu = __webpack_require__(364);

var _WFContentEditableMenu2 = _interopRequireDefault(_WFContentEditableMenu);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _getContentEditableMe = (0, _WFContentEditableMenu.getContentEditableMenuActions)(),
    ACTION_DELETE = _getContentEditableMe.ACTION_DELETE,
    ACTION_EDIT_CONFIG = _getContentEditableMe.ACTION_EDIT_CONFIG,
    ACTION_EDIT_OPTIONS = _getContentEditableMe.ACTION_EDIT_OPTIONS,
    ACTION_EDIT_GRID = _getContentEditableMe.ACTION_EDIT_GRID,
    ACTION_EDIT_VALIDATOR = _getContentEditableMe.ACTION_EDIT_VALIDATOR,
    ACTION_EDIT_VISIBLE = _getContentEditableMe.ACTION_EDIT_VISIBLE;

// ------------------- //

// WF BODY ------------------- //

// ------------------- //

var classes = {};

// ------------------- //

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    _this.state = {};
    return _this;
  }

  // VIEW ------------------- //

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _formEntryMgr$get = _WFormManagers.formEntryMgr.get(),
          formView = _formEntryMgr$get.formView;

      return _react2.default.createElement(
        "wf-body-data",
        null,
        this.getStepTabs(formView),
        _react2.default.createElement(
          _WFLivePreview2.default,
          null,
          this.getPlayer(formView)
        )
      );
    }

    // ------------------- //

  }, {
    key: "getStepTabs",
    value: function getStepTabs(formView) {
      var _this2 = this;

      if (!formView) {
        return false;
      }
      var _state = this.state,
          _state$wfc_step_curre = _state.wfc_step_current,
          wfc_step_current = _state$wfc_step_curre === undefined ? "0" : _state$wfc_step_curre,
          _state$wfc_step_order = _state.wfc_step_order,
          wfc_step_order = _state$wfc_step_order === undefined ? [] : _state$wfc_step_order,
          _state$wfc_step_value = _state.wfc_step_value,
          wfc_step_value = _state$wfc_step_value === undefined ? {} : _state$wfc_step_value,
          _state$wfc_steps = _state.wfc_steps,
          wfc_steps = _state$wfc_steps === undefined ? [] : _state$wfc_steps;

      var data = {
        items: (0, _concat2.default)([], wfc_steps)
      };
      return _react2.default.createElement(_WFTabs2.default, {
        ref: function ref(c) {
          return _this2.tabs = c;
        },
        visible: true,
        view: true,
        edit: true,
        control: true,
        editLabel: "Step",
        selected: [wfc_step_current],
        selectedBy: _Constants.WF_SELECT_BY_ID,
        selectedClassName: _Constants.WF_SELECT_CLASS,
        schema: wfc_steps,
        onPrev: function onPrev() {
          return _wfui2.default.wfc.editor.onSelectPrevStep();
        },
        onNext: function onNext() {
          return _wfui2.default.wfc.editor.onSelectNextStep();
        },
        onCreate: function onCreate() {
          return _wfui2.default.wfc.editor.onCreateStep();
        },
        onDelete: function onDelete() {
          return _wfui2.default.wfc.editor.onDelStep();
        },
        onSelect: function onSelect(row) {
          return _wfui2.default.wfc.editor.onSelectStep(row);
        },
        data: data,
        sortable: true,
        onReOrder: function onReOrder(order) {
          _wfui2.default.wfc.editor.onReorderStep(order);
        }
      });
    }

    // ------------------- //

  }, {
    key: "getPlayer",
    value: function getPlayer(formView) {
      var _state2 = this.state,
          _state2$wfc_contents = _state2.wfc_contents,
          wfc_contents = _state2$wfc_contents === undefined ? {} : _state2$wfc_contents,
          _state2$wfc_step_valu = _state2.wfc_step_value,
          wfc_step_value = _state2$wfc_step_valu === undefined ? {} : _state2$wfc_step_valu;

      if (!formView) {
        return false;
      } else {
        var stepType = wfc_step_value.type || "";
        return _react2.default.createElement(_WFormComponent2.default, {
          isEditable: true,
          navigation: true,
          onPrev: function onPrev() {
            return formView.onPrev();
          },
          onNext: function onNext() {
            return formView.onNext();
          },
          onSubmit: function onSubmit() {
            return formView.onSubmit();
          },
          onWillUnmount: function onWillUnmount() {
            return formView.onClear();
          },
          on: function on(evenType) {
            var eventArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

            formView.on(evenType, eventArgs);
          },
          onField: function onField(fieldName, evenType) {
            var eventArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

            formView.onField(fieldName, evenType, eventArgs);
          },
          onGetInput: function onGetInput(type, input_type, isAdminForm) {
            return _WFInputFactoryForAdmin2.default.get(type, input_type, isAdminForm);
          },
          onGetContentBuilder: function onGetContentBuilder() {
            var contentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
            var contentSchema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

            return false;
            /*
            const {
              current,
              schema
            } = WFUi.wfc.editor.getContentBuilderSchema();
            return (
              <WFormContentBuilder
                schema={schema}
                current={current}
                onSelect={(builder, value) => 
                  WFUi.wfc.editor.onContentBuilder(builder, value)
                }
                {...{stepType, contentType, contentSchema}}
              />
            )
            */
          },
          onFieldEditableMenu: function onFieldEditableMenu(fieldName, fieldSchema, fieldComponent) {
            var type = fieldSchema.type,
                input_type = fieldSchema.input_type,
                is_addon = fieldSchema.is_addon,
                visible = fieldSchema.visible;

            var _ref = wfc_contents[fieldName] || {},
                _ref$cols = _ref.cols,
                cols = _ref$cols === undefined ? {} : _ref$cols;

            var schema = [];
            schema.push(ACTION_EDIT_CONFIG);
            if (type.includes("select") || input_type === "select") {
              schema.push(ACTION_EDIT_OPTIONS);
            }
            if (!stepType.includes("extra")) {
              schema.push(ACTION_EDIT_GRID);
            }
            if (input_type !== "select"
            // && input_type !== "date" // remove when solution is founded for date
            && input_type !== "range") {
              if (type === "string" || type === "text" || type === "number" || type.includes("select")) {
                schema.push(ACTION_EDIT_VALIDATOR);
              }
            }
            if (!is_addon) {
              schema.push(ACTION_DELETE);
            } else {
              schema.push(ACTION_EDIT_VISIBLE);
            }
            return _react2.default.createElement(
              _WFContentEditableMenu2.default,
              {
                schema: schema,
                onDelete: function onDelete() {
                  _wfui2.default.wfc.editor.onDelFieldConfig(fieldName);
                },
                onEditVisible: function onEditVisible() {
                  _wfui2.default.wfc.editor.onToggleVisibleFieldConfig(fieldName, visible);
                },
                onEditConfig: function onEditConfig() {
                  _wfui2.default.wfc.editor.onEditFieldConfig(fieldName, input_type);
                },
                onEditOption: function onEditOption() {
                  _wfui2.default.wfc.editor.onEditFieldConfigBaobab(fieldName, input_type);
                },
                onEditGrid: function onEditGrid() {
                  _wfui2.default.wfc.editor.onEditGridContent(fieldName);
                },
                onEditValidator: function onEditValidator() {
                  _wfui2.default.wfc.editor.onEditFieldConfigValidation(fieldName, input_type);
                } },
              fieldComponent.getField()
            );
          }
        });
      }
    }
    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfconfig2.default.editor.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfconfig2.default.editor.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfconfig2.default.editor.viewMgr.willUnMount(this);
    }
    // ------------------- //

  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 471 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _stringify = __webpack_require__(104);

var _stringify2 = _interopRequireDefault(_stringify);

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _wfEnv = __webpack_require__(145);

var _wfEnv2 = _interopRequireDefault(_wfEnv);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFCol = __webpack_require__(24);

var _WFCol2 = _interopRequireDefault(_WFCol);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFCounter = __webpack_require__(69);

var _WFCounter2 = _interopRequireDefault(_WFCounter);

var _WFImg = __webpack_require__(52);

var _WFImg2 = _interopRequireDefault(_WFImg);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFClear = __webpack_require__(98);

var _WFClear2 = _interopRequireDefault(_WFClear);

var _WFLivePlayer = __webpack_require__(213);

var _WFIcon = __webpack_require__(8);

var _WFAdminView = __webpack_require__(18);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BODY ------------------- //

// ------------------- // 

var classes = {
	action: {
		btn: "wf-btn-yellow wf-btn-large"
	},
	stylizer: {
		btn: "wf-btn-stylizer"
	}
};

// ------------------- //

var img = {
	paint: __WF__.ASSETS + '/img/editor/theme.png',
	back: __WF__.ASSETS + '/img/editor/theme2.png'
};

// ------------------- //

var Sidebar = function (_Component) {
	(0, _inherits3.default)(Sidebar, _Component);

	// ------------------- //

	function Sidebar(props) {
		(0, _classCallCheck3.default)(this, Sidebar);

		var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

		_this.displayName = "Sidebar";
		_this.state = {
			themeCustom: false
		};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(Sidebar, [{
		key: 'render',
		value: function render() {
			var _formEntryMgr$get = _WFormManagers.formEntryMgr.get(),
			    formView = _formEntryMgr$get.formView;

			var _formConfigMgr$get = _WFormManagers.formConfigMgr.get(),
			    formState = _formConfigMgr$get.formState;

			return _react2.default.createElement(
				'wf-sidebar-data',
				null,
				_react2.default.createElement(
					_WFSection2.default,
					null,
					this.getStylizer(formView),
					this.getContentArchive(formView),
					this.getListActions(formView),
					this.getListLivePlayer(formState),
					this.getSchema(),
					this.getFormDebug(formState, formView)
				)
			);
		}

		// ------------------- //

	}, {
		key: 'getListLivePlayer',
		value: function getListLivePlayer(formState) {
			var _state$wfc_saved = this.state.wfc_saved,
			    wfc_saved = _state$wfc_saved === undefined ? true : _state$wfc_saved;

			if (!wfc_saved || !formState) {
				return false;
			}
			return _react2.default.createElement(
				_WFSection2.default,
				null,
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'Live Player'
				),
				_react2.default.createElement(_WFList2.default
				//selected={current_theme_setting}
				, {
					selected: [10],
					selectedBy: "label",
					selectable: true,
					view: function view(option, i) {
						return _react2.default.createElement(_WFIcon.WFIcon, { icon: option.type });
					},
					onSelect: function onSelect(option) {
						(0, _WFAdminView.Pub)(_Constants.WF_LIVEPLAYER, {
							id: formState.getEntryId(),
							title: formState.getName(),
							visible: true,
							option: option
						});
					},
					rowsClassName: "wf-live-player",
					rows: _WFLivePlayer.OPTIONS
				})
			);
		}

		// ------------------- //

	}, {
		key: 'getStylizer',
		value: function getStylizer(formView) {
			var _this2 = this;

			if (!formView) {
				return false;
			}
			var paint = img.paint,
			    back = img.back;
			var themeCustom = this.state.themeCustom;

			var productTypeId = _wfui2.default.wfc.editor.getProductTypeId();
			var isLimited = _wfui2.default.setting.isProductTypeLimited(productTypeId);
			return _react2.default.createElement(
				_WFSection2.default,
				{ top: 10 },
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'Form Theme'
				),
				_react2.default.createElement(
					_WFCol2.default,
					null,
					_react2.default.createElement(
						'wf-theme-select',
						null,
						_react2.default.createElement('span', { className: 'span' }),
						_react2.default.createElement(
							'select',
							{
								value: formView.getSettingMgr().getCurrent(),
								onChange: function onChange(e) {
									_wfui2.default.wfc.editor.onSelectThemeSetting(e.target.value);
								} },
							_wfconfig2.default.themes.getList(isLimited).map(function (theme, i) {
								var _theme$info = theme.info,
								    name = _theme$info.name,
								    label = _theme$info.label;

								return _react2.default.createElement(
									'option',
									{ key: name, value: name },
									label
								);
							})
						),
						_react2.default.createElement(_WFIcon.WFIDown, null)
					),
					_react2.default.createElement(
						'wf-theme-custom',
						{
							onClick: function onClick() {
								_this2.setState({
									themeCustom: !themeCustom
								});
							} },
						_react2.default.createElement(_WFImg2.default, { src: themeCustom ? back : paint })
					)
				),
				_react2.default.createElement(_WFClear2.default, null),
				_react2.default.createElement(
					'wf-theme-setting',
					null,
					_react2.default.createElement(_WFList2.default, { rows: _wfconfig2.default.resources.getListInfo(),
						selectedBy: "name",
						selectedClassName: "active",
						rowsClassName: "wf-table-col",
						visible: themeCustom,
						onSelect: function onSelect(_ref) {
							var name = _ref.name;

							_wfui2.default.wfc.editor.onEditThemeSetting(name);
						},
						view: function view(_ref2) {
							var label = _ref2.label;

							return _react2.default.createElement(
								'span',
								{ className: 'item-content' },
								_react2.default.createElement('span', { className: 'item-visible' }),
								_react2.default.createElement(
									'span',
									{ className: 'item-top left' },
									_react2.default.createElement(
										_WFText2.default,
										null,
										label
									),
									_react2.default.createElement(_WFIcon.WFIEdit, null)
								)
							);
						}
					})
				)
			);
		}

		// ------------------- //

	}, {
		key: 'getContentArchive',
		value: function getContentArchive(formView) {
			if (!formView) {
				return false;
			}
			var _state = this.state,
			    _state$themeCustom = _state.themeCustom,
			    themeCustom = _state$themeCustom === undefined ? false : _state$themeCustom,
			    _state$wfc_saved2 = _state.wfc_saved,
			    wfc_saved = _state$wfc_saved2 === undefined ? true : _state$wfc_saved2,
			    _state$wfc_published = _state.wfc_published,
			    wfc_published = _state$wfc_published === undefined ? false : _state$wfc_published,
			    _state$wfc_step_order = _state.wfc_step_order,
			    wfc_step_order = _state$wfc_step_order === undefined ? [] : _state$wfc_step_order,
			    _state$wfc_step_curre = _state.wfc_step_current,
			    wfc_step_current = _state$wfc_step_curre === undefined ? {} : _state$wfc_step_curre,
			    _state$wfc_step_value = _state.wfc_step_value,
			    wfc_step_value = _state$wfc_step_value === undefined ? {} : _state$wfc_step_value,
			    _state$wfc_steps = _state.wfc_steps,
			    wfc_steps = _state$wfc_steps === undefined ? [] : _state$wfc_steps,
			    _state$wfc_contents = _state.wfc_contents,
			    wfc_contents = _state$wfc_contents === undefined ? {} : _state$wfc_contents,
			    _state$wfc_fields = _state.wfc_fields,
			    wfc_fields = _state$wfc_fields === undefined ? {} : _state$wfc_fields;
			var _wfc_step_value$type = wfc_step_value.type,
			    type = _wfc_step_value$type === undefined ? null : _wfc_step_value$type,
			    _wfc_step_value$order = wfc_step_value.order,
			    order = _wfc_step_value$order === undefined ? [] : _wfc_step_value$order;

			var counter = order.length;
			if (counter === 0) {
				return false;
			}
			var fields = formView.getFields();
			var data = {
				items: (0, _concat2.default)([], order)
			};
			return _react2.default.createElement(
				_WFSection2.default,
				{
					visible: !themeCustom
				},
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'Step Contents',
					_react2.default.createElement(_WFCounter2.default, { counter: counter })
				),
				_react2.default.createElement(_WFList2.default, {
					sortable: true,
					rowsClassName: "wf-field",
					rows: order,
					data: data,
					onReOrder: function onReOrder(newValue) {
						_wfui2.default.wfc.editor.onReorderStepOrder(newValue);
					},
					view: function view(name, i) {
						// Get content by name
						var row = wfc_contents[name];
						if (!row) {
							return false;
						}
						var _row$isField = row.isField,
						    isField = _row$isField === undefined ? false : _row$isField,
						    _row$isIgnored = row.isIgnored,
						    isIgnored = _row$isIgnored === undefined ? false : _row$isIgnored,
						    _row$isPublish = row.isPublish,
						    isPublish = _row$isPublish === undefined ? true : _row$isPublish;

						var visible = true;
						var isAddon = false;
						var isSelect = false;
						var inputType = "";
						if (isField) {
							var fld = wfc_fields[name];
							if (!fld) {
								return false;
							} else {
								if (fld.hasOwnProperty('visible')) {
									visible = fld.visible;
								}
								if (fld.hasOwnProperty('is_addon')) {
									isAddon = fld.is_addon;
								}
								if (fld.hasOwnProperty('input_type')) {
									inputType = fld.input_type;
								}
								if (inputType.includes("select")) {
									isSelect = true;
								}
							}
						}
						if (isAddon) {
							return _react2.default.createElement(
								'span',
								{ className: 'item-content' },
								_react2.default.createElement('span', { className: 'item-visible ' + (isIgnored ? "not" : "") }),
								_react2.default.createElement(
									'span',
									{ className: 'item-top left' },
									_react2.default.createElement(
										_WFText2.default,
										null,
										name
									),
									_react2.default.createElement(_WFIcon.WFIcon, {
										icon: visible ? "eye2" : "eye-blocked",
										className: visible ? "active" : "not",
										onClick: function onClick() {
											return _wfui2.default.wfc.editor.onToggleVisibleFieldConfig(row.name, visible);
										}
									})
								)
							);
						} else {
							return _react2.default.createElement(
								'span',
								{ className: 'item-content' },
								_react2.default.createElement('span', { className: 'item-visible ' + (isIgnored ? "not" : "") }),
								_react2.default.createElement(
									'span',
									{ className: 'item-top left' },
									_react2.default.createElement(
										_WFText2.default,
										null,
										name
									),
									_react2.default.createElement(_WFIcon.WFIClose, {
										onClick: function onClick() {
											if (isField) {
												_wfui2.default.wfc.editor.onDelFieldConfig(row.name);
											} else {
												_wfui2.default.wfc.editor.onDelContent(row.name);
											}
										}
									})
								)
							);
						}
						/*
      return (
      	<span className="item-content">
      		<span className={`item-visible ${isIgnored?"not":""}`}/>
      		<span className="item-top left">
      			<WFText>{name}</WFText>
      			<WFIClose
      			visible={!isAddon}
      			onClick={() => {
      				if (isField) {
                 WFUi.wfc.editor.onDelFieldConfig(row.name)
      				} else {
                 WFUi.wfc.editor.onDelContent(row.name)
      				}
      			}}
      			/>
      		</span>
      		<span className="item-bottom left">
      			<WFIcon 
      			icon={"cog"}
      			onClick={() => WFUi.wfc.editor.onEditFieldConfig(row.name)}
      			/>
      			<WFIcon icon={"menu"}
      			visible={isSelect}
      			onClick={() => WFUi.wfc.editor.onEditFieldConfigBaobab(row.name, inputType)}
      			/>
      			<WFIcon 
      			visible={!isSelect}
      			icon={"police"}
      			onClick={() => WFUi.wfc.editor.onEditFieldConfigValidation(row.name)}
      			/>
      			<WFIcon 
      			icon={"equalizer"}
      			onClick={() => WFUi.wfc.editor.onEditGridContent(row.name)}
      			/>
      			<WFIcon 
      			visible={!isField}
      			icon={!isIgnored ? "eye2" : "eye-blocked"}
      			className={!isIgnored ? "active" : "not"}
      			onClick={() => WFUi.wfc.editor.onIgnoreContent(row.name)}
      			/>
      		</span>
      	</span>
      )
      */
					}
				})
			);
		}

		// ------------------- //

	}, {
		key: 'getListActions',
		value: function getListActions(formView) {
			if (!formView) {
				return false;
			}
			var _state2 = this.state,
			    themeCustom = _state2.themeCustom,
			    _state2$wfc_step_valu = _state2.wfc_step_value,
			    wfc_step_value = _state2$wfc_step_valu === undefined ? {} : _state2$wfc_step_valu;
			var _wfc_step_value$order2 = wfc_step_value.order,
			    order = _wfc_step_value$order2 === undefined ? [] : _wfc_step_value$order2,
			    _wfc_step_value$type2 = wfc_step_value.type,
			    type = _wfc_step_value$type2 === undefined ? null : _wfc_step_value$type2;

			var btnAddFieldIsVisible = true;
			if (order.length > 0 && type === "extra") {
				btnAddFieldIsVisible = false;
			}

			var _getState = this.getState(),
			    _getState$wf_contents = _getState.wf_contents,
			    wf_contents = _getState$wf_contents === undefined ? {} : _getState$wf_contents;

			return _react2.default.createElement(
				_WFSection2.default,
				{ visible: !themeCustom },
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'Step Actions'
				),
				_react2.default.createElement(
					_WFBtn2.default,
					{
						visible: btnAddFieldIsVisible,
						className: classes.action.btn,
						onClick: function onClick() {
							return _wfui2.default.wfc.editor.onCreateFieldConfig();
						}
					},
					'Add Field'
				)
			);
		}

		// DEBUG ------------------- //

	}, {
		key: 'getSchema',
		value: function getSchema(formEntryView) {

			if (!_wfEnv2.default) {
				return false;
			}

			var style = {
				color: "rgb(121, 202, 239)",
				background: "#243137",
				width: "100%",
				minHeight: 50
			};

			return _react2.default.createElement(
				_WFSection2.default,
				{
					visible: true
				},
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'CONTENTS'
				),
				_react2.default.createElement('textarea', {
					style: style,
					readOnly: true,
					value: (0, _stringify2.default)(_WFormManagers.formEntryMgr.formView.contents.toConfig(), 0, 2)
				}),
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'STEPS'
				),
				_react2.default.createElement('textarea', {
					style: style,
					readOnly: true,
					value: (0, _stringify2.default)(_WFormManagers.formEntryMgr.formView.steps.toConfig(), 0, 2)
				}),
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'SETTINGS'
				),
				_react2.default.createElement('textarea', {
					style: style,
					readOnly: true,
					value: (0, _stringify2.default)(_WFormManagers.formEntryMgr.formView.settings.toConfig(), 0, 2)
				}),
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'FIELDS'
				),
				_react2.default.createElement('textarea', {
					style: style,
					readOnly: true,
					value: (0, _stringify2.default)(_WFormManagers.formEntryMgr.formState.getFieldSchema(), 0, 2)
				})
			);
		}
	}, {
		key: 'getFormDebug',
		value: function getFormDebug(formConfigState, formEntryView) {

			return false;

			if (!_wfEnv2.default) {
				return false;
			}
			if (!formConfigState) {
				return false;
			}
			var _state3 = this.state,
			    _state3$wfc_values = _state3.wfc_values,
			    wfc_values = _state3$wfc_values === undefined ? {} : _state3$wfc_values,
			    _state3$wfc_attribute = _state3.wfc_attributes,
			    wfc_attributes = _state3$wfc_attribute === undefined ? {} : _state3$wfc_attribute,
			    _state3$wfc_saved = _state3.wfc_saved,
			    wfc_saved = _state3$wfc_saved === undefined ? true : _state3$wfc_saved,
			    _state3$wfc_published = _state3.wfc_published,
			    wfc_published = _state3$wfc_published === undefined ? false : _state3$wfc_published,
			    _state3$wfc_step_orde = _state3.wfc_step_order,
			    wfc_step_order = _state3$wfc_step_orde === undefined ? [] : _state3$wfc_step_orde,
			    _state3$wfc_step_curr = _state3.wfc_step_current,
			    wfc_step_current = _state3$wfc_step_curr === undefined ? {} : _state3$wfc_step_curr,
			    _state3$wfc_step_valu = _state3.wfc_step_value,
			    wfc_step_value = _state3$wfc_step_valu === undefined ? {} : _state3$wfc_step_valu,
			    _state3$wfc_steps = _state3.wfc_steps,
			    wfc_steps = _state3$wfc_steps === undefined ? [] : _state3$wfc_steps,
			    _state3$wfc_contents = _state3.wfc_contents,
			    wfc_contents = _state3$wfc_contents === undefined ? {} : _state3$wfc_contents,
			    _state3$wfc_fields = _state3.wfc_fields,
			    wfc_fields = _state3$wfc_fields === undefined ? [] : _state3$wfc_fields,
			    _state3$wfc_baobab_tr = _state3.wfc_baobab_tree_id,
			    wfc_baobab_tree_id = _state3$wfc_baobab_tr === undefined ? null : _state3$wfc_baobab_tr,
			    _state3$wfc_baobab_br = _state3.wfc_baobab_branches,
			    wfc_baobab_branches = _state3$wfc_baobab_br === undefined ? [] : _state3$wfc_baobab_br;

			var formConfig = formConfigState.getValues();
			var attributes = formConfig.attributes;
			delete formConfig.attributes;
			if (attributes !== "") {
				attributes = (0, _JSON.parse)(attributes);
			}
			return _react2.default.createElement(
				_WFSection2.default,
				{
					visible: true
				},
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					'DEBUG'
				),
				_react2.default.createElement(
					'wf-debugger',
					null,
					_react2.default.createElement(
						'div',
						null,
						_react2.default.createElement(
							'pre',
							null,
							'editor_status : ',
							(0, _stringify2.default)({ wfc_saved: wfc_saved, wfc_published: wfc_published, wfc_baobab_tree_id: wfc_baobab_tree_id }, 0, 2)
						),
						_react2.default.createElement(
							'pre',
							null,
							'current_step : ',
							(0, _stringify2.default)(wfc_step_value, 0, 2)
						)
					)
				),
				_react2.default.createElement(
					'wf-debugger',
					null,
					_react2.default.createElement(
						'div',
						null,
						_react2.default.createElement(
							'pre',
							null,
							'wfc_values : ',
							(0, _stringify2.default)(wfc_values, 0, 2)
						)
					),
					_react2.default.createElement(
						'div',
						null,
						_react2.default.createElement(
							'pre',
							null,
							'wfc_attributes : ',
							(0, _stringify2.default)(wfc_attributes, 0, 2)
						)
					)
				),
				_react2.default.createElement(
					'wf-debugger',
					null,
					_react2.default.createElement(
						'div',
						null,
						_react2.default.createElement(
							'pre',
							null,
							'fields : ',
							(0, _stringify2.default)(wfc_fields, 0, 2)
						)
					)
				)
			);
		}

		// ------------------- //

		// COMPONENT LIFECYCLE ------------------- //

		// ------------------- //

	}, {
		key: 'componentWillMount',
		value: function componentWillMount() {
			_wfconfig2.default.editor.viewMgr.willMount(this);
		}
	}, {
		key: 'componentDidMount',
		value: function componentDidMount() {
			_wfconfig2.default.editor.viewMgr.didMount(this);
		}
	}, {
		key: 'componentWillUnmount',
		value: function componentWillUnmount() {
			_wfconfig2.default.editor.viewMgr.willUnMount(this);
		}
		// ------------------- //

	}]);
	return Sidebar;
}(_react.Component);

// ------------------- //

exports.default = Sidebar;

// ------------------- //

/***/ }),
/* 472 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFSectionSearch = __webpack_require__(114);

var _WFSectionSearch2 = _interopRequireDefault(_WFSectionSearch);

var _WFPagination = __webpack_require__(100);

var _WFPagination2 = _interopRequireDefault(_WFPagination);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BODY ------------------- //

// ------------------- //

var classes = {
  icon: {
    title: "play"
  },
  btn: {
    create: "wf-btn-title wf-btn-yellow-dark"
  }
};

// ------------------- //

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _state = this.state,
          _state$page_loader = _state.page_loader,
          page_loader = _state$page_loader === undefined ? false : _state$page_loader,
          _state$wfconfigs = _state.wfconfigs,
          wfconfigs = _state$wfconfigs === undefined ? [] : _state$wfconfigs,
          _state$wfconfigs_sele = _state.wfconfigs_selected,
          wfconfigs_selected = _state$wfconfigs_sele === undefined ? [] : _state$wfconfigs_sele,
          _state$wfconfigs_page = _state.wfconfigs_pager,
          wfconfigs_pager = _state$wfconfigs_page === undefined ? {} : _state$wfconfigs_page;
      var _wfconfigs_pager$tota = wfconfigs_pager.total,
          total = _wfconfigs_pager$tota === undefined ? 0 : _wfconfigs_pager$tota,
          _wfconfigs_pager$coun = wfconfigs_pager.countRow,
          countRow = _wfconfigs_pager$coun === undefined ? 0 : _wfconfigs_pager$coun,
          _wfconfigs_pager$tota2 = wfconfigs_pager.totalRow,
          totalRow = _wfconfigs_pager$tota2 === undefined ? 0 : _wfconfigs_pager$tota2,
          _wfconfigs_pager$coun2 = wfconfigs_pager.countCursor,
          countCursor = _wfconfigs_pager$coun2 === undefined ? 0 : _wfconfigs_pager$coun2;

      var counter = countCursor;
      var counterMax = totalRow;
      var title = "Form archive " + (countRow > 0 ? "|" : "");
      if (wfconfigs_selected.length > 0) {
        counter = wfconfigs_selected.length;
        title = "Form selected |";
      }
      return _react2.default.createElement(
        "wf-body-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFSectionTitle2.default,
            {
              icon: classes.icon.title,
              text: title,
              counter: counter,
              counterMax: counterMax,
              loader: page_loader },
            _react2.default.createElement(
              _WFBtn2.default,
              {
                className: classes.btn.create,
                active: false,
                onClick: function onClick() {
                  return (0, _WFAdminView.Pub)(_Constants.WF_PAGE);
                }
              },
              "Create Form"
            )
          ),
          _react2.default.createElement(_WFSep2.default, null),
          _react2.default.createElement(
            _WFTable2.default,
            (0, _extends3.default)({
              rows: wfconfigs,
              selected: wfconfigs_selected
            }, _wfui2.default.wfc.getWFTableConfig()),
            _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
              visible: total > 1 && countRow > 0
            }, wfconfigs_pager, {
              onClick: function onClick(page) {
                _wfui2.default.wfc.onFind({ page: page });
              }
            }))
          ),
          _react2.default.createElement(_WFSep2.default, { type: 1 })
        )
      );
    }
    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfconfig2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfconfig2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfconfig2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 473 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _stringify = __webpack_require__(104);

var _stringify2 = _interopRequireDefault(_stringify);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFBtnGroup = __webpack_require__(97);

var _WFBtnGroup2 = _interopRequireDefault(_WFBtnGroup);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BAOBAB SIDEBAR ------------------- // 

// ------------------- //

var classes = {};

// ------------------- //

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  // ------------------- //

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    // State  
    _this.state = {};
    return _this;
  }

  // ------------------- //

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      var _state$wfconfigs_sele = this.state.wfconfigs_selected,
          wfconfigs_selected = _state$wfconfigs_sele === undefined ? [] : _state$wfconfigs_sele;

      var counter = wfconfigs_selected.length;
      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          { visible: counter > 0 },
          _react2.default.createElement(_WFBtnGroup2.default, {
            visible: counter > 0,
            counter: counter,
            schema: this.getActionConfig()
          })
        ),
        this.getDebug()
      );
    }
  }, {
    key: "getActionConfig",
    value: function getActionConfig() {
      return [{
        label: "Delete",
        className: "wf-btn-red wf-btn-large",
        onClick: function onClick() {
          _wfui2.default.wfc.onDel();
        }
      }];
    }
  }, {
    key: "getDebug",
    value: function getDebug() {
      return false;

      var _state = this.state,
          _state$wfconfigs = _state.wfconfigs,
          wfconfigs = _state$wfconfigs === undefined ? [] : _state$wfconfigs,
          _state$wfconfigs_sele2 = _state.wfconfigs_selected,
          wfconfigs_selected = _state$wfconfigs_sele2 === undefined ? [] : _state$wfconfigs_sele2,
          _state$wfconfigs_page = _state.wfconfigs_pager,
          wfconfigs_pager = _state$wfconfigs_page === undefined ? {} : _state$wfconfigs_page;

      return _react2.default.createElement(
        _WFSection2.default,
        null,
        _react2.default.createElement(
          "wf-debugger",
          null,
          _react2.default.createElement(
            "div",
            null,
            _react2.default.createElement(
              "pre",
              null,
              (0, _stringify2.default)(wfconfigs_selected, 0, 2)
            )
          )
        )
      );
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.wfc.onInit();
      _wfconfig2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfconfig2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.wfc.onClear();
      _wfconfig2.default.viewMgr.willUnMount(this);
    }

    // ------------------- //

  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //

exports.default = Sidebar;

// ------------------- //

/***/ }),
/* 474 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFTable = __webpack_require__(70);

var _WFTable2 = _interopRequireDefault(_WFTable);

var _WFTableForEach = __webpack_require__(359);

var _WFTableForEach2 = _interopRequireDefault(_WFTableForEach);

var _WFTableForOption = __webpack_require__(360);

var _WFTableForOption2 = _interopRequireDefault(_WFTableForOption);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFSectionSearch = __webpack_require__(114);

var _WFSectionSearch2 = _interopRequireDefault(_WFSectionSearch);

var _WFPagination = __webpack_require__(100);

var _WFPagination2 = _interopRequireDefault(_WFPagination);

var _WFIcon = __webpack_require__(8);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BAOBAB BODY ------------------- //

// ------------------- //

var classes = {
  icon: {
    title: "layers"
  }
};
// WFCOMPONENT

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    _this.state = {
      page_loader: false,
      page_search: false
    };
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _state = this.state,
          page_loader = _state.page_loader,
          page_search = _state.page_search,
          _state$wf_baobab_sche = _state.wf_baobab_schema,
          wf_baobab_schema = _state$wf_baobab_sche === undefined ? [] : _state$wf_baobab_sche,
          wf_baobab_is_branch_archive = _state.wf_baobab_is_branch_archive;

      var _WFUi$baobab$getWFSec = _wfui2.default.baobab.getWFSectionTitleConfig(this),
          title = _WFUi$baobab$getWFSec.title,
          counter = _WFUi$baobab$getWFSec.counter,
          counterMax = _WFUi$baobab$getWFSec.counterMax;

      return _react2.default.createElement(
        "wf-body-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFSectionTitle2.default,
            {
              icon: classes.icon.title,
              text: title,
              counter: counter,
              counterMax: counterMax,
              loader: page_loader,
              search: page_search
            },
            _react2.default.createElement(_WFSectionSearch2.default, {
              placeholder: "search...",
              onSearch: function onSearch(value) {
                _this2.setState({
                  page_search: value === "" ? false : true
                });
                _wfui2.default.baobab.onSearch(value);
              }
            })
          ),
          this.getTreeArchive(),
          this.getBranchArchive(),
          _react2.default.createElement(_WFTableForEach2.default, {
            visible: !wf_baobab_is_branch_archive,
            start: 1,
            table: function table(level, optionMgr) {
              return _this2.getOptionArchive(level + 1, optionMgr);
            },
            configs: wf_baobab_schema
          })
        )
      );
    }
  }, {
    key: "getTreeArchive",
    value: function getTreeArchive() {
      var _state2 = this.state,
          _state2$wf_baobab_his = _state2.wf_baobab_history,
          wf_baobab_history = _state2$wf_baobab_his === undefined ? [] : _state2$wf_baobab_his,
          _state2$wf_baobab_tre = _state2.wf_baobab_tree_rows,
          wf_baobab_tree_rows = _state2$wf_baobab_tre === undefined ? [] : _state2$wf_baobab_tre,
          _state2$wf_baobab_tre2 = _state2.wf_baobab_tree_pager,
          wf_baobab_tree_pager = _state2$wf_baobab_tre2 === undefined ? {} : _state2$wf_baobab_tre2,
          _state2$wf_baobab_cur = _state2.wf_baobab_current_tree,
          wf_baobab_current_tree = _state2$wf_baobab_cur === undefined ? {} : _state2$wf_baobab_cur;
      var _wf_baobab_tree_pager = wf_baobab_tree_pager.total,
          total = _wf_baobab_tree_pager === undefined ? 0 : _wf_baobab_tree_pager,
          _wf_baobab_tree_pager2 = wf_baobab_tree_pager.countRow,
          countRow = _wf_baobab_tree_pager2 === undefined ? 0 : _wf_baobab_tree_pager2;
      var _wf_baobab_current_tr = wf_baobab_current_tree.id,
          id = _wf_baobab_current_tr === undefined ? null : _wf_baobab_current_tr,
          _wf_baobab_current_tr2 = wf_baobab_current_tree.label,
          label = _wf_baobab_current_tr2 === undefined ? "" : _wf_baobab_current_tr2,
          _wf_baobab_current_tr3 = wf_baobab_current_tree.options_count,
          options_count = _wf_baobab_current_tr3 === undefined ? 0 : _wf_baobab_current_tr3;

      return _react2.default.createElement(
        _WFTable2.default
        // Config Table -- //
        ,
        (0, _extends3.default)({
          rows: wf_baobab_tree_rows,
          opened: wf_baobab_history
        }, _wfui2.default.baobab.getWFTableConfigForTreeArchive()),
        _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
          visible: total > 1 && countRow > 0
        }, wf_baobab_tree_pager, {
          onClick: function onClick(page) {
            _wfui2.default.baobab.onFind({ page: page });
          }
        }))
      );
    }
  }, {
    key: "getBranchArchive",
    value: function getBranchArchive() {
      var _state3 = this.state,
          _state3$wf_baobab_sel = _state3.wf_baobab_selection,
          wf_baobab_selection = _state3$wf_baobab_sel === undefined ? [] : _state3$wf_baobab_sel,
          wf_baobab_is_branch_archive = _state3.wf_baobab_is_branch_archive,
          _state3$wf_baobab_cur = _state3.wf_baobab_current_branch,
          wf_baobab_current_branch = _state3$wf_baobab_cur === undefined ? {} : _state3$wf_baobab_cur;
      var _wf_baobab_current_br = wf_baobab_current_branch.id,
          id = _wf_baobab_current_br === undefined ? null : _wf_baobab_current_br,
          _wf_baobab_current_br2 = wf_baobab_current_branch.label,
          label = _wf_baobab_current_br2 === undefined ? "" : _wf_baobab_current_br2,
          _wf_baobab_current_br3 = wf_baobab_current_branch.options_count,
          options_count = _wf_baobab_current_br3 === undefined ? 0 : _wf_baobab_current_br3,
          _wf_baobab_current_br4 = wf_baobab_current_branch.branches,
          branches = _wf_baobab_current_br4 === undefined ? [] : _wf_baobab_current_br4,
          _wf_baobab_current_br5 = wf_baobab_current_branch.options,
          options = _wf_baobab_current_br5 === undefined ? [] : _wf_baobab_current_br5,
          _wf_baobab_current_br6 = wf_baobab_current_branch.branchPager,
          branchPager = _wf_baobab_current_br6 === undefined ? {} : _wf_baobab_current_br6,
          _wf_baobab_current_br7 = wf_baobab_current_branch.optionPager,
          optionPager = _wf_baobab_current_br7 === undefined ? {} : _wf_baobab_current_br7;
      var _optionPager$total = optionPager.total,
          total = _optionPager$total === undefined ? 0 : _optionPager$total,
          _optionPager$countRow = optionPager.countRow,
          countRow = _optionPager$countRow === undefined ? 0 : _optionPager$countRow;

      if (!wf_baobab_is_branch_archive) {
        return false;
      } else {
        return _react2.default.createElement(
          _WFTable2.default,
          (0, _extends3.default)({
            rows: options,
            selected: wf_baobab_selection
          }, _wfui2.default.baobab.getWFTableConfigForBranchArchive()),
          _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
            visible: total > 1 && countRow > 0
          }, optionPager, {
            onClick: function onClick(page) {
              _wfui2.default.baobab.onFind({ page: page });
            }
          }))
        );
      }
    }
  }, {
    key: "getOptionArchive",
    value: function getOptionArchive(level, optionMgr) {
      var _this3 = this;

      var id = optionMgr.getId();
      var _state4 = this.state,
          _state4$wf_baobab_his = _state4.wf_baobab_history,
          wf_baobab_history = _state4$wf_baobab_his === undefined ? [] : _state4$wf_baobab_his,
          _state4$wf_baobab_sel = _state4.wf_baobab_selection,
          wf_baobab_selection = _state4$wf_baobab_sel === undefined ? [] : _state4$wf_baobab_sel;

      return _react2.default.createElement(_WFTableForOption2.default, {
        optionMg: optionMgr,
        table: function table(tbForOpt) {
          var _tbForOpt$state = tbForOpt.state,
              _tbForOpt$state$optio = _tbForOpt$state.options,
              options = _tbForOpt$state$optio === undefined ? [] : _tbForOpt$state$optio,
              _tbForOpt$state$optio2 = _tbForOpt$state.optionsId,
              optionsId = _tbForOpt$state$optio2 === undefined ? [] : _tbForOpt$state$optio2,
              _tbForOpt$state$optio3 = _tbForOpt$state.optionPager,
              optionPager = _tbForOpt$state$optio3 === undefined ? {} : _tbForOpt$state$optio3;
          var _optionPager$total2 = optionPager.total,
              total = _optionPager$total2 === undefined ? 0 : _optionPager$total2,
              _optionPager$countRow2 = optionPager.countRow,
              countRow = _optionPager$countRow2 === undefined ? 0 : _optionPager$countRow2;

          var i = 0;
          var l = wf_baobab_history.length;
          var opened = [];
          for (; i < l; i++) {
            var optId = wf_baobab_history[i];
            if (optionsId.includes(optId)) {
              opened.push(optId);
            }
          }
          var isOpened = opened.length > 0;
          return _react2.default.createElement(
            _WFTable2.default,
            (0, _extends3.default)({ level: level,
              rows: options,
              opened: opened,
              selected: wf_baobab_selection,
              willMount: function willMount() {
                return optionMgr.getView().willMount(_this3);
              },
              willUnMount: function willUnMount() {
                return optionMgr.getView().willUnMount();
              }
            }, _wfui2.default.baobab.getWFTableConfigForOptionArchive(isOpened)),
            _react2.default.createElement(_WFPagination2.default, (0, _extends3.default)({
              visible: total > 1 && countRow > 0
            }, optionPager, {
              onClick: function onClick(page) {
                _wfui2.default.baobab.onFind({ page: page });
              }
            }))
          );
        }
      });
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.baobab.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.baobab.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 475 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFBtnGroup = __webpack_require__(97);

var _WFBtnGroup2 = _interopRequireDefault(_WFBtnGroup);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BAOBAB SIDEBAR ------------------- // 

// ------------------- //

var classes = {};

// ------------------- //

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  // ------------------- //

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    _this.state = {};
    return _this;
  }

  // ------------------- //

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      var actionConfig = _wfui2.default.baobab.getWFListActionsConfig(this);
      var _state = this.state,
          _state$wf_baobab_tree = _state.wf_baobab_tree_rows,
          wf_baobab_tree_rows = _state$wf_baobab_tree === undefined ? [] : _state$wf_baobab_tree,
          _state$wf_baobab_tree2 = _state.wf_baobab_tree_pager,
          wf_baobab_tree_pager = _state$wf_baobab_tree2 === undefined ? {} : _state$wf_baobab_tree2,
          wf_baobab_is_tree_archive = _state.wf_baobab_is_tree_archive,
          wf_baobab_is_branch_archive = _state.wf_baobab_is_branch_archive,
          wf_baobab_is_option_archive = _state.wf_baobab_is_option_archive,
          _state$wf_baobab_curr = _state.wf_baobab_current_tree,
          wf_baobab_current_tree = _state$wf_baobab_curr === undefined ? null : _state$wf_baobab_curr,
          _state$wf_baobab_curr2 = _state.wf_baobab_current_branch,
          wf_baobab_current_branch = _state$wf_baobab_curr2 === undefined ? null : _state$wf_baobab_curr2,
          _state$wf_baobab_curr3 = _state.wf_baobab_current_option,
          wf_baobab_current_option = _state$wf_baobab_curr3 === undefined ? null : _state$wf_baobab_curr3;
      var archive = actionConfig.archive,
          visible = actionConfig.visible,
          position = actionConfig.position;

      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        _react2.default.createElement(
          "baobab-info",
          null,
          _react2.default.createElement(
            _WFSection2.default,
            null,
            this.getBaobabStatus()
          ),
          _react2.default.createElement(
            _WFSection2.default,
            { visible: position === "top" ? visible : false },
            this.getBaobabActions(actionConfig)
          ),
          _react2.default.createElement(
            _WFSection2.default,
            { visible: archive },
            this.getBaobabBranchArchive()
          ),
          _react2.default.createElement(
            _WFSection2.default,
            { visible: position === "bottom" ? visible : false },
            this.getBaobabActions(actionConfig)
          ),
          _react2.default.createElement("div", { className: "clearfix" })
        ),
        _react2.default.createElement("baobab-logo", null)
      );
    }
  }, {
    key: "getBaobabStatus",
    value: function getBaobabStatus() {
      var _WFUi$baobab$getWFLis = _wfui2.default.baobab.getWFListStatusConfig(this),
          title = _WFUi$baobab$getWFLis.title,
          counter = _WFUi$baobab$getWFLis.counter,
          counterMax = _WFUi$baobab$getWFLis.counterMax,
          callback = _WFUi$baobab$getWFLis.callback;

      return _react2.default.createElement(
        "span",
        {
          className: "wf-baoba-info",
          onClick: function onClick() {
            return (0, _Lodash.isFunction)(callback) ? callback() : "";
          }
        },
        _react2.default.createElement(_WFIcon.WFIcon, { icon: "radio-checked2" }),
        _react2.default.createElement(
          _WFText2.default,
          { limit: 15, counter: counterMax },
          title
        )
      );
    }
  }, {
    key: "getBaobabActions",
    value: function getBaobabActions(actionConfig) {
      var schema = actionConfig.schema,
          counter = actionConfig.counter,
          visible = actionConfig.visible;

      return _react2.default.createElement(_WFBtnGroup2.default, {
        visible: visible,
        className: "wf-baobab-action",
        counter: counter,
        schema: schema
      });
    }
  }, {
    key: "getBaobabBranchArchive",
    value: function getBaobabBranchArchive() {
      var _WFUi$baobab$getWFLis2 = _wfui2.default.baobab.getWFListBranchArchiveConfig(this),
          rows = _WFUi$baobab$getWFLis2.rows,
          selected = _WFUi$baobab$getWFLis2.selected,
          active = _WFUi$baobab$getWFLis2.active,
          visible = _WFUi$baobab$getWFLis2.visible;

      return _react2.default.createElement(_WFList2.default, {
        rows: rows,
        className: "wf-baobab-branch",
        visible: visible,
        selectable: true,
        selectedBy: "id",
        selectedClassName: "",
        hiddenNotSelected: true,
        selected: selected,
        active: active,
        view: function view(branch, i, isSelected) {
          var _branch$label = branch.label,
              label = _branch$label === undefined ? "" : _branch$label,
              _branch$subgroups_cou = branch.subgroups_count,
              subgroups_count = _branch$subgroups_cou === undefined ? 0 : _branch$subgroups_cou;

          return _react2.default.createElement(
            "span",
            null,
            _react2.default.createElement(_WFIcon.WFIcon, { icon: isSelected ? "radio-checked" : "radio-unchecked" }),
            _react2.default.createElement(
              _WFText2.default,
              { limit: 15, counter: subgroups_count },
              label
            )
          );
        },
        onSelect: function onSelect(optionConfig) {
          _wfui2.default.baobab.onExplore(_Constants.WF_BAOBAB_BRANCH, optionConfig);
        }
      });
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      //WFUi.baobab.onClear();
      _wfui2.default.baobab.onInit();
      _wfui2.default.baobab.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {}
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.baobab.onClear(true);
      _wfui2.default.baobab.willUnMount(this);
    }
  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 476 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFIcon = __webpack_require__(8);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

var _Constants = __webpack_require__(41);

var _Constants2 = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var banner = "http://dgucck1rzopms.cloudfront.net/wp-content/uploads/2017/06/03193008/wf-banner.jpg";

// ------------------- //

// WF BODY ------------------- //

// ------------------- //

var classes = {
  icon: {
    title: "play",
    licence: "check",
    noLicence: "password"
  }
};

// ------------------- //

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    _this.state = {};
    return _this;
  }

  // VIEW ------------------- //

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      return _react2.default.createElement(
        "wf-body-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            "span",
            null,
            _react2.default.createElement(
              "div",
              { className: "wf-banner wf-inner",
                style: {
                  backgroundColor: "#acd7ea",
                  backgroundImage: "url(" + banner + ")"
                }
              },
              _react2.default.createElement(
                "span",
                { className: "wf--version" },
                this.getVersion()
              ),
              _react2.default.createElement(
                "div",
                { className: "wf-inner-container" },
                _react2.default.createElement("span", { className: "wf--logo" }),
                _react2.default.createElement(
                  "span",
                  { className: "wf--slogan" },
                  _Constants.WF_SLOGAN
                )
              )
            ),
            _react2.default.createElement(_WFSep2.default, { type: 1 })
          ),
          _react2.default.createElement(_WFSectionTitle2.default, {
            icon: classes.icon.title,
            text: "Select your form"
          }),
          _react2.default.createElement(_WFSep2.default, { type: 1 }),
          _react2.default.createElement(
            "div",
            { className: "wf-wdproducts-archive row" },
            _wfconfig2.default.products.getList().map(function (p, i) {
              return _this2.getArchive(p, i);
            })
          ),
          _react2.default.createElement(_WFSep2.default, { type: 1 })
        )
      );
    }
  }, {
    key: "getVersion",
    value: function getVersion() {
      return "version " + _wfui2.default.setting.getStrVersion() + " " + __WF__.VERSION;
    }
  }, {
    key: "getArchive",
    value: function getArchive(product, index) {
      var icon = product.icon,
          title = product.title,
          slogan = product.slogan,
          _product$status = product.status,
          status = _product$status === undefined ? "" : _product$status,
          wf_producttype_id = product.wf_producttype_id,
          _product$forms = product.forms,
          forms = _product$forms === undefined ? [] : _product$forms;

      return _react2.default.createElement(
        "div",
        { key: index, className: "col-xs-4 text-center" },
        _react2.default.createElement(
          "div",
          { className: "wf-item " + (status !== "" ? "wf-item-status-" + status : "") },
          _react2.default.createElement(
            "div",
            { className: "wf-item-head" },
            this.getProductLicence(wf_producttype_id),
            _react2.default.createElement(_WFIcon.WFIcon, { className: "wf-item-icon", icon: icon }),
            _react2.default.createElement(
              _WFText2.default,
              { className: "wf-item-title" },
              title
            ),
            this.getStatus(status),
            _react2.default.createElement(
              _WFText2.default,
              { className: "wf-item-slogan" },
              slogan
            )
          ),
          _react2.default.createElement(
            "div",
            { className: "wf-item-foot" },
            forms.map(function (form, i) {
              var label = form.label,
                  wf_producttype_id = form.wf_producttype_id;

              return _react2.default.createElement(
                _WFBtn2.default,
                {
                  key: i,
                  className: 'wf-btn-large wf-btn-yellow',
                  onClick: function onClick() {
                    return _wfui2.default.wfc.onCreate(form, product);
                  } },
                label
              );
            })
          )
        )
      );
    }
  }, {
    key: "getStatus",
    value: function getStatus(status) {
      if (status === "required") {
        return _react2.default.createElement(
          _WFText2.default,
          { className: "wf-item-status" },
          "Required WonderForm Advanced"
        );
      } else if (status === "coming") {
        return _react2.default.createElement(
          _WFText2.default,
          { className: "wf-item-status" },
          "Coming Soon"
        );
      } else {
        return false;
      }
    }

    // todo charly later implementation

  }, {
    key: "hasEventFlag",
    value: function hasEventFlag() {
      return false;
    }
  }, {
    key: "getProductLicence",
    value: function getProductLicence(wf_producttype_id) {
      var licenses = WFAdminView.getState("wf_producttype_status");
      var status = null;
      if (licenses.hasOwnProperty(wf_producttype_id)) {
        status = licenses[wf_producttype_id].status;
      }
      if (_wfui2.default.setting.hasLicense(wf_producttype_id) || status) {
        return _react2.default.createElement(_WFIcon.WFIcon, {
          className: "wf-item-license",
          icon: classes.icon.licence
        });
      } else {
        return _react2.default.createElement(_WFIcon.WFIcon, {
          className: "wf-item-license wf-no-license",
          icon: classes.icon.noLicence,
          onClick: function onClick() {
            console.log("redirect to site page ...");
          }
        });
      }
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      this.on(_Constants2.WF_VIEW_ACTION_WILL_MOUNT, this.tabName);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.on(_Constants2.WF_VIEW_ACTION_DID_MOUNT, this.tabName);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.on(_Constants2.WF_VIEW_ACTION_WILL_UNMOUNT, this.tabName);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 477 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends2 = __webpack_require__(10);

var _extends3 = _interopRequireDefault(_extends2);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFBtn = __webpack_require__(14);

var _WFBtn2 = _interopRequireDefault(_WFBtn);

var _WFSep = __webpack_require__(36);

var _WFSep2 = _interopRequireDefault(_WFSep);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFSectionTitle = __webpack_require__(42);

var _WFSectionTitle2 = _interopRequireDefault(_WFSectionTitle);

var _WFPanelSetting = __webpack_require__(357);

var _WFPanelSetting2 = _interopRequireDefault(_WFPanelSetting);

var _WFIcon = __webpack_require__(8);

var _wfsetting = __webpack_require__(121);

var _wfsetting2 = _interopRequireDefault(_wfsetting);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SETTING BODY ------------------- //

// ------------------- //

var classes = {};

// WFCOMPONENT

var Body = function (_Component) {
  (0, _inherits3.default)(Body, _Component);

  function Body(props) {
    (0, _classCallCheck3.default)(this, Body);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Body.__proto__ || (0, _getPrototypeOf2.default)(Body)).call(this, props));

    _this.displayName = "Body";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Body, [{
    key: "render",
    value: function render() {
      return _react2.default.createElement(
        "wf-body-data",
        null,
        this.getPanels()
      );
    }
  }, {
    key: "getPanels",
    value: function getPanels() {
      var _state = this.state,
          _state$panels_visible = _state.panels_visible,
          panels_visible = _state$panels_visible === undefined ? [] : _state$panels_visible,
          _state$setting_values = _state.setting_values,
          setting_values = _state$setting_values === undefined ? {} : _state$setting_values,
          _state$wf_producttype = _state.wf_producttype_status,
          wf_producttype_status = _state$wf_producttype === undefined ? {} : _state$wf_producttype;

      return _wfsetting2.default.resources.getList().map(function (setting, i) {
        if (panels_visible.includes(setting.info.name)) {
          return _react2.default.createElement(_WFPanelSetting2.default, (0, _extends3.default)({
            key: i,
            onEdit: function onEdit(row) {
              _wfui2.default.setting.onEdit(row, "activate_license");
            },
            getValue: function getValue(row) {
              return _wfui2.default.setting.getValue(row, wf_producttype_status, setting_values);
            },
            isChecked: function isChecked(row) {
              return _wfui2.default.setting.isChecked(row, wf_producttype_status);
            }
          }, setting));
        } else {
          return false;
        }
      });
    }

    // COMPONENT LIFECYCLE ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfsetting2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfsetting2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfsetting2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Body;
}(_react.Component);

// ------------------- //


exports.default = Body;
// ------------------- //

/***/ }),
/* 478 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

var _wfsetting = __webpack_require__(121);

var _wfsetting2 = _interopRequireDefault(_wfsetting);

var _wfui = __webpack_require__(28);

var _wfui2 = _interopRequireDefault(_wfui);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF SETTINGS SIDEBAR ------------------- //

// ------------------- //

var classes = {};

// WFCOMPONENT

var Sidebar = function (_Component) {
  (0, _inherits3.default)(Sidebar, _Component);

  function Sidebar(props) {
    (0, _classCallCheck3.default)(this, Sidebar);

    var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

    _this.displayName = "Sidebar";
    // State
    _this.state = {};
    return _this;
  }

  (0, _createClass3.default)(Sidebar, [{
    key: "render",
    value: function render() {
      var _state$panels_visible = this.state.panels_visible,
          panels_visible = _state$panels_visible === undefined ? [] : _state$panels_visible;

      return _react2.default.createElement(
        "wf-sidebar-data",
        null,
        _react2.default.createElement(
          _WFSection2.default,
          null,
          _react2.default.createElement(
            _WFTitle2.default,
            { top: 10 },
            "Select Panel"
          ),
          _react2.default.createElement(_WFList2.default, {
            rows: _wfsetting2.default.resources.getListInfo(),
            onSelect: function onSelect(item) {
              return _wfui2.default.setting.onTogglePanel(item);
            },
            rowsClassName: "wf-table-col",
            view: function view(item, i) {
              var name = item.name,
                  _item$short = item.short,
                  short = _item$short === undefined ? "" : _item$short;

              var isVisible = panels_visible.includes(name);
              return _react2.default.createElement(
                "span",
                { className: "item-content" },
                _react2.default.createElement("span", { className: "item-visible " + (!isVisible ? "not" : "") }),
                _react2.default.createElement(
                  "span",
                  { className: "item-top left" },
                  _react2.default.createElement(
                    _WFText2.default,
                    null,
                    short
                  ),
                  _react2.default.createElement(_WFIcon.WFIVisible, { visible: isVisible })
                )
              );
            }
          })
        )
      );
    }

    // ------------------- //

    // COMPONENT LIFECYCLE ------------------- //

    // ------------------- //

  }, {
    key: "componentWillMount",
    value: function componentWillMount() {
      _wfui2.default.setting.onInit();
      _wfsetting2.default.viewMgr.willMount(this);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      _wfsetting2.default.viewMgr.didMount(this);
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      _wfui2.default.setting.onClear();
      _wfsetting2.default.viewMgr.willUnMount(this);
    }
  }]);
  return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 479 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
	value: true
});

var _stringify = __webpack_require__(104);

var _stringify2 = _interopRequireDefault(_stringify);

var _getPrototypeOf = __webpack_require__(3);

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = __webpack_require__(5);

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = __webpack_require__(4);

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = __webpack_require__(2);

var _react2 = _interopRequireDefault(_react);

var _Lodash = __webpack_require__(6);

var _WFList = __webpack_require__(35);

var _WFList2 = _interopRequireDefault(_WFList);

var _WFText = __webpack_require__(11);

var _WFText2 = _interopRequireDefault(_WFText);

var _WFTitle = __webpack_require__(46);

var _WFTitle2 = _interopRequireDefault(_WFTitle);

var _WFSection = __webpack_require__(20);

var _WFSection2 = _interopRequireDefault(_WFSection);

var _WFIcon = __webpack_require__(8);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF BODY ------------------- // 

// ------------------- //

var classes = {};

// ------------------- //

var Sidebar = function (_Component) {
	(0, _inherits3.default)(Sidebar, _Component);

	// ------------------- //

	function Sidebar(props) {
		(0, _classCallCheck3.default)(this, Sidebar);

		var _this = (0, _possibleConstructorReturn3.default)(this, (Sidebar.__proto__ || (0, _getPrototypeOf2.default)(Sidebar)).call(this, props));

		_this.displayName = "Sidebar";
		_this.state = {};
		return _this;
	}

	// ------------------- //

	(0, _createClass3.default)(Sidebar, [{
		key: "render",
		value: function render() {

			return false;

			var _props$wf_current_for = this.props.wf_current_formConfig,
			    wf_current_formConfig = _props$wf_current_for === undefined ? {} : _props$wf_current_for;

			return _react2.default.createElement(
				"wf-sidebar-data",
				null,
				_react2.default.createElement(
					_WFSection2.default,
					null,
					this.getFormDebug(wf_current_formConfig)
				)
			);

			return _react2.default.createElement(
				"wf-sidebar-data",
				null,
				_react2.default.createElement(
					_WFSection2.default,
					null,
					_react2.default.createElement(
						_WFTitle2.default,
						null,
						"Simple List"
					),
					_react2.default.createElement(_WFList2.default, {
						selected: [10],
						selectedBy: "label",
						selectable: true,
						view: function view(item, i) {
							var _item$label = item.label,
							    label = _item$label === undefined ? "" : _item$label,
							    _item$icon = item.icon,
							    icon = _item$icon === undefined ? "" : _item$icon;

							return _react2.default.createElement(
								"span",
								{ className: "item-content" },
								_react2.default.createElement(_WFIcon.WFIcon, { icon: icon, className: "first" }),
								_react2.default.createElement(
									_WFText2.default,
									null,
									label
								)
							);
						},
						onClick: function onClick(item) {
							console.log("onClick : ", item);
						},
						rowsClassName: "wf-item",
						rows: [{ label: "Create le 26/01/2016", icon: "clock" }, { label: "150 000 users", icon: "happy" }, { label: "200 000 messages", icon: "chat" }, { label: "150 000 publications", icon: "toolbox" }, { label: "150 Go of Media", icon: "layers" }, { label: "450 000 000 visits", icon: "global" }, { label: "1460 Groups", icon: "linegraph" }]
					})
				)
			);
		}

		// ------------------- //

		// todo charly remove after dev field
		// ------------------- //

	}, {
		key: "getFormDebug",
		value: function getFormDebug(wf_current_form) {
			var _wf_current_form$fiel = wf_current_form.fields,
			    fields = _wf_current_form$fiel === undefined ? [] : _wf_current_form$fiel;

			return _react2.default.createElement(
				_WFSection2.default,
				{
					visible: true
				},
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					"Fields Debugger"
				),
				_react2.default.createElement(
					"wf-debugger",
					null,
					_react2.default.createElement(
						"div",
						null,
						_react2.default.createElement(
							"pre",
							null,
							(0, _stringify2.default)(fields, 0, 2)
						)
					)
				),
				_react2.default.createElement(
					_WFTitle2.default,
					null,
					"Forms Debugger"
				),
				_react2.default.createElement(
					"wf-debugger",
					null,
					_react2.default.createElement(
						"div",
						null,
						_react2.default.createElement(
							"pre",
							null,
							(0, _stringify2.default)(wf_current_form, 0, 2)
						)
					)
				)
			);
		}

		// ------------------- //

		// COMPONENT LIFECYCLE ------------------- //

		// ------------------- //

	}, {
		key: "componentWillMount",
		value: function componentWillMount() {
			if ((0, _Lodash.isFunction)(this.willMount)) {
				this.willMount(this);
			}
		}
	}, {
		key: "componentDidMount",
		value: function componentDidMount() {
			if ((0, _Lodash.isFunction)(this.didMount)) {
				this.didMount(this);
			}
		}
	}, {
		key: "componentWillUnmount",
		value: function componentWillUnmount() {
			if ((0, _Lodash.isFunction)(this.willUnmount)) {
				this.willUnmount(this);
			}
		}

		// ------------------- //

	}]);
	return Sidebar;
}(_react.Component);

// ------------------- //


exports.default = Sidebar;
// ------------------- //

/***/ }),
/* 480 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _WFHeaderView = __webpack_require__(469);

var _WFHeaderView2 = _interopRequireDefault(_WFHeaderView);

var _WFStudioBodyView = __webpack_require__(470);

var _WFStudioBodyView2 = _interopRequireDefault(_WFStudioBodyView);

var _WFStudioSidebarView = __webpack_require__(471);

var _WFStudioSidebarView2 = _interopRequireDefault(_WFStudioSidebarView);

var _WFActionsBodyView = __webpack_require__(463);

var _WFActionsBodyView2 = _interopRequireDefault(_WFActionsBodyView);

var _WFActionsSidebarView = __webpack_require__(464);

var _WFActionsSidebarView2 = _interopRequireDefault(_WFActionsSidebarView);

var _WFEntriesBodyView = __webpack_require__(467);

var _WFEntriesBodyView2 = _interopRequireDefault(_WFEntriesBodyView);

var _WFEntriesSidebarView = __webpack_require__(468);

var _WFEntriesSidebarView2 = _interopRequireDefault(_WFEntriesSidebarView);

var _WFAnalyticsBodyView = __webpack_require__(465);

var _WFAnalyticsBodyView2 = _interopRequireDefault(_WFAnalyticsBodyView);

var _WFAnalyticsSidebarView = __webpack_require__(466);

var _WFAnalyticsSidebarView2 = _interopRequireDefault(_WFAnalyticsSidebarView);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ------------------- //

// WF EDITOR VIEW CONFIG ------------------- //

// ------------------- //


// WF VIEW COMPONENTS  ----------- //

var WFPageFormEditorConfig = {
  name: _Constants.PAGE_FORM_EDITOR,
  current: _Constants.TAB_EDITOR_STUDIO,
  visible: false,
  elements: {
    header: _WFHeaderView2.default
  },
  tabs: [{
    name: _Constants.TAB_EDITOR_STUDIO,
    label: _Constants.TAB_EDITOR_STUDIO_LABEL,
    body: _WFStudioBodyView2.default,
    sidebar: _WFStudioSidebarView2.default
  }, {
    name: _Constants.TAB_EDITOR_ACTIONS,
    label: _Constants.TAB_EDITOR_ACTIONS_LABEL,
    body: _WFActionsBodyView2.default,
    sidebar: _WFActionsSidebarView2.default
  }, {
    name: _Constants.TAB_EDITOR_ENTRIES,
    label: _Constants.TAB_EDITOR_ENTRIES_LABEL,
    body: _WFEntriesBodyView2.default,
    sidebar: _WFEntriesSidebarView2.default
  }, {
    name: _Constants.TAB_EDITOR_ANALYTICS,
    label: _Constants.TAB_EDITOR_ANALYTICS_LABEL,
    body: _WFAnalyticsBodyView2.default,
    sidebar: _WFAnalyticsSidebarView2.default
  }]
};
// ------------------- //
exports.default = WFPageFormEditorConfig;
// ------------------- //

/***/ }),
/* 481 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFSidebarView = __webpack_require__(479);

var _WFSidebarView2 = _interopRequireDefault(_WFSidebarView);

var _WFCreateBodyView = __webpack_require__(476);

var _WFCreateBodyView2 = _interopRequireDefault(_WFCreateBodyView);

var _WFArchiveBodyView = __webpack_require__(472);

var _WFArchiveBodyView2 = _interopRequireDefault(_WFArchiveBodyView);

var _WFArchiveSidebarView = __webpack_require__(473);

var _WFArchiveSidebarView2 = _interopRequireDefault(_WFArchiveSidebarView);

var _WFBaobabBodyView = __webpack_require__(474);

var _WFBaobabBodyView2 = _interopRequireDefault(_WFBaobabBodyView);

var _WFBaobabSidebarView = __webpack_require__(475);

var _WFBaobabSidebarView2 = _interopRequireDefault(_WFBaobabSidebarView);

var _WFSettingBodyView = __webpack_require__(477);

var _WFSettingBodyView2 = _interopRequireDefault(_WFSettingBodyView);

var _WFSettingSidebarView = __webpack_require__(478);

var _WFSettingSidebarView2 = _interopRequireDefault(_WFSettingSidebarView);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var tabs = [{
  name: _Constants.TAB_HOME_CREATE,
  label: _Constants.TAB_HOME_CREATE_LABEL,
  body: _WFCreateBodyView2.default,
  sidebar: _WFSidebarView2.default
}, {
  name: _Constants.TAB_HOME_FORM,
  label: _Constants.TAB_HOME_FORM_LABEL,
  body: _WFArchiveBodyView2.default,
  sidebar: _WFArchiveSidebarView2.default
}, {
  name: _Constants.TAB_HOME_BAOBAB,
  label: _Constants.TAB_HOME_BAOBAB_LABEL,
  body: _WFBaobabBodyView2.default,
  sidebar: _WFBaobabSidebarView2.default
}, {
  name: _Constants.TAB_HOME_SETTING,
  label: _Constants.TAB_HOME_SETTING_LABEL,
  body: _WFSettingBodyView2.default,
  sidebar: _WFSettingSidebarView2.default
}];

// ------------------- //

// WF HOME VIEW CONFIG ------------------- //

// ------------------- //

// WF VIEW COMPONENTS  ----------- //
var WFPageHomeConfig = {
  name: _Constants.PAGE_HOME,
  current: _Constants.TAB_HOME_CREATE,
  visible: true,
  tabs: tabs
};

// ------------------- //
exports.default = WFPageHomeConfig;
// ------------------- //

/***/ }),
/* 482 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the comfirm box
 * @code
  Pub(WF_ALERT, {
    banner        : ":url",
    title         : ":string",
    message       : ":html",
    btnLabel      : ":string",
    btnCallback   : ":callback",
    onCancel      : () => alert('onCancel...')
  })
 * @endcode
 *
 * Hidden the alert box
 * @code
  Pub(WF_ALERT)
 * @endcode
 *
 */
var WFAlert = function () {
  function WFAlert() {
    (0, _classCallCheck3.default)(this, WFAlert);
  }

  (0, _createClass3.default)(WFAlert, null, [{
    key: "on",
    value: function on() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_ALERT, WFAlert.getContext(context)));
    }
  }, {
    key: "getContext",
    value: function getContext(context) {
      if ((0, _keys2.default)(context).length > 0) {
        return (0, _assign2.default)({
          banner: "",
          title: "",
          message: "",
          btnLabel: "",
          btnCallback: null
        }, context);
      } else {
        return {};
      }
    }
  }]);
  return WFAlert;
}();

(0, _WFAdminView.Sub)(_Constants.WF_ALERT, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if ((0, _Lodash.isObject)(context)) {
    WFAlert.on(context);
  }
});

/***/ }),
/* 483 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the comfirm box
 * @code
  Pub(WF_COMFIRM, {
    labelCancel   : "no",
    labelValid    : "yes",
    message       : "Would you want to unpublish your form ?",
    legend        : "if you want edit this, unpublish before...",
    onValid       : () => alert('onValid...'),
    onCancel      : () => alert('onCancel...')
  })
 * @endcode
 *
 * Hidden the comfirm box
 * @code
  Pub(WF_COMFIRM)
 * @endcode
 *
 */
var WFComfirm = function () {
  function WFComfirm() {
    (0, _classCallCheck3.default)(this, WFComfirm);
  }

  (0, _createClass3.default)(WFComfirm, null, [{
    key: "on",
    value: function on() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_COMFIRM, WFComfirm.getContext(context)));
    }
  }, {
    key: "getContext",
    value: function getContext(context) {
      var onCancel = context.onCancel,
          onValid = context.onValid;

      return (0, _assign2.default)({
        labelValid: "continue",
        labelCancel: "cancel",
        message: "msg not define...",
        legend: "",
        onValidCallBack: function onValidCallBack() {
          (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY);
          if ((0, _Lodash.isFunction)(onValid)) {
            setTimeout(function () {
              return onValid();
            }, 100);
          }
        },
        onCancelCallBack: function onCancelCallBack() {
          (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY);
          if ((0, _Lodash.isFunction)(onCancel)) {
            onCancel();
          }
        }
      }, context);
    }
  }]);
  return WFComfirm;
}();

(0, _WFAdminView.Sub)(_Constants.WF_COMFIRM, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if ((0, _Lodash.isObject)(context)) {
    if ((0, _keys2.default)(context).length > 0) {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY, {
        color: _Constants.COLOR_DARK,
        afterOpen: function afterOpen() {
          return WFComfirm.on(context);
        }
      });
    }
  }
});

/***/ }),
/* 484 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Screen = __webpack_require__(168);

var _Body = __webpack_require__(122);

var _WFormManagers = __webpack_require__(30);

var _WFEventTypes = __webpack_require__(16);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the editor
 * @code
  Pub(WF_EDITOR, {

    formView     : instance,

    widget        : "WF_PANEL",
    widgetConfig  : {size:"sm"},

    icon          : "cog",
    title         : "Panel Edit",
    message       : null,
    
    labelValid    : "Save",
    labelCancel   : "Cancel",
    
    onValid       : () => alert("onValid..."),
    onCancel      : () => alert("onCancel...")
  })
 * @endcode
 *
 */

var classes = {
  active: {
    editor: "wf-editor-open",
    modal: "wf-editor-modal",
    panel: "wf-editor-panel",
    tooltip: "wf-editor-tooltip",
    scroll: "wf-scroll-y"
  }
};

var WFEditor = function () {
  function WFEditor() {
    (0, _classCallCheck3.default)(this, WFEditor);
  }

  (0, _createClass3.default)(WFEditor, null, [{
    key: "on",
    value: function on(context) {
      if (!(0, _Lodash.isObject)(context)) {
        return;
      } else {
        if ((0, _keys2.default)(context).length === 0) {
          WFEditor.close();
          return;
        } else {
          var ctx = WFEditor.getContext(context);
          switch (ctx.widget) {

            case _Constants.WF_PANEL:
              WFEditor.panelEdit(ctx);
              break;

            case _Constants.WF_MODAL:
              WFEditor.modalEdit(ctx);
              break;

            case _Constants.WF_TOOLTIP:
              WFEditor.tooltipEdit(ctx);
              break;
          }
        }
      }
    }
  }, {
    key: "open",
    value: function open(widget, widgetConfig) {
      var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      var formView = context.formView,
          _context$customView = context.customView,
          customView = _context$customView === undefined ? null : _context$customView,
          _context$customViewAr = context.customViewArgs,
          customViewArgs = _context$customViewAr === undefined ? {} : _context$customViewAr;

      var _WFConfig$themes$get = _wfconfig2.default.themes.get("WFAdminTheme"),
          info = _WFConfig$themes$get.info,
          settingValues = _WFConfig$themes$get.settingValues;

      formView.setTheme(info.name, settingValues);
      _WFormManagers.formEditorMgr.set(formView);
      if (_WFormManagers.formEditorMgr.isReady()) {
        var _WFAdminView$setState;

        (0, _Body.BodyAddClass)(classes.active.editor);
        _WFAdminView2.default.setState((_WFAdminView$setState = {}, (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.IS_EDITING, true), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_EDITOR, true), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_EDITOR_READY, false), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_EDITOR_CUSTOM_VIEW, customView), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_EDITOR_CUSTOM_VIEW_ARGS, customViewArgs), (0, _defineProperty3.default)(_WFAdminView$setState, widget, widgetConfig), _WFAdminView$setState));
        formView.sub(_WFEventTypes.WF_EVENT_ONVALIDATE, function (isValid) {
          return WFEditor.setStatus(isValid);
        });
        if (formView.getFormState().hasEntryId()) {
          WFEditor.setStatus(true);
        }
      }
    }
  }, {
    key: "close",
    value: function close() {
      var _WFAdminView$setState2;

      (0, _Body.BodyRemoveClass)(classes.active.editor);
      (0, _Body.BodyRemoveClass)(classes.active.tooltip);
      (0, _Body.BodyRemoveClass)(classes.active.panel);
      (0, _Body.BodyRemoveClass)(classes.active.modal);
      (0, _Body.BodyRemoveClass)(classes.active.scroll);
      (0, _Screen.scrollTop)();
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY);
      _WFAdminView2.default.setState((_WFAdminView$setState2 = {}, (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.IS_EDITING, false), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_PANEL, {}), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_MODAL, {}), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_TOOLTIP, {}), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_EDITOR, false), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_EDITOR_READY, false), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_EDITOR_CUSTOM_VIEW, null), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_EDITOR_CUSTOM_VIEW_ARGS, {}), _WFAdminView$setState2));
      _WFormManagers.formEditorMgr.clear();
    }
  }, {
    key: "setStatus",
    value: function setStatus(state) {
      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_EDITOR_READY, state));
    }
  }, {
    key: "panelEdit",
    value: function panelEdit(context) {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY, {
        zIndex: 4000,
        color: _Constants.COLOR_TRANSPARENT,
        afterOpen: function afterOpen() {
          var widgetConfig = WFEditor.getPanelContext(context);
          WFEditor.open(_Constants.WF_PANEL, widgetConfig, context);
          (0, _Body.BodyAddClass)(classes.active.panel);
        },
        callBacks: {
          onClick: context.onClose
        }
      });
    }
  }, {
    key: "modalEdit",
    value: function modalEdit(context) {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY, {
        zIndex: 5000,
        color: _Constants.COLOR_DARK,
        afterOpen: function afterOpen() {
          var widgetConfig = WFEditor.getModalContext(context);
          WFEditor.open(_Constants.WF_MODAL, widgetConfig, context);
          (0, _Body.BodyAddClass)(classes.active.modal);
          (0, _Body.BodyAddClass)(classes.active.scroll);
        },
        callBacks: {
          onClick: context.onClose
        }
      });
    }
  }, {
    key: "tooltipEdit",
    value: function tooltipEdit(context) {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY, {
        zIndex: 4000,
        color: _Constants.COLOR_TRANSPARENT,
        afterOpen: function afterOpen() {
          var widgetConfig = WFEditor.getTooltipContext(context);
          WFEditor.open(_Constants.WF_TOOLTIP, widgetConfig, context);
          (0, _Body.BodyAddClass)(classes.active.tooltip);
        },
        callBacks: {
          onClick: context.onClose
        }
      });
    }
  }, {
    key: "getPanelContext",
    value: function getPanelContext(context) {
      var onValid = context.onValid,
          onCancel = context.onCancel,
          onClose = context.onClose,
          widgetConfig = context.widgetConfig;

      return (0, _assign2.default)({
        size: "sm",
        open: true,
        onValidCallBack: function onValidCallBack() {
          return onValid();
        },
        onCancelCallBack: function onCancelCallBack() {
          return onClose(function () {
            return (0, _Lodash.isFunction)(onCancel) ? onCancel() : null;
          });
        }
      }, context, widgetConfig);
    }
  }, {
    key: "getModalContext",
    value: function getModalContext(context) {
      var onValid = context.onValid,
          onCancel = context.onCancel,
          onClose = context.onClose;

      return (0, _assign2.default)({
        width: 780,
        visible: true,
        onValidCallBack: function onValidCallBack() {
          return onValid();
        },
        onCancelCallBack: function onCancelCallBack() {
          return onClose(function () {
            return (0, _Lodash.isFunction)(onCancel) ? onCancel() : null;
          });
        }
      }, context);
    }
  }, {
    key: "getTooltipContext",
    value: function getTooltipContext(context) {
      var title = context.title,
          _onValid = context.onValid,
          _onCancel = context.onCancel,
          onClose = context.onClose,
          widgetConfig = context.widgetConfig;

      return (0, _assign2.default)({
        top: 195,
        left: 368,
        visible: true,
        title: title,
        onValid: function onValid() {
          return _onValid();
        },
        onCancel: function onCancel() {
          return onClose(function () {
            return (0, _Lodash.isFunction)(_onCancel) ? _onCancel() : null;
          });
        }
      }, widgetConfig);
    }
  }, {
    key: "getContext",
    value: function getContext(context) {
      var _context$widget = context.widget,
          widget = _context$widget === undefined ? _Constants.WF_MODAL : _context$widget;

      return (0, _assign2.default)({

        widget: widget,
        widgetConfig: {},

        icon: "cog",
        title: null,
        message: null,

        labelValid: "Save",
        labelCancel: "Cancel",

        onValid: null,
        onCancel: null,
        onClose: function onClose() {
          var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

          WFEditor.close();
          if (next) {
            next();
          }
        }
      }, context);
    }
  }]);
  return WFEditor;
}();

(0, _WFAdminView.Sub)(_Constants.WF_EDITOR, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  return WFEditor.on(context);
});

/*

  Pub("wf_editor", {

      formView     : instance,

      widget        : "wf_panel",
      widgetConfig  : {size:"sm"},

      icon        : "cog",
      title       : "Panel Edit",
      
      labelValid  : "Save",
      labelCancel : "Cancel",
      
      onValid       : () => alert("onValid..."),
      onCancel      : () => alert("onCancel...")
  })

  Pub("wf_editor", {

      formView     : instance,

      widget        : "wf_modal",
      widgetConfig  : {size:"sm"},

      icon        : "cog",
      title       : "Modal Edit",
      message     : null,
      
      labelValid  : "Save",
      labelCancel : "Cancel",
      
      onValid       : () => alert("onValid..."),
      onCancel      : () => alert("onCancel...")
  })

  Pub("wf_editor", {

      formView     : instance,

      widget        : "wf_tooltip",
      widgetConfig  : {},

      title       : "",

      labelValid  : "Save",
      labelCancel : "Cancel",
      
      onValid       : () => alert("onValid..."),
      onCancel      : () => alert("onCancel...")
  })

*/

/***/ }),
/* 485 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

var _Body = __webpack_require__(122);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the livePlayer 
 * @code
 Pub(WF_LIVEPLAYER, {
    title: "",
    option: {...}
  })
 * @endcode
 *
 * Hidden the livePlayer
 * @code
  Pub(WF_LIVEPLAYER)
 * @endcode
 *
 */

var classes = {
  active: {
    editor: "wf-editor-open",
    modal: "wf-editor-modal",
    panel: "wf-editor-panel",
    tooltip: "wf-editor-tooltip",
    scroll: "wf-scroll-y"
  }
};

var WFLivePlayer = function () {
  function WFLivePlayer() {
    (0, _classCallCheck3.default)(this, WFLivePlayer);
  }

  (0, _createClass3.default)(WFLivePlayer, null, [{
    key: "open",
    value: function open() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      //console.log("WFLivePlayer open : ", context );
      (0, _Body.BodyAddClass)(classes.active.scroll);
      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_LIVEPLAYER, context));
    }
  }, {
    key: "close",
    value: function close() {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY);
      (0, _Body.BodyRemoveClass)(classes.active.scroll);
      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_LIVEPLAYER, {}));
    }
  }]);
  return WFLivePlayer;
}();

(0, _WFAdminView.Sub)(_Constants.WF_LIVEPLAYER, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if ((0, _Lodash.isObject)(context)) {
    if ((0, _keys2.default)(context).length === 0) {
      WFLivePlayer.close();
    } else {
      (0, _WFAdminView.Pub)(_Constants.WF_OVERLAY, {
        color: _Constants.COLOR_DARK,
        afterOpen: function afterOpen() {
          return WFLivePlayer.open(context);
        }
      });
    }
  }
});

/***/ }),
/* 486 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the loader
 * @code 
  Pub(WF_LOADER, true)
 * @endcode
 *
 * Hidden the loader
 * @code 
  Pub(WF_LOADER, false)
 * @endcode
 */
(0, _WFAdminView.Sub)(_Constants.WF_LOADER, function (state) {
  if ((0, _Lodash.isBoolean)(state)) {
    _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_LOADER, state));
  }
});

/***/ }),
/* 487 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Publish a notification
 * @code

  Pub(WF_NOTIFY,{
    msg : "Sauvegarde en cours...",
  })

  Pub(WF_NOTIFY,{
    type  : NOTIFY_SUCCESS, 
    msg   : "Form Sauvegardé...",
    delay : 2000
  })

  Pub(WF_NOTIFY,{
    type  : NOTIFY_ERROR, 
    msg   : "Error404 form not found...",
    delay : 3000
  })

  Pub(WF_NOTIFY,{
    type  : NOTIFY_WARNING, 
    msg   : "Update disponible...",
    delay : 4000
  })

 * @endcode
 *
 */

var Notify = new _WFArray2.default({
  isCollection: true,
  findBy: "id"
});

(0, _WFAdminView.Sub)(_Constants.WF_NOTIFY, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if ((0, _Lodash.isObject)(context)) {
    if ((0, _keys2.default)(context).length > 0) {
      var _context$delay = context.delay,
          delay = _context$delay === undefined ? 3000 : _context$delay,
          _context$type = context.type,
          type = _context$type === undefined ? _Constants.NOTIFY_INFO : _context$type,
          _context$msg = context.msg,
          msg = _context$msg === undefined ? "" : _context$msg;

      var id = parseInt((0, _Lodash.uniqueId)());
      Notify.insert({ id: id, msg: msg, type: type }, function () {
        _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_NOTIFY, {
          messages: Notify.getValue(),
          counter: Notify.getCounter()
        }));
        setTimeout(function () {
          Notify.delete(id);
          _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_NOTIFY, {
            messages: Notify.getValue(),
            counter: Notify.getCounter()
          }));
        }, delay);
      });
    }
  }
});

/*

test in console

Pub("wf_notify",{
  msg : "Sauvegarde en cours...",
})
setTimeout( () => WFAdminView.on("wf_notify",{
  type  : "success", 
  msg   : "Form Sauvegardé...",
  delay : 4000
})
, 1000 );
setTimeout( () => WFAdminView.on("wf_notify",{
  type  : "error", 
  msg   : "Error404 form not found...",
  delay : 4000
})
, 2000 );
setTimeout( () => WFAdminView.on("wf_notify",{
  type  : "warning", 
  msg   : "Update disponible...",
  delay : 4000
})
, 3000 );

*/

/***/ }),
/* 488 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _keys = __webpack_require__(19);

var _keys2 = _interopRequireDefault(_keys);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the overlay
 * @code
  Pub(WF_OVERLAY, {
    color           : "rgba(60,60,60,0.8)", 
    pointerEvents   : true,
    afterOpen       : () => console.log("afterOpen..."),
    beforeClose     : () => console.log("beforeClose..."),
    callBacks       : {
      onMouseEnter    : () => console.log("onMouseEnter..."),
      onMouseLeave    : () => console.log("onMouseLeave..."),
      onTouchStart    : () => console.log("onTouchStart..."),
      onClick         : () => console.log("onClick..."),
    }
  })
 * @endcode
 *
 * Hidden the overlay
 * @code
  WFAdminView.on(WF_OVERLAY)
 * @endcode
 *
 */
var WFOverlay = function () {
  function WFOverlay() {
    (0, _classCallCheck3.default)(this, WFOverlay);
  }

  (0, _createClass3.default)(WFOverlay, null, [{
    key: "open",
    value: function open() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_OVERLAY, WFOverlay.getContext(context)));
    }
  }, {
    key: "close",
    value: function close() {
      _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_OVERLAY, {}));
    }
  }, {
    key: "getContext",
    value: function getContext(context) {
      return (0, _assign2.default)({
        color: _Constants.COLOR_TRANSPARENT,
        visible: true,
        zIndex: 4000,
        afterOpen: null,
        beforeClose: null,
        callBacks: {}
      }, context);
    }
  }]);
  return WFOverlay;
}();

(0, _WFAdminView.Sub)(_Constants.WF_OVERLAY, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if ((0, _Lodash.isBoolean)(context)) {
    WFOverlay.open();
  } else if ((0, _Lodash.isObject)(context)) {
    if ((0, _keys2.default)(context).length > 0) {
      WFOverlay.open(context);
    } else {
      WFOverlay.close();
    }
  }
});

/***/ }),
/* 489 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _toConsumableArray2 = __webpack_require__(508);

var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Body = __webpack_require__(122);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Navigate in admin
 *
 * Back to home
 * @code
 * WFAdminView.on(WF_PAGE)
 * @endcode
 *
 * redirect to
 * @code
 * Pub(WF_PAGE, [
 *  PAGE_HOME,
 *  TAB_HOME_CREATE 
 * ])
 * @endcode
 */
var WFPage = function () {
  function WFPage() {
    (0, _classCallCheck3.default)(this, WFPage);
  }

  (0, _createClass3.default)(WFPage, null, [{
    key: "goHome",
    value: function goHome() {
      _WFAdminView2.default.changeView({
        name: _Constants.PAGE_HOME,
        tabName: _Constants.TAB_HOME_CREATE
      });
    }
  }, {
    key: "redirectTo",
    value: function redirectTo(pageName) {
      var tabName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var to = {
        name: pageName
      };
      if (tabName) {
        to["tabName"] = tabName;
      }
      _WFAdminView2.default.changeView(to);
    }
  }]);
  return WFPage;
}();

(0, _WFAdminView.Sub)(_Constants.WF_REDIRECT, function () {
  var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

  if ((0, _Lodash.isFunction)(callback)) {
    _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_REDIRECT, function () {
      callback();
      (0, _WFAdminView.Pub)(_Constants.WF_REDIRECT);
    }));
  } else {
    var _WFAdminView$setState2;

    _WFAdminView2.default.setState((_WFAdminView$setState2 = {}, (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_REDIRECT, null), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_LOADER, false), _WFAdminView$setState2));
  }
});

(0, _WFAdminView.Sub)(_Constants.WF_PAGE_TITLE, function () {
  var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

  if ((0, _Lodash.isString)(title)) {
    _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_PAGE_TITLE, title));
    (0, _Body.BodyAddClass)(_Constants.WF_PAGE_TITLE_BODY_CLASS);
  } else {
    _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_PAGE_TITLE, null));
    (0, _Body.BodyRemoveClass)(_Constants.WF_PAGE_TITLE_BODY_CLASS);
  }
});

(0, _WFAdminView.Sub)(_Constants.WF_PAGE, function () {
  var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

  if ((0, _Lodash.isArray)(args)) {
    var count = args.length;
    if (count === 0) {
      WFPage.goHome();
    } else if (count === 1) {
      WFPage.redirectTo(args[0]);
    } else {
      WFPage.redirectTo.apply(WFPage, (0, _toConsumableArray3.default)(args));
    }
  }
});

/*

  Pub(WF_COMFIRM, {
    labelCancel   : "no",
    labelValid    : "yes",
    message       : `Are you sure ?`,
    legend        : "...",
    onValid       : () => {
      WFAdminView.changeView(to)
    }
  })

*/

/***/ }),
/* 490 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _classCallCheck2 = __webpack_require__(0);

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = __webpack_require__(1);

var _createClass3 = _interopRequireDefault(_createClass2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _Lodash = __webpack_require__(6);

var _Body = __webpack_require__(122);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
 * Display the panel custom
 * @code
  Pub(WF_PANELS, {
    size          : "md", // sm || md || lg
    labelCancel   : "no",
    labelValid    : "yes",
    title         : "Panel Custom",
    onValid       : () => alert('onValid...'),
    onCancel      : () => alert('onCancel...')
  })
 * @endcode
 *
 * Hidden the comfirm box
 * @code
  WFAdminView.on(WF_COMFIRM)
 * @endcode
 *
 */
var classes = {
  active: {
    panels: "wf-panels"
  }
};

var WFPanels = function () {
  function WFPanels() {
    (0, _classCallCheck3.default)(this, WFPanels);
  }

  (0, _createClass3.default)(WFPanels, null, [{
    key: "open",
    value: function open() {
      var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      if ((0, _Lodash.isObject)(context)) {
        var _WFAdminView$setState;

        var _context$customView = context.customView,
            customView = _context$customView === undefined ? null : _context$customView,
            _context$customViewAr = context.customViewArgs,
            customViewArgs = _context$customViewAr === undefined ? {} : _context$customViewAr;

        (0, _Body.BodyAddClass)(classes.active.panels);
        _WFAdminView2.default.setState((_WFAdminView$setState = {}, (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_PANELS, WFPanels.getContext(context)), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_PANELS_CUSTOM, customView), (0, _defineProperty3.default)(_WFAdminView$setState, _Constants.WF_PANELS_CUSTOM_ARGS, customViewArgs), _WFAdminView$setState));
      }
    }
  }, {
    key: "close",
    value: function close() {
      var _WFAdminView$setState2;

      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      (0, _Body.BodyRemoveClass)(classes.active.panels);
      _WFAdminView2.default.setState((_WFAdminView$setState2 = {}, (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_PANELS, {}), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_PANELS_CUSTOM, null), (0, _defineProperty3.default)(_WFAdminView$setState2, _Constants.WF_PANELS_CUSTOM_ARGS, {}), _WFAdminView$setState2));
      if ((0, _Lodash.isFunction)(next)) {
        next();
      }
    }
  }, {
    key: "getContext",
    value: function getContext(context) {
      var onCancel = context.onCancel,
          onValid = context.onValid;

      if (context.hasOwnProperty("customView")) {
        delete context.customView;
      }
      if (context.hasOwnProperty("customViewArgs")) {
        delete context.customViewArgs;
      }
      return (0, _assign2.default)({
        size: "md", // sm || md || lg
        open: true,
        labelCancel: "no",
        labelValid: "yes",
        message: "Would you want to unpublish your form ?",
        legend: "if you want edit this, unpublish before...",
        onValidCallBack: function onValidCallBack() {
          return onValid();
        },
        onCancelCallBack: function onCancelCallBack() {
          return WFPanels.close(onCancel);
        }
      }, context);
    }
  }]);
  return WFPanels;
}();

(0, _WFAdminView.Sub)(_Constants.WF_PANELS, function () {
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

  if ((0, _Lodash.isObject)(context)) {
    WFPanels.open(context);
  } else {
    WFPanels.close();
  }
});

/*
  WFAdminView.on("wf_panels", {
    size          : "md",
    labelCancel   : "cancel",
    labelValid    : "save",
    title         : "Panel Custom",
    onValid       : () => alert('onValid...'),
    onCancel      : () => alert('onCancel...')
  })
*/

/***/ }),
/* 491 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _WFBaobab = __webpack_require__(224);

var _WFBaobab2 = _interopRequireDefault(_WFBaobab);

var _WFBaobabObserver = __webpack_require__(225);

var _WFBaobabObserver2 = _interopRequireDefault(_WFBaobabObserver);

var _wflicense = __webpack_require__(162);

var _wflicense2 = _interopRequireDefault(_wflicense);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.BAOBAB ----------------- //

// ----------------- //

/**
 * baobab hook the current view with the model
 * view => WFBaobabMgr.viewMrg contains global state
 * model => WFBaobabMgr.mgr
 * component => hook with {willMount, willUnMount}
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var baobab = function baobab() {
  var modules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};


  /**
   * Manager
   **/
  var WFBaobabMgr = new _WFBaobab2.default();

  // todo remove after
  window.WFBaobabMgr = WFBaobabMgr;

  /**
   * Modules
   **/
  var tree = modules.tree,
      branch = modules.branch,
      option = modules.option;

  /**
   * Private props
   **/

  var isInit = false;

  /**
   * Private method
   **/
  var onLoad = function onLoad() {
    var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    WFBaobabMgr.viewMgr.setState({
      page_loader: flag
    });
  };

  /**
   * Public method
   **/
  var fn = {

    /**
     * Call when the user enters the page
     */
    onInit: function onInit() {
      if (!isInit) {
        _WFBaobabObserver2.default.observe(WFBaobabMgr, {
          change: function change() {
            return onLoad();
          },
          ready: function ready() {
            return onLoad(false);
          }
        });
        isInit = true;
      }
      fn.onFind();
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

      WFBaobabMgr.clear(force);
      _WFBaobabObserver2.default.unObserve(WFBaobabMgr);
      isInit = false;
    },

    /**
     * Find in current {tree || branch || option}
     * @param args {page}
     */
    onFind: function onFind() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      WFBaobabMgr.find(args);
    },


    /**
     * Search in current {tree || branch || option}
     * @param value 
     */
    onSearch: function onSearch() {
      var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";

      WFBaobabMgr.search(value, 1);
    },


    /**
     * Explore tree || branch || option
     * @param type is tree || branch || option
     * @param optionConfig   
     */
    onExplore: function onExplore(type, optionConfig) {
      WFBaobabMgr.explore(optionConfig, type);
    },


    /**
     * Select option in current {tree || branch || option}
     * @param optionConfig   
     */
    onSelect: function onSelect(optionConfig) {
      WFBaobabMgr.select(optionConfig);
    },


    // MANAGE OPTION ------------- //

    /**
     * Create tree || branch || option
     * @param type is tree || branch || option
     */
    onCreate: function onCreate(type) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      switch (type) {
        case _Constants.WF_BAOBAB_TREE:
          tree.onCreate(WFBaobabMgr);
          break;

        case _Constants.WF_BAOBAB_BRANCH:
          branch.onCreate(WFBaobabMgr);
          break;

        case _Constants.WF_BAOBAB_OPTION:
          option.onCreate(WFBaobabMgr, args);
          break;
      }
    },


    /**
     * Edit tree || branch || option
     * @param type is tree || branch || option
     * @param optionConfig   
     */
    onEdit: function onEdit(type, optionConfig) {
      var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

      switch (type) {
        case _Constants.WF_BAOBAB_TREE:
          tree.onEdit(WFBaobabMgr, optionConfig, args);
          break;

        case _Constants.WF_BAOBAB_BRANCH:
          branch.onEdit(WFBaobabMgr, optionConfig, args);
          break;

        case _Constants.WF_BAOBAB_OPTION:
          option.onEdit(WFBaobabMgr, optionConfig, args);
          break;
      }
    },


    /**
     * Del selection in {tree || branch || option}
     * @param type is tree || branch || option
     * @param optionConfig  
     */
    onDel: function onDel(type) {
      var optionConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

      (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
        labelCancel: "no",
        labelValid: "yes",
        message: "Would you want to delete ?",
        legend: "...",
        onValid: function onValid() {
          switch (type) {
            case _Constants.WF_BAOBAB_TREE:
              tree.onDel(WFBaobabMgr, optionConfig);
              break;

            case _Constants.WF_BAOBAB_BRANCH:
              branch.onDel(WFBaobabMgr, optionConfig);
              break;

            case _Constants.WF_BAOBAB_OPTION:
              option.onDel(WFBaobabMgr);
              break;
          }
        }
      });
    },


    // ------------------------------ //
    // COMPONENTS HELPERS
    // ------------------------------ //


    // MANAGE COMPONENT ------------- //

    /**
     * When the component mount set
     */
    willMount: function willMount(component) {
      WFBaobabMgr.viewMgr.willMount(component);
    },

    /**
     * When the component unmount unset
     */
    willUnMount: function willUnMount(component) {
      WFBaobabMgr.viewMgr.willUnMount(component);
    },

    // COMPONENT CONFIG ---------------------- //

    /**
     * Get the config of WFtable component for tree archive
     * @return object 
     */
    getWFTableConfigForTreeArchive: function getWFTableConfigForTreeArchive() {
      var _ref;

      return _ref = {

        // Table Config -- //
        level: 1,
        visible: true,
        head: false,

        // Table ScrollBar Config -- //
        scrollAutoHide: false,
        scrollheightMax: 685,
        scrollheightMin: 0,

        // Table Cell Config -- //
        cellConfig: {
          preview: true,
          previewSplit: ",",
          limit: {
            string: 25,
            text: 45,
            select: 40
          }
        },

        // Table Capabilities -- //
        canOpen: true,
        canDelete: true,

        // Capabilities Hook -- //
        onOpen: function onOpen(val, optionConfig) {
          fn.onExplore(_Constants.WF_BAOBAB_TREE, optionConfig);
        },
        onDelete: function onDelete(val, optionConfig) {
          fn.onDel(_Constants.WF_BAOBAB_TREE, optionConfig);
        }

      }, (0, _defineProperty3.default)(_ref, "cellConfig", {
        preview: true,
        previewSplit: ",",
        limit: {
          string: 25,
          text: 45,
          select: 40
        }
      }), (0, _defineProperty3.default)(_ref, "cellCallbacks", {
        label: function label(val, optionConfig) {
          fn.onEdit(_Constants.WF_BAOBAB_TREE, optionConfig);
        }
      }), (0, _defineProperty3.default)(_ref, "rowConfig", {
        values: ["id", "label", "name", "options_count"],
        types: ["id", "text", "string", "number"]
      }), (0, _defineProperty3.default)(_ref, "selectBy", "id"), (0, _defineProperty3.default)(_ref, "openBy", "id"), _ref;
    },

    /**
     * Get the config of WFtable component for branch archive
     * @return object 
     */
    getWFTableConfigForBranchArchive: function getWFTableConfigForBranchArchive() {
      var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;

      return {

        // Table Config -- //
        level: level,
        visible: true,
        head: false,

        // Table ScrollBar Config -- //
        scrollAutoHide: false,
        scrollheightMax: 685,
        scrollheightMin: 0,

        // Table Capabilities -- //
        canSelect: true,
        // Capabilities Hook -- //
        onSelect: function onSelect(val, optionConfig) {
          fn.onSelect(optionConfig);
        },

        // Table Cell Config -- //
        cellConfig: {
          preview: true,
          previewSplit: ",",
          limit: {
            string: 25,
            text: 45,
            select: 40
          }
        },
        cellCallbacks: {
          label: function label(val, optionConfig) {
            fn.onEdit(_Constants.WF_BAOBAB_OPTION, optionConfig);
          }
        },

        // Config Row -- //
        rowConfig: {
          values: ["id", "label", "name", "options_count"],
          types: ["id", "text", "string", "number"]
        },

        // Select Hook -- //
        selectBy: "id"
      };
    },

    /**
     * Get the config of WFtable component for option archive
     * @return object 
     */
    getWFTableConfigForOptionArchive: function getWFTableConfigForOptionArchive(isOpened) {
      return {

        // Table Config -- //
        visible: true,
        head: false,

        // Table ScrollBar Config -- //
        scrollAutoHide: false,
        scrollheightMax: 685,
        scrollheightMin: 0,

        // Table Cell Config -- //
        cellConfig: {
          preview: true,
          previewSplit: ",",
          limit: {
            string: 25,
            text: 45,
            select: 40
          }
        },

        // Table Capabilities -- //
        canSelect: true,
        canAdd: true,
        canOpen: true,

        // Capabilities Hook -- //
        onSelect: function onSelect(val, optionConfig) {
          fn.onSelect(optionConfig);
        },
        onAdd: function onAdd(val, optionConfig) {
          fn.onCreate(_Constants.WF_BAOBAB_OPTION, {
            optionId: isOpened ? null : optionConfig.id
          });
        },
        onOpen: function onOpen(val, optionConfig) {
          fn.onExplore(_Constants.WF_BAOBAB_OPTION, optionConfig);
        },

        cellCallbacks: {
          label: function label(val, optionConfig) {
            fn.onEdit(_Constants.WF_BAOBAB_OPTION, optionConfig);
          }
        },

        // Config Row -- //
        rowConfig: {
          values: ["id", "label", "name", "options_count"],
          types: ["id", "text", "string", "number"]
        },

        // Select Hook -- //
        selectBy: "id",
        // Open Hook -- //
        openBy: "id"
      };
    },

    /**
     * Get the config of WFtable component for branch archive
     * @return object 
     */
    getWFSectionTitleConfig: function getWFSectionTitleConfig(component) {
      var _component$state = component.state,
          _component$state$wf_b = _component$state.wf_baobab_selection,
          wf_baobab_selection = _component$state$wf_b === undefined ? [] : _component$state$wf_b,
          _component$state$wf_b2 = _component$state.wf_baobab_tree_pager,
          wf_baobab_tree_pager = _component$state$wf_b2 === undefined ? {} : _component$state$wf_b2,
          wf_baobab_is_tree_archive = _component$state.wf_baobab_is_tree_archive,
          wf_baobab_is_branch_archive = _component$state.wf_baobab_is_branch_archive,
          wf_baobab_is_option_archive = _component$state.wf_baobab_is_option_archive,
          _component$state$wf_b3 = _component$state.wf_baobab_current_tree,
          wf_baobab_current_tree = _component$state$wf_b3 === undefined ? {} : _component$state$wf_b3,
          _component$state$wf_b4 = _component$state.wf_baobab_current_branch,
          wf_baobab_current_branch = _component$state$wf_b4 === undefined ? {} : _component$state$wf_b4,
          _component$state$wf_b5 = _component$state.wf_baobab_current_option,
          wf_baobab_current_option = _component$state$wf_b5 === undefined ? {} : _component$state$wf_b5;

      var shortTitle = "";
      var title = "Baobab → ";
      var counter = 0;
      var counterMax = 0;

      if (wf_baobab_selection.length > 0) {
        shortTitle = "option(s) selected ";
        title += shortTitle;
        counter = wf_baobab_selection.length;
        counterMax = 0;
      } else if (wf_baobab_is_branch_archive) {
        var _wf_baobab_current_br = wf_baobab_current_branch.label,
            label = _wf_baobab_current_br === undefined ? "" : _wf_baobab_current_br,
            _wf_baobab_current_br2 = wf_baobab_current_branch.optionPager,
            optionPager = _wf_baobab_current_br2 === undefined ? {} : _wf_baobab_current_br2;
        var _optionPager$countCur = optionPager.countCursor,
            countCursor = _optionPager$countCur === undefined ? 0 : _optionPager$countCur,
            _optionPager$totalRow = optionPager.totalRow,
            totalRow = _optionPager$totalRow === undefined ? 0 : _optionPager$totalRow;

        shortTitle = label;
        title += "tree  \u2192 branch \u2192 " + label;
        counter = countCursor;
        counterMax = totalRow;
      } else if (wf_baobab_is_option_archive) {
        var _wf_baobab_current_op = wf_baobab_current_option.label,
            _label = _wf_baobab_current_op === undefined ? "" : _wf_baobab_current_op,
            _wf_baobab_current_op2 = wf_baobab_current_option.optionPager,
            _optionPager = _wf_baobab_current_op2 === undefined ? {} : _wf_baobab_current_op2;

        var _optionPager$countCur2 = _optionPager.countCursor,
            _countCursor = _optionPager$countCur2 === undefined ? 0 : _optionPager$countCur2,
            _optionPager$totalRow2 = _optionPager.totalRow,
            _totalRow = _optionPager$totalRow2 === undefined ? 0 : _optionPager$totalRow2;

        shortTitle = _label;
        title += "tree  \u2192 option \u2192 " + _label;
        counter = _countCursor;
        counterMax = _totalRow;
      } else if (wf_baobab_is_tree_archive) {
        var _wf_baobab_current_tr = wf_baobab_current_tree.label,
            _label2 = _wf_baobab_current_tr === undefined ? "" : _wf_baobab_current_tr,
            _wf_baobab_current_tr2 = wf_baobab_current_tree.optionPager,
            _optionPager2 = _wf_baobab_current_tr2 === undefined ? {} : _wf_baobab_current_tr2;

        var _optionPager2$countCu = _optionPager2.countCursor,
            _countCursor2 = _optionPager2$countCu === undefined ? 0 : _optionPager2$countCu,
            _optionPager2$totalRo = _optionPager2.totalRow,
            _totalRow2 = _optionPager2$totalRo === undefined ? 0 : _optionPager2$totalRo;

        shortTitle = _label2;
        title += "tree  \u2192 " + _label2;
        counter = _countCursor2;
        counterMax = _totalRow2;
      } else {
        var _wf_baobab_tree_pager = wf_baobab_tree_pager.countCursor,
            _countCursor3 = _wf_baobab_tree_pager === undefined ? 0 : _wf_baobab_tree_pager,
            _wf_baobab_tree_pager2 = wf_baobab_tree_pager.totalRow,
            _totalRow3 = _wf_baobab_tree_pager2 === undefined ? 0 : _wf_baobab_tree_pager2;

        shortTitle = "tree archive";
        title += "tree archive";
        counter = _countCursor3;
        counterMax = _totalRow3;
      }
      if (counter > 0) {
        title += " | ";
      }
      return {
        title: title,
        shortTitle: shortTitle,
        counter: counter,
        counterMax: counterMax
      };
    },

    /**
     * Get the Status of WFList component 
     * @return object 
     */
    getWFListStatusConfig: function getWFListStatusConfig(component) {
      var _component$state2 = component.state,
          _component$state2$wf_ = _component$state2.wf_baobab_tree_rows,
          wf_baobab_tree_rows = _component$state2$wf_ === undefined ? [] : _component$state2$wf_,
          _component$state2$wf_2 = _component$state2.wf_baobab_tree_pager,
          wf_baobab_tree_pager = _component$state2$wf_2 === undefined ? {} : _component$state2$wf_2,
          wf_baobab_is_tree_archive = _component$state2.wf_baobab_is_tree_archive,
          wf_baobab_is_branch_archive = _component$state2.wf_baobab_is_branch_archive,
          wf_baobab_is_option_archive = _component$state2.wf_baobab_is_option_archive,
          _component$state2$wf_3 = _component$state2.wf_baobab_current_tree,
          wf_baobab_current_tree = _component$state2$wf_3 === undefined ? {} : _component$state2$wf_3,
          _component$state2$wf_4 = _component$state2.wf_baobab_current_branch,
          wf_baobab_current_branch = _component$state2$wf_4 === undefined ? {} : _component$state2$wf_4,
          _component$state2$wf_5 = _component$state2.wf_baobab_current_option,
          wf_baobab_current_option = _component$state2$wf_5 === undefined ? {} : _component$state2$wf_5;
      var _wf_baobab_current_tr3 = wf_baobab_current_tree.label,
          label = _wf_baobab_current_tr3 === undefined ? "" : _wf_baobab_current_tr3,
          _wf_baobab_current_tr4 = wf_baobab_current_tree.options_count,
          options_count = _wf_baobab_current_tr4 === undefined ? 0 : _wf_baobab_current_tr4;

      var title = "Baobab → ";
      var counterMax = wf_baobab_tree_rows.length;
      var callback = false;
      if (wf_baobab_is_tree_archive || wf_baobab_is_option_archive || wf_baobab_is_branch_archive) {
        title = label;
        counterMax = options_count;
      }
      if (wf_baobab_is_branch_archive) {
        callback = function callback() {
          fn.onExplore(_Constants.WF_BAOBAB_BRANCH, wf_baobab_current_branch);
        };
      } else if (wf_baobab_is_option_archive) {
        callback = function callback() {
          fn.onExplore(_Constants.WF_BAOBAB_OPTION, wf_baobab_current_option);
        };
      } else if (wf_baobab_is_tree_archive) {
        callback = function callback() {
          fn.onExplore(_Constants.WF_BAOBAB_TREE, wf_baobab_current_tree);
        };
      }
      return {
        title: title,
        counterMax: counterMax,
        callback: callback
      };
    },


    /**
     * Get the config of WFList component for branch archive actions
     * @return object 
     */
    getWFListBranchArchiveConfig: function getWFListBranchArchiveConfig(component) {
      var _component$state3 = component.state,
          _component$state3$bra = _component$state3.branch_history,
          branch_history = _component$state3$bra === undefined ? [] : _component$state3$bra,
          _component$state3$wf_ = _component$state3.wf_baobab_selection,
          wf_baobab_selection = _component$state3$wf_ === undefined ? [] : _component$state3$wf_,
          wf_baobab_is_branch_archive = _component$state3.wf_baobab_is_branch_archive,
          _component$state3$wf_2 = _component$state3.wf_baobab_current_tree,
          wf_baobab_current_tree = _component$state3$wf_2 === undefined ? {} : _component$state3$wf_2,
          _component$state3$wf_3 = _component$state3.wf_baobab_current_branch,
          wf_baobab_current_branch = _component$state3$wf_3 === undefined ? {} : _component$state3$wf_3,
          _component$state3$wf_4 = _component$state3.wf_baobab_current_branch_id,
          wf_baobab_current_branch_id = _component$state3$wf_4 === undefined ? null : _component$state3$wf_4;
      var _wf_baobab_current_tr5 = wf_baobab_current_tree.id,
          id = _wf_baobab_current_tr5 === undefined ? null : _wf_baobab_current_tr5,
          _wf_baobab_current_tr6 = wf_baobab_current_tree.label,
          label = _wf_baobab_current_tr6 === undefined ? "" : _wf_baobab_current_tr6,
          _wf_baobab_current_tr7 = wf_baobab_current_tree.options_count,
          options_count = _wf_baobab_current_tr7 === undefined ? 0 : _wf_baobab_current_tr7,
          _wf_baobab_current_tr8 = wf_baobab_current_tree.branches,
          branches = _wf_baobab_current_tr8 === undefined ? [] : _wf_baobab_current_tr8,
          _wf_baobab_current_tr9 = wf_baobab_current_tree.options,
          options = _wf_baobab_current_tr9 === undefined ? [] : _wf_baobab_current_tr9,
          _wf_baobab_current_tr10 = wf_baobab_current_tree.branchPager,
          branchPager = _wf_baobab_current_tr10 === undefined ? {} : _wf_baobab_current_tr10,
          _wf_baobab_current_tr11 = wf_baobab_current_tree.optionPager,
          optionPager = _wf_baobab_current_tr11 === undefined ? {} : _wf_baobab_current_tr11;

      return {
        visible: wf_baobab_selection.length === 0,
        rows: wf_baobab_is_branch_archive ? [wf_baobab_current_branch] : branches,
        selected: wf_baobab_is_branch_archive ? [wf_baobab_current_branch_id] : [],
        active: branch_history
      };
    },


    /**
     * Get the config of WFList component for all actions
     * @return object 
     */
    getWFListActionsConfig: function getWFListActionsConfig(component) {
      var _component$state4 = component.state,
          _component$state4$wf_ = _component$state4.wf_baobab_selection,
          wf_baobab_selection = _component$state4$wf_ === undefined ? [] : _component$state4$wf_,
          wf_baobab_is_tree_archive = _component$state4.wf_baobab_is_tree_archive,
          wf_baobab_is_branch_archive = _component$state4.wf_baobab_is_branch_archive,
          wf_baobab_is_option_archive = _component$state4.wf_baobab_is_option_archive,
          _component$state4$wf_2 = _component$state4.wf_baobab_current_branch,
          wf_baobab_current_branch = _component$state4$wf_2 === undefined ? {} : _component$state4$wf_2;

      var schema = [];
      var counter = wf_baobab_selection.length;
      var position = "top";
      var visible = true;
      var archive = true;
      var action = {
        plantTree: {
          label: "Plant tree",
          icon: "circle-plus",
          onClick: function onClick() {
            fn.onCreate(_Constants.WF_BAOBAB_TREE);
          }
        },
        addBranch: {
          label: "Add Branch",
          icon: "circle-plus",
          onClick: function onClick() {
            fn.onCreate(_Constants.WF_BAOBAB_BRANCH);
          }
        },
        editBranch: {
          label: "Edit Branch",
          icon: "circle-plus",
          onClick: function onClick() {
            fn.onEdit(_Constants.WF_BAOBAB_BRANCH, wf_baobab_current_branch);
          }
        },
        deleteBranch: {
          label: "Delete Branch",
          icon: "circle-plus close",
          className: "wf-delete",
          onClick: function onClick() {
            fn.onDel(_Constants.WF_BAOBAB_BRANCH, wf_baobab_current_branch);
          }
        },
        addOption: {
          label: "Add Option",
          icon: "circle-plus",
          onClick: function onClick() {
            fn.onCreate(_Constants.WF_BAOBAB_OPTION);
          }
        },
        deleteOption: {
          label: "Delete",
          icon: "circle-plus close",
          className: "wf-delete",
          onClick: function onClick() {
            fn.onDel(_Constants.WF_BAOBAB_OPTION, {
              selection: wf_baobab_selection
            });
          }
        }
      };
      if (wf_baobab_is_branch_archive) {
        position = "bottom";
        schema = [action.addOption, action.editBranch, action.deleteBranch];
      } else if (wf_baobab_is_tree_archive || wf_baobab_is_option_archive) {
        schema = [action.addBranch, action.addOption];
      } else {
        archive = false;
        schema = [action.plantTree];
      }
      if (counter > 0) {
        visible = true;
        schema = [action.deleteOption];
      }
      return {
        schema: schema,
        counter: counter,
        archive: archive,
        visible: visible,
        position: position
      };
    }
  };
  return (0, _assign2.default)(fn, modules);
};

exports.default = baobab;

/***/ }),
/* 492 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _WFBaobabClient = __webpack_require__(119);

var _WFBaobabClient2 = _interopRequireDefault(_WFBaobabClient);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFAdminView = __webpack_require__(18);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.BAOBAB.BRANCH ----------------- //

// ----------------- //

var branch = function () {
  return {
    /**
     * Create Branch
     * @param WFBaobabMgr
     */
    onCreate: function onCreate(WFBaobabMgr) {
      var currentTreeId = WFBaobabMgr.getCurrentTreeId();
      var formState = _WFBaobabClient2.default.createOption();
      formState.addFields([{
        "name": "options",
        "type": "text",
        "len": 6550,
        "input_type": "textarea",
        "label": "",
        "required": true,
        "create_column": true,
        "attributes": {
          isMultiliner: true
        }
      }]);
      formState.setDisplayFields(["options"]);
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_tooltip",
        title: "Add Branches",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.beforeMassOptionSave({
            type: 'option-group',
            optionState: formState,
            map: function map(optConfig) {
              return (0, _assign2.default)({
                parent_id: currentTreeId
              }, optConfig);
            },
            next: function next(massUpdater) {
              _WFBaobabClient2.default.massOptionSave(massUpdater, function (res) {
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                WFBaobabMgr.getCurrentTree().findBranch({}, function () {
                  return WFBaobabMgr.ready();
                });
              });
            }
          });
        }
      });
    },

    /**
     * Delete Branch
     * @param WFBaobabMgr
     * @param next callback
     */
    onDel: function onDel(WFBaobabMgr, optionConfig) {
      var formState = _WFBaobabClient2.default.createOption(optionConfig);
      if (WFBaobabMgr.isBranchArchive()) {
        WFBaobabMgr.explore(optionConfig, _Constants.WF_BAOBAB_BRANCH);
      }
      (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
      _WFBaobabClient2.default.delOption(formState, {
        onSuccess: function onSuccess(res) {
          (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          WFBaobabMgr.find({
            page: 0
          });
        },
        onError: function onError(err) {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          console.error(err);
        }
      });
    },

    /**
     * Edit Branch
     * @param WFBaobabMgr
     * @param next callback
     */
    onEdit: function onEdit(WFBaobabMgr, optionConfig) {
      var formState = _WFBaobabClient2.default.createOption(optionConfig);
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_panel", //"wf_tooltip",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.saveOption(formState, {
            onSuccess: function onSuccess(res) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              WFBaobabMgr.getCurrentBranch().setProps(res);
              WFBaobabMgr.getCurrentTree().getBranchMgr().insert(WFBaobabMgr.getCurrentBranch().getSchema());
              WFBaobabMgr.ready();
            },
            onError: function onError(err) {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              console.error(err);
            }
          });
        }
      });
    }
  };
}();

exports.default = branch;

/***/ }),
/* 493 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _concat = __webpack_require__(76);

var _concat2 = _interopRequireDefault(_concat);

var _WFBaobabClient = __webpack_require__(119);

var _WFBaobabClient2 = _interopRequireDefault(_WFBaobabClient);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFAdminView = __webpack_require__(18);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.BAOBAB.OPTION ----------------- //

// ----------------- //

var option = function () {
  return {
    /**
     * Create Option
     * @param WFBaobabMgr
     */
    onCreate: function onCreate(WFBaobabMgr) {
      var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var _args$optionConfig = args.optionConfig,
          optionConfig = _args$optionConfig === undefined ? null : _args$optionConfig,
          _args$optionId = args.optionId,
          optionId = _args$optionId === undefined ? null : _args$optionId;

      var refreshBranch = false;
      var formState = _WFBaobabClient2.default.createOption();
      var branches = (0, _concat2.default)([], WFBaobabMgr.getCurrentTree().getBranchMgr().getValue());
      if (!WFBaobabMgr.isBranchArchive() && branches.length > 0) {
        branches.unshift({
          id: "0",
          label: "Select Branch..."
        });
        formState.addFields([{
          "name": "branch",
          "type": "number",
          "input_type": "select",
          "label": "",
          "required": false,
          "create_column": true,
          "attributes": {
            valueBy: "id",
            data: branches
          }
        }, {
          "name": "options",
          "type": "text",
          "len": 6550,
          "input_type": "textarea",
          "label": "",
          "required": true,
          "create_column": true,
          "attributes": {
            isMultiliner: true
          }
        }]);
        formState.setDisplayFields(["branch", "options"]);
      } else {
        formState.addFields([{
          "name": "options",
          "type": "text",
          "len": 6550,
          "input_type": "textarea",
          "label": "",
          "required": true,
          "create_column": true,
          "attributes": {
            isMultiliner: true
          }
        }]);
        formState.setDisplayFields(["options"]);
      }
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_tooltip",
        title: "Add Option(s)",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.beforeMassOptionSave({
            type: 'option',
            optionState: formState,
            map: function map(optConfig) {
              var branchId = null;
              if (formState.getField("branch")) {
                branchId = formState.getField("branch").getValue();
              }
              var optCfg = (0, _assign2.default)({
                wf_optiongroup_id: WFBaobabMgr.getCurrentTreeId()
              }, optConfig);
              if (WFBaobabMgr.isBranchArchive()) {
                optCfg = (0, _assign2.default)(optCfg, {
                  parent_id: WFBaobabMgr.getCurrentBranchId()
                });
              } else if (WFBaobabMgr.isOptionArchive()) {
                optCfg = (0, _assign2.default)(optCfg, {
                  wf_optiongroup_id: WFBaobabMgr.getCurrentOptionId()
                });
              }
              if (branchId) {
                refreshBranch = true;
                optCfg = (0, _assign2.default)(optCfg, {
                  parent_id: branchId
                });
              }
              if (optionId) {
                optCfg = (0, _assign2.default)(optCfg, {
                  wf_optiongroup_id: optionId
                });
              }
              return optCfg;
            },
            next: function next(massUpdater) {
              _WFBaobabClient2.default.massOptionSave(massUpdater, function (res) {
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                if (refreshBranch) {
                  WFBaobabMgr.currentTree.findBranch({}, function () {
                    if (!optionId) {
                      WFBaobabMgr.find();
                    }
                  });
                } else {
                  if (!optionId) {
                    WFBaobabMgr.find();
                  }
                }
              });
            }
          });
        }
      });
    },

    /**
     * Delete Option
     * @param WFBaobabMgr
     * @param next callback
     */
    onDel: function onDel(WFBaobabMgr) {
      var options = WFBaobabMgr.getSelectValue();
      if (options.length > 0) {
        (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
        var massUpdater = _WFBaobabClient2.default.createOptionMassUpdater();
        options.forEach(function (o) {
          return massUpdater.push(o);
        });
        _WFBaobabClient2.default.massOptionDel(massUpdater, function (res) {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          WFBaobabMgr.find({ page: 1 });
        });
      }
    },

    /**
     * Edit Option
     * @param WFBaobabMgr
     * @param next callback
     */
    onEdit: function onEdit(WFBaobabMgr, optionConfig) {
      var formState = _WFBaobabClient2.default.createOption(optionConfig);
      var branches = (0, _concat2.default)([], WFBaobabMgr.getCurrentTree().getBranchMgr().getValue());
      if (!WFBaobabMgr.isBranchArchive() && branches.length > 0) {
        branches.unshift({
          id: "0",
          label: "Select Branch..."
        });
        formState.addFields([{
          "name": "parent_id",
          "type": "number",
          "input_type": "select",
          "label": "Branch association",
          "required": false,
          //"len": 255,
          "create_column": true,
          "attributes": {
            valueBy: "id",
            data: branches
          }
        }, {
          "name": "options",
          "type": "text",
          "input_type": "textarea",
          "label": "",
          "required": true,
          "create_column": true,
          "attributes": {
            isMultiliner: true
          }
        }]);
        formState.setDisplayFields(["parent_id", "label", "legend", "color", "icon", "image"]);
      } else {
        formState.setDisplayFields(["label", "legend", "color", "icon", "image"]);
      }
      formState.setValues({
        parent_id: optionConfig.parent_id
      });
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_panel",
        title: "Edit Options",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.saveOption(formState, {
            onSuccess: function onSuccess(res) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              setTimeout(function () {
                return WFBaobabMgr.find();
              }, 150);
            },
            onError: function onError(err) {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              console.error(err);
            }
          });
        }
      });
    }
  };
}();

exports.default = option;

/***/ }),
/* 494 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFBaobabClient = __webpack_require__(119);

var _WFBaobabClient2 = _interopRequireDefault(_WFBaobabClient);

var _Lodash = __webpack_require__(6);

var _JSON = __webpack_require__(17);

var _WFAdminView = __webpack_require__(18);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.BAOBAB.TREE ----------------- //

// ----------------- //

var tree = function () {
  return {
    /**
     * Create OptionGroup
     * @param WFBaobabMgr
     */
    onCreate: function onCreate(WFBaobabMgr) {
      var formState = _WFBaobabClient2.default.createOptionGroup();
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_tooltip", //"wf_tooltip",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.beforeSaveOptionGroup(formState);
          _WFBaobabClient2.default.saveOptionGroup(formState, {
            onSuccess: function onSuccess(res) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              setTimeout(function () {
                return WFBaobabMgr.find({ page: 0 });
              }, 100);
            },
            onError: function onError(err) {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              console.error(err);
            }
          });
        }
      });
    },

    /**
     * Delete OptionGroup
     * @param WFBaobabMgr
     * @param next callback
     */
    onDel: function onDel(WFBaobabMgr, optionConfig) {
      var formState = _WFBaobabClient2.default.createOptionGroup(optionConfig);
      (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
      _WFBaobabClient2.default.delOptionGroup(formState, {
        onSuccess: function onSuccess(res) {
          (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          WFBaobabMgr.find({ page: 0 });
        },
        onError: function onError(err) {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
          console.error(err);
        }
      });
    },

    /**
     * Edit OptionGroup
     * @param WFBaobabMgr
     * @param next callback
     */
    onEdit: function onEdit(WFBaobabMgr, optionConfig) {
      var formState = _WFBaobabClient2.default.createOptionGroup(optionConfig);
      var formView = _WFBaobabClient2.default.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_panel", //"wf_tooltip",
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          _WFBaobabClient2.default.saveOptionGroup(formState, {
            onSuccess: function onSuccess(res) {
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              setTimeout(function () {
                return WFBaobabMgr.find({ page: 0 });
              }, 150);
            },
            onError: function onError(err) {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              console.error(err);
            }
          });
        }
      });
    }
  };
}();

exports.default = tree;

/***/ }),
/* 495 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _wfEnv = __webpack_require__(145);

var _wfEnv2 = _interopRequireDefault(_wfEnv);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFUrl = __webpack_require__(26);

var _WFUrl2 = _interopRequireDefault(_WFUrl);

var _WFViewOffset = __webpack_require__(450);

var _WFViewOffset2 = _interopRequireDefault(_WFViewOffset);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfsetting = __webpack_require__(121);

var _wfsetting2 = _interopRequireDefault(_wfsetting);

var _wflicense = __webpack_require__(162);

var _wflicense2 = _interopRequireDefault(_wflicense);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _WFProductType = __webpack_require__(15);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.SETTING ----------------- //

// ----------------- //

/**
 * setting hook the current view with the model
 * view => WFSetting.viewMrg contains global state
 * model => WFSetting.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var setting = function setting() {
  var modules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  /**
   * Private props
   **/
  var initialPanelMgrValue = _wfsetting2.default.resources.getListInfo().map(function (s) {
    return s.name;
  });
  var panelMgr = new _WFArray2.default({
    value: initialPanelMgrValue
  });

  /**
   * Public method
   **/
  var fn = {
    /**
     * Ready : refresh state
     * @param additional object value
     */
    ready: function ready() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _wfsetting2.default.mgr.change((0, _assign2.default)({
        panels_visible: panelMgr.getValue(),
        wf_producttype_status: _wflicense2.default.valueMgr.getValue()
      }, obj));
    },

    /**
     * Call when the user enters the page
     * @param next callback
     */
    onInit: function onInit(next) {
      _wfsetting2.default.mgr.init();
      fn.ready();
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      _wfsetting2.default.mgr.clear();
      panelMgr.set(initialPanelMgrValue);
      fn.ready();
    },

    /**
     * Toggle visible or hidden Panel
     * @param row {name}
     */
    onTogglePanel: function onTogglePanel(_ref) {
      var name = _ref.name;

      if (panelMgr.has(name)) {
        panelMgr.delete(name);
        fn.ready();
      } else {
        panelMgr.insert(name);
        fn.ready();
      }
    },

    /**
     * Edit setting
     * @param row
     */
    onEdit: function onEdit(row) {
      if (row.hasOwnProperty("type") && row.type === "license") {
        fn.editLicense(row);
      } else {
        fn.edit(row);
      }
    },

    /**
     * Get setting value
     * @param row
     * @param statusValues license values
     * @param globalValues
     */
    getValue: function getValue(row, statusValues, globalValues) {
      var key = row.key,
          _row$type = row.type,
          type = _row$type === undefined ? null : _row$type,
          _row$wf_producttype_i = row.wf_producttype_id,
          wf_producttype_id = _row$wf_producttype_i === undefined ? null : _row$wf_producttype_i;

      if (type === "license") {
        if (statusValues.hasOwnProperty(wf_producttype_id)) {
          var _statusValues$wf_prod = statusValues[wf_producttype_id].license_key,
              license_key = _statusValues$wf_prod === undefined ? "" : _statusValues$wf_prod;

          return license_key;
        } else {
          return "";
        }
      } else {
        if (globalValues.hasOwnProperty(key)) {
          return globalValues[key];
        } else {
          return "";
        }
      }
    },


    /*
     * Get setting value
     * @param row
     * @param status is license values
     */
    isChecked: function isChecked(row, statusValues) {
      var _row$wf_producttype_i2 = row.wf_producttype_id,
          wf_producttype_id = _row$wf_producttype_i2 === undefined ? null : _row$wf_producttype_i2;

      if (statusValues.hasOwnProperty(wf_producttype_id)) {
        var _statusValues$wf_prod2 = statusValues[wf_producttype_id],
            _statusValues$wf_prod3 = _statusValues$wf_prod2.status,
            status = _statusValues$wf_prod3 === undefined ? false : _statusValues$wf_prod3,
            _statusValues$wf_prod4 = _statusValues$wf_prod2.license_key,
            license_key = _statusValues$wf_prod4 === undefined ? "" : _statusValues$wf_prod4;

        return status;
      } else {
        return false;
      }
    },


    /**
     * Edit setting
     * @param row
     */
    edit: function edit(row) {
      var key = row.key;

      var settingState = _wfsetting2.default.mgr.edit(key);
      var formView = _wfsetting2.default.mgr.createFormView(settingState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        widget: "wf_tooltip",
        widgetConfig: _WFViewOffset2.default.getElemPosition(key, { left: 52 }),
        formView: formView,
        onValid: function onValid() {
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          settingState.setValues(formView.getValues());
          _wfsetting2.default.mgr.save(settingState, {
            onSuccess: function onSuccess() {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
              fn.ready();
            },
            onError: function onError(err) {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              console.error(err);
            }
          });
        }
      });
    },

    /**
     * Check license
     * @param wf_producttype_id
     * @return boolean
     */
    hasLicense: function hasLicense(wf_producttype_id) {
      if (!_wfEnv2.default) {
        if (_WFProductType.WF_CONTACT_SIMPLE_ID === wf_producttype_id) {
          return _wflicense2.default.valueMgr.isValid(wf_producttype_id);
        } else {
          if (_wflicense2.default.valueMgr.isValid(_WFProductType.WF_CONTACT_ADVANCED_ID)) {
            return _wflicense2.default.valueMgr.isValid(wf_producttype_id);
          } else {
            return false;
          }
        }
      } else {
        return true;
      }
    },


    /**
     * Get WonderForm version
     * @return string
     */
    getStrVersion: function getStrVersion() {
      var version = "Lite";
      if (fn.hasLicense(_WFProductType.WF_CONTACT_ADVANCED_ID) || fn.hasLicense(_WFProductType.WF_QUIZ_QUIZZ_ID)) {
        version = "Premium";
      }
      if (fn.hasLicense(_WFProductType.WF_CUSTOM_CUSTOM_ID)) {
        version = "Elite";
      }
      return version;
    },


    /**
     * Check is wf_producttype_id is limited
     * @param wf_producttype_id
     * @return boolean
     */
    isProductTypeLimited: function isProductTypeLimited(wf_producttype_id) {
      if (wf_producttype_id === _WFProductType.WF_CONTACT_SIMPLE_ID) {
        return !fn.hasLicense(_WFProductType.WF_CONTACT_ADVANCED_ID);
      } else {
        return false;
      }
    },


    /**
     * Check license
     * @param wf_producttype_id
     */
    alertLicenseRequired: function alertLicenseRequired() {
      var wf_producttype_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var context = _wfconfig2.default.products.getAlertContext(wf_producttype_id);
      (0, _WFAdminView.Pub)(_Constants.WF_ALERT, (0, _assign2.default)(context, {
        btnCallback: function btnCallback() {
          return _WFUrl2.default.download(_WFUrl2.default.getWFDomain('join'));
        }
      }));
    },


    /**
     * Edit license
     * @param row
     */
    editLicense: function editLicense(row) {
      var key = row.key,
          item_name = row.item_name,
          _row$wf_producttype_i3 = row.wf_producttype_id,
          wf_producttype_id = _row$wf_producttype_i3 === undefined ? null : _row$wf_producttype_i3;

      //console.error("editLicense")
      //console.log(item_name)
      //console.log(wf_producttype_id)

      var formView = _wflicense2.default.mgr.createFormView(wf_producttype_id);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_tooltip",
        widgetConfig: _WFViewOffset2.default.getElemPosition(key, { left: 102 }),
        onValid: function onValid() {
          var formState = formView.getFormState();
          var fld = formState.getField("license_key");
          var license_key = fld.getValue();
          (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
          // Activate -> license 
          _wflicense2.default.mgr.activate({
            item_name: item_name,
            license_key: license_key,
            wf_producttype_id: wf_producttype_id,
            // Invalid license
            onInvalid: function onInvalid() {
              (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
              (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                type: _Constants.NOTIFY_ERROR,
                msg: "Your License is invalid...",
                delay: 5000
              });
            },
            // Valid -> Save license
            onValid: function onValid() {
              _wflicense2.default.mgr.save(formState, {
                onSuccess: function onSuccess(res) {
                  var _res$rows = res.rows,
                      rows = _res$rows === undefined ? [] : _res$rows;

                  (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                  (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                  (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                    type: _Constants.NOTIFY_SUCCESS,
                    msg: "License valid...",
                    delay: 5000
                  });
                  _wflicense2.default.mgr.find();
                },
                onError: function onError(err) {
                  (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                  console.error(err);
                }
              });
            }
          });
        }
      });
    }
  };
  return (0, _assign2.default)(fn, modules);
};

/**
 * Add Observer to sync state with WFLicense.values
 * view => WFSetting.viewMrg contains global state
 **/
_wfsetting2.default.viewMgr.setObserver({
  ready: function ready() {
    _wflicense2.default.valueMgr.set(_WFProductType.WF_CONTACT_SIMPLE_ID, {
      status: true
    });
    _WFAdminView2.default.setState((0, _defineProperty3.default)({}, _Constants.WF_PRODUCTTYPE_STATUS, _wflicense2.default.valueMgr.getValue()));
  }
});

exports.default = setting;

/***/ }),
/* 496 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _wfanalytics = __webpack_require__(120);

var _wfanalytics2 = _interopRequireDefault(_wfanalytics);

var _WFAdminView = __webpack_require__(18);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var YEAR = "years";
var MONTH = "month";
var WEEK = "week";

// ----------------- //

// WFUI.WFC.ANALYTICS ----------------- //

// ----------------- //

/**
 * analytics hook the current view with the model
 * view => WFEntry.viewMrg contains global state
 * model => WFEntry.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var analytics = function () {
  /**
   * Private props
   **/

  /**
   * Private method
   **/
  var onLoad = function onLoad() {
    var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    _wfanalytics2.default.mgr.change({
      page_loader: flag
    });
  };

  /**
   * Public method
   **/
  var fn = {

    /**
     * Change : refresh state
     * @param object value
     */
    change: function change() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _wfanalytics2.default.mgr.change(obj);
    },

    /**
     * Call when the user enters the page
     * @param next callback
     */
    onInit: function onInit() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var _formEntryMgr$get = _WFormManagers.formEntryMgr.get(),
          formState = _formEntryMgr$get.formState;

      _wfanalytics2.default.mgr.init(formState);
      fn.onSelectTab(_Constants.TAB_ANALYTICS_FORM);
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      _wfanalytics2.default.mgr.clear();
    },

    /**
     * Select Tab
     * @param tabName
     */
    onSelectTab: function onSelectTab(tabName) {
      fn.change({ tabName: tabName });
      switch (tabName) {

        case _Constants.TAB_ANALYTICS_FORM:
          fn.onSelectYear(_wfanalytics2.default.mgr.getCurrentYear());
          break;

        case _Constants.TAB_ANALYTICS_FIELDS:
          fn.onSelectField(_wfanalytics2.default.mgr.getCurrentField());
          break;
      }
    },

    /**
     * Select Tab
     * @param year
     */
    onSelectYear: function onSelectYear(year) {
      onLoad();
      _wfanalytics2.default.mgr.findFormStatsByYear(year, {
        onError: function onError(err) {
          onLoad(false);
          console.error(err);
        },
        onSuccess: function onSuccess(res) {
          onLoad(false);
        }
      });
    },

    /**
     * Filter by Month
     * @param month
     */
    onSelectMonth: function onSelectMonth(month) {
      onLoad();
      _wfanalytics2.default.mgr.findFormStatsByYearMonth(_wfanalytics2.default.mgr.getCurrentYear(), month, {
        onError: function onError(err) {
          onLoad(false);
          console.error(err);
        },
        onSuccess: function onSuccess(res) {
          onLoad(false);
        }
      });
    },

    /**
     * Filter by Week
     * @param week
     */
    onSelectWeek: function onSelectWeek(week) {
      onLoad();
      _wfanalytics2.default.mgr.findFormStatsByYearWeek(_wfanalytics2.default.mgr.getCurrentYear(), week, {
        onError: function onError(err) {
          onLoad(false);
          console.error(err);
        },
        onSuccess: function onSuccess(res) {
          onLoad(false);
        }
      });
    },

    /**
     * Select Field by entry_id
     * @param fieldSchema
     */
    onSelectField: function onSelectField(fieldSchema) {
      var _WFAnalytics$mgr$getS = _wfanalytics2.default.mgr.getState(),
          _WFAnalytics$mgr$getS2 = _WFAnalytics$mgr$getS.optionResults,
          optionResults = _WFAnalytics$mgr$getS2 === undefined ? [] : _WFAnalytics$mgr$getS2;

      var entry_id = fieldSchema.entry_id;

      fn.change({
        currentField: entry_id,
        currentFieldValue: fieldSchema
      });
      if (optionResults.length === 0) {
        onLoad();
        _wfanalytics2.default.mgr.countOptionEntries({
          onError: function onError(err) {
            onLoad(false);
            console.error(err);
          },
          onSuccess: function onSuccess() {
            onLoad(false);
          }
        });
      } else {
        _wfanalytics2.default.mgr.setFieldOptions();
      }
    }
  };
  return fn;
}();

// ----------------- //
exports.default = analytics;
// ----------------- //

/***/ }),
/* 497 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _defineProperty2 = __webpack_require__(7);

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _WFArray = __webpack_require__(21);

var _WFArray2 = _interopRequireDefault(_WFArray);

var _WFormView = __webpack_require__(65);

var _WFormView2 = _interopRequireDefault(_WFormView);

var _WFormStateFactory = __webpack_require__(73);

var _WFormStateFactory2 = _interopRequireDefault(_WFormStateFactory);

var _wfentry = __webpack_require__(160);

var _wfentry2 = _interopRequireDefault(_wfentry);

var _WFAdminView = __webpack_require__(18);

var _WFormManagers = __webpack_require__(30);

var _WFProductType = __webpack_require__(15);

var _Constants = __webpack_require__(12);

var _editor = __webpack_require__(170);

var _editor2 = _interopRequireDefault(_editor);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.WFC.ENTRY ----------------- //

// ----------------- //

/**
 * entry hook the current view with the model
 * view => WFEntry.viewMrg contains global state
 * model => WFEntry.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var entry = function () {
  /**
   * Private props
   **/
  var defaultSearchFilter = null;
  var fieldSearchableRows = [];
  var fieldSearchableMgr = new _WFArray2.default({
    isCollection: true,
    findBy: "name"
  });

  /**
   * Private method
   **/
  var onLoad = function onLoad() {
    var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    _wfentry2.default.mgr.change({
      page_loader: flag
    });
  };

  /**
   * Public method
   **/
  var fn = {

    /**
     * Ready : refresh state
     * @param additional object value
     */
    ready: function ready() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      var fields_name = [];
      var fields_type = [];
      fieldSearchableMgr.map(function (f) {
        fields_name.push(f.name);
        if (f.input_type === "date") {
          fields_type.push("date");
        } else if (f.input_type === "file") {
          fields_type.push("file");
        } else {
          fields_type.push(f.type);
        }
      });
      _wfentry2.default.mgr.change((0, _assign2.default)({
        fields_name: fields_name,
        fields_type: fields_type
      }, obj));
    },

    /**
     * Call when the user enters the page
     * @param next callback
     */
    onInit: function onInit(next) {
      var _formEntryMgr$get = _WFormManagers.formEntryMgr.get(),
          formState = _formEntryMgr$get.formState;

      _wfentry2.default.mgr.init(formState);
      var display_fields = formState.getDisplayFields();
      fieldSearchableRows = formState.getAllFieldSearchable();
      fieldSearchableMgr.setValue(fieldSearchableRows);
      if (!fieldSearchableMgr.isEmpty()) {
        defaultSearchFilter = fieldSearchableMgr.getFirst().name;
      }
      fn.ready({
        display_fields: display_fields,
        fields_searchable: fieldSearchableMgr.map(function (f) {
          return f.name;
        })
      });
      fn.onFind();
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      _wfentry2.default.mgr.clear();
      if (_WFormManagers.formEntryMgr.isReady()) {
        _WFormManagers.formEntryMgr.formState.clearValues();
      }
      fieldSearchableMgr.clear();
      fieldSearchableRows = [];
      defaultSearchFilter = null;
    },

    /**
     * Select entry
     *@param entry
     */
    onSelect: function onSelect(row) {
      _wfentry2.default.mgr.select(row);
    },

    /**
     * Find entries
     * @param args {page}
     */
    onFind: function onFind() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      onLoad();
      _wfentry2.default.mgr.find(args, {
        onSuccess: function onSuccess() {
          return onLoad(false);
        },
        onError: function onError(err) {
          console.error(err);
          onLoad(false);
        }
      });
    },

    /**
     * Search entries
     * @param val
     */
    onSearch: function onSearch(value) {
      var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var l = value.length;
      if (l === 0) {
        _wfentry2.default.queryMrg.clearFilters();
        fn.onFind();
      } else if (l > 1) {
        var filter = defaultSearchFilter;
        if (key) {
          filter = key;
        }
        _wfentry2.default.queryMrg.setPage(1);
        _wfentry2.default.queryMrg.setFilter(filter, value);
        fn.onFind();
      }
    },

    /**
     * Edit entry
     * @param row
     */
    onEdit: function onEdit(row) {
      if (row) {
        // create new fromEntryState
        var formConfig = _WFormManagers.formConfigMgr.getConfig();
        var formEntryState = _WFormStateFactory2.default.createFormEntryState(formConfig);
        var formView = new _WFormView2.default(formEntryState, true);
        // Set Fields
        var fieldSchema = _WFormManagers.formEntryMgr.formState.getFieldSchema();
        for (var x in fieldSchema) {
          formView.createOrUpdateField(fieldSchema[x]);
        }
        // Generate display fields
        _WFormManagers.formEntryMgr.formView.generateDisplayFields();
        var displayFields = _WFormManagers.formEntryMgr.formView.getDisplayFields();
        // Set Prev Values and displayFields
        formEntryState.setValues(row);
        formView.setDisplayFields(displayFields);
        //formView.ignoreValidator = true;
        // Show editor
        (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
          formView: formView,
          icon: "cog",
          widget: "wf_panel",
          widgetConfig: { size: "md" },
          title: "Edit Entry",
          onValid: function onValid() {
            (0, _WFAdminView.Pub)(_Constants.WF_LOADER, true);
            //formView.ignoreValidator = false;
            formView.onSubmit({
              onSuccess: function onSuccess(res) {
                (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
                (0, _WFAdminView.Pub)(_Constants.WF_LOADER, false);
                setTimeout(function () {
                  fn.onFind({ page: 1 });
                }, 100);
              },
              onError: function onError(err) {
                console.error(err);
              }
            });
          },
          onCancel: function onCancel() {
            formView.onClear();
          }
        });
      }
    },

    /**
     * Delete entry
     */
    onDel: function onDel() {
      (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
        labelCancel: "no",
        labelValid: "yes",
        message: 'Would you want to delete entries ?',
        legend: '...',
        onValid: function onValid() {
          onLoad();
          _wfentry2.default.mgr.del({
            onSuccess: function onSuccess(res) {
              onLoad(false);
              fn.onFind({ page: 1 });
            },
            onError: function onError(err) {
              console.error(err);
              onLoad(false);
            }
          });
        }
      });
    },

    /**
     * Filter field searchable
     * @param fieldName
     */
    onFilterFieldSearchable: function onFilterFieldSearchable(fieldName) {
      if (fieldSearchableMgr.has(fieldName)) {
        fieldSearchableMgr.delete(fieldName);
      } else {
        var prevVal = fieldSearchableMgr.map(function (f) {
          return f.name;
        });
        var nextVal = fieldSearchableRows.filter(function (f) {
          return prevVal.includes(f.name) || f.name === fieldName;
        });
        fieldSearchableMgr.setValue(nextVal);
      }
      fn.ready();
    },


    /**
     * Filter col order
     * @param colName 
     * @param position => {up || down}
     * @param order => {asc || desc}
     * @param filter => [colName, "up"] || [colName, "down"]
     */
    onReorderCol: function onReorderCol(colName, position, order, filter) {
      var flag = false;
      var nextFilter = [colName, position];
      if (filter.length > 0) {
        if (filter[0] === colName && filter[1] === position) {
          flag = true;
        }
      }
      console.log(flag, nextFilter);
      if (flag) {
        _wfentry2.default.mgr.change({
          current_filter: []
        });
        _wfentry2.default.mgr.reOrder(null, colName);
      } else {
        _wfentry2.default.mgr.change({
          current_filter: nextFilter
        });
        _wfentry2.default.mgr.reOrder(order, colName);
      }
      fn.onFind();
    },


    // COMPONENT HELPERS -------------- //

    /**
     * Check is WFTable is filterable (in the futur set addons)
     * @return boolean
     */
    canFilterCols: function canFilterCols() {
      var id = _editor2.default.getProductTypeId();
      return id === _WFProductType.WF_CUSTOM_CUSTOM_ID;
    },


    /**
     * Create Schema 
     * When user click in cell apply onEdit
     * @param colsName is array
     * @return schema is object contains {...fieldName : callback}
     */
    getColEditableSchema: function getColEditableSchema() {
      var colsName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];

      var schema = {};
      colsName.map(function (name) {
        (0, _assign2.default)(schema, (0, _defineProperty3.default)({}, name, function (cell, row) {
          fn.onEdit(row);
        }));
      });
      return schema;
    },


    /**
     * Create Schema for reorder the columns
     * @param cellNames is array
     * @param currentFilter is an array [colName, "up"] || [colName, "down"]
     * @return schema is object contains {...fieldName : callbacks}
     */
    getColFilterableSchema: function getColFilterableSchema() {
      var colsName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
      var currentFilter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

      var schema = {};
      colsName.map(function (name) {
        (0, _assign2.default)(schema, (0, _defineProperty3.default)({}, name, {
          up: function up(col) {
            return fn.onReorderCol(col, "up", "desc", currentFilter);
          },
          down: function down(col) {
            return fn.onReorderCol(col, "down", "asc", currentFilter);
          }
        }));
      });
      return schema;
    }
  };
  return fn;
}();

// ----------------- //
exports.default = entry;
// ----------------- //

/***/ }),
/* 498 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _wfc = __webpack_require__(499);

var _wfc2 = _interopRequireDefault(_wfc);

var _editor = __webpack_require__(170);

var _editor2 = _interopRequireDefault(_editor);

var _action = __webpack_require__(266);

var _action2 = _interopRequireDefault(_action);

var _entry = __webpack_require__(497);

var _entry2 = _interopRequireDefault(_entry);

var _analytics = __webpack_require__(496);

var _analytics2 = _interopRequireDefault(_analytics);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = (0, _wfc2.default)({
  action: _action2.default,
  entry: _entry2.default,
  editor: _editor2.default,
  analytics: _analytics2.default
});

/***/ }),
/* 499 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _assign = __webpack_require__(13);

var _assign2 = _interopRequireDefault(_assign);

var _WFAdminView = __webpack_require__(18);

var _WFAdminView2 = _interopRequireDefault(_WFAdminView);

var _WFormViewHelpers = __webpack_require__(164);

var _WFormViewHelpers2 = _interopRequireDefault(_WFormViewHelpers);

var _wfconfig = __webpack_require__(53);

var _wfconfig2 = _interopRequireDefault(_wfconfig);

var _wfieldconfig = __webpack_require__(249);

var _wfieldconfig2 = _interopRequireDefault(_wfieldconfig);

var _Lodash = __webpack_require__(6);

var _WFormManagers = __webpack_require__(30);

var _Constants = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// ----------------- //

// WFUI.WFC ----------------- //

// ----------------- //

/**
 * license hook the current view with the model
 * view => WFConfig.viewMrg contains global state
 * model => WFConfig.mgr
 * method with the prefix on is an action 
 * method {ready, change} manage global state 
 **/
var wfc = function wfc() {
  var modules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};


  /**
   * Modules
   **/
  var editor = modules.editor;


  var isNewForm = false;
  var isCreatePage = false;

  /**
   * Private method
   **/
  var onLoad = function onLoad() {
    var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    _wfconfig2.default.mgr.change({
      page_loader: flag
    });
    if (editor.isInit() || isCreatePage) {
      (0, _WFAdminView.Pub)(_Constants.WF_LOADER, flag);
    }
  };

  /**
   * Public method
   **/
  var fn = {

    /**
     * Ready : refresh state
     * @param additional object value
     */
    ready: function ready() {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      _wfconfig2.default.mgr.change((0, _assign2.default)({}, obj));
    },

    /**
     * Call when the user enters the page
     * @param next callback
     */
    onInit: function onInit(next) {
      _wfconfig2.default.mgr.init();
      fn.onFind();
    },

    /**
     * Call when the user leaves the page
     */
    onClear: function onClear() {
      _wfconfig2.default.mgr.clear();
      (0, _WFAdminView.Pub)(_Constants.WF_PAGE_TITLE);
    },

    /**
     * Select form
     * @param row
     */
    onSelect: function onSelect(row) {
      _wfconfig2.default.mgr.select(row);
    },

    /**
     * Find forms
     * @param args {page}
     */
    onFind: function onFind() {
      var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

      onLoad();
      _wfconfig2.default.mgr.find(args, {
        onSuccess: function onSuccess() {
          onLoad(false);
        },
        onError: function onError(err) {
          console.error(err);
          onLoad(false);
        }
      });
    },


    /**
     * Save form
     * if fieldConfig it saved update current formConfig 
     * @param formState
     * @param next callback
     */
    onSave: function onSave() {
      var fs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

      var formState = fs;
      if (!formState && _WFormManagers.formConfigMgr.isReady()) {
        formState = _WFormManagers.formConfigMgr.get().formState;
      }
      if (editor.isInit()) {
        editor.onSave();
      }
      if (formState) {
        onLoad();
        _wfconfig2.default.mgr.save(formState, {
          onSuccess: function onSuccess(res) {
            onLoad(false);
            isCreatePage = false;
            isNewForm = false;
            if (editor.isInit()) {
              if (editor.isFieldSaved()) {
                onLoad();
                _wfconfig2.default.mgr.edit(res.name, {
                  onSuccess: function onSuccess(formConfig, formConfigView, formEntryView) {
                    onLoad(false);

                    // todo component dead after that...
                    //formConfigMgr.set(formConfigView);
                    //formEntryMgr.set(formEntryView);

                    editor.initFieldConfigMgr(formConfig);
                    editor.ready();
                  },
                  onError: function onError(err) {
                    onLoad(false);
                    console.error(err);
                  }
                });
              } else {
                editor.ready();
              }
            }
            if ((0, _Lodash.isFunction)(next)) {
              next(res);
            }
          },
          onError: function onError(err) {
            onLoad(false);
            if (fs) {
              _WFormViewHelpers2.default.setError(formState, err);
            } else {
              _WFormViewHelpers2.default.mapError(err, function (msg) {
                (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
                  type: _Constants.NOTIFY_ERROR,
                  msg: msg,
                  delay: 6000
                });
              });
            }
          }
        });
      }
    },

    /**
     * Create form
     * @param args {page}
     */
    onCreate: function onCreate(form, setting) {
      var label = form.label;
      var icon = setting.icon,
          slogan = setting.slogan,
          wf_producttype_id = setting.wf_producttype_id;

      var formState = _wfconfig2.default.mgr.create({ wf_producttype_id: wf_producttype_id });
      var formView = _wfconfig2.default.mgr.createFormView(formState);
      // Call editor
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_modal",
        icon: icon,
        title: "Create " + label,
        message: slogan,
        labelValid: "Create",
        labelCancel: "Cancel",
        onValid: function onValid() {
          // Save form
          isCreatePage = true;
          fn.onSave(formState, function (res) {
            (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
            (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
              type: _Constants.NOTIFY_SUCCESS,
              msg: "Form is created...",
              delay: 3000
            });
            // Edit form
            isNewForm = true;
            fn.onEdit(res);
          });
        }
      });
    },


    /**
     * Delete form
     */
    onPublish: function onPublish() {
      onLoad();
      _wfconfig2.default.mgr.publish(_WFormManagers.formConfigMgr.get().formState, {
        onSuccess: function onSuccess() {
          onLoad(false);
          if (editor.isInit()) {
            editor.onPublish();
          }
        },
        onError: function onError(err) {
          console.error(err);
          onLoad(false);
        }
      });
    },

    /**
     * Publish form
     */
    onUnPublish: function onUnPublish() {
      var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

      var _formConfigMgr$get = _WFormManagers.formConfigMgr.get(),
          formState = _formConfigMgr$get.formState;

      onLoad();
      _wfconfig2.default.mgr.unpublish(_WFormManagers.formConfigMgr.get().formState, {
        onSuccess: function onSuccess() {
          onLoad(false);
          if (editor.isInit()) {
            editor.onUnPublish(next);
          }
        },
        onError: function onError(err) {
          console.error(err);
          onLoad(false);
        }
      });
    },

    /**
     * Delete form
     */
    onDel: function onDel() {
      var del = function del() {
        var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

        onLoad();
        _wfconfig2.default.mgr.del({
          onSuccess: function onSuccess(res) {
            onLoad(false);
            if ((0, _Lodash.isFunction)(next)) {
              next();
            }
          },
          onError: function onError(err) {
            console.error(err);
            onLoad(false);
          }
        });
      };
      (0, _WFAdminView.Pub)(_Constants.WF_COMFIRM, {
        labelCancel: "no",
        labelValid: "yes",
        message: "Would you want to delete forms ?",
        legend: '...',
        onValid: function onValid() {
          if (editor.isInit()) {
            del(function () {
              return (0, _WFAdminView.Pub)(_Constants.WF_PAGE);
            });
          } else {
            del(function () {
              return fn.onFind({ page: 1 });
            });
          }
        }
      });
    },

    /**
     * Edit current form
     */
    onEditConfig: function onEditConfig() {
      var _formConfigMgr$get2 = _WFormManagers.formConfigMgr.get(),
          formState = _formConfigMgr$get2.formState;

      var formView = _wfconfig2.default.mgr.createFormView(formState);
      (0, _WFAdminView.Pub)(_Constants.WF_EDITOR, {
        formView: formView,
        widget: "wf_modal",
        icon: "cog",
        title: "Form Setting",
        message: "...",
        labelValid: "Update",
        labelCancel: "Cancel",
        onValid: function onValid() {
          fn.onSave(formState, function () {
            (0, _WFAdminView.Pub)(_Constants.WF_EDITOR);
            (0, _WFAdminView.Pub)(_Constants.WF_NOTIFY, {
              type: _Constants.NOTIFY_SUCCESS,
              msg: "Form is updated...",
              delay: 3000
            });
          });
        }
      });
    },


    /**
     * Edit form
     * Init WFieldConfig.mgr with config.fields
     * create global {formConfigMgr, formEntryMgr} for all components
     * start the wfc.editor
     * @param formConfigLight is a wfc archive's formConfig
     * @param to is tabName for redirect callback
     */
    onEdit: function onEdit(formConfigLight) {
      var _this = this;

      var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
      var name = formConfigLight.name,
          published = formConfigLight.published;

      onLoad();
      _wfconfig2.default.mgr.edit(name, {
        onSuccess: function onSuccess(formConfig, formConfigView, formEntryView) {
          _WFormManagers.formConfigMgr.set(formConfigView);
          _WFormManagers.formConfigMgr.setInitialConfig(formConfig);
          _WFormManagers.formEntryMgr.set(formEntryView);
          editor.start(_this, formConfig, function () {
            onLoad(false);
            var tabName = _Constants.TAB_EDITOR_STUDIO;
            if (to) {
              tabName = to;
              if (to === _Constants.TAB_EDITOR_ENTRIES && published == false || to === _Constants.TAB_EDITOR_ANALYTICS && published == false) {
                tabName = _Constants.TAB_EDITOR_STUDIO;
              }
            }
            _WFAdminView2.default.changeView({
              name: _Constants.PAGE_FORM_EDITOR,
              tabName: tabName,
              next: function next() {
                _wfconfig2.default.mgr.select(formConfig);
                formEntryView.ready();
                (0, _WFAdminView.Pub)(_Constants.WF_PAGE_TITLE, formConfig.title + " : [wonderform id=" + formConfig.id + "]");
                if (isNewForm) {
                  _wfconfig2.default.editor.mgr.change({
                    wfc_values: false
                  });
                }
              }
            });
          });
        },
        onError: function onError(err) {
          console.error(err);
          onLoad(false);
        }
      });
    },


    // UTILS ---------------------- //

    /**
     * Get the config of WFtable component
     * to dsplay and manipulate WFConfig colection
     * @return object 
     */
    getWFTableConfig: function getWFTableConfig() {
      return {

        // Table Config -- //
        visible: true,
        head: true,

        // Table ScrollBar Config -- //
        scrollAutoHide: false,
        scrollheightMax: 685,
        scrollheightMin: 0,

        // Table Cell Config -- //
        cellConfig: {
          preview: true,
          previewSplit: ",",
          limit: {
            string: 25,
            text: 45,
            select: 40
          }
        },

        // Table Capabilities -- //
        canEdit: true,
        hasShortcode: true,

        // Select Hook -- //
        selectBy: "name",
        canSelect: true,
        onSelect: function onSelect(val, row) {
          fn.onSelect(row);
        },

        // Table Capabilities Hook -- //
        onEdit: function onEdit(cell, row) {
          fn.onEdit(row);
        },

        // Table Capabilities Custom -- //
        customAction: [{
          name: "entries",
          icon: "layers",
          callback: function callback(cell, row) {
            fn.onEdit(row, _Constants.TAB_EDITOR_ENTRIES);
          }
        }, {
          name: "analytics",
          icon: "piechart",
          callback: function callback(cell, row) {
            fn.onEdit(row, _Constants.TAB_EDITOR_ANALYTICS);
          }
        }],

        // Table Shortode Config -- //
        shortcodeConfig: {
          prefix: "wonderform id=",
          sufix: "",
          prop: "id"
        },

        // Table Row Config -- //
        rowConfig: {
          labels: ["id", "published", "title", "description", "entries"],
          values: ["id", "created_tms", "title", "description", "entries_count"],
          types: ["id", "date", "string", "text", "number"]
        },

        // Table Cell Hook -- //
        cellCallbacks: {
          id: function id(cell, row) {
            fn.onEdit(row);
          },
          title: function title(cell, row) {
            fn.onEdit(row);
          },
          description: function description(cell, row) {
            fn.onEdit(row);
          },
          entries_count: function entries_count(cell, row) {
            fn.onEdit(row, _Constants.TAB_EDITOR_ENTRIES);
          }
        }
      };
    }
  };
  return (0, _assign2.default)(fn, modules);
};

exports.default = wfc;

/***/ }),
/* 500 */,
/* 501 */,
/* 502 */,
/* 503 */,
/* 504 */,
/* 505 */,
/* 506 */,
/* 507 */,
/* 508 */,
/* 509 */,
/* 510 */,
/* 511 */,
/* 512 */,
/* 513 */,
/* 514 */,
/* 515 */,
/* 516 */,
/* 517 */,
/* 518 */,
/* 519 */,
/* 520 */,
/* 521 */,
/* 522 */,
/* 523 */,
/* 524 */,
/* 525 */,
/* 526 */,
/* 527 */,
/* 528 */,
/* 529 */,
/* 530 */,
/* 531 */,
/* 532 */,
/* 533 */,
/* 534 */,
/* 535 */,
/* 536 */,
/* 537 */,
/* 538 */,
/* 539 */,
/* 540 */,
/* 541 */,
/* 542 */,
/* 543 */,
/* 544 */,
/* 545 */,
/* 546 */,
/* 547 */,
/* 548 */,
/* 549 */,
/* 550 */,
/* 551 */,
/* 552 */,
/* 553 */,
/* 554 */,
/* 555 */,
/* 556 */,
/* 557 */,
/* 558 */,
/* 559 */,
/* 560 */,
/* 561 */,
/* 562 */,
/* 563 */,
/* 564 */,
/* 565 */,
/* 566 */,
/* 567 */,
/* 568 */,
/* 569 */,
/* 570 */,
/* 571 */,
/* 572 */,
/* 573 */,
/* 574 */,
/* 575 */,
/* 576 */,
/* 577 */,
/* 578 */,
/* 579 */,
/* 580 */,
/* 581 */,
/* 582 */,
/* 583 */,
/* 584 */,
/* 585 */,
/* 586 */,
/* 587 */,
/* 588 */,
/* 589 */,
/* 590 */,
/* 591 */,
/* 592 */,
/* 593 */,
/* 594 */,
/* 595 */,
/* 596 */,
/* 597 */,
/* 598 */,
/* 599 */,
/* 600 */,
/* 601 */,
/* 602 */,
/* 603 */,
/* 604 */,
/* 605 */,
/* 606 */,
/* 607 */,
/* 608 */,
/* 609 */,
/* 610 */,
/* 611 */,
/* 612 */,
/* 613 */,
/* 614 */,
/* 615 */,
/* 616 */,
/* 617 */,
/* 618 */,
/* 619 */,
/* 620 */,
/* 621 */,
/* 622 */,
/* 623 */,
/* 624 */,
/* 625 */,
/* 626 */,
/* 627 */,
/* 628 */,
/* 629 */,
/* 630 */,
/* 631 */,
/* 632 */,
/* 633 */,
/* 634 */,
/* 635 */,
/* 636 */,
/* 637 */,
/* 638 */,
/* 639 */,
/* 640 */,
/* 641 */,
/* 642 */,
/* 643 */,
/* 644 */,
/* 645 */,
/* 646 */,
/* 647 */,
/* 648 */,
/* 649 */,
/* 650 */,
/* 651 */,
/* 652 */,
/* 653 */,
/* 654 */,
/* 655 */,
/* 656 */,
/* 657 */,
/* 658 */,
/* 659 */,
/* 660 */,
/* 661 */,
/* 662 */,
/* 663 */,
/* 664 */,
/* 665 */,
/* 666 */,
/* 667 */,
/* 668 */,
/* 669 */,
/* 670 */,
/* 671 */,
/* 672 */,
/* 673 */,
/* 674 */,
/* 675 */,
/* 676 */,
/* 677 */,
/* 678 */,
/* 679 */,
/* 680 */,
/* 681 */,
/* 682 */,
/* 683 */,
/* 684 */,
/* 685 */,
/* 686 */,
/* 687 */,
/* 688 */,
/* 689 */,
/* 690 */,
/* 691 */,
/* 692 */,
/* 693 */,
/* 694 */,
/* 695 */,
/* 696 */,
/* 697 */,
/* 698 */,
/* 699 */,
/* 700 */,
/* 701 */,
/* 702 */,
/* 703 */,
/* 704 */,
/* 705 */,
/* 706 */,
/* 707 */,
/* 708 */,
/* 709 */,
/* 710 */,
/* 711 */,
/* 712 */,
/* 713 */,
/* 714 */,
/* 715 */,
/* 716 */,
/* 717 */,
/* 718 */,
/* 719 */,
/* 720 */,
/* 721 */,
/* 722 */,
/* 723 */,
/* 724 */,
/* 725 */,
/* 726 */,
/* 727 */,
/* 728 */,
/* 729 */,
/* 730 */,
/* 731 */,
/* 732 */,
/* 733 */,
/* 734 */,
/* 735 */,
/* 736 */,
/* 737 */,
/* 738 */,
/* 739 */,
/* 740 */,
/* 741 */,
/* 742 */,
/* 743 */,
/* 744 */,
/* 745 */,
/* 746 */,
/* 747 */,
/* 748 */,
/* 749 */,
/* 750 */,
/* 751 */,
/* 752 */,
/* 753 */,
/* 754 */,
/* 755 */,
/* 756 */,
/* 757 */,
/* 758 */,
/* 759 */,
/* 760 */,
/* 761 */,
/* 762 */,
/* 763 */,
/* 764 */,
/* 765 */,
/* 766 */,
/* 767 */,
/* 768 */,
/* 769 */,
/* 770 */,
/* 771 */,
/* 772 */,
/* 773 */,
/* 774 */,
/* 775 */,
/* 776 */,
/* 777 */,
/* 778 */,
/* 779 */,
/* 780 */,
/* 781 */,
/* 782 */,
/* 783 */,
/* 784 */,
/* 785 */,
/* 786 */,
/* 787 */,
/* 788 */,
/* 789 */,
/* 790 */,
/* 791 */,
/* 792 */,
/* 793 */,
/* 794 */,
/* 795 */,
/* 796 */,
/* 797 */,
/* 798 */,
/* 799 */,
/* 800 */,
/* 801 */,
/* 802 */,
/* 803 */,
/* 804 */,
/* 805 */,
/* 806 */,
/* 807 */,
/* 808 */,
/* 809 */,
/* 810 */,
/* 811 */,
/* 812 */,
/* 813 */,
/* 814 */,
/* 815 */,
/* 816 */,
/* 817 */,
/* 818 */,
/* 819 */,
/* 820 */,
/* 821 */,
/* 822 */,
/* 823 */,
/* 824 */,
/* 825 */,
/* 826 */,
/* 827 */,
/* 828 */,
/* 829 */,
/* 830 */,
/* 831 */,
/* 832 */,
/* 833 */,
/* 834 */,
/* 835 */,
/* 836 */,
/* 837 */,
/* 838 */,
/* 839 */,
/* 840 */,
/* 841 */,
/* 842 */,
/* 843 */,
/* 844 */,
/* 845 */,
/* 846 */,
/* 847 */,
/* 848 */,
/* 849 */,
/* 850 */,
/* 851 */,
/* 852 */,
/* 853 */,
/* 854 */,
/* 855 */,
/* 856 */,
/* 857 */,
/* 858 */,
/* 859 */,
/* 860 */,
/* 861 */,
/* 862 */,
/* 863 */,
/* 864 */,
/* 865 */,
/* 866 */,
/* 867 */,
/* 868 */,
/* 869 */,
/* 870 */,
/* 871 */,
/* 872 */,
/* 873 */,
/* 874 */,
/* 875 */,
/* 876 */,
/* 877 */,
/* 878 */,
/* 879 */,
/* 880 */,
/* 881 */,
/* 882 */,
/* 883 */,
/* 884 */,
/* 885 */,
/* 886 */,
/* 887 */,
/* 888 */,
/* 889 */,
/* 890 */,
/* 891 */,
/* 892 */,
/* 893 */,
/* 894 */,
/* 895 */,
/* 896 */,
/* 897 */,
/* 898 */
/***/ (function(module, exports) {

module.exports = Ajv;

/***/ }),
/* 899 */
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),
/* 900 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(349);
module.exports = __webpack_require__(348);


/***/ })
],[900]);