text: (function webpackUniversalModuleDefinition(root, factory) {
  	if(typeof exports === 'object' && typeof module === 'object')
  		module.exports = factory();
  	else if(typeof define === 'function' && define.amd)
  		define([], factory);
  	else if(typeof exports === 'object')
  		exports["Boogie"] = factory();
  	else
  		root["Boogie"] = factory();
  })(typeof self !== 'undefined' ? self : this, function() {
  return /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  /******/
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId]) {
  /******/ 			return installedModules[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			i: moduleId,
  /******/ 			l: false,
  /******/ 			exports: {}
  /******/ 		};
  /******/
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  /******/
  /******/ 		// Flag the module as loaded
  /******/ 		module.l = true;
  /******/
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/
  /******/
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  /******/
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  /******/
  /******/ 	// define getter function for harmony exports
  /******/ 	__webpack_require__.d = function(exports, name, getter) {
  /******/ 		if(!__webpack_require__.o(exports, name)) {
  /******/ 			Object.defineProperty(exports, name, {
  /******/ 				configurable: false,
  /******/ 				enumerable: true,
  /******/ 				get: getter
  /******/ 			});
  /******/ 		}
  /******/ 	};
  /******/
  /******/ 	// getDefaultExport function for compatibility with non-harmony modules
  /******/ 	__webpack_require__.n = function(module) {
  /******/ 		var getter = module && module.__esModule ?
  /******/ 			function getDefault() { return module['default']; } :
  /******/ 			function getModuleExports() { return module; };
  /******/ 		__webpack_require__.d(getter, 'a', getter);
  /******/ 		return getter;
  /******/ 	};
  /******/
  /******/ 	// Object.prototype.hasOwnProperty.call
  /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  /******/
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  /******/
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(__webpack_require__.s = 0);
  /******/ })
  /************************************************************************/
  /******/ ([
  /* 0 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
  
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  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"); } }
  
  var Boogie,
      default_options,
      noop,
      indexOf = [].indexOf;
  
  noop = function noop() {};
  
  default_options = {
    filter: ['log', 'info', 'warn', 'error'],
    codes: {},
    prefix: null,
    url_prefix: 'boogie',
    unknown_template: 'Unkonwn event.',
    onRecord: noop,
    onActivate: noop,
    onDeactivate: noop
  };
  
  module.exports = Boogie = function () {
    function Boogie(options) {
      _classCallCheck(this, Boogie);
  
      this.is_active = false;
      this.options = {};
      this.setOptions(default_options);
      this.setOptions(options);
      this.history = [];
      this.evalLocation();
      this.evalStorage();
    }
  
    _createClass(Boogie, [{
      key: 'setOptions',
      value: function setOptions() {
        var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  
        return this.options = _extends(this.options, options);
      }
    }, {
      key: 'getTemplateByCode',
      value: function getTemplateByCode(code) {
        var found_object, i, len, ref, step;
        if (!code) {
          return this.options.unknown_template;
        }
        found_object = this.options.codes;
        ref = code.split('.');
        for (i = 0, len = ref.length; i < len; i++) {
          step = ref[i];
          if (found_object[step] == null) {
            return this.options.unknown_template;
          }
          found_object = found_object[step];
        }
        return found_object;
      }
    }, {
      key: 'evalTemplate',
      value: function evalTemplate() {
        var template = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.unknown_template;
        var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  
        switch (typeof template === 'undefined' ? 'undefined' : _typeof(template)) {
          case 'function':
            return template(data);
          case 'string':
            return template;
          default:
            if (template.toString != null) {
              return template.toString();
            } else {
              return template;
            }
        }
      }
    }, {
      key: 'record',
      value: function record() {
        var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'log';
        var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
        var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  
        var console_args, item, template;
        if (!this.is_active) {
          return;
        }
        template = this.getTemplateByCode(code);
        item = {
          type: type,
          code: code,
          data: data,
          timestamp: new Date().getTime(),
          message: this.evalTemplate(template, data)
        };
        this.history.push(item);
        if (indexOf.call(this.options.filter, type) >= 0) {
          console_args = [item.message, data];
          if (this.options.prefix != null) {
            console_args.unshift(this.options.prefix);
          }
          console[type].apply(console, console_args);
          return this.options.onRecord(type, code, data, item.message);
        }
      }
    }, {
      key: 'log',
      value: function log(code, data) {
        return this.record('log', code, data);
      }
    }, {
      key: 'info',
      value: function info(code, data) {
        return this.record('info', code, data);
      }
    }, {
      key: 'warn',
      value: function warn(code, data) {
        return this.record('warn', code, data);
      }
    }, {
      key: 'error',
      value: function error(code, data) {
        return this.record('error', code, data);
      }
    }, {
      key: 'activate',
      value: function activate() {
        this.is_active = true;
        return this.options.onActivate();
      }
    }, {
      key: 'deactivate',
      value: function deactivate() {
        this.is_active = false;
        localStorage.removeItem(this.options.url_prefix + 'activate');
        return this.options.onDeactivate();
      }
    }, {
      key: 'parseLocation',
      value: function parseLocation(location) {
        var ref, result;
        result = {};
        if ((ref = location.search) != null) {
          ref.replace(/^\?/, '').split('&').map(function (item) {
            var key, val;
  
            var _item$split = item.split('=');
  
            var _item$split2 = _slicedToArray(_item$split, 2);
  
            key = _item$split2[0];
            val = _item$split2[1];
  
            return result[key] = val;
          });
        }
        return result;
      }
    }, {
      key: 'evalLocation',
      value: function evalLocation() {
        var location = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.location;
  
        var found_filter, params;
        params = this.parseLocation(location);
        if (params[this.options.url_prefix + 'activate'] != null) {
          localStorage.setItem(this.options.url_prefix + 'activate', 1);
          this.activate();
        }
        found_filter = params[this.options.url_prefix + 'filter'];
        if (found_filter != null) {
          localStorage.setItem(this.options.url_prefix + 'filter', found_filter);
          return this.setOptions({
            filter: found_filter.split(',')
          });
        }
      }
    }, {
      key: 'evalStorage',
      value: function evalStorage() {
        var found_filter;
        if (localStorage.getItem(this.options.url_prefix + 'activate') != null) {
          this.activate();
        }
        found_filter = localStorage.getItem(this.options.url_prefix + 'filter');
        if (found_filter != null) {
          return this.setOptions({
            filter: found_filter.split(',')
          });
        }
      }
    }]);
  
    return Boogie;
  }();
  
  /***/ })
  /******/ ]);
  });