(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__(6);
var _baseEvents2 = _interopRequireDefault(_baseEvents);
var _basePlayback = __webpack_require__(47);
var _basePlayback2 = _interopRequireDefault(_basePlayback);
var _baseContainer_plugin = __webpack_require__(128);
var _baseContainer_plugin2 = _interopRequireDefault(_baseContainer_plugin);
var _baseCore_plugin = __webpack_require__(149);
var _baseCore_plugin2 = _interopRequireDefault(_baseCore_plugin);
var _baseUi_core_plugin = __webpack_require__(143);
var _baseUi_core_plugin2 = _interopRequireDefault(_baseUi_core_plugin);
var _baseUi_container_plugin = __webpack_require__(123);
var _baseUi_container_plugin2 = _interopRequireDefault(_baseUi_container_plugin);
var _baseBase_object = __webpack_require__(5);
var _baseBase_object2 = _interopRequireDefault(_baseBase_object);
var _baseUi_object = __webpack_require__(18);
var _baseUi_object2 = _interopRequireDefault(_baseUi_object);
var _componentsBrowser = __webpack_require__(3);
var _componentsBrowser2 = _interopRequireDefault(_componentsBrowser);
var _componentsContainer = __webpack_require__(27);
var _componentsContainer2 = _interopRequireDefault(_componentsContainer);
var _componentsCore = __webpack_require__(14);
var _componentsCore2 = _interopRequireDefault(_componentsCore);
var _componentsLoader = __webpack_require__(56);
var _componentsLoader2 = _interopRequireDefault(_componentsLoader);
var _componentsMediator = __webpack_require__(46);
var _componentsMediator2 = _interopRequireDefault(_componentsMediator);
var _componentsMedia_control = __webpack_require__(43);
var _componentsMedia_control2 = _interopRequireDefault(_componentsMedia_control);
var _componentsPlayer_info = __webpack_require__(54);
var _componentsPlayer_info2 = _interopRequireDefault(_componentsPlayer_info);
var _playbacksBase_flash_playback = __webpack_require__(70);
var _playbacksBase_flash_playback2 = _interopRequireDefault(_playbacksBase_flash_playback);
var _playbacksFlash = __webpack_require__(68);
var _playbacksFlash2 = _interopRequireDefault(_playbacksFlash);
var _playbacksFlashls = __webpack_require__(77);
var _playbacksFlashls2 = _interopRequireDefault(_playbacksFlashls);
var _playbacksHls = __webpack_require__(81);
var _playbacksHls2 = _interopRequireDefault(_playbacksHls);
var _playbacksHtml5_audio = __webpack_require__(75);
var _playbacksHtml5_audio2 = _interopRequireDefault(_playbacksHtml5_audio);
var _playbacksHtml5_video = __webpack_require__(64);
var _playbacksHtml5_video2 = _interopRequireDefault(_playbacksHtml5_video);
var _playbacksHtml_img = __webpack_require__(114);
var _playbacksHtml_img2 = _interopRequireDefault(_playbacksHtml_img);
var _playbacksNo_op = __webpack_require__(117);
var _playbacksNo_op2 = _interopRequireDefault(_playbacksNo_op);
var _pluginsPoster = __webpack_require__(133);
var _pluginsPoster2 = _interopRequireDefault(_pluginsPoster);
var _pluginsLog = __webpack_require__(7);
var _pluginsLog2 = _interopRequireDefault(_pluginsLog);
var _baseStyler = __webpack_require__(16);
var _baseStyler2 = _interopRequireDefault(_baseStyler);
var _baseTemplate = __webpack_require__(17);
var _baseTemplate2 = _interopRequireDefault(_baseTemplate);
var _clapprZepto = __webpack_require__(4);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
var version = ("0.2.31");
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'],
Loader: _componentsLoader2['default'],
BaseObject: _baseBase_object2['default'],
UIObject: _baseUi_object2['default'],
Utils: _baseUtils2['default'],
BaseFlashPlayback: _playbacksBase_flash_playback2['default'],
Flash: _playbacksFlash2['default'],
FlasHLS: _playbacksFlashls2['default'],
HLS: _playbacksHls2['default'],
HTML5Audio: _playbacksHtml5_audio2['default'],
HTML5Video: _playbacksHtml5_video2['default'],
HTMLImg: _playbacksHtml_img2['default'],
NoOp: _playbacksNo_op2['default'],
Poster: _pluginsPoster2['default'],
Log: _pluginsLog2['default'],
Styler: _baseStyler2['default'],
version: version,
template: _baseTemplate2['default'],
$: _clapprZepto2['default']
};
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; _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; desc = parent = undefined; 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__(5);
var _baseBase_object2 = _interopRequireDefault(_baseBase_object);
var _baseEvents = __webpack_require__(6);
var _baseEvents2 = _interopRequireDefault(_baseEvents);
var _componentsCore_factory = __webpack_require__(12);
var _componentsCore_factory2 = _interopRequireDefault(_componentsCore_factory);
var _componentsLoader = __webpack_require__(56);
var _componentsLoader2 = _interopRequireDefault(_componentsLoader);
var _componentsPlayer_info = __webpack_require__(54);
var _componentsPlayer_info2 = _interopRequireDefault(_componentsPlayer_info);
var _clapprZepto = __webpack_require__(4);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
var _lodashFind = __webpack_require__(31);
var _lodashFind2 = _interopRequireDefault(_lodashFind);
var baseUrl = (0, _baseUtils.currentScriptUrl)().replace(/\/[^\/]+$/, "");
/**
* @class Player
* @constructor
* @extends BaseObject
* @module components
* @example
* ### Using the Player
*
* Add the following script on your HTML:
* ```html
*
*
*
* ```
* Now, create the player:
* ```html
*
*
*
*
* ```
*/
var Player = (function (_BaseObject) {
_inherits(Player, _BaseObject);
_createClass(Player, [{
key: 'loader',
set: function set(loader) {
this._loader = loader;
},
get: function get() {
return this._loader = this._loader || new _componentsLoader2['default'](this.options.plugins || {}, this.options.playerId);
}
/**
* Determine if the playback has ended.
* @property ended
* @type Boolean
*/
}, {
key: 'ended',
get: function get() {
return this.core.mediaControl.container.ended;
}
/**
* Determine if the playback is having to buffer in order for
* playback to be smooth.
* (i.e if a live stream is playing smoothly, this will be false)
* @property buffering
* @type Boolean
*/
}, {
key: 'buffering',
get: function get() {
return this.core.mediaControl.container.buffering;
}
/*
* determine if the player is ready.
* @property isReady
* @type {Boolean} `true` if the player is ready. ie PLAYER_READY event has fired
*/
}, {
key: 'isReady',
get: function get() {
return !!this.ready;
}
/**
* ## Player's constructor
*
* You might pass the options object to build the player.
* ```javascript
* var options = {source: "http://example.com/video.mp4", param1: "val1"};
* var player = new Clappr.Player(options);
* ```
*
* @method constructor
* @param {Object} options Data
* options to build a player instance
* @param {Number} [options.width]
* player's width **default**: `640`
* @param {Number} [options.height]
* player's height **default**: `360`
* @param {String} [options.parentId]
* the id of the element on the page that the player should be inserted into
* @param {Object} [options.parent]
* a reference to a dom element that the player should be inserted into
* @param {String} [options.source]
* The media source URL, or {source: <>, mimeType: <>}
* @param {Object} [options.sources]
* An array of media source URL's, or an array of {source: <>, mimeType: <>}
* @param {Boolean} [options.autoPlay]
* automatically play after page load **default**: `false`
* @param {Boolean} [options.loop]
* automatically replay after it ends **default**: `false`
* @param {Boolean} [options.chromeless]
* player acts in chromeless mode **default**: `false`
* @param {Boolean} [options.muted]
* start the video muted **default**: `false`
* @param {String} [options.mimeType]
* add `mimeType: "application/vnd.apple.mpegurl"` if you need to use a url without extension.
* @param {String} [options.actualLiveTime]
* show duration and seek time relative to actual time.
* @param {String} [options.actualLiveServerTime]
* specify server time as a string, format: "2015/11/26 06:01:03". This option is meant to be used with actualLiveTime.
* @param {Boolean} [options.persistConfig]
* persist player's settings (volume) through the same domain **default**: `true`
* @param {String} [options.preload]
* video will be preloaded according to `preload` attribute options **default**: `'metadata'`
* @param {Number} [options.maxBufferLength]
* the default behavior for the **HLS playback** is to keep buffering indefinitely, even on VoD. This replicates the behavior for progressive download, which continues buffering when pausing the video, thus making the video available for playback even on slow networks. To change this behavior use `maxBufferLength` where **value is in seconds**.
* @param {String} [options.gaAccount]
* enable Google Analytics events dispatch **(play/pause/stop/buffering/etc)** by adding your `gaAccount`
* @param {String} [options.gaTrackerName]
* besides `gaAccount` you can optionally, pass your favorite trackerName as `gaTrackerName`
* @param {Object} [options.mediacontrol]
* customize control bar colors, example: `mediacontrol: {seekbar: "#E113D3", buttons: "#66B2FF"}`
* @param {Boolean} [options.hideMediaControl]
* control media control auto hide **default**: `true`
* @param {Boolean} [options.hideVolumeBar]
* when embedded with width less than 320, volume bar will hide. You can force this behavior for all sizes by adding `true` **default**: `false`
* @param {String} [options.watermark]
* put `watermark: 'http://url/img.png'` on your embed parameters to automatically add watermark on your video. You can customize corner position by defining position parameter. Positions can be `bottom-left`, `bottom-right`, `top-left` and `top-right`.
* @param {String} [options.watermarkLink]
* `watermarkLink: 'http://example.net/'` - define URL to open when the watermark is clicked. If not provided watermark will not be clickable.
* @param {Boolean} [options.disableVideoTagContextMenu]
* disables the context menu (right click) on the video element if a HTML5Video playback is used.
* @param {Boolean} [options.autoSeekFromUrl]
* Automatically seek to the seconds provided in the url (e.g example.com?t=100) **default**: `true`
* @param {String} [options.poster]
* define a poster by adding its address `poster: 'http://url/img.png'`. It will appear after video embed, disappear on play and go back when user stops the video.
* @param {String} [options.playbackNotSupportedMessage]
* define a custom message to be displayed when a playback is not supported.
* @param {Object} [options.events]
* Specify listeners which will be registered with their corresponding player events.
* E.g. onReady -> "PLAYER_READY", onTimeUpdate -> "PLAYER_TIMEUPDATE"
*/
}]);
function Player(options) {
_classCallCheck(this, Player);
_get(Object.getPrototypeOf(Player.prototype), 'constructor', this).call(this, options);
var defaultOptions = { playerId: (0, _baseUtils.uniqueId)(""), persistConfig: true, width: 640, height: 360, baseUrl: baseUrl };
this.options = _clapprZepto2['default'].extend(defaultOptions, options);
this.options.sources = this.normalizeSources(options);
this.registerOptionEventListeners();
this.coreFactory = new _componentsCore_factory2['default'](this);
this.playerInfo = _componentsPlayer_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);
} else if (this.options.parent) {
this.attachTo(this.options.parent);
}
}
/**
* Specify a `parentId` to the player.
* @method setParentId
* @param {String} parentId the element parent id.
*/
_createClass(Player, [{
key: 'setParentId',
value: function setParentId(parentId) {
var el = document.querySelector(parentId);
if (el) {
this.attachTo(el);
}
}
/**
* You can use this method to attach the player to a given element. You don't need to do this when you specify it during the player instantiation passing the `parentId` param.
* @method attachTo
* @param {Object} element a given element.
*/
}, {
key: 'attachTo',
value: function attachTo(element) {
this.options.parentElement = element;
this.core = this.coreFactory.create();
this.addEventListeners();
}
}, {
key: 'addEventListeners',
value: function addEventListeners() {
if (!this.core.isReady) {
this.listenToOnce(this.core, _baseEvents2['default'].CORE_READY, this.onReady);
} else {
this.onReady();
}
this.listenTo(this.core.mediaControl, _baseEvents2['default'].MEDIACONTROL_CONTAINERCHANGED, this.containerChanged);
}
}, {
key: 'addContainerEventListeners',
value: function addContainerEventListeners() {
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);
this.listenTo(container, _baseEvents2['default'].CONTAINER_VOLUME, this.onVolumeUpdate);
}
}
}, {
key: 'registerOptionEventListeners',
value: function registerOptionEventListeners() {
var _this = this;
var eventsMapping = {
"onReady": _baseEvents2['default'].PLAYER_READY,
"onResize": _baseEvents2['default'].PLAYER_RESIZE,
"onPlay": _baseEvents2['default'].PLAYER_PLAY,
"onPause": _baseEvents2['default'].PLAYER_PAUSE,
"onStop": _baseEvents2['default'].PLAYER_STOP,
"onEnded": _baseEvents2['default'].PLAYER_ENDED,
"onSeek": _baseEvents2['default'].PLAYER_SEEK,
"onError": _baseEvents2['default'].PLAYER_ERROR,
"onTimeUpdate": _baseEvents2['default'].PLAYER_TIMEUPDATE,
"onVolumeUpdate": _baseEvents2['default'].PLAYER_VOLUMEUPDATE
};
var userEvents = this.options.events || {};
Object.keys(userEvents).forEach(function (userEvent) {
var eventType = eventsMapping[userEvent];
if (eventType) {
var eventFunction = userEvents[userEvent];
eventFunction = typeof eventFunction === "function" && eventFunction;
eventFunction && _this.listenTo(_this, eventType, eventFunction);
}
});
}
}, {
key: 'containerChanged',
value: function containerChanged() {
this.stopListening();
this.addEventListeners();
}
}, {
key: 'onReady',
value: function onReady() {
this.ready = true;
this.addContainerEventListeners();
this.trigger(_baseEvents2['default'].PLAYER_READY);
}
}, {
key: 'onVolumeUpdate',
value: function onVolumeUpdate(volume) {
this.trigger(_baseEvents2['default'].PLAYER_VOLUMEUPDATE, volume);
}
}, {
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(time) {
this.trigger(_baseEvents2['default'].PLAYER_SEEK, time);
}
}, {
key: 'onTimeUpdate',
value: function onTimeUpdate(timeProgress) {
this.trigger(_baseEvents2['default'].PLAYER_TIMEUPDATE, timeProgress);
}
}, {
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] : []);
return sources.length === 0 ? [{ source: "", mimeType: "" }] : sources;
}
/**
* resizes the current player canvas.
* @method resize
* @param {Object} size should be a literal object with `height` and `width`.
* @example
* ```javascript
* player.resize({height: 360, width: 640})
* ```
*/
}, {
key: 'resize',
value: function resize(size) {
this.core.resize(size);
}
/**
* loads a new source.
* @method load
* @param {Object} sources source or sources of video.
* sources can be a string or {source: <>, mimeType: <>}
* @param {Object} mimeType a mime type, example: `'application/vnd.apple.mpegurl'`
*
*/
}, {
key: 'load',
value: function load(sources, mimeType) {
this.core.load(sources, mimeType);
}
/**
* destroys the current player and removes it from the DOM.
* @method destroy
*/
}, {
key: 'destroy',
value: function destroy() {
this.core.destroy();
}
/**
* plays the current video (`source`).
* @method play
*/
}, {
key: 'play',
value: function play() {
this.core.mediaControl.container.play();
}
/**
* pauses the current video (`source`).
* @method pause
*/
}, {
key: 'pause',
value: function pause() {
this.core.mediaControl.container.pause();
}
/**
* stops the current video (`source`).
* @method stop
*/
}, {
key: 'stop',
value: function stop() {
this.core.mediaControl.container.stop();
}
/**
* seeks the current video (`source`). For example, `player.seek(120)` will seek to second 120 (2minutes) of the current video.
* @method seek
* @param {Number} time should be a number between 0 and the video duration.
*/
}, {
key: 'seek',
value: function seek(time) {
this.core.mediaControl.container.seek(time);
}
/**
* seeks the current video (`source`). For example, `player.seek(50)` will seek to the middle of the current video.
* @method seekPercentage
* @param {Number} time should be a number between 0 and 100.
*/
}, {
key: 'seekPercentage',
value: function seekPercentage(percentage) {
this.core.mediaControl.container.seekPercentage(percentage);
}
/**
* Set the volume for the current video (`source`).
* @method setVolume
* @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.
*/
}, {
key: 'setVolume',
value: function setVolume(volume) {
this.core.mediaControl.container.setVolume(volume);
}
/**
* Get the volume for the current video
* @method getVolume
* @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume.
*/
}, {
key: 'getVolume',
value: function getVolume() {
return this.core.mediaControl.container.volume;
}
/**
* mutes the current video (`source`).
* @method mute
*/
}, {
key: 'mute',
value: function mute() {
this.core.mediaControl.container.setVolume(0);
}
/**
* unmutes the current video (`source`).
* @method unmute
*/
}, {
key: 'unmute',
value: function unmute() {
this.core.mediaControl.container.setVolume(100);
}
/**
* checks if the player is playing.
* @method isPlaying
* @return {Boolean} `true` if the current source is playing, otherwise `false`
*/
}, {
key: 'isPlaying',
value: function isPlaying() {
return this.core.mediaControl.container.isPlaying();
}
/**
* enables to configure a player after its creation
* @method configure
* @param {Object} options all the options to change in form of a javascript object
*/
}, {
key: 'configure',
value: function configure(options) {
this.core.configure(options);
}
/**
* get a plugin by its name.
* @method getPlugin
* @param {String} name of the plugin.
* @return {Object} the plugin instance
* @example
* ```javascript
* var poster = player.getPlugin('poster');
* poster.hidePlayButton();
* ```
*/
}, {
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;
});
}
/**
* the current time in seconds.
* @method getCurrentTime
* @return {Number} current time (in seconds) of the current source
*/
}, {
key: 'getCurrentTime',
value: function getCurrentTime() {
return this.core.mediaControl.container.getCurrentTime();
}
/**
* the duration time in seconds.
* @method getDuration
* @return {Number} duration time (in seconds) of the current source
*/
}, {
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.
/*jshint -W079 */
'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; _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; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
exports.extend = extend;
exports.formatTime = formatTime;
exports.seekStringToSeconds = seekStringToSeconds;
exports.uniqueId = uniqueId;
exports.isNumber = isNumber;
exports.currentScriptUrl = currentScriptUrl;
exports.getBrowserLanguage = getBrowserLanguage;
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 _componentsBrowser = __webpack_require__(3);
var _componentsBrowser2 = _interopRequireDefault(_componentsBrowser);
var _clapprZepto = __webpack_require__(4);
var _clapprZepto2 = _interopRequireDefault(_clapprZepto);
function extend(parent, properties) {
var pluginName = properties.name || "";
var MergedPlugin = (function (_parent) {
_inherits(MergedPlugin, _parent);
function MergedPlugin(args) {
_classCallCheck(this, MergedPlugin);
_get(Object.getPrototypeOf(MergedPlugin.prototype), 'constructor', this).call(this, args);
if (properties.initialize) {
properties.initialize.apply(this, Array.prototype.slice.apply(arguments));
}
}
_createClass(MergedPlugin, [{
key: 'name',
get: function get() {
return pluginName;
}
}]);
return MergedPlugin;
})(parent);
delete properties.name;
_clapprZepto2['default'].extend(MergedPlugin.prototype, properties);
return MergedPlugin;
}
function formatTime(time, paddedHours) {
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 || paddedHours) {
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: '_createKeyspace',
value: function _createKeyspace(key) {
return 'clappr.' + document.domain + '.' + key;
}
}, {
key: 'restore',
value: function restore(key) {
if (_componentsBrowser2['default'].hasLocalstorage && localStorage[this._createKeyspace(key)]) {
return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
}
return this._defaultValueFor(key);
}
}, {
key: 'persist',
value: function persist(key, value) {
if (_componentsBrowser2['default'].hasLocalstorage) {
try {
localStorage[this._createKeyspace(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;
function getBrowserLanguage() {
if (window.navigator && window.navigator.language) {
return window.navigator.language.toLowerCase();
}
return null;
}
exports['default'] = {
Config: Config,
Fullscreen: Fullscreen,
extend: extend,
formatTime: formatTime,
seekStringToSeconds: seekStringToSeconds,
uniqueId: uniqueId,
currentScriptUrl: currentScriptUrl,
isNumber: isNumber,
requestAnimationFrame: requestAnimationFrame,
cancelAnimationFrame: cancelAnimationFrame,
getBrowserLanguage: getBrowserLanguage
};
/***/ },
/* 3 */
/***/ 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 = /safari/i.test(navigator.userAgent) && navigator.userAgent.indexOf('Chrome') === -1;
Browser.isChrome = /chrome/i.test(navigator.userAgent);
Browser.isFirefox = /firefox/i.test(navigator.userAgent);
Browser.isLegacyIE = !!window.ActiveXObject;
Browser.isIE = Browser.isLegacyIE || /trident.*rv:1\d/i.test(navigator.userAgent);
Browser.isIE11 = /trident.*rv:11/i.test(navigator.userAgent);
Browser.isChromecast = Browser.isChrome && /CrKey/i.test(navigator.userAgent);
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.isAndroid = /Android/i.test(navigator.userAgent);
Browser.isWindowsPhone = /Windows Phone/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'];
/***/ },
/* 4 */
/***/ 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 = /