(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';

var _customGreeting = require('./custom-greeting');

// initialize all elements
var componentsList = document.querySelectorAll(_customGreeting.CustomGreeting.getSelector()); // Import all components

for (var i = 0; i < componentsList.length; i++) {
	new _customGreeting.CustomGreeting(componentsList[i]);
}
},{"./custom-greeting":2}],2:[function(require,module,exports){
'use strict';

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

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * custom-greeting.js
 * Script generates greeting based current time
 */

/**
* Declare constants
*/
var attributeBase = 'data-rs-custom-greeting';

var CustomGreeting = exports.CustomGreeting = function () {
	function CustomGreeting(element) {
		_classCallCheck(this, CustomGreeting);

		this.element = element;
		this.element.innerText = this.getCustomGreeting();
	}

	/**
  * Get custom greeting
  */


	_createClass(CustomGreeting, [{
		key: 'getCustomGreeting',
		value: function getCustomGreeting() {
			var hours = new Date().getHours();

			if (hours < 6) {
				return 'good night';
			} else if (hours >= 6 && hours < 12) {
				return 'good morning';
			} else if (hours >= 12 && hours < 18) {
				return 'good afternoon';
			} else if (hours >= 18) {
				return 'good evening';
			}
		}

		/**
   * Get selector
   */

	}], [{
		key: 'getSelector',
		value: function getSelector() {
			return '[' + attributeBase + ']';
		}
	}]);

	return CustomGreeting;
}();
},{}]},{},[1]);
