(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["Clappr"] = factory();
else
root["Clappr"] = factory();
})(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] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = 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;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "<%=baseUrl%>/";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _componentsPlayer = __webpack_require__(1);
var _componentsPlayer2 = _interopRequireDefault(_componentsPlayer);
var _baseUtils = __webpack_require__(2);
var _baseUtils2 = _interopRequireDefault(_baseUtils);
var _baseEvents = __webpack_require__(16);
var _baseEvents2 = _interopRequireDefault(_baseEvents);
var _basePlayback = __webpack_require__(96);
var _basePlayback2 = _interopRequireDefault(_basePlayback);
var _baseContainer_plugin = __webpack_require__(126);
var _baseContainer_plugin2 = _interopRequireDefault(_baseContainer_plugin);
var _baseCore_plugin = __webpack_require__(157);
var _baseCore_plugin2 = _interopRequireDefault(_baseCore_plugin);
var _baseUi_core_plugin = __webpack_require__(141);
var _baseUi_core_plugin2 = _interopRequireDefault(_baseUi_core_plugin);
var _baseUi_container_plugin = __webpack_require__(121);
var _baseUi_container_plugin2 = _interopRequireDefault(_baseUi_container_plugin);
var _baseBase_object = __webpack_require__(15);
var _baseBase_object2 = _interopRequireDefault(_baseBase_object);
var _baseUi_object = __webpack_require__(27);
var _baseUi_object2 = _interopRequireDefault(_baseUi_object);
var _componentsBrowser = __webpack_require__(14);
var _componentsBrowser2 = _interopRequireDefault(_componentsBrowser);
var _componentsContainer = __webpack_require__(32);
var _componentsContainer2 = _interopRequireDefault(_componentsContainer);
var _componentsCore = __webpack_require__(24);
var _componentsCore2 = _interopRequireDefault(_componentsCore);
var _componentsMediator = __webpack_require__(64);
var _componentsMediator2 = _interopRequireDefault(_componentsMediator);
var _componentsMedia_control = __webpack_require__(58);
var _componentsMedia_control2 = _interopRequireDefault(_componentsMedia_control);
var _componentsPlayer_info = __webpack_require__(65);
var _componentsPlayer_info2 = _interopRequireDefault(_componentsPlayer_info);
var _playbacksFlash = __webpack_require__(99);
var _playbacksFlash2 = _interopRequireDefault(_playbacksFlash);
var _playbacksHls = __webpack_require__(106);
var _playbacksHls2 = _interopRequireDefault(_playbacksHls);
var _playbacksHtml5_audio = __webpack_require__(104);
var _playbacksHtml5_audio2 = _interopRequireDefault(_playbacksHtml5_audio);
var _playbacksHtml5_video = __webpack_require__(93);
var _playbacksHtml5_video2 = _interopRequireDefault(_playbacksHtml5_video);
var _playbacksHtml_img = __webpack_require__(112);
var _playbacksHtml_img2 = _interopRequireDefault(_playbacksHtml_img);
var _pluginsPoster = __webpack_require__(131);
var _pluginsPoster2 = _interopRequireDefault(_pluginsPoster);
var _pluginsLog = __webpack_require__(19);
var _pluginsLog2 = _interopRequireDefault(_pluginsLog);
window.DEBUG = false;
var version = ("0.2.5");
exports['default'] = {
Player: _componentsPlayer2['default'],
Mediator: _componentsMediator2['default'],
Events: _baseEvents2['default'],
Browser: _componentsBrowser2['default'],
PlayerInfo: _componentsPlayer_info2['default'],
MediaControl: _componentsMedia_control2['default'],
ContainerPlugin: _baseContainer_plugin2['default'],
UIContainerPlugin: _baseUi_container_plugin2['default'],
CorePlugin: _baseCore_plugin2['default'],
UICorePlugin: _baseUi_core_plugin2['default'],
Playback: _basePlayback2['default'],
Container: _componentsContainer2['default'],
Core: _componentsCore2['default'],
BaseObject: _baseBase_object2['default'],
UIObject: _baseUi_object2['default'],
Utils: _baseUtils2['default'],
Flash: _playbacksFlash2['default'],
HLS: _playbacksHls2['default'],
HTML5Audio: _playbacksHtml5_audio2['default'],
HTML5Video: _playbacksHtml5_video2['default'],
HTMLImg: _playbacksHtml_img2['default'],
Poster: _pluginsPoster2['default'],
Log: _pluginsLog2['default'],
version: version
};
module.exports = exports['default'];
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _baseUtils = __webpack_require__(2);
var _baseBase_object = __webpack_require__(15);
var _baseBase_object2 = _interopRequireDefault(_baseBase_object);
var _baseEvents = __webpack_require__(16);
var _baseEvents2 = _interopRequireDefault(_baseEvents);
var _core_factory = __webpack_require__(22);
var _core_factory2 = _interopRequireDefault(_core_factory);
var _loader = __webpack_require__(72);
var _loader2 = _interopRequireDefault(_loader);
var _lodashAssign = __webpack_require__(3);
var _lodashAssign2 = _interopRequireDefault(_lodashAssign);
var _lodashFind = __webpack_require__(38);
var _lodashFind2 = _interopRequireDefault(_lodashFind);
var _player_info = __webpack_require__(65);
var _player_info2 = _interopRequireDefault(_player_info);
var baseUrl = (0, _baseUtils.currentScriptUrl)().replace(/\/[^\/]+$/, "");
var Player = (function (_BaseObject) {
_inherits(Player, _BaseObject);
function Player(options) {
_classCallCheck(this, Player);
_get(Object.getPrototypeOf(Player.prototype), 'constructor', this).call(this, options);
window.p = this;
var defaultOptions = { playerId: (0, _baseUtils.uniqueId)(""), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl };
this.options = (0, _lodashAssign2['default'])(defaultOptions, options);
this.options.sources = this.normalizeSources(options);
this.loader = new _loader2['default'](this.options.plugins || {}, this.options.playerId);
this.coreFactory = new _core_factory2['default'](this, this.loader);
this.playerInfo = _player_info2['default'].getInstance(this.options.playerId);
this.playerInfo.currentSize = { width: options.width, height: options.height };
this.playerInfo.options = this.options;
if (this.options.parentId) {
this.setParentId(this.options.parentId);
}
}
_createClass(Player, [{
key: 'setParentId',
value: function setParentId(parentId) {
var el = document.querySelector(parentId);
if (el) {
this.attachTo(el);
}
}
}, {
key: 'attachTo',
value: function attachTo(element) {
this.options.parentElement = element;
this.core = this.coreFactory.create();
this.addEventListeners();
}
}, {
key: 'addEventListeners',
value: function addEventListeners() {
this.listenTo(this.core.mediaControl, _baseEvents2['default'].MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
var container = this.core.mediaControl.container;
if (!!container) {
this.listenTo(container, _baseEvents2['default'].CONTAINER_PLAY, this.onPlay);
this.listenTo(container, _baseEvents2['default'].CONTAINER_PAUSE, this.onPause);
this.listenTo(container, _baseEvents2['default'].CONTAINER_STOP, this.onStop);
this.listenTo(container, _baseEvents2['default'].CONTAINER_ENDED, this.onEnded);
this.listenTo(container, _baseEvents2['default'].CONTAINER_SEEK, this.onSeek);
this.listenTo(container, _baseEvents2['default'].CONTAINER_ERROR, this.onError);
this.listenTo(container, _baseEvents2['default'].CONTAINER_TIMEUPDATE, this.onTimeUpdate);
}
}
}, {
key: 'containerChanged',
value: function containerChanged() {
this.stopListening();
this.addEventListeners();
}
}, {
key: 'onPlay',
value: function onPlay() {
this.trigger(_baseEvents2['default'].PLAYER_PLAY);
}
}, {
key: 'onPause',
value: function onPause() {
this.trigger(_baseEvents2['default'].PLAYER_PAUSE);
}
}, {
key: 'onStop',
value: function onStop() {
this.trigger(_baseEvents2['default'].PLAYER_STOP, this.getCurrentTime());
}
}, {
key: 'onEnded',
value: function onEnded() {
this.trigger(_baseEvents2['default'].PLAYER_ENDED);
}
}, {
key: 'onSeek',
value: function onSeek(percent) {
this.trigger(_baseEvents2['default'].PLAYER_SEEK, percent);
}
}, {
key: 'onTimeUpdate',
value: function onTimeUpdate(position, duration) {
this.trigger(_baseEvents2['default'].PLAYER_TIMEUPDATE, position, duration);
}
}, {
key: 'onError',
value: function onError(error) {
this.trigger(_baseEvents2['default'].PLAYER_ERROR, error);
}
}, {
key: 'is',
value: function is(value, type) {
return value.constructor === type;
}
}, {
key: 'normalizeSources',
value: function normalizeSources(options) {
var sources = options.sources || (options.source !== undefined ? [options.source.toString()] : []);
return sources.length === 0 ? ['no.op'] : sources;
}
}, {
key: 'resize',
value: function resize(size) {
this.core.resize(size);
}
}, {
key: 'load',
value: function load(sources, mimeType) {
this.core.load(sources, mimeType);
}
}, {
key: 'destroy',
value: function destroy() {
this.core.destroy();
}
}, {
key: 'play',
value: function play() {
this.core.mediaControl.container.play();
}
}, {
key: 'pause',
value: function pause() {
this.core.mediaControl.container.pause();
}
}, {
key: 'stop',
value: function stop() {
this.core.mediaControl.container.stop();
}
}, {
key: 'seek',
value: function seek(time) {
this.core.mediaControl.container.setCurrentTime(time);
}
}, {
key: 'setVolume',
value: function setVolume(volume) {
this.core.mediaControl.container.setVolume(volume);
}
}, {
key: 'mute',
value: function mute() {
this.core.mediaControl.container.setVolume(0);
}
}, {
key: 'unmute',
value: function unmute() {
this.core.mediaControl.container.setVolume(100);
}
}, {
key: 'isPlaying',
value: function isPlaying() {
return this.core.mediaControl.container.isPlaying();
}
}, {
key: 'getPlugin',
value: function getPlugin(name) {
var plugins = this.core.plugins.concat(this.core.mediaControl.container.plugins);
return (0, _lodashFind2['default'])(plugins, function (plugin) {
return plugin.name === name;
});
}
}, {
key: 'getCurrentTime',
value: function getCurrentTime() {
return this.core.mediaControl.container.getCurrentTime();
}
}, {
key: 'getDuration',
value: function getDuration() {
return this.core.mediaControl.container.getDuration();
}
}]);
return Player;
})(_baseBase_object2['default']);
exports['default'] = Player;
module.exports = exports['default'];
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'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; }; })();
exports.extend = extend;
exports.formatTime = formatTime;
exports.seekStringToSeconds = seekStringToSeconds;
exports.uniqueId = uniqueId;
exports.isNumber = isNumber;
exports.currentScriptUrl = currentScriptUrl;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _lodashAssign = __webpack_require__(3);
var _lodashAssign2 = _interopRequireDefault(_lodashAssign);
var _componentsBrowser = __webpack_require__(14);
var _componentsBrowser2 = _interopRequireDefault(_componentsBrowser);
function extend(parent, properties) {
var constructor = function constructor() {
parent.prototype.constructor.apply(this, arguments);
if (properties.constructor) {
properties.constructor.apply(this, arguments);
}
};
constructor.prototype = Object.create(parent.prototype);
(0, _lodashAssign2['default'])(constructor.prototype, properties);
return constructor;
}
function formatTime(time) {
if (!isFinite(time)) {
return "--:--";
}
time = time * 1000;
time = parseInt(time / 1000);
var seconds = time % 60;
time = parseInt(time / 60);
var minutes = time % 60;
time = parseInt(time / 60);
var hours = time % 24;
var days = parseInt(time / 24);
var out = "";
if (days && days > 0) {
out += days + ":";
if (hours < 1) out += "00:";
}
if (hours && hours > 0) out += ("0" + hours).slice(-2) + ":";
out += ("0" + minutes).slice(-2) + ":";
out += ("0" + seconds).slice(-2);
return out.trim();
}
var Fullscreen = {
isFullscreen: function isFullscreen() {
return document.webkitFullscreenElement || document.webkitIsFullScreen || document.mozFullScreen || !!document.msFullscreenElement;
},
requestFullscreen: function requestFullscreen(el) {
if (el.requestFullscreen) {
el.requestFullscreen();
} else if (el.webkitRequestFullscreen) {
el.webkitRequestFullscreen();
} else if (el.mozRequestFullScreen) {
el.mozRequestFullScreen();
} else if (el.msRequestFullscreen) {
el.msRequestFullscreen();
} else if (el.querySelector && el.querySelector("video") && el.querySelector("video").webkitEnterFullScreen) {
el.querySelector("video").webkitEnterFullScreen();
}
},
cancelFullscreen: function cancelFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
};
exports.Fullscreen = Fullscreen;
var Config = (function () {
function Config() {
_classCallCheck(this, Config);
}
_createClass(Config, null, [{
key: '_defaultConfig',
value: function _defaultConfig() {
return {
volume: {
value: 100,
parse: parseInt
}
};
}
}, {
key: '_defaultValueFor',
value: function _defaultValueFor(key) {
try {
return this._defaultConfig()[key]['parse'](this._defaultConfig()[key]['value']);
} catch (e) {
return undefined;
}
}
}, {
key: '_create_keyspace',
value: function _create_keyspace(key) {
return 'clappr.' + document.domain + '.' + key;
}
}, {
key: 'restore',
value: function restore(key) {
if (_componentsBrowser2['default'].hasLocalstorage && localStorage[this._create_keyspace(key)]) {
return this._defaultConfig()[key]['parse'](localStorage[this._create_keyspace(key)]);
}
return this._defaultValueFor(key);
}
}, {
key: 'persist',
value: function persist(key, value) {
if (_componentsBrowser2['default'].hasLocalstorage) {
try {
localStorage[this._create_keyspace(key)] = value;
return true;
} catch (e) {
return false;
}
}
}
}]);
return Config;
})();
exports.Config = Config;
function seekStringToSeconds(url) {
var parts = url.match(/t=([0-9]*)(&|\/|$)/);
if (parts && parts.length > 0) {
return parseInt(parts[1], 10);
} else {
var seconds = 0;
var factor = { 'h': 3600, 'm': 60, 's': 1 };
parts = url.match(/[0-9]+[hms]+/g) || [];
parts.forEach(function (el) {
if (el) {
var suffix = el[el.length - 1];
var time = parseInt(el.slice(0, el.length - 1), 10);
seconds += time * factor[suffix];
}
});
return seconds;
}
}
var idsCounter = {};
function uniqueId(prefix) {
idsCounter[prefix] || (idsCounter[prefix] = 0);
var id = ++idsCounter[prefix];
return prefix + id;
}
function isNumber(value) {
return value - parseFloat(value) + 1 >= 0;
}
function currentScriptUrl() {
var scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1].src;
}
var requestAnimationFrame = (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {
window.setTimeout(fn, 1000 / 60);
}).bind(window);
exports.requestAnimationFrame = requestAnimationFrame;
var cancelAnimationFrame = (window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout).bind(window);
exports.cancelAnimationFrame = cancelAnimationFrame;
exports['default'] = {
Config: Config,
Fullscreen: Fullscreen,
extend: extend,
formatTime: formatTime,
seekStringToSeconds: seekStringToSeconds,
uniqueId: uniqueId,
currentScriptUrl: currentScriptUrl,
isNumber: isNumber,
requestAnimationFrame: requestAnimationFrame,
cancelAnimationFrame: cancelAnimationFrame
};
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* lodash 3.0.0 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.7.0
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
'use strict';
var baseAssign = __webpack_require__(4),
createAssigner = __webpack_require__(10);
/**
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources overwrite property assignments of previous sources.
* If `customizer` is provided it is invoked to produce the assigned values.
* The `customizer` is bound to `thisArg` and invoked with five arguments;
* (objectValue, sourceValue, key, object, source).
*
* @static
* @memberOf _
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @param {Function} [customizer] The function to customize assigning values.
* @param {*} [thisArg] The `this` binding of `customizer`.
* @returns {Object} Returns `object`.
* @example
*
* _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
* // => { 'user': 'fred', 'age': 40 }
*
* // using a customizer callback
* var defaults = _.partialRight(_.assign, function(value, other) {
* return typeof value == 'undefined' ? other : value;
* });
*
* defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
* // => { 'user': 'barney', 'age': 36 }
*/
var assign = createAssigner(baseAssign);
module.exports = assign;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/**
* lodash 3.2.0 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
'use strict';
var baseCopy = __webpack_require__(5),
keys = __webpack_require__(6);
/**
* The base implementation of `_.assign` without support for argument juggling,
* multiple sources, and `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return source == null ? object : baseCopy(source, keys(source), object);
}
module.exports = baseAssign;
/***/ },
/* 5 */
/***/ function(module, exports) {
/**
* lodash 3.0.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy.
* @param {Object} [object={}] The object to copy properties to.
* @returns {Object} Returns `object`.
*/
"use strict";
function baseCopy(source, props, object) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
object[key] = source[key];
}
return object;
}
module.exports = baseCopy;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/**
* lodash 3.1.2 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
'use strict';
var getNative = __webpack_require__(7),
isArguments = __webpack_require__(8),
isArray = __webpack_require__(9);
/** Used to detect unsigned integer values. */
var reIsUint = /^\d+$/;
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/* Native method references for those with the same name as other `lodash` methods. */
var nativeKeys = getNative(Object, 'keys');
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function (object) {
return object == null ? undefined : object[key];
};
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Checks if `value` is array-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value));
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = typeof value == 'number' || reIsUint.test(value) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* A fallback implementation of `Object.keys` which creates an array of the
* own enumerable property names of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function shimKeys(object) {
var props = keysIn(object),
propsLength = props.length,
length = propsLength && object.length;
var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object));
var index = -1,
result = [];
while (++index < propsLength) {
var key = props[index];
if (allowIndexes && isIndex(key, length) || hasOwnProperty.call(object, key)) {
result.push(key);
}
}
return result;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
* for more details.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
var keys = !nativeKeys ? shimKeys : function (object) {
var Ctor = object == null ? undefined : object.constructor;
if (typeof Ctor == 'function' && Ctor.prototype === object || typeof object != 'function' && isArrayLike(object)) {
return shimKeys(object);
}
return isObject(object) ? nativeKeys(object) : [];
};
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
if (object == null) {
return [];
}
if (!isObject(object)) {
object = Object(object);
}
var length = object.length;
length = length && isLength(length) && (isArray(object) || isArguments(object)) && length || 0;
var Ctor = object.constructor,
index = -1,
isProto = typeof Ctor == 'function' && Ctor.prototype === object,
result = Array(length),
skipIndexes = length > 0;
while (++index < length) {
result[index] = index + '';
}
for (var key in object) {
if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = keys;
/***/ },
/* 7 */
/***/ function(module, exports) {
/**
* lodash 3.9.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** `Object#toString` result references. */
'use strict';
var funcTag = '[object Function]';
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for regexes
// and Safari 8 equivalents which return 'object' for typed array constructors.
return isObject(value) && objToString.call(value) == funcTag;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(fnToString.call(value));
}
return isObjectLike(value) && reIsHostCtor.test(value);
}
module.exports = getNative;
/***/ },
/* 8 */
/***/ function(module, exports) {
/**
* lodash 3.0.4 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
'use strict';
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Native method references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function (object) {
return object == null ? undefined : object[key];
};
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Checks if `value` is array-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value));
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as an `arguments` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
return isObjectLike(value) && isArrayLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
}
module.exports = isArguments;
/***/ },
/* 9 */
/***/ function(module, exports) {
/**
* lodash 3.0.4 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** `Object#toString` result references. */
'use strict';
var arrayTag = '[object Array]',
funcTag = '[object Function]';
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeIsArray = getNative(Array, 'isArray');
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(function() { return arguments; }());
* // => false
*/
var isArray = nativeIsArray || function (value) {
return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
};
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for regexes
// and Safari 8 equivalents which return 'object' for typed array constructors.
return isObject(value) && objToString.call(value) == funcTag;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(fnToString.call(value));
}
return isObjectLike(value) && reIsHostCtor.test(value);
}
module.exports = isArray;
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/**
* lodash 3.1.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
'use strict';
var bindCallback = __webpack_require__(11),
isIterateeCall = __webpack_require__(12),
restParam = __webpack_require__(13);
/**
* Creates a function that assigns properties of source object(s) to a given
* destination object.
*
* **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return restParam(function (object, sources) {
var index = -1,
length = object == null ? 0 : sources.length,
customizer = length > 2 ? sources[length - 2] : undefined,
guard = length > 2 ? sources[2] : undefined,
thisArg = length > 1 ? sources[length - 1] : undefined;
if (typeof customizer == 'function') {
customizer = bindCallback(customizer, thisArg, 5);
length -= 2;
} else {
customizer = typeof thisArg == 'function' ? thisArg : undefined;
length -= customizer ? 1 : 0;
}
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, customizer);
}
}
return object;
});
}
module.exports = createAssigner;
/***/ },
/* 11 */
/***/ function(module, exports) {
/**
* lodash 3.0.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/**
* A specialized version of `baseCallback` which only supports `this` binding
* and specifying the number of arguments to provide to `func`.
*
* @private
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {number} [argCount] The number of arguments to provide to `func`.
* @returns {Function} Returns the callback.
*/
'use strict';
function bindCallback(func, thisArg, argCount) {
if (typeof func != 'function') {
return identity;
}
if (thisArg === undefined) {
return func;
}
switch (argCount) {
case 1:
return function (value) {
return func.call(thisArg, value);
};
case 3:
return function (value, index, collection) {
return func.call(thisArg, value, index, collection);
};
case 4:
return function (accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
case 5:
return function (value, other, key, object, source) {
return func.call(thisArg, value, other, key, object, source);
};
}
return function () {
return func.apply(thisArg, arguments);
};
}
/**
* This method returns the first argument provided to it.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'user': 'fred' };
*
* _.identity(object) === object;
* // => true
*/
function identity(value) {
return value;
}
module.exports = bindCallback;
/***/ },
/* 12 */
/***/ function(module, exports) {
/**
* lodash 3.0.9 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** Used to detect unsigned integer values. */
'use strict';
var reIsUint = /^\d+$/;
/**
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function (object) {
return object == null ? undefined : object[key];
};
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Checks if `value` is array-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value));
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = typeof value == 'number' || reIsUint.test(value) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/**
* Checks if the provided arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
var other = object[index];
return value === value ? value === other : other !== other;
}
return false;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
module.exports = isIterateeCall;
/***/ },
/* 13 */
/***/ function(module, exports) {
/**
* lodash 3.6.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** Used as the `TypeError` message for "Functions" methods. */
'use strict';
var FUNC_ERROR_TEXT = 'Expected a function';
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as an array.
*
* **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.restParam(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function restParam(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = nativeMax(start === undefined ? func.length - 1 : +start || 0, 0);
return function () {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
rest = Array(length);
while (++index < length) {
rest[index] = args[start + index];
}
switch (start) {
case 0:
return func.call(this, rest);
case 1:
return func.call(this, args[0], rest);
case 2:
return func.call(this, args[0], args[1], rest);
}
var otherArgs = Array(start + 1);
index = -1;
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = rest;
return func.apply(this, otherArgs);
};
}
module.exports = restParam;
/***/ },
/* 14 */
/***/ function(module, exports) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var Browser = {};
var hasLocalstorage = function hasLocalstorage() {
try {
localStorage.setItem('clappr', 'clappr');
localStorage.removeItem('clappr');
return true;
} catch (e) {
return false;
}
};
var hasFlash = function hasFlash() {
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
return !!fo;
} catch (e) {
return !!(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] !== undefined && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin);
}
};
var getBrowserInfo = function getBrowserInfo() {
var ua = navigator.userAgent;
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
var extra;
if (/trident/i.test(parts[1])) {
extra = /\brv[ :]+(\d+)/g.exec(ua) || [];
return { name: 'IE', version: parseInt(extra[1] || '') };
} else if (parts[1] === 'Chrome') {
extra = ua.match(/\bOPR\/(\d+)/);
if (extra != null) {
return { name: 'Opera', version: parseInt(extra[1]) };
}
}
parts = parts[2] ? [parts[1], parts[2]] : [navigator.appName, navigator.appVersion, '-?'];
if (extra = ua.match(/version\/(\d+)/i)) {
parts.splice(1, 1, extra[1]);
}
return { name: parts[0], version: parseInt(parts[1]) };
};
var browserInfo = getBrowserInfo();
Browser.isSafari = !!navigator.userAgent.match(/safari/i) && navigator.userAgent.indexOf('Chrome') === -1;
Browser.isChrome = !!navigator.userAgent.match(/chrome/i);
Browser.isFirefox = !!navigator.userAgent.match(/firefox/i);
Browser.isLegacyIE = !!window.ActiveXObject;
Browser.isIE = Browser.isLegacyIE || !!navigator.userAgent.match(/trident.*rv:1\d/i);
Browser.isIE11 = !!navigator.userAgent.match(/trident.*rv:11/i);
Browser.isMobile = !!/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent);
Browser.isiOs = !!/iPad|iPhone|iPod/i.test(navigator.userAgent);
Browser.isWin8App = !!/MSAppHost/i.test(navigator.userAgent);
Browser.isWiiU = !!/WiiU/i.test(navigator.userAgent);
Browser.isPS4 = !!/PlayStation 4/i.test(navigator.userAgent);
Browser.hasLocalstorage = hasLocalstorage();
Browser.hasFlash = hasFlash();
Browser.name = browserInfo.name;
Browser.version = browserInfo.version;
exports['default'] = Browser;
module.exports = exports['default'];
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _utils = __webpack_require__(2);
var _events = __webpack_require__(16);
var _events2 = _interopRequireDefault(_events);
var BaseObject = (function (_Events) {
_inherits(BaseObject, _Events);
function BaseObject() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
_classCallCheck(this, BaseObject);
_get(Object.getPrototypeOf(BaseObject.prototype), 'constructor', this).call(this, options);
this.uniqueId = (0, _utils.uniqueId)('o');
}
return BaseObject;
})(_events2['default']);
exports['default'] = BaseObject;
module.exports = exports['default'];
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _utils = __webpack_require__(2);
var _lodashOnce = __webpack_require__(17);
var _lodashOnce2 = _interopRequireDefault(_lodashOnce);
var _pluginsLog = __webpack_require__(19);
var _pluginsLog2 = _interopRequireDefault(_pluginsLog);
var logger = _pluginsLog2['default'].getInstance();
var slice = Array.prototype.slice;
var Events = (function () {
function Events() {
_classCallCheck(this, Events);
}
_createClass(Events, [{
key: 'on',
value: function on(name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({ callback: callback, context: context, ctx: context || this });
return this;
}
}, {
key: 'once',
value: function once(name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
var self = this;
var once = (0, _lodashOnce2['default'])(function () {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
}
}, {
key: 'off',
value: function off(name, callback, context) {
var retain, ev, events, names, i, l, j, k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) {
this._events = void 0;
return this;
}
names = name ? [name] : Object.keys(this._events);
for (i = 0, l = names.length; i < l; i++) {
name = names[i];
events = this._events[name];
if (events) {
this._events[name] = retain = [];
if (callback || context) {
for (j = 0, k = events.length; j < k; j++) {
ev = events[j];
if (callback && callback !== ev.callback && callback !== ev.callback._callback || context && context !== ev.context) {
retain.push(ev);
}
}
}
if (!retain.length) delete this._events[name];
}
}
return this;
}
}, {
key: 'trigger',
value: function trigger(name) {
try {
var klass = this.name || this.constructor.name;
logger.debug.apply(logger, [klass].concat(Array.prototype.slice.call(arguments)));
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(events, args);
if (allEvents) triggerEvents(allEvents, arguments);
} catch (exception) {
logger.error.apply(logger, [klass, 'error on event', name, 'trigger', '-', exception]);
}
return this;
}
}, {
key: 'stopListening',
value: function stopListening(obj, name, callback) {
var listeningTo = this._listeningTo;
if (!listeningTo) return this;
var remove = !name && !callback;
if (!callback && typeof name === 'object') callback = this;
if (obj) (listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) {
obj = listeningTo[id];
obj.off(name, callback, this);
if (remove || Object.keys(obj._events).length === 0) delete this._listeningTo[id];
}
return this;
}
}]);
return Events;
})();
exports['default'] = Events;
var eventSplitter = /\s+/;
var eventsApi = function eventsApi(obj, action, name, rest) {
if (!name) return true;
// Handle event maps.
if (typeof name === 'object') {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
// Handle space separated event names.
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, l = names.length; i < l; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
var triggerEvents = function triggerEvents(events, args) {
var ev,
i = -1,
l = events.length,
a1 = args[0],
a2 = args[1],
a3 = args[2];
switch (args.length) {
case 0:
while (++i < l) (ev = events[i]).callback.call(ev.ctx);return;
case 1:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1);return;
case 2:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2);return;
case 3:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);return;
default:
while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);return;
}
};
var listenMethods = { listenTo: 'on', listenToOnce: 'once' };
Object.keys(listenMethods).forEach(function (method) {
Events.prototype[method] = function (obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = (0, _utils.uniqueId)('l'));
listeningTo[id] = obj;
if (!callback && typeof name === 'object') callback = this;
obj[listenMethods[method]](name, callback, this);
return this;
};
});
// PLAYER EVENTS
Events.PLAYER_RESIZE = 'resize';
Events.PLAYER_PLAY = 'play';
Events.PLAYER_PAUSE = 'pause';
Events.PLAYER_STOP = 'stop';
Events.PLAYER_ENDED = 'ended';
Events.PLAYER_SEEK = 'seek';
Events.PLAYER_ERROR = 'error';
Events.PLAYER_TIMEUPDATE = 'timeupdate';
// Playback Events
Events.PLAYBACK_PROGRESS = 'playback:progress';
Events.PLAYBACK_TIMEUPDATE = 'playback:timeupdate';
Events.PLAYBACK_READY = 'playback:ready';
Events.PLAYBACK_BUFFERING = 'playback:buffering';
Events.PLAYBACK_BUFFERFULL = 'playback:bufferfull';
Events.PLAYBACK_SETTINGSUPDATE = 'playback:settingsupdate';
Events.PLAYBACK_LOADEDMETADATA = 'playback:loadedmetadata';
Events.PLAYBACK_HIGHDEFINITIONUPDATE = 'playback:highdefinitionupdate';
Events.PLAYBACK_BITRATE = 'playback:bitrate';
Events.PLAYBACK_PLAYBACKSTATE = 'playback:playbackstate';
Events.PLAYBACK_DVR = 'playback:dvr';
Events.PLAYBACK_MEDIACONTROL_DISABLE = 'playback:mediacontrol:disable';
Events.PLAYBACK_MEDIACONTROL_ENABLE = 'playback:mediacontrol:enable';
Events.PLAYBACK_ENDED = 'playback:ended';
Events.PLAYBACK_PLAY = 'playback:play';
Events.PLAYBACK_PAUSE = 'playback:pause';
Events.PLAYBACK_ERROR = 'playback:error';
Events.PLAYBACK_STATS_ADD = 'playback:stats:add';
Events.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded';
// Container Events
Events.CONTAINER_PLAYBACKSTATE = 'container:playbackstate';
Events.CONTAINER_PLAYBACKDVRSTATECHANGED = 'container:dvr';
Events.CONTAINER_BITRATE = 'container:bitrate';
Events.CONTAINER_STATS_REPORT = 'container:stats:report';
Events.CONTAINER_DESTROYED = 'container:destroyed';
Events.CONTAINER_READY = 'container:ready';
Events.CONTAINER_ERROR = 'container:error';
Events.CONTAINER_LOADEDMETADATA = 'container:loadedmetadata';
Events.CONTAINER_TIMEUPDATE = 'container:timeupdate';
Events.CONTAINER_PROGRESS = 'container:progress';
Events.CONTAINER_PLAY = 'container:play';
Events.CONTAINER_STOP = 'container:stop';
Events.CONTAINER_PAUSE = 'container:pause';
Events.CONTAINER_ENDED = 'container:ended';
Events.CONTAINER_CLICK = 'container:click';
Events.CONTAINER_DBLCLICK = 'container:dblclick';
Events.CONTAINER_MOUSE_ENTER = 'container:mouseenter';
Events.CONTAINER_MOUSE_LEAVE = 'container:mouseleave';
Events.CONTAINER_SEEK = 'container:seek';
Events.CONTAINER_VOLUME = 'container:volume';
Events.CONTAINER_FULLSCREEN = 'container:fullscreen';
Events.CONTAINER_STATE_BUFFERING = 'container:state:buffering';
Events.CONTAINER_STATE_BUFFERFULL = 'container:state:bufferfull';
Events.CONTAINER_SETTINGSUPDATE = 'container:settingsupdate';
Events.CONTAINER_HIGHDEFINITIONUPDATE = 'container:highdefinitionupdate';
Events.CONTAINER_MEDIACONTROL_DISABLE = 'container:mediacontrol:disable';
Events.CONTAINER_MEDIACONTROL_ENABLE = 'container:mediacontrol:enable';
Events.CONTAINER_STATS_ADD = 'container:stats:add';
// MediaControl Events
Events.MEDIACONTROL_RENDERED = 'mediacontrol:rendered';
Events.MEDIACONTROL_FULLSCREEN = 'mediacontrol:fullscreen';
Events.MEDIACONTROL_SHOW = 'mediacontrol:show';
Events.MEDIACONTROL_HIDE = 'mediacontrol:hide';
Events.MEDIACONTROL_MOUSEMOVE_SEEKBAR = 'mediacontrol:mousemove:seekbar';
Events.MEDIACONTROL_MOUSELEAVE_SEEKBAR = 'mediacontrol:mouseleave:seekbar';
Events.MEDIACONTROL_PLAYING = 'mediacontrol:playing';
Events.MEDIACONTROL_NOTPLAYING = 'mediacontrol:notplaying';
Events.MEDIACONTROL_CONTAINERCHANGED = 'mediacontrol:containerchanged';
module.exports = exports['default'];
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
/**
* lodash 3.0.0 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.7.0
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
'use strict';
var before = __webpack_require__(18);
/**
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first call. The `func` is invoked
* with the `this` binding of the created function.
*
* @static
* @memberOf _
* @type Function
* @category Function
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // `initialize` invokes `createApplication` once
*/
function once(func) {
return before(func, 2);
}
module.exports = once;
/***/ },
/* 18 */
/***/ function(module, exports) {
/**
* lodash 3.0.3 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** Used as the `TypeError` message for "Functions" methods. */
'use strict';
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that invokes `func`, with the `this` binding and arguments
* of the created function, while it is called less than `n` times. Subsequent
* calls to the created function return the result of the last `func` invocation.
*
* @static
* @memberOf _
* @category Function
* @param {number} n The number of calls at which `func` is no longer invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* jQuery('#add').on('click', _.before(5, addContactToList));
* // => allows adding up to 4 contacts to the list
*/
function before(n, func) {
var result;
if (typeof func != 'function') {
if (typeof n == 'function') {
var temp = n;
n = func;
func = temp;
} else {
throw new TypeError(FUNC_ERROR_TEXT);
}
}
return function () {
if (--n > 0) {
result = func.apply(this, arguments);
}
if (n <= 1) {
func = undefined;
}
return result;
};
}
module.exports = before;
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(20);
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
'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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var _baseKibo = __webpack_require__(21);
var _baseKibo2 = _interopRequireDefault(_baseKibo);
var BOLD = 'font-weight: bold; font-size: 13px;';
var INFO = 'color: #006600;' + BOLD;
var DEBUG = 'color: #0000ff;' + BOLD;
var WARN = 'color: #ff8000;' + BOLD;
var ERROR = 'color: #ff0000;' + BOLD;
var LEVEL_DEBUG = 0;
var LEVEL_INFO = 1;
var LEVEL_WARN = 2;
var LEVEL_ERROR = 3;
var LEVEL_DISABLED = 4;
var COLORS = [DEBUG, INFO, WARN, ERROR, ERROR];
var DESCRIPTIONS = ['debug', 'info', 'warn', 'error', 'disabled'];
var Log = (function () {
function Log() {
var _this = this;
var level = arguments.length <= 0 || arguments[0] === undefined ? LEVEL_WARN : arguments[0];
_classCallCheck(this, Log);
this.kibo = new _baseKibo2['default']();
this.kibo.down(['ctrl shift d'], function () {
return _this.onOff();
});
this.BLACKLIST = ['timeupdate', 'playback:timeupdate', 'playback:progress', 'container:hover', 'container:timeupdate', 'container:progress'];
this.level = level;
}
_createClass(Log, [{
key: 'debug',
value: function debug(klass) {
this.log(klass, LEVEL_DEBUG, Array.prototype.slice.call(arguments, 1));
}
}, {
key: 'info',
value: function info(klass) {
this.log(klass, LEVEL_INFO, Array.prototype.slice.call(arguments, 1));
}
}, {
key: 'warn',
value: function warn(klass) {
this.log(klass, LEVEL_WARN, Array.prototype.slice.call(arguments, 1));
}
}, {
key: 'error',
value: function error(klass) {
this.log(klass, LEVEL_ERROR, Array.prototype.slice.call(arguments, 1));
}
}, {
key: 'onOff',
value: function onOff() {
if (this.level === LEVEL_DISABLED) {
this.level = this.previousLevel;
} else {
this.previousLevel = this.level;
this.level = LEVEL_DISABLED;
}
console.log.apply(console, ["%c[Clappr.Log] set log level to " + DESCRIPTIONS[this.level], ERROR]);
}
}, {
key: 'level',
value: function level(newLevel) {
this.level = newLevel;
}
}, {
key: 'log',
value: function log(klass, level, message) {
if (this.BLACKLIST.indexOf(message[0]) >= 0) return;
if (level < this.level) return;
if (!message) {
message = klass;
klass = null;
}
var klassDescription = "";
var color = COLORS[level];
if (klass) {
klassDescription = "[" + klass + "]";
}
console.log.apply(console, ["%c[" + DESCRIPTIONS[level] + "]" + klassDescription, color].concat(message));
}
}]);
return Log;
})();
exports['default'] = Log;
Log.LEVEL_DEBUG = LEVEL_DEBUG;
Log.LEVEL_INFO = LEVEL_INFO;
Log.LEVEL_WARN = LEVEL_WARN;
Log.LEVEL_ERROR = LEVEL_ERROR;
Log.getInstance = function () {
if (this._instance === undefined) {
this._instance = new this();
}
return this._instance;
};
module.exports = exports['default'];
/***/ },
/* 21 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var Kibo = function Kibo(element) {
this.element = element || window.document;
this.initialize();
};
Kibo.KEY_NAMES_BY_CODE = {
8: 'backspace', 9: 'tab', 13: 'enter',
16: 'shift', 17: 'ctrl', 18: 'alt',
20: 'caps_lock',
27: 'esc',
32: 'space',
37: 'left', 38: 'up', 39: 'right', 40: 'down',
48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9',
65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z',
112: 'f1', 113: 'f2', 114: 'f3', 115: 'f4', 116: 'f5', 117: 'f6', 118: 'f7', 119: 'f8', 120: 'f9', 121: 'f10', 122: 'f11', 123: 'f12'
};
Kibo.KEY_CODES_BY_NAME = {};
(function () {
for (var key in Kibo.KEY_NAMES_BY_CODE) if (Object.prototype.hasOwnProperty.call(Kibo.KEY_NAMES_BY_CODE, key)) Kibo.KEY_CODES_BY_NAME[Kibo.KEY_NAMES_BY_CODE[key]] = +key;
})();
Kibo.MODIFIERS = ['shift', 'ctrl', 'alt'];
Kibo.registerEvent = (function () {
if (document.addEventListener) {
return function (element, eventName, func) {
element.addEventListener(eventName, func, false);
};
} else if (document.attachEvent) {
return function (element, eventName, func) {
element.attachEvent('on' + eventName, func);
};
}
})();
Kibo.unregisterEvent = (function () {
if (document.removeEventListener) {
return function (element, eventName, func) {
element.removeEventListener(eventName, func, false);
};
} else if (document.detachEvent) {
return function (element, eventName, func) {
element.detachEvent('on' + eventName, func);
};
}
})();
Kibo.stringContains = function (string, substring) {
return string.indexOf(substring) !== -1;
};
Kibo.neatString = function (string) {
return string.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ');
};
Kibo.capitalize = function (string) {
return string.toLowerCase().replace(/^./, function (match) {
return match.toUpperCase();
});
};
Kibo.isString = function (what) {
return Kibo.stringContains(Object.prototype.toString.call(what), 'String');
};
Kibo.arrayIncludes = (function () {
if (Array.prototype.indexOf) {
return function (haystack, needle) {
return haystack.indexOf(needle) !== -1;
};
} else {
return function (haystack, needle) {
for (var i = 0; i < haystack.length; i++) if (haystack[i] === needle) return true;
return false;
};
}
})();
Kibo.extractModifiers = function (keyCombination) {
var modifiers, i;
modifiers = [];
for (i = 0; i < Kibo.MODIFIERS.length; i++) if (Kibo.stringContains(keyCombination, Kibo.MODIFIERS[i])) modifiers.push(Kibo.MODIFIERS[i]);
return modifiers;
};
Kibo.extractKey = function (keyCombination) {
var keys, i;
keys = Kibo.neatString(keyCombination).split(' ');
for (i = 0; i < keys.length; i++) if (!Kibo.arrayIncludes(Kibo.MODIFIERS, keys[i])) return keys[i];
};
Kibo.modifiersAndKey = function (keyCombination) {
var result, key;
if (Kibo.stringContains(keyCombination, 'any')) {
return Kibo.neatString(keyCombination).split(' ').slice(0, 2).join(' ');
}
result = Kibo.extractModifiers(keyCombination);
key = Kibo.extractKey(keyCombination);
if (key && !Kibo.arrayIncludes(Kibo.MODIFIERS, key)) result.push(key);
return result.join(' ');
};
Kibo.keyName = function (keyCode) {
return Kibo.KEY_NAMES_BY_CODE[keyCode + ''];
};
Kibo.keyCode = function (keyName) {
return +Kibo.KEY_CODES_BY_NAME[keyName];
};
Kibo.prototype.initialize = function () {
var i,
that = this;
this.lastKeyCode = -1;
this.lastModifiers = {};
for (i = 0; i < Kibo.MODIFIERS.length; i++) this.lastModifiers[Kibo.MODIFIERS[i]] = false;
this.keysDown = { any: [] };
this.keysUp = { any: [] };
this.downHandler = this.handler('down');
this.upHandler = this.handler('up');
Kibo.registerEvent(this.element, 'keydown', this.downHandler);
Kibo.registerEvent(this.element, 'keyup', this.upHandler);
Kibo.registerEvent(window, 'unload', function unloader() {
Kibo.unregisterEvent(that.element, 'keydown', that.downHandler);
Kibo.unregisterEvent(that.element, 'keyup', that.upHandler);
Kibo.unregisterEvent(window, 'unload', unloader);
});
};
Kibo.prototype.handler = function (upOrDown) {
var that = this;
return function (e) {
var i, registeredKeys, lastModifiersAndKey;
e = e || window.event;
that.lastKeyCode = e.keyCode;
for (i = 0; i < Kibo.MODIFIERS.length; i++) that.lastModifiers[Kibo.MODIFIERS[i]] = e[Kibo.MODIFIERS[i] + 'Key'];
if (Kibo.arrayIncludes(Kibo.MODIFIERS, Kibo.keyName(that.lastKeyCode))) that.lastModifiers[Kibo.keyName(that.lastKeyCode)] = true;
registeredKeys = that['keys' + Kibo.capitalize(upOrDown)];
for (i = 0; i < registeredKeys.any.length; i++) if (registeredKeys.any[i](e) === false && e.preventDefault) e.preventDefault();
lastModifiersAndKey = that.lastModifiersAndKey();
if (registeredKeys[lastModifiersAndKey]) for (i = 0; i < registeredKeys[lastModifiersAndKey].length; i++) if (registeredKeys[lastModifiersAndKey][i](e) === false && e.preventDefault) e.preventDefault();
};
};
Kibo.prototype.registerKeys = function (upOrDown, newKeys, func) {
var i,
keys,
registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];
if (Kibo.isString(newKeys)) newKeys = [newKeys];
for (i = 0; i < newKeys.length; i++) {
keys = newKeys[i];
keys = Kibo.modifiersAndKey(keys + '');
if (registeredKeys[keys]) registeredKeys[keys].push(func);else registeredKeys[keys] = [func];
}
return this;
};
Kibo.prototype.unregisterKeys = function (upOrDown, newKeys, func) {
var i,
j,
keys,
registeredKeys = this['keys' + Kibo.capitalize(upOrDown)];
if (Kibo.isString(newKeys)) newKeys = [newKeys];
for (i = 0; i < newKeys.length; i++) {
keys = newKeys[i];
keys = Kibo.modifiersAndKey(keys + '');
if (func === null) delete registeredKeys[keys];else {
if (registeredKeys[keys]) {
for (j = 0; j < registeredKeys[keys].length; j++) {
if (String(registeredKeys[keys][j]) === String(func)) {
registeredKeys[keys].splice(j, 1);
break;
}
}
}
}
}
return this;
};
Kibo.prototype.off = function (keys) {
return this.unregisterKeys('down', keys, null);
};
Kibo.prototype.delegate = function (upOrDown, keys, func) {
return func !== null || func !== undefined ? this.registerKeys(upOrDown, keys, func) : this.unregisterKeys(upOrDown, keys, func);
};
Kibo.prototype.down = function (keys, func) {
return this.delegate('down', keys, func);
};
Kibo.prototype.up = function (keys, func) {
return this.delegate('up', keys, func);
};
Kibo.prototype.lastKey = function (modifier) {
if (!modifier) return Kibo.keyName(this.lastKeyCode);
return this.lastModifiers[modifier];
};
Kibo.prototype.lastModifiersAndKey = function () {
var result, i;
result = [];
for (i = 0; i < Kibo.MODIFIERS.length; i++) if (this.lastKey(Kibo.MODIFIERS[i])) result.push(Kibo.MODIFIERS[i]);
if (!Kibo.arrayIncludes(result, this.lastKey())) result.push(this.lastKey());
return result.join(' ');
};
exports['default'] = Kibo;
module.exports = exports['default'];
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(23);
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/**
* The Core Factory is responsible for instantiate the core and it's plugins.
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _baseBase_object = __webpack_require__(15);
var _baseBase_object2 = _interopRequireDefault(_baseBase_object);
var _core = __webpack_require__(24);
var _core2 = _interopRequireDefault(_core);
var CoreFactory = (function (_BaseObject) {
_inherits(CoreFactory, _BaseObject);
function CoreFactory(player, loader) {
_classCallCheck(this, CoreFactory);
_get(Object.getPrototypeOf(CoreFactory.prototype), 'constructor', this).call(this);
this.player = player;
this.options = player.options;
this.loader = loader;
this.options.loader = this.loader;
}
_createClass(CoreFactory, [{
key: 'create',
value: function create() {
this.core = new _core2['default'](this.options);
this.core.then(this.addCorePlugins.bind(this));
return this.core;
}
}, {
key: 'addCorePlugins',
value: function addCorePlugins() {
var _this = this;
this.loader.corePlugins.forEach(function (Plugin) {
var plugin = new Plugin(_this.core);
_this.core.addPlugin(plugin);
_this.setupExternalInterface(plugin);
});
return this.core;
}
}, {
key: 'setupExternalInterface',
value: function setupExternalInterface(plugin) {
var externalFunctions = plugin.getExternalInterface();
for (var key in externalFunctions) {
this.player[key] = externalFunctions[key].bind(plugin);
}
}
}]);
return CoreFactory;
})(_baseBase_object2['default']);
exports['default'] = CoreFactory;
module.exports = exports['default'];
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(25);
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
// Copyright 2014 Globo.com Player authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/**
* The Core is responsible to manage Containers, the mediator, MediaControl
* and the player state.
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _baseUtils = __webpack_require__(2);
var _lodashAssign = __webpack_require__(3);
var _lodashAssign2 = _interopRequireDefault(_lodashAssign);
var _clapprZepto = __webpack_require__(26);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
var _baseUi_object = __webpack_require__(27);
var _baseUi_object2 = _interopRequireDefault(_baseUi_object);
var _container_factory = __webpack_require__(30);
var _container_factory2 = _interopRequireDefault(_container_factory);
var _baseStyler = __webpack_require__(34);
var _baseStyler2 = _interopRequireDefault(_baseStyler);
var _media_control = __webpack_require__(58);
var _media_control2 = _interopRequireDefault(_media_control);
var _player_info = __webpack_require__(65);
var _player_info2 = _interopRequireDefault(_player_info);
var _mediator = __webpack_require__(64);
var _mediator2 = _interopRequireDefault(_mediator);
var _baseEvents = __webpack_require__(16);
var _baseEvents2 = _interopRequireDefault(_baseEvents);
var _browser = __webpack_require__(14);
var _browser2 = _interopRequireDefault(_browser);
var _publicStyleScss = __webpack_require__(71);
var _publicStyleScss2 = _interopRequireDefault(_publicStyleScss);
var _lodashFind = __webpack_require__(38);
var _lodashFind2 = _interopRequireDefault(_lodashFind);
var Core = (function (_UIObject) {
_inherits(Core, _UIObject);
_createClass(Core, [{
key: 'events',
get: function get() {
return {
'webkitfullscreenchange': 'exit',
'mousemove': 'showMediaControl',
'mouseleave': 'hideMediaControl'
};
}
}, {
key: 'attributes',
get: function get() {
return {
'data-player': '',
tabindex: 9999
};
}
}]);
function Core(options) {
var _this = this;
_classCallCheck(this, Core);
_get(Object.getPrototypeOf(Core.prototype), 'constructor', this).call(this, options);
this.playerInfo = _player_info2['default'].getInstance(options.playerId);
this.options = options;
this.plugins = [];
this.containers = [];
this.createContainers(options);
//FIXME fullscreen api sucks
(0, _clapprZepto2['default'])(document).bind('fullscreenchange', function () {
return _this.exit();
});
(0, _clapprZepto2['default'])(document).bind('MSFullscreenChange', function () {
return _this.exit();
});
(0, _clapprZepto2['default'])(document).bind('mozfullscreenchange', function () {
return _this.exit();
});
}
_createClass(Core, [{
key: 'createContainers',
value: function createContainers(options) {
var _this2 = this;
this.defer = _clapprZepto2['default'].Deferred();
this.defer.promise(this);
this.containerFactory = new _container_factory2['default'](options, options.loader);
this.containerFactory.createContainers().then(function (containers) {
return _this2.setupContainers(containers);
}).then(function (containers) {
return _this2.resolveOnContainersReady(containers);
});
}
}, {
key: 'updateSize',
value: function updateSize() {
if (_baseUtils.Fullscreen.isFullscreen()) {
this.setFullscreen();
} else {
this.setPlayerSize();
}
_mediator2['default'].trigger(this.options.playerId + ':' + _baseEvents2['default'].PLAYER_RESIZE, this.playerInfo.currentSize);
}
}, {
key: 'setFullscreen',
value: function setFullscreen() {
if (!_browser2['default'].isiOs) {
this.$el.addClass('fullscreen');
this.$el.removeAttr('style');
this.playerInfo.previousSize = this.playerInfo.currentSize;
this.playerInfo.currentSize = { width: (0, _clapprZepto2['default'])(window).width(), height: (0, _clapprZepto2['default'])(window).height() };
}
}
}, {
key: 'setPlayerSize',
value: function setPlayerSize() {
this.$el.removeClass('fullscreen');
this.playerInfo.currentSize = this.playerInfo.previousSize;
this.playerInfo.previousSize = { width: (0, _clapprZepto2['default'])(window).width(), height: (0, _clapprZepto2['default'])(window).height() };
this.resize(this.playerInfo.currentSize);
}
}, {
key: 'resize',
value: function resize(options) {
if (!(0, _baseUtils.isNumber)(options.height) && !(0, _baseUtils.isNumber)(options.width)) {
this.el.style.height = '' + options.height;
this.el.style.width = '' + options.width;
} else {
this.el.style.height = options.height + 'px';
this.el.style.width = options.width + 'px';
}
this.playerInfo.previousSize = this.playerInfo.currentSize;
this.playerInfo.currentSize = options;
_mediator2['default'].trigger(this.options.playerId + ':' + _baseEvents2['default'].PLAYER_RESIZE, this.playerInfo.currentSize);
}
}, {
key: 'enableResizeObserver',
value: function enableResizeObserver() {
var _this3 = this;
var checkSizeCallback = function checkSizeCallback() {
if (_this3.reqAnimFrame) clearTimeout(_this3.reqAnimFrame);
if (_this3.playerInfo.computedSize.width != _this3.el.clientWidth || _this3.playerInfo.computedSize.height != _this3.el.clientHeight) {
_this3.playerInfo.computedSize = { width: _this3.el.clientWidth, height: _this3.el.clientHeight };
_mediator2['default'].trigger(_this3.options.playerId + ':' + _baseEvents2['default'].PLAYER_RESIZE, _this3.playerInfo.computedSize);
}
_this3.reqAnimFrame = setTimeout(checkSizeCallback, 500);
};
this.reqAnimFrame = setTimeout(checkSizeCallback, 500);
}
}, {
key: 'disableResizeObserver',
value: function disableResizeObserver() {
if (this.reqAnimFrame) (0, _baseUtils.cancelAnimationFrame)(this.reqAnimFrame);
}
}, {
key: 'resolveOnContainersReady',
value: function resolveOnContainersReady(containers) {
var _this4 = this;
_clapprZepto2['default'].when.apply(_clapprZepto2['default'], containers).done(function () {
return _this4.defer.resolve(_this4);
});
}
}, {
key: 'addPlugin',
value: function addPlugin(plugin) {
this.plugins.push(plugin);
}
}, {
key: 'hasPlugin',
value: function hasPlugin(name) {
return !!this.getPlugin(name);
}
}, {
key: 'getPlugin',
value: function getPlugin(name) {
return (0, _lodashFind2['default'])(this.plugins, function (plugin) {
return plugin.name === name;
});
}
}, {
key: 'load',
value: function load(sources, mimeType) {
var _this5 = this;
this.options.mimeType = mimeType;
sources = sources && sources.constructor === Array ? sources : [sources.toString()];
this.containers.forEach(function (container) {
return container.destroy();
});
this.containerFactory.options = (0, _lodashAssign2['default'])(this.options, { sources: sources });
this.containerFactory.createContainers().then(function (containers) {
_this5.setupContainers(containers);
});
}
}, {
key: 'destroy',
value: function destroy() {
this.disableResizeObserver();
this.containers.forEach(function (container) {
return container.destroy();
});
this.plugins.forEach(function (plugin) {
return plugin.destroy();
});
this.$el.remove();
this.mediaControl.destroy();
(0, _clapprZepto2['default'])(document).unbind('fullscreenchange');
(0, _clapprZepto2['default'])(document).unbind('MSFullscreenChange');
(0, _clapprZepto2['default'])(document).unbind('mozfullscreenchange');
}
}, {
key: 'exit',
value: function exit() {
this.updateSize();
this.mediaControl.show();
}
}, {
key: 'setMediaControlContainer',
value: function setMediaControlContainer(container) {
this.mediaControl.setContainer(container);
this.mediaControl.render();
}
}, {
key: 'disableMediaControl',
value: function disableMediaControl() {
this.mediaControl.disable();
this.$el.removeClass('nocursor');
}
}, {
key: 'enableMediaControl',
value: function enableMediaControl() {
this.mediaControl.enable();
}
}, {
key: 'removeContainer',
value: function removeContainer(container) {
this.stopListening(container);
this.containers = this.containers.filter(function (c) {
return c !== container;
});
}
}, {
key: 'appendContainer',
value: function appendContainer(container) {
this.listenTo(container, _baseEvents2['default'].CONTAINER_DESTROYED, this.removeContainer);
this.el.appendChild(container.render().el);
this.containers.push(container);
}
}, {
key: 'setupContainers',
value: function setupContainers(containers) {
containers.map(this.appendContainer.bind(this));
this.setupMediaControl(this.getCurrentContainer());
this.render();
this.$el.appendTo(this.options.parentElement);
return containers;
}
}, {
key: 'createContainer',
value: function createContainer(source, options) {
var container = this.containerFactory.createContainer(source, options);
this.appendContainer(container);
return container;
}
}, {
key: 'setupMediaControl',
value: function setupMediaControl(container) {
if (this.mediaControl) {
this.mediaControl.setContainer(container);
} else {
this.mediaControl = this.createMediaControl((0, _lodashAssign2['default'])({ container: container, focusElement: this.el }, this.options));
this.listenTo(this.mediaControl, _baseEvents2['default'].MEDIACONTROL_FULLSCREEN, this.toggleFullscreen);
this.listenTo(this.mediaControl, _baseEvents2['default'].MEDIACONTROL_SHOW, this.onMediaControlShow.bind(this, true));
this.listenTo(this.mediaControl, _baseEvents2['default'].MEDIACONTROL_HIDE, this.onMediaControlShow.bind(this, false));
}
}
}, {
key: 'createMediaControl',
value: function createMediaControl(options) {
if (options.mediacontrol && options.mediacontrol.external) {
return new options.mediacontrol.external(options);
} else {
return new _media_control2['default'](options);
}
}
}, {
key: 'getCurrentContainer',
value: function getCurrentContainer() {
if (!this.mediacontrol) {
return this.containers[0];
}
return this.mediaControl.container;
}
}, {
key: 'getPlaybackType',
value: function getPlaybackType() {
return this.getCurrentContainer().getPlaybackType();
}
}, {
key: 'toggleFullscreen',
value: function toggleFullscreen() {
if (!_baseUtils.Fullscreen.isFullscreen()) {
_baseUtils.Fullscreen.requestFullscreen(this.el);
if (!_browser2['default'].isiOs) {
this.$el.addClass('fullscreen');
}
} else {
_baseUtils.Fullscreen.cancelFullscreen();
if (!_browser2['default'].isiOs) {
this.$el.removeClass('fullscreen nocursor');
}
}
this.mediaControl.show();
}
}, {
key: 'showMediaControl',
value: function showMediaControl(event) {
this.mediaControl.show(event);
}
}, {
key: 'hideMediaControl',
value: function hideMediaControl(event) {
this.mediaControl.hide(this.options.hideMediaControlDelay);
}
}, {
key: 'onMediaControlShow',
value: function onMediaControlShow(showing) {
if (showing) this.$el.removeClass('nocursor');else if (_baseUtils.Fullscreen.isFullscreen()) this.$el.addClass('nocursor');
}
}, {
key: 'render',
value: function render() {
var style = _baseStyler2['default'].getStyleFor(_publicStyleScss2['default']);
//FIXME
//this.$el.empty()
this.$el.append(style);
this.$el.append(this.mediaControl.render().el);
this.options.width = this.options.width || this.$el.width();
this.options.height = this.options.height || this.$el.height();
var size = { width: this.options.width, height: this.options.height };
this.playerInfo.previousSize = this.playerInfo.currentSize = this.playerInfo.computedSize = size;
this.updateSize();
this.previousSize = { width: this.$el.width(), height: this.$el.height() };
this.enableResizeObserver();
return this;
}
}]);
return Core;
})(_baseUi_object2['default']);
exports['default'] = Core;
module.exports = exports['default'];
/***/ },
/* 26 */
/***/ function(module, exports) {
/* Zepto v1.1.4-80-ga9184b2 - zepto event ajax callbacks deferred touch selector ie - zeptojs.com/license */
"use strict";
var Zepto = (function () {
function D(t) {
return null == t ? String(t) : j[S.call(t)] || "object";
}function L(t) {
return "function" == D(t);
}function k(t) {
return null != t && t == t.window;
}function Z(t) {
return null != t && t.nodeType == t.DOCUMENT_NODE;
}function $(t) {
return "object" == D(t);
}function F(t) {
return $(t) && !k(t) && Object.getPrototypeOf(t) == Object.prototype;
}function R(t) {
return "number" == typeof t.length;
}function q(t) {
return s.call(t, function (t) {
return null != t;
});
}function W(t) {
return t.length > 0 ? n.fn.concat.apply([], t) : t;
}function z(t) {
return t.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase();
}function H(t) {
return t in c ? c[t] : c[t] = new RegExp("(^|\\s)" + t + "(\\s|$)");
}function _(t, e) {
return "number" != typeof e || l[z(t)] ? e : e + "px";
}function I(t) {
var e, n;return (f[t] || (e = u.createElement(t), u.body.appendChild(e), n = getComputedStyle(e, "").getPropertyValue("display"), e.parentNode.removeChild(e), "none" == n && (n = "block"), f[t] = n), f[t]);
}function U(t) {
return "children" in t ? a.call(t.children) : n.map(t.childNodes, function (t) {
return 1 == t.nodeType ? t : void 0;
});
}function X(t, e) {
var n,
i = t ? t.length : 0;for (n = 0; i > n; n++) this[n] = t[n];this.length = i, this.selector = e || "";
}function B(n, i, r) {
for (e in i) r && (F(i[e]) || A(i[e])) ? (F(i[e]) && !F(n[e]) && (n[e] = {}), A(i[e]) && !A(n[e]) && (n[e] = []), B(n[e], i[e], r)) : i[e] !== t && (n[e] = i[e]);
}function V(t, e) {
return null == e ? n(t) : n(t).filter(e);
}function Y(t, e, n, i) {
return L(e) ? e.call(t, n, i) : e;
}function J(t, e, n) {
null == n ? t.removeAttribute(e) : t.setAttribute(e, n);
}function G(e, n) {
var i = e.className || "",
r = i && i.baseVal !== t;return n === t ? r ? i.baseVal : i : void (r ? i.baseVal = n : e.className = n);
}function K(t) {
try {
return t ? "true" == t || ("false" == t ? !1 : "null" == t ? null : +t + "" == t ? +t : /^[\[\{]/.test(t) ? n.parseJSON(t) : t) : t;
} catch (e) {
return t;
}
}function Q(t, e) {
e(t);for (var n = 0, i = t.childNodes.length; i > n; n++) Q(t.childNodes[n], e);
}var t,
e,
n,
i,
N,
P,
r = [],
o = r.concat,
s = r.filter,
a = r.slice,
u = window.document,
f = {},
c = {},
l = { "column-count": 1, columns: 1, "font-weight": 1, "line-height": 1, opacity: 1, "z-index": 1, zoom: 1 },
h = /^\s*<(\w+|!)[^>]*>/,
p = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
d = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
m = /^(?:body|html)$/i,
g = /([A-Z])/g,
v = ["val", "css", "html", "text", "data", "width", "height", "offset"],
y = ["after", "prepend", "before", "append"],
w = u.createElement("table"),
x = u.createElement("tr"),
b = { tr: u.createElement("tbody"), tbody: w, thead: w, tfoot: w, td: x, th: x, "*": u.createElement("div") },
E = /complete|loaded|interactive/,
T = /^[\w-]*$/,
j = {},
S = j.toString,
C = {},
O = u.createElement("div"),
M = { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" },
A = Array.isArray || function (t) {
return t instanceof Array;
};return (C.matches = function (t, e) {
if (!e || !t || 1 !== t.nodeType) return !1;var n = t.webkitMatchesSelector || t.mozMatchesSelector || t.oMatchesSelector || t.matchesSelector;if (n) return n.call(t, e);var i,
r = t.parentNode,
o = !r;return (o && (r = O).appendChild(t), i = ~C.qsa(r, e).indexOf(t), o && O.removeChild(t), i);
}, N = function (t) {
return t.replace(/-+(.)?/g, function (t, e) {
return e ? e.toUpperCase() : "";
});
}, P = function (t) {
return s.call(t, function (e, n) {
return t.indexOf(e) == n;
});
}, C.fragment = function (e, i, r) {
var o, s, f;return (p.test(e) && (o = n(u.createElement(RegExp.$1))), o || (e.replace && (e = e.replace(d, "<$1>$2>")), i === t && (i = h.test(e) && RegExp.$1), i in b || (i = "*"), f = b[i], f.innerHTML = "" + e, o = n.each(a.call(f.childNodes), function () {
f.removeChild(this);
})), F(r) && (s = n(o), n.each(r, function (t, e) {
v.indexOf(t) > -1 ? s[t](e) : s.attr(t, e);
})), o);
}, C.Z = function (t, e) {
return new X(t, e);
}, C.isZ = function (t) {
return t instanceof C.Z;
}, C.init = function (e, i) {
var r;if (!e) return C.Z();if ("string" == typeof e) if ((e = e.trim(), "<" == e[0] && h.test(e))) r = C.fragment(e, RegExp.$1, i), e = null;else {
if (i !== t) return n(i).find(e);r = C.qsa(u, e);
} else {
if (L(e)) return n(u).ready(e);if (C.isZ(e)) return e;if (A(e)) r = q(e);else if ($(e)) r = [e], e = null;else if (h.test(e)) r = C.fragment(e.trim(), RegExp.$1, i), e = null;else {
if (i !== t) return n(i).find(e);r = C.qsa(u, e);
}
}return C.Z(r, e);
}, n = function (t, e) {
return C.init(t, e);
}, n.extend = function (t) {
var e,
n = a.call(arguments, 1);return ("boolean" == typeof t && (e = t, t = n.shift()), n.forEach(function (n) {
B(t, n, e);
}), t);
}, C.qsa = function (t, e) {
var n,
i = "#" == e[0],
r = !i && "." == e[0],
o = i || r ? e.slice(1) : e,
s = T.test(o);return t.getElementById && s && i ? (n = t.getElementById(o)) ? [n] : [] : 1 !== t.nodeType && 9 !== t.nodeType && 11 !== t.nodeType ? [] : a.call(s && !i && t.getElementsByClassName ? r ? t.getElementsByClassName(o) : t.getElementsByTagName(e) : t.querySelectorAll(e));
}, n.contains = u.documentElement.contains ? function (t, e) {
return t !== e && t.contains(e);
} : function (t, e) {
for (; e && (e = e.parentNode);) if (e === t) return !0;return !1;
}, n.type = D, n.isFunction = L, n.isWindow = k, n.isArray = A, n.isPlainObject = F, n.isEmptyObject = function (t) {
var e;for (e in t) return !1;return !0;
}, n.inArray = function (t, e, n) {
return r.indexOf.call(e, t, n);
}, n.camelCase = N, n.trim = function (t) {
return null == t ? "" : String.prototype.trim.call(t);
}, n.uuid = 0, n.support = {}, n.expr = {}, n.noop = function () {}, n.map = function (t, e) {
var n,
r,
o,
i = [];if (R(t)) for (r = 0; r < t.length; r++) n = e(t[r], r), null != n && i.push(n);else for (o in t) n = e(t[o], o), null != n && i.push(n);return W(i);
}, n.each = function (t, e) {
var n, i;if (R(t)) {
for (n = 0; n < t.length; n++) if (e.call(t[n], n, t[n]) === !1) return t;
} else for (i in t) if (e.call(t[i], i, t[i]) === !1) return t;return t;
}, n.grep = function (t, e) {
return s.call(t, e);
}, window.JSON && (n.parseJSON = JSON.parse), n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (t, e) {
j["[object " + e + "]"] = e.toLowerCase();
}), n.fn = { constructor: C.Z, length: 0, forEach: r.forEach, reduce: r.reduce, push: r.push, sort: r.sort, splice: r.splice, indexOf: r.indexOf, concat: function concat() {
var t,
e,
n = [];for (t = 0; t < arguments.length; t++) e = arguments[t], n[t] = C.isZ(e) ? e.toArray() : e;return o.apply(C.isZ(this) ? this.toArray() : this, n);
}, map: function map(t) {
return n(n.map(this, function (e, n) {
return t.call(e, n, e);
}));
}, slice: function slice() {
return n(a.apply(this, arguments));
}, ready: function ready(t) {
return (E.test(u.readyState) && u.body ? t(n) : u.addEventListener("DOMContentLoaded", function () {
t(n);
}, !1), this);
}, get: function get(e) {
return e === t ? a.call(this) : this[e >= 0 ? e : e + this.length];
}, toArray: function toArray() {
return this.get();
}, size: function size() {
return this.length;
}, remove: function remove() {
return this.each(function () {
null != this.parentNode && this.parentNode.removeChild(this);
});
}, each: function each(t) {
return (r.every.call(this, function (e, n) {
return t.call(e, n, e) !== !1;
}), this);
}, filter: function filter(t) {
return L(t) ? this.not(this.not(t)) : n(s.call(this, function (e) {
return C.matches(e, t);
}));
}, add: function add(t, e) {
return n(P(this.concat(n(t, e))));
}, is: function is(t) {
return this.length > 0 && C.matches(this[0], t);
}, not: function not(e) {
var i = [];if (L(e) && e.call !== t) this.each(function (t) {
e.call(this, t) || i.push(this);
});else {
var r = "string" == typeof e ? this.filter(e) : R(e) && L(e.item) ? a.call(e) : n(e);this.forEach(function (t) {
r.indexOf(t) < 0 && i.push(t);
});
}return n(i);
}, has: function has(t) {
return this.filter(function () {
return $(t) ? n.contains(this, t) : n(this).find(t).size();
});
}, eq: function eq(t) {
return -1 === t ? this.slice(t) : this.slice(t, +t + 1);
}, first: function first() {
var t = this[0];return t && !$(t) ? t : n(t);
}, last: function last() {
var t = this[this.length - 1];return t && !$(t) ? t : n(t);
}, find: function find(t) {
var e,
i = this;return e = t ? "object" == typeof t ? n(t).filter(function () {
var t = this;return r.some.call(i, function (e) {
return n.contains(e, t);
});
}) : 1 == this.length ? n(C.qsa(this[0], t)) : this.map(function () {
return C.qsa(this, t);
}) : n();
}, closest: function closest(t, e) {
var i = this[0],
r = !1;for ("object" == typeof t && (r = n(t)); i && !(r ? r.indexOf(i) >= 0 : C.matches(i, t));) i = i !== e && !Z(i) && i.parentNode;return n(i);
}, parents: function parents(t) {
for (var e = [], i = this; i.length > 0;) i = n.map(i, function (t) {
return (t = t.parentNode) && !Z(t) && e.indexOf(t) < 0 ? (e.push(t), t) : void 0;
});return V(e, t);
}, parent: function parent(t) {
return V(P(this.pluck("parentNode")), t);
}, children: function children(t) {
return V(this.map(function () {
return U(this);
}), t);
}, contents: function contents() {
return this.map(function () {
return this.contentDocument || a.call(this.childNodes);
});
}, siblings: function siblings(t) {
return V(this.map(function (t, e) {
return s.call(U(e.parentNode), function (t) {
return t !== e;
});
}), t);
}, empty: function empty() {
return this.each(function () {
this.innerHTML = "";
});
}, pluck: function pluck(t) {
return n.map(this, function (e) {
return e[t];
});
}, show: function show() {
return this.each(function () {
"none" == this.style.display && (this.style.display = ""), "none" == getComputedStyle(this, "").getPropertyValue("display") && (this.style.display = I(this.nodeName));
});
}, replaceWith: function replaceWith(t) {
return this.before(t).remove();
}, wrap: function wrap(t) {
var e = L(t);if (this[0] && !e) var i = n(t).get(0),
r = i.parentNode || this.length > 1;return this.each(function (o) {
n(this).wrapAll(e ? t.call(this, o) : r ? i.cloneNode(!0) : i);
});
}, wrapAll: function wrapAll(t) {
if (this[0]) {
n(this[0]).before(t = n(t));for (var e; (e = t.children()).length;) t = e.first();n(t).append(this);
}return this;
}, wrapInner: function wrapInner(t) {
var e = L(t);return this.each(function (i) {
var r = n(this),
o = r.contents(),
s = e ? t.call(this, i) : t;o.length ? o.wrapAll(s) : r.append(s);
});
}, unwrap: function unwrap() {
return (this.parent().each(function () {
n(this).replaceWith(n(this).children());
}), this);
}, clone: function clone() {
return this.map(function () {
return this.cloneNode(!0);
});
}, hide: function hide() {
return this.css("display", "none");
}, toggle: function toggle(e) {
return this.each(function () {
var i = n(this);(e === t ? "none" == i.css("display") : e) ? i.show() : i.hide();
});
}, prev: function prev(t) {
return n(this.pluck("previousElementSibling")).filter(t || "*");
}, next: function next(t) {
return n(this.pluck("nextElementSibling")).filter(t || "*");
}, html: function html(t) {
return 0 in arguments ? this.each(function (e) {
var i = this.innerHTML;n(this).empty().append(Y(this, t, e, i));
}) : 0 in this ? this[0].innerHTML : null;
}, text: function text(t) {
return 0 in arguments ? this.each(function (e) {
var n = Y(this, t, e, this.textContent);this.textContent = null == n ? "" : "" + n;
}) : 0 in this ? this[0].textContent : null;
}, attr: function attr(n, i) {
var r;return "string" != typeof n || 1 in arguments ? this.each(function (t) {
if (1 === this.nodeType) if ($(n)) for (e in n) J(this, e, n[e]);else J(this, n, Y(this, i, t, this.getAttribute(n)));
}) : this.length && 1 === this[0].nodeType ? !(r = this[0].getAttribute(n)) && n in this[0] ? this[0][n] : r : t;
}, removeAttr: function removeAttr(t) {
return this.each(function () {
1 === this.nodeType && t.split(" ").forEach(function (t) {
J(this, t);
}, this);
});
}, prop: function prop(t, e) {
return (t = M[t] || t, 1 in arguments ? this.each(function (n) {
this[t] = Y(this, e, n, this[t]);
}) : this[0] && this[0][t]);
}, data: function data(e, n) {
var i = "data-" + e.replace(g, "-$1").toLowerCase(),
r = 1 in arguments ? this.attr(i, n) : this.attr(i);return null !== r ? K(r) : t;
}, val: function val(t) {
return 0 in arguments ? this.each(function (e) {
this.value = Y(this, t, e, this.value);
}) : this[0] && (this[0].multiple ? n(this[0]).find("option").filter(function () {
return this.selected;
}).pluck("value") : this[0].value);
}, offset: function offset(t) {
if (t) return this.each(function (e) {
var i = n(this),
r = Y(this, t, e, i.offset()),
o = i.offsetParent().offset(),
s = { top: r.top - o.top, left: r.left - o.left };"static" == i.css("position") && (s.position = "relative"), i.css(s);
});if (!this.length) return null;if (!n.contains(u.documentElement, this[0])) return { top: 0, left: 0 };var e = this[0].getBoundingClientRect();return { left: e.left + window.pageXOffset, top: e.top + window.pageYOffset, width: Math.round(e.width), height: Math.round(e.height) };
}, css: function css(t, i) {
if (arguments.length < 2) {
var r,
o = this[0];if (!o) return;if ((r = getComputedStyle(o, ""), "string" == typeof t)) return o.style[N(t)] || r.getPropertyValue(t);if (A(t)) {
var s = {};return (n.each(t, function (t, e) {
s[e] = o.style[N(e)] || r.getPropertyValue(e);
}), s);
}
}var a = "";if ("string" == D(t)) i || 0 === i ? a = z(t) + ":" + _(t, i) : this.each(function () {
this.style.removeProperty(z(t));
});else for (e in t) t[e] || 0 === t[e] ? a += z(e) + ":" + _(e, t[e]) + ";" : this.each(function () {
this.style.removeProperty(z(e));
});return this.each(function () {
this.style.cssText += ";" + a;
});
}, index: function index(t) {
return t ? this.indexOf(n(t)[0]) : this.parent().children().indexOf(this[0]);
}, hasClass: function hasClass(t) {
return t ? r.some.call(this, function (t) {
return this.test(G(t));
}, H(t)) : !1;
}, addClass: function addClass(t) {
return t ? this.each(function (e) {
if ("className" in this) {
i = [];var r = G(this),
o = Y(this, t, e, r);o.split(/\s+/g).forEach(function (t) {
n(this).hasClass(t) || i.push(t);
}, this), i.length && G(this, r + (r ? " " : "") + i.join(" "));
}
}) : this;
}, removeClass: function removeClass(e) {
return this.each(function (n) {
if ("className" in this) {
if (e === t) return G(this, "");i = G(this), Y(this, e, n, i).split(/\s+/g).forEach(function (t) {
i = i.replace(H(t), " ");
}), G(this, i.trim());
}
});
}, toggleClass: function toggleClass(e, i) {
return e ? this.each(function (r) {
var o = n(this),
s = Y(this, e, r, G(this));s.split(/\s+/g).forEach(function (e) {
(i === t ? !o.hasClass(e) : i) ? o.addClass(e) : o.removeClass(e);
});
}) : this;
}, scrollTop: function scrollTop(e) {
if (this.length) {
var n = ("scrollTop" in this[0]);return e === t ? n ? this[0].scrollTop : this[0].pageYOffset : this.each(n ? function () {
this.scrollTop = e;
} : function () {
this.scrollTo(this.scrollX, e);
});
}
}, scrollLeft: function scrollLeft(e) {
if (this.length) {
var n = ("scrollLeft" in this[0]);return e === t ? n ? this[0].scrollLeft : this[0].pageXOffset : this.each(n ? function () {
this.scrollLeft = e;
} : function () {
this.scrollTo(e, this.scrollY);
});
}
}, position: function position() {
if (this.length) {
var t = this[0],
e = this.offsetParent(),
i = this.offset(),
r = m.test(e[0].nodeName) ? { top: 0, left: 0 } : e.offset();return (i.top -= parseFloat(n(t).css("margin-top")) || 0, i.left -= parseFloat(n(t).css("margin-left")) || 0, r.top += parseFloat(n(e[0]).css("border-top-width")) || 0, r.left += parseFloat(n(e[0]).css("border-left-width")) || 0, { top: i.top - r.top, left: i.left - r.left });
}
}, offsetParent: function offsetParent() {
return this.map(function () {
for (var t = this.offsetParent || u.body; t && !m.test(t.nodeName) && "static" == n(t).css("position");) t = t.offsetParent;return t;
});
} }, n.fn.detach = n.fn.remove, ["width", "height"].forEach(function (e) {
var i = e.replace(/./, function (t) {
return t[0].toUpperCase();
});n.fn[e] = function (r) {
var o,
s = this[0];return r === t ? k(s) ? s["inner" + i] : Z(s) ? s.documentElement["scroll" + i] : (o = this.offset()) && o[e] : this.each(function (t) {
s = n(this), s.css(e, Y(this, r, t, s[e]()));
});
};
}), y.forEach(function (t, e) {
var i = e % 2;n.fn[t] = function () {
var t,
o,
r = n.map(arguments, function (e) {
return (t = D(e), "object" == t || "array" == t || null == e ? e : C.fragment(e));
}),
s = this.length > 1;return r.length < 1 ? this : this.each(function (t, a) {
o = i ? a : a.parentNode, a = 0 == e ? a.nextSibling : 1 == e ? a.firstChild : 2 == e ? a : null;var f = n.contains(u.documentElement, o);r.forEach(function (t) {
if (s) t = t.cloneNode(!0);else if (!o) return n(t).remove();o.insertBefore(t, a), f && Q(t, function (t) {
null == t.nodeName || "SCRIPT" !== t.nodeName.toUpperCase() || t.type && "text/javascript" !== t.type || t.src || window.eval.call(window, t.innerHTML);
});
});
});
}, n.fn[i ? t + "To" : "insert" + (e ? "Before" : "After")] = function (e) {
return (n(e)[t](this), this);
};
}), C.Z.prototype = X.prototype = n.fn, C.uniq = P, C.deserializeValue = K, n.zepto = C, n);
})();window.Zepto = Zepto, void 0 === window.$ && (window.$ = Zepto), (function (t) {
function l(t) {
return t._zid || (t._zid = e++);
}function h(t, e, n, i) {
if ((e = p(e), e.ns)) var r = d(e.ns);return (s[l(t)] || []).filter(function (t) {
return !(!t || e.e && t.e != e.e || e.ns && !r.test(t.ns) || n && l(t.fn) !== l(n) || i && t.sel != i);
});
}function p(t) {
var e = ("" + t).split(".");return { e: e[0], ns: e.slice(1).sort().join(" ") };
}function d(t) {
return new RegExp("(?:^| )" + t.replace(" ", " .* ?") + "(?: |$)");
}function m(t, e) {
return t.del && !u && t.e in f || !!e;
}function g(t) {
return c[t] || u && f[t] || t;
}function v(e, i, r, o, a, u, f) {
var h = l(e),
d = s[h] || (s[h] = []);i.split(/\s/).forEach(function (i) {
if ("ready" == i) return t(document).ready(r);var s = p(i);s.fn = r, s.sel = a, s.e in c && (r = function (e) {
var n = e.relatedTarget;return !n || n !== this && !t.contains(this, n) ? s.fn.apply(this, arguments) : void 0;
}), s.del = u;var l = u || r;s.proxy = function (t) {
if ((t = T(t), !t.isImmediatePropagationStopped())) {
t.data = o;var i = l.apply(e, t._args == n ? [t] : [t].concat(t._args));return (i === !1 && (t.preventDefault(), t.stopPropagation()), i);
}
}, s.i = d.length, d.push(s), "addEventListener" in e && e.addEventListener(g(s.e), s.proxy, m(s, f));
});
}function y(t, e, n, i, r) {
var o = l(t);(e || "").split(/\s/).forEach(function (e) {
h(t, e, n, i).forEach(function (e) {
delete s[o][e.i], "removeEventListener" in t && t.removeEventListener(g(e.e), e.proxy, m(e, r));
});
});
}function T(e, i) {
return ((i || !e.isDefaultPrevented) && (i || (i = e), t.each(E, function (t, n) {
var r = i[t];e[t] = function () {
return (this[n] = w, r && r.apply(i, arguments));
}, e[n] = x;
}), (i.defaultPrevented !== n ? i.defaultPrevented : "returnValue" in i ? i.returnValue === !1 : i.getPreventDefault && i.getPreventDefault()) && (e.isDefaultPrevented = w)), e);
}function j(t) {
var e,
i = { originalEvent: t };for (e in t) b.test(e) || t[e] === n || (i[e] = t[e]);return T(i, t);
}var n,
e = 1,
i = Array.prototype.slice,
r = t.isFunction,
o = function o(t) {
return "string" == typeof t;
},
s = {},
a = {},
u = ("onfocusin" in window),
f = { focus: "focusin", blur: "focusout" },
c = { mouseenter: "mouseover", mouseleave: "mouseout" };a.click = a.mousedown = a.mouseup = a.mousemove = "MouseEvents", t.event = { add: v, remove: y }, t.proxy = function (e, n) {
var s = 2 in arguments && i.call(arguments, 2);if (r(e)) {
var a = function a() {
return e.apply(n, s ? s.concat(i.call(arguments)) : arguments);
};return (a._zid = l(e), a);
}if (o(n)) return s ? (s.unshift(e[n], e), t.proxy.apply(null, s)) : t.proxy(e[n], e);throw new TypeError("expected function");
}, t.fn.bind = function (t, e, n) {
return this.on(t, e, n);
}, t.fn.unbind = function (t, e) {
return this.off(t, e);
}, t.fn.one = function (t, e, n, i) {
return this.on(t, e, n, i, 1);
};var w = function w() {
return !0;
},
x = function x() {
return !1;
},
b = /^([A-Z]|returnValue$|layer[XY]$)/,
E = { preventDefault: "isDefaultPrevented", stopImmediatePropagation: "isImmediatePropagationStopped", stopPropagation: "isPropagationStopped" };t.fn.delegate = function (t, e, n) {
return this.on(e, t, n);
}, t.fn.undelegate = function (t, e, n) {
return this.off(e, t, n);
}, t.fn.live = function (e, n) {
return (t(document.body).delegate(this.selector, e, n), this);
}, t.fn.die = function (e, n) {
return (t(document.body).undelegate(this.selector, e, n), this);
}, t.fn.on = function (e, s, a, u, f) {
var c,
l,
h = this;return e && !o(e) ? (t.each(e, function (t, e) {
h.on(t, s, a, e, f);
}), h) : (o(s) || r(u) || u === !1 || (u = a, a = s, s = n), (u === n || a === !1) && (u = a, a = n), u === !1 && (u = x), h.each(function (n, r) {
f && (c = function (t) {
return (y(r, t.type, u), u.apply(this, arguments));
}), s && (l = function (e) {
var n,
o = t(e.target).closest(s, r).get(0);return o && o !== r ? (n = t.extend(j(e), { currentTarget: o, liveFired: r }), (c || u).apply(o, [n].concat(i.call(arguments, 1)))) : void 0;
}), v(r, e, u, a, s, l || c);
}));
}, t.fn.off = function (e, i, s) {
var a = this;return e && !o(e) ? (t.each(e, function (t, e) {
a.off(t, i, e);
}), a) : (o(i) || r(s) || s === !1 || (s = i, i = n), s === !1 && (s = x), a.each(function () {
y(this, e, s, i);
}));
}, t.fn.trigger = function (e, n) {
return (e = o(e) || t.isPlainObject(e) ? t.Event(e) : T(e), e._args = n, this.each(function () {
e.type in f && "function" == typeof this[e.type] ? this[e.type]() : "dispatchEvent" in this ? this.dispatchEvent(e) : t(this).triggerHandler(e, n);
}));
}, t.fn.triggerHandler = function (e, n) {
var i, r;return (this.each(function (s, a) {
i = j(o(e) ? t.Event(e) : e), i._args = n, i.target = a, t.each(h(a, e.type || e), function (t, e) {
return (r = e.proxy(i), i.isImmediatePropagationStopped() ? !1 : void 0);
});
}), r);
}, "focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function (e) {
t.fn[e] = function (t) {
return 0 in arguments ? this.bind(e, t) : this.trigger(e);
};
}), t.Event = function (t, e) {
o(t) || (e = t, t = e.type);var n = document.createEvent(a[t] || "Events"),
i = !0;if (e) for (var r in e) "bubbles" == r ? i = !!e[r] : n[r] = e[r];return (n.initEvent(t, i, !0), T(n));
};
})(Zepto), (function (t) {
function h(e, n, i) {
var r = t.Event(n);return (t(e).trigger(r, i), !r.isDefaultPrevented());
}function p(t, e, i, r) {
return t.global ? h(e || n, i, r) : void 0;
}function d(e) {
e.global && 0 === t.active++ && p(e, null, "ajaxStart");
}function m(e) {
e.global && ! --t.active && p(e, null, "ajaxStop");
}function g(t, e) {
var n = e.context;return e.beforeSend.call(n, t, e) === !1 || p(e, n, "ajaxBeforeSend", [t, e]) === !1 ? !1 : void p(e, n, "ajaxSend", [t, e]);
}function v(t, e, n, i) {
var r = n.context,
o = "success";n.success.call(r, t, o, e), i && i.resolveWith(r, [t, o, e]), p(n, r, "ajaxSuccess", [e, n, t]), w(o, e, n);
}function y(t, e, n, i, r) {
var o = i.context;i.error.call(o, n, e, t), r && r.rejectWith(o, [n, e, t]), p(i, o, "ajaxError", [n, i, t || e]), w(e, n, i);
}function w(t, e, n) {
var i = n.context;n.complete.call(i, e, t), p(n, i, "ajaxComplete", [e, n]), m(n);
}function x() {}function b(t) {
return (t && (t = t.split(";", 2)[0]), t && (t == f ? "html" : t == u ? "json" : s.test(t) ? "script" : a.test(t) && "xml") || "text");
}function E(t, e) {
return "" == e ? t : (t + "&" + e).replace(/[&?]{1,2}/, "?");
}function T(e) {
e.processData && e.data && "string" != t.type(e.data) && (e.data = t.param(e.data, e.traditional)), !e.data || e.type && "GET" != e.type.toUpperCase() || (e.url = E(e.url, e.data), e.data = void 0);
}function j(e, n, i, r) {
return (t.isFunction(n) && (r = i, i = n, n = void 0), t.isFunction(i) || (r = i, i = void 0), { url: e, data: n, success: i, dataType: r });
}function C(e, n, i, r) {
var o,
s = t.isArray(n),
a = t.isPlainObject(n);t.each(n, function (n, u) {
o = t.type(u), r && (n = i ? r : r + "[" + (a || "object" == o || "array" == o ? n : "") + "]"), !r && s ? e.add(u.name, u.value) : "array" == o || !i && "object" == o ? C(e, u, i, n) : e.add(n, u);
});
}var i,
r,
e = 0,
n = window.document,
o = /