1 | var renderReactPlayer =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, {
|
41 | configurable: false,
|
42 | enumerable: true,
|
43 | get: getter
|
44 | /******/ });
|
45 | /******/ }
|
46 | /******/ };
|
47 | /******/
|
48 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
49 | /******/ __webpack_require__.n = function(module) {
|
50 | var getter = module && module.__esModule ?
|
51 | function getDefault() { return module['default']; } :
|
52 | function getModuleExports() { return module; };
|
53 | __webpack_require__.d(getter, 'a', getter);
|
54 | return getter;
|
55 | };
|
56 |
|
57 |
|
58 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
|
60 |
|
61 | __webpack_require__.p = "";
|
62 |
|
63 |
|
64 | return __webpack_require__(__webpack_require__.s = 34);
|
65 | })
|
66 |
|
67 | ([
|
68 |
|
69 | (function(module, exports, __webpack_require__) {
|
70 |
|
71 | "use strict";
|
72 |
|
73 |
|
74 | if (true) {
|
75 | module.exports = __webpack_require__(35);
|
76 | } else {
|
77 | module.exports = require('./cjs/react.development.js');
|
78 | }
|
79 |
|
80 | }),
|
81 |
|
82 | (function(module, exports, __webpack_require__) {
|
83 |
|
84 | "use strict";
|
85 |
|
86 |
|
87 | Object.defineProperty(exports, "__esModule", {
|
88 | value: true
|
89 | });
|
90 |
|
91 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
92 |
|
93 | var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
94 |
|
95 | exports.parseStartTime = parseStartTime;
|
96 | exports.parseEndTime = parseEndTime;
|
97 | exports.randomString = randomString;
|
98 | exports.queryString = queryString;
|
99 | exports.getSDK = getSDK;
|
100 | exports.getConfig = getConfig;
|
101 | exports.omit = omit;
|
102 | exports.callPlayer = callPlayer;
|
103 | exports.isObject = isObject;
|
104 | exports.isEqual = isEqual;
|
105 | exports.isMediaStream = isMediaStream;
|
106 |
|
107 | var _loadScript = __webpack_require__(47);
|
108 |
|
109 | var _loadScript2 = _interopRequireDefault(_loadScript);
|
110 |
|
111 | var _deepmerge = __webpack_require__(48);
|
112 |
|
113 | var _deepmerge2 = _interopRequireDefault(_deepmerge);
|
114 |
|
115 | var _props = __webpack_require__(5);
|
116 |
|
117 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
118 |
|
119 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
120 |
|
121 | var MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
|
122 | var MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
|
123 | var MATCH_START_STAMP = /(\d+)(h|m|s)/g;
|
124 | var MATCH_NUMERIC = /^\d+$/;
|
125 |
|
126 |
|
127 |
|
128 | function parseTimeParam(url, pattern) {
|
129 | var match = url.match(pattern);
|
130 | if (match) {
|
131 | var stamp = match[1];
|
132 | if (stamp.match(MATCH_START_STAMP)) {
|
133 | return parseTimeString(stamp);
|
134 | }
|
135 | if (MATCH_NUMERIC.test(stamp)) {
|
136 | return parseInt(stamp);
|
137 | }
|
138 | }
|
139 | return undefined;
|
140 | }
|
141 |
|
142 | function parseTimeString(stamp) {
|
143 | var seconds = 0;
|
144 | var array = MATCH_START_STAMP.exec(stamp);
|
145 | while (array !== null) {
|
146 | var _array = array,
|
147 | _array2 = _slicedToArray(_array, 3),
|
148 | count = _array2[1],
|
149 | period = _array2[2];
|
150 |
|
151 | if (period === 'h') seconds += parseInt(count, 10) * 60 * 60;
|
152 | if (period === 'm') seconds += parseInt(count, 10) * 60;
|
153 | if (period === 's') seconds += parseInt(count, 10);
|
154 | array = MATCH_START_STAMP.exec(stamp);
|
155 | }
|
156 | return seconds;
|
157 | }
|
158 |
|
159 | function parseStartTime(url) {
|
160 | return parseTimeParam(url, MATCH_START_QUERY);
|
161 | }
|
162 |
|
163 | function parseEndTime(url) {
|
164 | return parseTimeParam(url, MATCH_END_QUERY);
|
165 | }
|
166 |
|
167 |
|
168 | function randomString() {
|
169 | return Math.random().toString(36).substr(2, 5);
|
170 | }
|
171 |
|
172 | function queryString(object) {
|
173 | return Object.keys(object).map(function (key) {
|
174 | return key + '=' + object[key];
|
175 | }).join('&');
|
176 | }
|
177 |
|
178 |
|
179 |
|
180 | var resolves = {};
|
181 | function getSDK(url, sdkGlobal) {
|
182 | var sdkReady = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
183 | var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
184 | return true;
|
185 | };
|
186 | var fetchScript = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _loadScript2['default'];
|
187 |
|
188 | if (window[sdkGlobal] && isLoaded(window[sdkGlobal])) {
|
189 | return Promise.resolve(window[sdkGlobal]);
|
190 | }
|
191 | return new Promise(function (resolve, reject) {
|
192 |
|
193 |
|
194 | if (resolves[url]) {
|
195 | resolves[url].push(resolve);
|
196 | return;
|
197 | }
|
198 | resolves[url] = [resolve];
|
199 | var onLoaded = function onLoaded(sdk) {
|
200 |
|
201 | resolves[url].forEach(function (resolve) {
|
202 | return resolve(sdk);
|
203 | });
|
204 | };
|
205 | if (sdkReady) {
|
206 | var previousOnReady = window[sdkReady];
|
207 | window[sdkReady] = function () {
|
208 | if (previousOnReady) previousOnReady();
|
209 | onLoaded(window[sdkGlobal]);
|
210 | };
|
211 | }
|
212 | fetchScript(url, function (err) {
|
213 | if (err) reject(err);
|
214 | if (!sdkReady) {
|
215 | onLoaded(window[sdkGlobal]);
|
216 | }
|
217 | });
|
218 | });
|
219 | }
|
220 |
|
221 | function getConfig(props, defaultProps, showWarning) {
|
222 | var config = (0, _deepmerge2['default'])(defaultProps.config, props.config);
|
223 | var _iteratorNormalCompletion = true;
|
224 | var _didIteratorError = false;
|
225 | var _iteratorError = undefined;
|
226 |
|
227 | try {
|
228 | for (var _iterator = _props.DEPRECATED_CONFIG_PROPS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
229 | var p = _step.value;
|
230 |
|
231 | if (props[p]) {
|
232 | var key = p.replace(/Config$/, '');
|
233 | config = (0, _deepmerge2['default'])(config, _defineProperty({}, key, props[p]));
|
234 | if (showWarning) {
|
235 | var link = 'https://github.com/CookPete/react-player#config-prop';
|
236 | var message = 'ReactPlayer: %c' + p + ' %cis deprecated, please use the config prop instead \u2013 ' + link;
|
237 | console.warn(message, 'font-weight: bold', '');
|
238 | }
|
239 | }
|
240 | }
|
241 | } catch (err) {
|
242 | _didIteratorError = true;
|
243 | _iteratorError = err;
|
244 | } finally {
|
245 | try {
|
246 | if (!_iteratorNormalCompletion && _iterator['return']) {
|
247 | _iterator['return']();
|
248 | }
|
249 | } finally {
|
250 | if (_didIteratorError) {
|
251 | throw _iteratorError;
|
252 | }
|
253 | }
|
254 | }
|
255 |
|
256 | return config;
|
257 | }
|
258 |
|
259 | function omit(object) {
|
260 | var _ref;
|
261 |
|
262 | for (var _len = arguments.length, arrays = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
263 | arrays[_key - 1] = arguments[_key];
|
264 | }
|
265 |
|
266 | var omitKeys = (_ref = []).concat.apply(_ref, arrays);
|
267 | var output = {};
|
268 | var keys = Object.keys(object);
|
269 | var _iteratorNormalCompletion2 = true;
|
270 | var _didIteratorError2 = false;
|
271 | var _iteratorError2 = undefined;
|
272 |
|
273 | try {
|
274 | for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
275 | var key = _step2.value;
|
276 |
|
277 | if (omitKeys.indexOf(key) === -1) {
|
278 | output[key] = object[key];
|
279 | }
|
280 | }
|
281 | } catch (err) {
|
282 | _didIteratorError2 = true;
|
283 | _iteratorError2 = err;
|
284 | } finally {
|
285 | try {
|
286 | if (!_iteratorNormalCompletion2 && _iterator2['return']) {
|
287 | _iterator2['return']();
|
288 | }
|
289 | } finally {
|
290 | if (_didIteratorError2) {
|
291 | throw _iteratorError2;
|
292 | }
|
293 | }
|
294 | }
|
295 |
|
296 | return output;
|
297 | }
|
298 |
|
299 | function callPlayer(method) {
|
300 | var _player;
|
301 |
|
302 |
|
303 |
|
304 | if (!this.player || !this.player[method]) {
|
305 | var message = 'ReactPlayer: ' + this.constructor.displayName + ' player could not call %c' + method + '%c \u2013 ';
|
306 | if (!this.player) {
|
307 | message += 'The player was not available';
|
308 | } else if (!this.player[method]) {
|
309 | message += 'The method was not available';
|
310 | }
|
311 | console.warn(message, 'font-weight: bold', '');
|
312 | return null;
|
313 | }
|
314 |
|
315 | for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
316 | args[_key2 - 1] = arguments[_key2];
|
317 | }
|
318 |
|
319 | return (_player = this.player)[method].apply(_player, args);
|
320 | }
|
321 |
|
322 | function isObject(val) {
|
323 | return val !== null && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object';
|
324 | }
|
325 |
|
326 |
|
327 |
|
328 | function isEqual(a, b) {
|
329 | if (typeof a === 'function' && typeof b === 'function') {
|
330 | return true;
|
331 | }
|
332 | if (a instanceof Array && b instanceof Array) {
|
333 | if (a.length !== b.length) {
|
334 | return false;
|
335 | }
|
336 | for (var i = 0; i !== a.length; i++) {
|
337 | if (!isEqual(a[i], b[i])) {
|
338 | return false;
|
339 | }
|
340 | }
|
341 | return true;
|
342 | }
|
343 | if (isObject(a) && isObject(b)) {
|
344 | if (Object.keys(a).length !== Object.keys(b).length) {
|
345 | return false;
|
346 | }
|
347 | var _iteratorNormalCompletion3 = true;
|
348 | var _didIteratorError3 = false;
|
349 | var _iteratorError3 = undefined;
|
350 |
|
351 | try {
|
352 | for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
353 | var key = _step3.value;
|
354 |
|
355 | if (!isEqual(a[key], b[key])) {
|
356 | return false;
|
357 | }
|
358 | }
|
359 | } catch (err) {
|
360 | _didIteratorError3 = true;
|
361 | _iteratorError3 = err;
|
362 | } finally {
|
363 | try {
|
364 | if (!_iteratorNormalCompletion3 && _iterator3['return']) {
|
365 | _iterator3['return']();
|
366 | }
|
367 | } finally {
|
368 | if (_didIteratorError3) {
|
369 | throw _iteratorError3;
|
370 | }
|
371 | }
|
372 | }
|
373 |
|
374 | return true;
|
375 | }
|
376 | return a === b;
|
377 | }
|
378 |
|
379 | function isMediaStream(url) {
|
380 | return typeof window !== 'undefined' && typeof window.MediaStream !== 'undefined' && url instanceof window.MediaStream;
|
381 | }
|
382 |
|
383 | }),
|
384 |
|
385 | (function(module, exports, __webpack_require__) {
|
386 |
|
387 | "use strict";
|
388 |
|
389 |
|
390 | Object.defineProperty(exports, "__esModule", {
|
391 | value: true
|
392 | });
|
393 |
|
394 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
395 |
|
396 | 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; }; }();
|
397 |
|
398 | exports['default'] = createSinglePlayer;
|
399 |
|
400 | var _react = __webpack_require__(0);
|
401 |
|
402 | var _react2 = _interopRequireDefault(_react);
|
403 |
|
404 | var _props2 = __webpack_require__(5);
|
405 |
|
406 | var _utils = __webpack_require__(1);
|
407 |
|
408 | var _Player = __webpack_require__(7);
|
409 |
|
410 | var _Player2 = _interopRequireDefault(_Player);
|
411 |
|
412 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
413 |
|
414 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
415 |
|
416 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
417 |
|
418 | 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; }
|
419 |
|
420 | var SUPPORTED_PROPS = Object.keys(_props2.propTypes);
|
421 |
|
422 | function createSinglePlayer(activePlayer) {
|
423 | var _class, _temp2;
|
424 |
|
425 | return _temp2 = _class = function (_Component) {
|
426 | _inherits(SinglePlayer, _Component);
|
427 |
|
428 | function SinglePlayer() {
|
429 | var _ref;
|
430 |
|
431 | var _temp, _this, _ret;
|
432 |
|
433 | _classCallCheck(this, SinglePlayer);
|
434 |
|
435 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
436 | args[_key] = arguments[_key];
|
437 | }
|
438 |
|
439 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SinglePlayer.__proto__ || Object.getPrototypeOf(SinglePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.config = (0, _utils.getConfig)(_this.props, _props2.defaultProps, true), _this.getDuration = function () {
|
440 | if (!_this.player) return null;
|
441 | return _this.player.getDuration();
|
442 | }, _this.getCurrentTime = function () {
|
443 | if (!_this.player) return null;
|
444 | return _this.player.getCurrentTime();
|
445 | }, _this.getSecondsLoaded = function () {
|
446 | if (!_this.player) return null;
|
447 | return _this.player.getSecondsLoaded();
|
448 | }, _this.getInternalPlayer = function () {
|
449 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
|
450 |
|
451 | if (!_this.player) return null;
|
452 | return _this.player.getInternalPlayer(key);
|
453 | }, _this.seekTo = function (fraction, type) {
|
454 | if (!_this.player) return null;
|
455 | _this.player.seekTo(fraction, type);
|
456 | }, _this.ref = function (player) {
|
457 | _this.player = player;
|
458 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
459 | }
|
460 |
|
461 | _createClass(SinglePlayer, [{
|
462 | key: 'shouldComponentUpdate',
|
463 | value: function shouldComponentUpdate(nextProps) {
|
464 | return !(0, _utils.isEqual)(this.props, nextProps);
|
465 | }
|
466 | }, {
|
467 | key: 'componentWillUpdate',
|
468 | value: function componentWillUpdate(nextProps) {
|
469 | this.config = (0, _utils.getConfig)(nextProps, _props2.defaultProps);
|
470 | }
|
471 | }, {
|
472 | key: 'render',
|
473 | value: function render() {
|
474 | var _config$file = this.config.file,
|
475 | forceVideo = _config$file.forceVideo,
|
476 | forceAudio = _config$file.forceAudio,
|
477 | forceHLS = _config$file.forceHLS,
|
478 | forceDASH = _config$file.forceDASH;
|
479 |
|
480 | var skipCanPlay = forceVideo || forceAudio || forceHLS || forceDASH;
|
481 | if (!activePlayer.canPlay(this.props.url) && !skipCanPlay) {
|
482 | return null;
|
483 | }
|
484 | var _props = this.props,
|
485 | style = _props.style,
|
486 | width = _props.width,
|
487 | height = _props.height,
|
488 | Wrapper = _props.wrapper;
|
489 |
|
490 | var otherProps = (0, _utils.omit)(this.props, SUPPORTED_PROPS, _props2.DEPRECATED_CONFIG_PROPS);
|
491 | return _react2['default'].createElement(
|
492 | Wrapper,
|
493 | _extends({ style: _extends({}, style, { width: width, height: height }) }, otherProps),
|
494 | _react2['default'].createElement(_Player2['default'], _extends({}, this.props, {
|
495 | ref: this.ref,
|
496 | activePlayer: activePlayer,
|
497 | config: this.config
|
498 | }))
|
499 | );
|
500 | }
|
501 | }]);
|
502 |
|
503 | return SinglePlayer;
|
504 | }(_react.Component), _class.displayName = activePlayer.displayName + 'Player', _class.propTypes = _props2.propTypes, _class.defaultProps = _props2.defaultProps, _class.canPlay = activePlayer.canPlay, _temp2;
|
505 | }
|
506 |
|
507 | }),
|
508 |
|
509 | (function(module, exports, __webpack_require__) {
|
510 |
|
511 | "use strict";
|
512 |
|
513 |
|
514 | Object.defineProperty(exports, "__esModule", {
|
515 | value: true
|
516 | });
|
517 | exports.parserUtils = undefined;
|
518 |
|
519 | var _util = __webpack_require__(13);
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 | function childByName(node, name) {
|
532 | var childNodes = node.childNodes;
|
533 |
|
534 | for (var childKey in childNodes) {
|
535 | var child = childNodes[childKey];
|
536 |
|
537 | if (child.nodeName === name) {
|
538 | return child;
|
539 | }
|
540 | }
|
541 | }
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 | function childrenByName(node, name) {
|
550 | var children = [];
|
551 | var childNodes = node.childNodes;
|
552 |
|
553 | for (var childKey in childNodes) {
|
554 | var child = childNodes[childKey];
|
555 |
|
556 | if (child.nodeName === name) {
|
557 | children.push(child);
|
558 | }
|
559 | }
|
560 | return children;
|
561 | }
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 | function resolveVastAdTagURI(vastAdTagUrl, originalUrl) {
|
570 | if (!originalUrl) {
|
571 | return vastAdTagUrl;
|
572 | }
|
573 |
|
574 | if (vastAdTagUrl.indexOf('//') === 0) {
|
575 | var _location = location,
|
576 | protocol = _location.protocol;
|
577 |
|
578 | return '' + protocol + vastAdTagUrl;
|
579 | }
|
580 |
|
581 | if (vastAdTagUrl.indexOf('://') === -1) {
|
582 |
|
583 | var baseURL = originalUrl.slice(0, originalUrl.lastIndexOf('/'));
|
584 | return baseURL + '/' + vastAdTagUrl;
|
585 | }
|
586 |
|
587 | return vastAdTagUrl;
|
588 | }
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 | function parseBoolean(booleanString) {
|
596 | return ['true', 'TRUE', '1'].indexOf(booleanString) !== -1;
|
597 | }
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 | function parseNodeText(node) {
|
605 | return node && (node.textContent || node.text || '').trim();
|
606 | }
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 | function copyNodeAttribute(attributeName, nodeSource, nodeDestination) {
|
615 | var attributeValue = nodeSource.getAttribute(attributeName);
|
616 | if (attributeValue) {
|
617 | nodeDestination.setAttribute(attributeName, attributeValue);
|
618 | }
|
619 | }
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 | function parseDuration(durationString) {
|
627 | if (durationString === null || typeof durationString === 'undefined') {
|
628 | return -1;
|
629 | }
|
630 |
|
631 | if (_util.util.isNumeric(durationString)) {
|
632 | return parseInt(durationString);
|
633 | }
|
634 |
|
635 | var durationComponents = durationString.split(':');
|
636 | if (durationComponents.length !== 3) {
|
637 | return -1;
|
638 | }
|
639 |
|
640 | var secondsAndMS = durationComponents[2].split('.');
|
641 | var seconds = parseInt(secondsAndMS[0]);
|
642 | if (secondsAndMS.length === 2) {
|
643 | seconds += parseFloat('0.' + secondsAndMS[1]);
|
644 | }
|
645 |
|
646 | var minutes = parseInt(durationComponents[1] * 60);
|
647 | var hours = parseInt(durationComponents[0] * 60 * 60);
|
648 |
|
649 | if (isNaN(hours) || isNaN(minutes) || isNaN(seconds) || minutes > 60 * 60 || seconds > 60) {
|
650 | return -1;
|
651 | }
|
652 | return hours + minutes + seconds;
|
653 | }
|
654 |
|
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 | function splitVAST(ads) {
|
662 | var splittedVAST = [];
|
663 | var lastAdPod = null;
|
664 |
|
665 | ads.forEach(function (ad, i) {
|
666 | if (ad.sequence) {
|
667 | ad.sequence = parseInt(ad.sequence, 10);
|
668 | }
|
669 |
|
670 | if (ad.sequence > 1) {
|
671 | var lastAd = ads[i - 1];
|
672 |
|
673 | if (lastAd && lastAd.sequence === ad.sequence - 1) {
|
674 | lastAdPod && lastAdPod.push(ad);
|
675 | return;
|
676 | }
|
677 |
|
678 |
|
679 | delete ad.sequence;
|
680 | }
|
681 |
|
682 | lastAdPod = [ad];
|
683 | splittedVAST.push(lastAdPod);
|
684 | });
|
685 |
|
686 | return splittedVAST;
|
687 | }
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 | function mergeWrapperAdData(unwrappedAd, wrapper) {
|
696 | unwrappedAd.errorURLTemplates = wrapper.errorURLTemplates.concat(unwrappedAd.errorURLTemplates);
|
697 | unwrappedAd.impressionURLTemplates = wrapper.impressionURLTemplates.concat(unwrappedAd.impressionURLTemplates);
|
698 | unwrappedAd.extensions = wrapper.extensions.concat(unwrappedAd.extensions);
|
699 |
|
700 | unwrappedAd.creatives.forEach(function (creative) {
|
701 | if (wrapper.trackingEvents && wrapper.trackingEvents[creative.type]) {
|
702 | for (var eventName in wrapper.trackingEvents[creative.type]) {
|
703 | var urls = wrapper.trackingEvents[creative.type][eventName];
|
704 | if (!Array.isArray(creative.trackingEvents[eventName])) {
|
705 | creative.trackingEvents[eventName] = [];
|
706 | }
|
707 | creative.trackingEvents[eventName] = creative.trackingEvents[eventName].concat(urls);
|
708 | }
|
709 | }
|
710 | });
|
711 |
|
712 | if (wrapper.videoClickTrackingURLTemplates && wrapper.videoClickTrackingURLTemplates.length) {
|
713 | unwrappedAd.creatives.forEach(function (creative) {
|
714 | if (creative.type === 'linear') {
|
715 | creative.videoClickTrackingURLTemplates = creative.videoClickTrackingURLTemplates.concat(wrapper.videoClickTrackingURLTemplates);
|
716 | }
|
717 | });
|
718 | }
|
719 |
|
720 | if (wrapper.videoCustomClickURLTemplates && wrapper.videoCustomClickURLTemplates.length) {
|
721 | unwrappedAd.creatives.forEach(function (creative) {
|
722 | if (creative.type === 'linear') {
|
723 | creative.videoCustomClickURLTemplates = creative.videoCustomClickURLTemplates.concat(wrapper.videoCustomClickURLTemplates);
|
724 | }
|
725 | });
|
726 | }
|
727 |
|
728 |
|
729 | if (wrapper.videoClickThroughURLTemplate) {
|
730 | unwrappedAd.creatives.forEach(function (creative) {
|
731 | if (creative.type === 'linear' && (creative.videoClickThroughURLTemplate === null || typeof creative.videoClickThroughURLTemplate === 'undefined')) {
|
732 | creative.videoClickThroughURLTemplate = wrapper.videoClickThroughURLTemplate;
|
733 | }
|
734 | });
|
735 | }
|
736 | }
|
737 |
|
738 | var parserUtils = exports.parserUtils = {
|
739 | childByName: childByName,
|
740 | childrenByName: childrenByName,
|
741 | resolveVastAdTagURI: resolveVastAdTagURI,
|
742 | parseBoolean: parseBoolean,
|
743 | parseNodeText: parseNodeText,
|
744 | copyNodeAttribute: copyNodeAttribute,
|
745 | parseDuration: parseDuration,
|
746 | splitVAST: splitVAST,
|
747 | mergeWrapperAdData: mergeWrapperAdData
|
748 | };
|
749 |
|
750 | }),
|
751 |
|
752 | (function(module, exports, __webpack_require__) {
|
753 |
|
754 | "use strict";
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 | function makeEmptyFunction(arg) {
|
767 | return function () {
|
768 | return arg;
|
769 | };
|
770 | }
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 | var emptyFunction = function emptyFunction() {};
|
778 |
|
779 | emptyFunction.thatReturns = makeEmptyFunction;
|
780 | emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
781 | emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
782 | emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
783 | emptyFunction.thatReturnsThis = function () {
|
784 | return this;
|
785 | };
|
786 | emptyFunction.thatReturnsArgument = function (arg) {
|
787 | return arg;
|
788 | };
|
789 |
|
790 | module.exports = emptyFunction;
|
791 |
|
792 | }),
|
793 |
|
794 | (function(module, exports, __webpack_require__) {
|
795 |
|
796 | "use strict";
|
797 |
|
798 |
|
799 | Object.defineProperty(exports, "__esModule", {
|
800 | value: true
|
801 | });
|
802 | exports.DEPRECATED_CONFIG_PROPS = exports.defaultProps = exports.propTypes = undefined;
|
803 |
|
804 | var _propTypes = __webpack_require__(49);
|
805 |
|
806 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
807 |
|
808 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
809 |
|
810 | var string = _propTypes2['default'].string,
|
811 | bool = _propTypes2['default'].bool,
|
812 | number = _propTypes2['default'].number,
|
813 | array = _propTypes2['default'].array,
|
814 | oneOfType = _propTypes2['default'].oneOfType,
|
815 | shape = _propTypes2['default'].shape,
|
816 | object = _propTypes2['default'].object,
|
817 | func = _propTypes2['default'].func;
|
818 | var propTypes = exports.propTypes = {
|
819 | url: oneOfType([string, array, object]),
|
820 | playing: bool,
|
821 | loop: bool,
|
822 | controls: bool,
|
823 | volume: number,
|
824 | muted: bool,
|
825 | playbackRate: number,
|
826 | width: oneOfType([string, number]),
|
827 | height: oneOfType([string, number]),
|
828 | style: object,
|
829 | progressInterval: number,
|
830 | playsinline: bool,
|
831 | pip: bool,
|
832 | light: oneOfType([bool, string]),
|
833 | wrapper: oneOfType([string, func, shape({ render: func.isRequired })]),
|
834 | config: shape({
|
835 | soundcloud: shape({
|
836 | options: object,
|
837 | preload: bool
|
838 | }),
|
839 | youtube: shape({
|
840 | playerVars: object,
|
841 | embedOptions: object,
|
842 | preload: bool
|
843 | }),
|
844 | facebook: shape({
|
845 | appId: string
|
846 | }),
|
847 | dailymotion: shape({
|
848 | params: object,
|
849 | preload: bool
|
850 | }),
|
851 | vimeo: shape({
|
852 | playerOptions: object,
|
853 | preload: bool
|
854 | }),
|
855 | file: shape({
|
856 | attributes: object,
|
857 | tracks: array,
|
858 | forceVideo: bool,
|
859 | forceAudio: bool,
|
860 | forceHLS: bool,
|
861 | forceDASH: bool,
|
862 | hlsOptions: object,
|
863 | hlsVersion: string,
|
864 | dashVersion: string
|
865 | }),
|
866 | wistia: shape({
|
867 | options: object
|
868 | }),
|
869 | mixcloud: shape({
|
870 | options: object
|
871 | }),
|
872 | twitch: shape({
|
873 | options: object
|
874 | })
|
875 | }),
|
876 | onAdSkippable: func,
|
877 | onReady: func,
|
878 | onStart: func,
|
879 | onPlay: func,
|
880 | onPause: func,
|
881 | onBuffer: func,
|
882 | onBufferEnd: func,
|
883 | onEnded: func,
|
884 | onError: func,
|
885 | onDuration: func,
|
886 | onSeek: func,
|
887 | onProgress: func,
|
888 | onVolumeChange: func,
|
889 | onEnablePIP: func,
|
890 | onDisablePIP: func
|
891 | };
|
892 |
|
893 | var defaultProps = exports.defaultProps = {
|
894 | playing: false,
|
895 | loop: false,
|
896 | controls: false,
|
897 | volume: null,
|
898 | muted: false,
|
899 | playbackRate: 1,
|
900 | width: '640px',
|
901 | height: '360px',
|
902 | style: {},
|
903 | progressInterval: 1000,
|
904 | playsinline: false,
|
905 | pip: false,
|
906 | light: false,
|
907 | wrapper: 'div',
|
908 | config: {
|
909 | soundcloud: {
|
910 | options: {
|
911 | visual: true,
|
912 | buying: false,
|
913 | liking: false,
|
914 | download: false,
|
915 | sharing: false,
|
916 | show_comments: false,
|
917 | show_playcount: false
|
918 | }
|
919 | },
|
920 | youtube: {
|
921 | playerVars: {
|
922 | playsinline: 1,
|
923 | showinfo: 0,
|
924 | rel: 0,
|
925 | iv_load_policy: 3,
|
926 | modestbranding: 1
|
927 | },
|
928 | embedOptions: {},
|
929 | preload: false
|
930 | },
|
931 | facebook: {
|
932 | appId: '1309697205772819'
|
933 | },
|
934 | dailymotion: {
|
935 | params: {
|
936 | api: 1,
|
937 | 'endscreen-enable': false
|
938 | },
|
939 | preload: false
|
940 | },
|
941 | vimeo: {
|
942 | playerOptions: {
|
943 | autopause: false,
|
944 | byline: false,
|
945 | portrait: false,
|
946 | title: false
|
947 | },
|
948 | preload: false
|
949 | },
|
950 | file: {
|
951 | attributes: {},
|
952 | tracks: [],
|
953 | forceVideo: false,
|
954 | forceAudio: false,
|
955 | forceHLS: false,
|
956 | forceDASH: false,
|
957 | hlsOptions: {},
|
958 | hlsVersion: '0.10.1',
|
959 | dashVersion: '2.9.2'
|
960 | },
|
961 | wistia: {
|
962 | options: {}
|
963 | },
|
964 | mixcloud: {
|
965 | options: {
|
966 | hide_cover: 1
|
967 | }
|
968 | },
|
969 | twitch: {
|
970 | options: {}
|
971 | }
|
972 | },
|
973 | onAdSkippable: function onAdSkippable() {},
|
974 | onReady: function onReady() {},
|
975 | onStart: function onStart() {},
|
976 | onPlay: function onPlay() {},
|
977 | onPause: function onPause() {},
|
978 | onBuffer: function onBuffer() {},
|
979 | onBufferEnd: function onBufferEnd() {},
|
980 | onEnded: function onEnded() {},
|
981 | onError: function onError() {},
|
982 | onDuration: function onDuration() {},
|
983 | onSeek: function onSeek() {},
|
984 | onVolumeChange: function onVolumeChange() {},
|
985 | onProgress: function onProgress() {},
|
986 | onEnablePIP: function onEnablePIP() {},
|
987 | onDisablePIP: function onDisablePIP() {}
|
988 | };
|
989 |
|
990 | var DEPRECATED_CONFIG_PROPS = exports.DEPRECATED_CONFIG_PROPS = ['soundcloudConfig', 'youtubeConfig', 'facebookConfig', 'dailymotionConfig', 'vimeoConfig', 'fileConfig', 'wistiaConfig'];
|
991 |
|
992 | }),
|
993 |
|
994 | (function(module, exports, __webpack_require__) {
|
995 |
|
996 | "use strict";
|
997 |
|
998 |
|
999 | Object.defineProperty(exports, "__esModule", {
|
1000 | value: true
|
1001 | });
|
1002 | exports.YouTube = undefined;
|
1003 |
|
1004 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1005 |
|
1006 | 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; }; }();
|
1007 |
|
1008 | var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
1009 |
|
1010 | var _react = __webpack_require__(0);
|
1011 |
|
1012 | var _react2 = _interopRequireDefault(_react);
|
1013 |
|
1014 | var _utils = __webpack_require__(1);
|
1015 |
|
1016 | var _singlePlayer = __webpack_require__(2);
|
1017 |
|
1018 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
1019 |
|
1020 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
1021 |
|
1022 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1023 |
|
1024 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1025 |
|
1026 | 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; }
|
1027 |
|
1028 | var SDK_URL = 'https://www.youtube.com/iframe_api';
|
1029 | var SDK_GLOBAL = 'YT';
|
1030 | var SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady';
|
1031 | var MATCH_URL = /(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/;
|
1032 | var MATCH_PLAYLIST = /list=([a-zA-Z0-9_-]+)/;
|
1033 |
|
1034 | function parsePlaylist(url) {
|
1035 | if (MATCH_PLAYLIST.test(url)) {
|
1036 | var _url$match = url.match(MATCH_PLAYLIST),
|
1037 | _url$match2 = _slicedToArray(_url$match, 2),
|
1038 | playlistId = _url$match2[1];
|
1039 |
|
1040 | return {
|
1041 | listType: 'playlist',
|
1042 | list: playlistId
|
1043 | };
|
1044 | }
|
1045 | return {};
|
1046 | }
|
1047 |
|
1048 | var YouTube = exports.YouTube = function (_Component) {
|
1049 | _inherits(YouTube, _Component);
|
1050 |
|
1051 | function YouTube() {
|
1052 | var _ref;
|
1053 |
|
1054 | var _temp, _this, _ret;
|
1055 |
|
1056 | _classCallCheck(this, YouTube);
|
1057 |
|
1058 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1059 | args[_key] = arguments[_key];
|
1060 | }
|
1061 |
|
1062 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.onStateChange = function (_ref2) {
|
1063 | var data = _ref2.data;
|
1064 | var _this$props = _this.props,
|
1065 | onPlay = _this$props.onPlay,
|
1066 | onPause = _this$props.onPause,
|
1067 | onBuffer = _this$props.onBuffer,
|
1068 | onBufferEnd = _this$props.onBufferEnd,
|
1069 | onEnded = _this$props.onEnded,
|
1070 | onReady = _this$props.onReady,
|
1071 | loop = _this$props.loop;
|
1072 | var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,
|
1073 | PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,
|
1074 | PAUSED = _window$SDK_GLOBAL$Pl.PAUSED,
|
1075 | BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING,
|
1076 | ENDED = _window$SDK_GLOBAL$Pl.ENDED,
|
1077 | CUED = _window$SDK_GLOBAL$Pl.CUED;
|
1078 |
|
1079 | if (data === PLAYING) {
|
1080 | onPlay();
|
1081 | onBufferEnd();
|
1082 | }
|
1083 | if (data === PAUSED) onPause();
|
1084 | if (data === BUFFERING) onBuffer();
|
1085 | if (data === ENDED) {
|
1086 | var isPlaylist = !!_this.callPlayer('getPlaylist');
|
1087 | if (loop && !isPlaylist) {
|
1088 | _this.play();
|
1089 | }
|
1090 | onEnded();
|
1091 | }
|
1092 | if (data === CUED) onReady();
|
1093 | }, _this.mute = function () {
|
1094 | _this.callPlayer('mute');
|
1095 | }, _this.unmute = function () {
|
1096 | _this.callPlayer('unMute');
|
1097 | }, _this.ref = function (container) {
|
1098 | _this.container = container;
|
1099 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1100 | }
|
1101 |
|
1102 | _createClass(YouTube, [{
|
1103 | key: 'load',
|
1104 | value: function load(url, isReady) {
|
1105 | var _this2 = this;
|
1106 |
|
1107 | var _props = this.props,
|
1108 | playing = _props.playing,
|
1109 | muted = _props.muted,
|
1110 | playsinline = _props.playsinline,
|
1111 | controls = _props.controls,
|
1112 | loop = _props.loop,
|
1113 | config = _props.config,
|
1114 | _onError = _props.onError;
|
1115 | var _config$youtube = config.youtube,
|
1116 | playerVars = _config$youtube.playerVars,
|
1117 | embedOptions = _config$youtube.embedOptions;
|
1118 |
|
1119 | var id = url && url.match(MATCH_URL)[1];
|
1120 | if (isReady) {
|
1121 | if (MATCH_PLAYLIST.test(url)) {
|
1122 | this.player.loadPlaylist(parsePlaylist(url));
|
1123 | return;
|
1124 | }
|
1125 | this.player.cueVideoById({
|
1126 | videoId: id,
|
1127 | startSeconds: (0, _utils.parseStartTime)(url) || playerVars.start,
|
1128 | endSeconds: (0, _utils.parseEndTime)(url) || playerVars.end
|
1129 | });
|
1130 | return;
|
1131 | }
|
1132 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {
|
1133 | return YT.loaded;
|
1134 | }).then(function (YT) {
|
1135 | if (!_this2.container) return;
|
1136 | _this2.player = new YT.Player(_this2.container, _extends({
|
1137 | width: '100%',
|
1138 | height: '100%',
|
1139 | videoId: id,
|
1140 | playerVars: _extends({
|
1141 | autoplay: playing ? 1 : 0,
|
1142 | mute: muted ? 1 : 0,
|
1143 | controls: controls ? 1 : 0,
|
1144 | start: (0, _utils.parseStartTime)(url),
|
1145 | end: (0, _utils.parseEndTime)(url),
|
1146 | origin: window.location.origin,
|
1147 | playsinline: playsinline
|
1148 | }, parsePlaylist(url), playerVars),
|
1149 | events: {
|
1150 | onReady: _this2.props.onReady,
|
1151 | onStateChange: _this2.onStateChange,
|
1152 | onError: function onError(event) {
|
1153 | return _onError(event.data);
|
1154 | }
|
1155 | }
|
1156 | }, embedOptions));
|
1157 | if (loop) {
|
1158 | _this2.player.setLoop(true);
|
1159 | }
|
1160 | }, _onError);
|
1161 | }
|
1162 | }, {
|
1163 | key: 'play',
|
1164 | value: function play() {
|
1165 | this.callPlayer('playVideo');
|
1166 | }
|
1167 | }, {
|
1168 | key: 'pause',
|
1169 | value: function pause() {
|
1170 | this.callPlayer('pauseVideo');
|
1171 | }
|
1172 | }, {
|
1173 | key: 'stop',
|
1174 | value: function stop() {
|
1175 | if (!document.body.contains(this.callPlayer('getIframe'))) return;
|
1176 | this.callPlayer('stopVideo');
|
1177 | }
|
1178 | }, {
|
1179 | key: 'seekTo',
|
1180 | value: function seekTo(amount) {
|
1181 | this.callPlayer('seekTo', amount);
|
1182 | if (!this.props.playing) {
|
1183 | this.pause();
|
1184 | }
|
1185 | }
|
1186 | }, {
|
1187 | key: 'setVolume',
|
1188 | value: function setVolume(fraction) {
|
1189 | this.callPlayer('setVolume', fraction * 100);
|
1190 | }
|
1191 | }, {
|
1192 | key: 'setPlaybackRate',
|
1193 | value: function setPlaybackRate(rate) {
|
1194 | this.callPlayer('setPlaybackRate', rate);
|
1195 | }
|
1196 | }, {
|
1197 | key: 'setLoop',
|
1198 | value: function setLoop(loop) {
|
1199 | this.callPlayer('setLoop', loop);
|
1200 | }
|
1201 | }, {
|
1202 | key: 'getDuration',
|
1203 | value: function getDuration() {
|
1204 | return this.callPlayer('getDuration');
|
1205 | }
|
1206 | }, {
|
1207 | key: 'getCurrentTime',
|
1208 | value: function getCurrentTime() {
|
1209 | return this.callPlayer('getCurrentTime');
|
1210 | }
|
1211 | }, {
|
1212 | key: 'getSecondsLoaded',
|
1213 | value: function getSecondsLoaded() {
|
1214 | return this.callPlayer('getVideoLoadedFraction') * this.getDuration();
|
1215 | }
|
1216 | }, {
|
1217 | key: 'render',
|
1218 | value: function render() {
|
1219 | var style = _extends({
|
1220 | width: '100%',
|
1221 | height: '100%'
|
1222 | }, this.props.style);
|
1223 | return _react2['default'].createElement(
|
1224 | 'div',
|
1225 | { style: style },
|
1226 | _react2['default'].createElement('div', { ref: this.ref })
|
1227 | );
|
1228 | }
|
1229 | }]);
|
1230 |
|
1231 | return YouTube;
|
1232 | }(_react.Component);
|
1233 |
|
1234 | YouTube.displayName = 'YouTube';
|
1235 |
|
1236 | YouTube.canPlay = function (url) {
|
1237 | return MATCH_URL.test(url);
|
1238 | };
|
1239 |
|
1240 | exports['default'] = (0, _singlePlayer2['default'])(YouTube);
|
1241 |
|
1242 | }),
|
1243 |
|
1244 | (function(module, exports, __webpack_require__) {
|
1245 |
|
1246 | "use strict";
|
1247 |
|
1248 |
|
1249 | Object.defineProperty(exports, "__esModule", {
|
1250 | value: true
|
1251 | });
|
1252 |
|
1253 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1254 |
|
1255 | 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; }; }();
|
1256 |
|
1257 | var _react = __webpack_require__(0);
|
1258 |
|
1259 | var _react2 = _interopRequireDefault(_react);
|
1260 |
|
1261 | var _props2 = __webpack_require__(5);
|
1262 |
|
1263 | var _utils = __webpack_require__(1);
|
1264 |
|
1265 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
1266 |
|
1267 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1268 |
|
1269 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1270 |
|
1271 | 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; }
|
1272 |
|
1273 | var SEEK_ON_PLAY_EXPIRY = 5000;
|
1274 |
|
1275 | var Player = function (_Component) {
|
1276 | _inherits(Player, _Component);
|
1277 |
|
1278 | function Player() {
|
1279 | var _ref;
|
1280 |
|
1281 | var _temp, _this, _ret;
|
1282 |
|
1283 | _classCallCheck(this, Player);
|
1284 |
|
1285 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1286 | args[_key] = arguments[_key];
|
1287 | }
|
1288 |
|
1289 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Player.__proto__ || Object.getPrototypeOf(Player)).call.apply(_ref, [this].concat(args))), _this), _this.mounted = false, _this.isReady = false, _this.isPlaying = false, _this.isLoading = true, _this.loadOnReady = null, _this.startOnPlay = true, _this.seekOnPlay = null, _this.onDurationCalled = false, _this.getInternalPlayer = function (key) {
|
1290 | if (!_this.player) return null;
|
1291 | return _this.player[key];
|
1292 | }, _this.progress = function () {
|
1293 | if (_this.props.url && _this.player && _this.isReady) {
|
1294 | var playedSeconds = _this.getCurrentTime() || 0;
|
1295 | var loadedSeconds = _this.getSecondsLoaded();
|
1296 | var duration = _this.getDuration();
|
1297 | if (duration) {
|
1298 | var progress = {
|
1299 | playedSeconds: playedSeconds,
|
1300 | played: playedSeconds / duration
|
1301 | };
|
1302 | if (loadedSeconds !== null) {
|
1303 | progress.loadedSeconds = loadedSeconds;
|
1304 | progress.loaded = loadedSeconds / duration;
|
1305 | }
|
1306 |
|
1307 | if (progress.played !== _this.prevPlayed || progress.loaded !== _this.prevLoaded) {
|
1308 | _this.props.onProgress(progress);
|
1309 | }
|
1310 | _this.prevPlayed = progress.played;
|
1311 | _this.prevLoaded = progress.loaded;
|
1312 | }
|
1313 | }
|
1314 | _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
|
1315 | }, _this.onReady = function () {
|
1316 | if (!_this.mounted) return;
|
1317 | _this.isReady = true;
|
1318 | _this.isLoading = false;
|
1319 | var _this$props = _this.props,
|
1320 | onReady = _this$props.onReady,
|
1321 | playing = _this$props.playing,
|
1322 | volume = _this$props.volume,
|
1323 | muted = _this$props.muted;
|
1324 |
|
1325 | onReady();
|
1326 | if (!muted && volume !== null) {
|
1327 | _this.player.setVolume(volume);
|
1328 | }
|
1329 | if (_this.loadOnReady) {
|
1330 | _this.player.load(_this.loadOnReady, true);
|
1331 | _this.loadOnReady = null;
|
1332 | } else if (playing) {
|
1333 | _this.player.play();
|
1334 | }
|
1335 | _this.onDurationCheck();
|
1336 | }, _this.onPlay = function () {
|
1337 | _this.isPlaying = true;
|
1338 | _this.isLoading = false;
|
1339 | var _this$props2 = _this.props,
|
1340 | onStart = _this$props2.onStart,
|
1341 | onPlay = _this$props2.onPlay,
|
1342 | playbackRate = _this$props2.playbackRate;
|
1343 |
|
1344 | if (_this.startOnPlay) {
|
1345 | if (_this.player.setPlaybackRate) {
|
1346 | _this.player.setPlaybackRate(playbackRate);
|
1347 | }
|
1348 | onStart();
|
1349 | _this.startOnPlay = false;
|
1350 | }
|
1351 | onPlay();
|
1352 | if (_this.seekOnPlay) {
|
1353 | _this.seekTo(_this.seekOnPlay);
|
1354 | _this.seekOnPlay = null;
|
1355 | }
|
1356 | _this.onDurationCheck();
|
1357 | }, _this.onPause = function (e) {
|
1358 | _this.isPlaying = false;
|
1359 | if (!_this.isLoading) {
|
1360 | _this.props.onPause(e);
|
1361 | }
|
1362 | }, _this.onEnded = function () {
|
1363 | var _this$props3 = _this.props,
|
1364 | activePlayer = _this$props3.activePlayer,
|
1365 | loop = _this$props3.loop,
|
1366 | onEnded = _this$props3.onEnded;
|
1367 |
|
1368 | if (activePlayer.loopOnEnded && loop) {
|
1369 | _this.seekTo(0);
|
1370 | }
|
1371 | if (!loop) {
|
1372 | _this.isPlaying = false;
|
1373 | onEnded();
|
1374 | }
|
1375 | }, _this.onError = function (e) {
|
1376 | _this.isLoading = false;
|
1377 | _this.props.onError(e);
|
1378 | }, _this.onDurationCheck = function () {
|
1379 | clearTimeout(_this.durationCheckTimeout);
|
1380 | var duration = _this.getDuration();
|
1381 | if (duration) {
|
1382 | if (!_this.onDurationCalled) {
|
1383 | _this.props.onDuration(duration);
|
1384 | _this.onDurationCalled = true;
|
1385 | }
|
1386 | } else {
|
1387 | _this.durationCheckTimeout = setTimeout(_this.onDurationCheck, 100);
|
1388 | }
|
1389 | }, _this.onLoaded = function () {
|
1390 |
|
1391 |
|
1392 | _this.isLoading = false;
|
1393 | }, _this.ref = function (player) {
|
1394 | if (player) {
|
1395 | _this.player = player;
|
1396 | }
|
1397 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1398 | }
|
1399 |
|
1400 |
|
1401 |
|
1402 | _createClass(Player, [{
|
1403 | key: 'componentDidMount',
|
1404 | value: function componentDidMount() {
|
1405 | this.mounted = true;
|
1406 | this.player.load(this.props.url);
|
1407 | this.progress();
|
1408 | }
|
1409 | }, {
|
1410 | key: 'componentWillUnmount',
|
1411 | value: function componentWillUnmount() {
|
1412 | clearTimeout(this.progressTimeout);
|
1413 | clearTimeout(this.durationCheckTimeout);
|
1414 | if (this.isReady) {
|
1415 | this.player.stop();
|
1416 | }
|
1417 | if (this.player.disablePIP) {
|
1418 | this.player.disablePIP();
|
1419 | }
|
1420 | this.mounted = false;
|
1421 | }
|
1422 | }, {
|
1423 | key: 'componentWillReceiveProps',
|
1424 | value: function componentWillReceiveProps(nextProps) {
|
1425 | var _this2 = this;
|
1426 |
|
1427 |
|
1428 | var _props = this.props,
|
1429 | url = _props.url,
|
1430 | playing = _props.playing,
|
1431 | volume = _props.volume,
|
1432 | muted = _props.muted,
|
1433 | playbackRate = _props.playbackRate,
|
1434 | pip = _props.pip,
|
1435 | loop = _props.loop;
|
1436 |
|
1437 | if (!(0, _utils.isEqual)(url, nextProps.url)) {
|
1438 | if (this.isLoading) {
|
1439 | console.warn('ReactPlayer: the attempt to load ' + nextProps.url + ' is being deferred until the player has loaded');
|
1440 | this.loadOnReady = nextProps.url;
|
1441 | return;
|
1442 | }
|
1443 | this.isLoading = true;
|
1444 | this.startOnPlay = true;
|
1445 | this.onDurationCalled = false;
|
1446 | this.player.load(nextProps.url, this.isReady);
|
1447 | }
|
1448 | if (!playing && nextProps.playing && !this.isPlaying) {
|
1449 | this.player.play();
|
1450 | }
|
1451 | if (playing && !nextProps.playing && this.isPlaying) {
|
1452 | this.player.pause();
|
1453 | }
|
1454 | if (!pip && nextProps.pip && this.player.enablePIP) {
|
1455 | this.player.enablePIP();
|
1456 | } else if (pip && !nextProps.pip && this.player.disablePIP) {
|
1457 | this.player.disablePIP();
|
1458 | }
|
1459 | if (volume !== nextProps.volume && nextProps.volume !== null) {
|
1460 | this.player.setVolume(nextProps.volume);
|
1461 | }
|
1462 | if (muted !== nextProps.muted) {
|
1463 | if (nextProps.muted) {
|
1464 | this.player.mute();
|
1465 | } else {
|
1466 | this.player.unmute();
|
1467 | if (nextProps.volume !== null) {
|
1468 |
|
1469 | setTimeout(function () {
|
1470 | return _this2.player.setVolume(nextProps.volume);
|
1471 | });
|
1472 | }
|
1473 | }
|
1474 | }
|
1475 | if (playbackRate !== nextProps.playbackRate && this.player.setPlaybackRate) {
|
1476 | this.player.setPlaybackRate(nextProps.playbackRate);
|
1477 | }
|
1478 | if (loop !== nextProps.loop && this.player.setLoop) {
|
1479 | this.player.setLoop(nextProps.loop);
|
1480 | }
|
1481 | }
|
1482 | }, {
|
1483 | key: 'getDuration',
|
1484 | value: function getDuration() {
|
1485 | if (!this.isReady) return null;
|
1486 | return this.player.getDuration();
|
1487 | }
|
1488 | }, {
|
1489 | key: 'getCurrentTime',
|
1490 | value: function getCurrentTime() {
|
1491 | if (!this.isReady) return null;
|
1492 | return this.player.getCurrentTime();
|
1493 | }
|
1494 | }, {
|
1495 | key: 'getSecondsLoaded',
|
1496 | value: function getSecondsLoaded() {
|
1497 | if (!this.isReady) return null;
|
1498 | return this.player.getSecondsLoaded();
|
1499 | }
|
1500 | }, {
|
1501 | key: 'seekTo',
|
1502 | value: function seekTo(amount, type) {
|
1503 | var _this3 = this;
|
1504 |
|
1505 |
|
1506 | if (!this.isReady && amount !== 0) {
|
1507 | this.seekOnPlay = amount;
|
1508 | setTimeout(function () {
|
1509 | _this3.seekOnPlay = null;
|
1510 | }, SEEK_ON_PLAY_EXPIRY);
|
1511 | return;
|
1512 | }
|
1513 | var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';
|
1514 | if (isFraction) {
|
1515 |
|
1516 | var duration = this.player.getDuration();
|
1517 | if (!duration) {
|
1518 | console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
|
1519 | return;
|
1520 | }
|
1521 | this.player.seekTo(duration * amount);
|
1522 | return;
|
1523 | }
|
1524 | this.player.seekTo(amount);
|
1525 | }
|
1526 | }, {
|
1527 | key: 'render',
|
1528 | value: function render() {
|
1529 | var Player = this.props.activePlayer;
|
1530 | if (!Player) {
|
1531 | return null;
|
1532 | }
|
1533 | return _react2['default'].createElement(Player, _extends({}, this.props, {
|
1534 | ref: this.ref,
|
1535 | onReady: this.onReady,
|
1536 | onPlay: this.onPlay,
|
1537 | onPause: this.onPause,
|
1538 | onEnded: this.onEnded,
|
1539 | onLoaded: this.onLoaded,
|
1540 | onError: this.onError
|
1541 | }));
|
1542 | }
|
1543 | }]);
|
1544 |
|
1545 | return Player;
|
1546 | }(_react.Component);
|
1547 |
|
1548 | Player.displayName = 'Player';
|
1549 | Player.propTypes = _props2.propTypes;
|
1550 | Player.defaultProps = _props2.defaultProps;
|
1551 | exports['default'] = Player;
|
1552 |
|
1553 | }),
|
1554 |
|
1555 | (function(module, exports, __webpack_require__) {
|
1556 |
|
1557 | "use strict";
|
1558 |
|
1559 |
|
1560 | Object.defineProperty(exports, "__esModule", {
|
1561 | value: true
|
1562 | });
|
1563 | exports.SoundCloud = undefined;
|
1564 |
|
1565 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1566 |
|
1567 | 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; }; }();
|
1568 |
|
1569 | var _react = __webpack_require__(0);
|
1570 |
|
1571 | var _react2 = _interopRequireDefault(_react);
|
1572 |
|
1573 | var _utils = __webpack_require__(1);
|
1574 |
|
1575 | var _singlePlayer = __webpack_require__(2);
|
1576 |
|
1577 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
1578 |
|
1579 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
1580 |
|
1581 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1582 |
|
1583 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1584 |
|
1585 | 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; }
|
1586 |
|
1587 | var SDK_URL = 'https://w.soundcloud.com/player/api.js';
|
1588 | var SDK_GLOBAL = 'SC';
|
1589 | var MATCH_URL = /(soundcloud\.com|snd\.sc)\/.+$/;
|
1590 |
|
1591 | var SoundCloud = exports.SoundCloud = function (_Component) {
|
1592 | _inherits(SoundCloud, _Component);
|
1593 |
|
1594 | function SoundCloud() {
|
1595 | var _ref;
|
1596 |
|
1597 | var _temp, _this, _ret;
|
1598 |
|
1599 | _classCallCheck(this, SoundCloud);
|
1600 |
|
1601 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1602 | args[_key] = arguments[_key];
|
1603 | }
|
1604 |
|
1605 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = SoundCloud.__proto__ || Object.getPrototypeOf(SoundCloud)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.fractionLoaded = null, _this.mute = function () {
|
1606 | _this.setVolume(0);
|
1607 | }, _this.unmute = function () {
|
1608 | if (_this.props.volume !== null) {
|
1609 | _this.setVolume(_this.props.volume);
|
1610 | }
|
1611 | }, _this.ref = function (iframe) {
|
1612 | _this.iframe = iframe;
|
1613 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1614 | }
|
1615 |
|
1616 | _createClass(SoundCloud, [{
|
1617 | key: 'load',
|
1618 | value: function load(url, isReady) {
|
1619 | var _this2 = this;
|
1620 |
|
1621 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {
|
1622 | if (!_this2.iframe) return;
|
1623 | var _SC$Widget$Events = SC.Widget.Events,
|
1624 | PLAY = _SC$Widget$Events.PLAY,
|
1625 | PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,
|
1626 | PAUSE = _SC$Widget$Events.PAUSE,
|
1627 | FINISH = _SC$Widget$Events.FINISH,
|
1628 | ERROR = _SC$Widget$Events.ERROR;
|
1629 |
|
1630 | if (!isReady) {
|
1631 | _this2.player = SC.Widget(_this2.iframe);
|
1632 | _this2.player.bind(PLAY, _this2.props.onPlay);
|
1633 | _this2.player.bind(PAUSE, _this2.props.onPause);
|
1634 | _this2.player.bind(PLAY_PROGRESS, function (e) {
|
1635 | _this2.currentTime = e.currentPosition / 1000;
|
1636 | _this2.fractionLoaded = e.loadedProgress;
|
1637 | });
|
1638 | _this2.player.bind(FINISH, function () {
|
1639 | return _this2.props.onEnded();
|
1640 | });
|
1641 | _this2.player.bind(ERROR, function (e) {
|
1642 | return _this2.props.onError(e);
|
1643 | });
|
1644 | }
|
1645 | _this2.player.load(url, _extends({}, _this2.props.config.soundcloud.options, {
|
1646 | callback: function callback() {
|
1647 | _this2.player.getDuration(function (duration) {
|
1648 | _this2.duration = duration / 1000;
|
1649 | _this2.props.onReady();
|
1650 | });
|
1651 | }
|
1652 | }));
|
1653 | });
|
1654 | }
|
1655 | }, {
|
1656 | key: 'play',
|
1657 | value: function play() {
|
1658 | this.callPlayer('play');
|
1659 | }
|
1660 | }, {
|
1661 | key: 'pause',
|
1662 | value: function pause() {
|
1663 | this.callPlayer('pause');
|
1664 | }
|
1665 | }, {
|
1666 | key: 'stop',
|
1667 | value: function stop() {
|
1668 |
|
1669 | }
|
1670 | }, {
|
1671 | key: 'seekTo',
|
1672 | value: function seekTo(seconds) {
|
1673 | this.callPlayer('seekTo', seconds * 1000);
|
1674 | }
|
1675 | }, {
|
1676 | key: 'setVolume',
|
1677 | value: function setVolume(fraction) {
|
1678 | this.callPlayer('setVolume', fraction * 100);
|
1679 | }
|
1680 | }, {
|
1681 | key: 'getDuration',
|
1682 | value: function getDuration() {
|
1683 | return this.duration;
|
1684 | }
|
1685 | }, {
|
1686 | key: 'getCurrentTime',
|
1687 | value: function getCurrentTime() {
|
1688 | return this.currentTime;
|
1689 | }
|
1690 | }, {
|
1691 | key: 'getSecondsLoaded',
|
1692 | value: function getSecondsLoaded() {
|
1693 | return this.fractionLoaded * this.duration;
|
1694 | }
|
1695 | }, {
|
1696 | key: 'render',
|
1697 | value: function render() {
|
1698 | var style = _extends({
|
1699 | width: '100%',
|
1700 | height: '100%'
|
1701 | }, this.props.style);
|
1702 | return _react2['default'].createElement('iframe', {
|
1703 | ref: this.ref,
|
1704 | src: 'https://w.soundcloud.com/player/?url=' + encodeURIComponent(this.props.url),
|
1705 | style: style,
|
1706 | frameBorder: 0,
|
1707 | allow: 'autoplay'
|
1708 | });
|
1709 | }
|
1710 | }]);
|
1711 |
|
1712 | return SoundCloud;
|
1713 | }(_react.Component);
|
1714 |
|
1715 | SoundCloud.displayName = 'SoundCloud';
|
1716 |
|
1717 | SoundCloud.canPlay = function (url) {
|
1718 | return MATCH_URL.test(url);
|
1719 | };
|
1720 |
|
1721 | SoundCloud.loopOnEnded = true;
|
1722 | exports['default'] = (0, _singlePlayer2['default'])(SoundCloud);
|
1723 |
|
1724 | }),
|
1725 |
|
1726 | (function(module, exports, __webpack_require__) {
|
1727 |
|
1728 | "use strict";
|
1729 |
|
1730 |
|
1731 | Object.defineProperty(exports, "__esModule", {
|
1732 | value: true
|
1733 | });
|
1734 | exports.Vimeo = undefined;
|
1735 |
|
1736 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1737 |
|
1738 | 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; }; }();
|
1739 |
|
1740 | var _react = __webpack_require__(0);
|
1741 |
|
1742 | var _react2 = _interopRequireDefault(_react);
|
1743 |
|
1744 | var _utils = __webpack_require__(1);
|
1745 |
|
1746 | var _singlePlayer = __webpack_require__(2);
|
1747 |
|
1748 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
1749 |
|
1750 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
1751 |
|
1752 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1753 |
|
1754 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1755 |
|
1756 | 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; }
|
1757 |
|
1758 | var SDK_URL = 'https://player.vimeo.com/api/player.js';
|
1759 | var SDK_GLOBAL = 'Vimeo';
|
1760 | var MATCH_URL = /vimeo\.com\/.+/;
|
1761 | var MATCH_FILE_URL = /vimeo\.com\/external\/.+\.mp4/;
|
1762 |
|
1763 | var Vimeo = exports.Vimeo = function (_Component) {
|
1764 | _inherits(Vimeo, _Component);
|
1765 |
|
1766 | function Vimeo() {
|
1767 | var _ref;
|
1768 |
|
1769 | var _temp, _this, _ret;
|
1770 |
|
1771 | _classCallCheck(this, Vimeo);
|
1772 |
|
1773 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1774 | args[_key] = arguments[_key];
|
1775 | }
|
1776 |
|
1777 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Vimeo.__proto__ || Object.getPrototypeOf(Vimeo)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.mute = function () {
|
1778 | _this.setVolume(0);
|
1779 | }, _this.unmute = function () {
|
1780 | if (_this.props.volume !== null) {
|
1781 | _this.setVolume(_this.props.volume);
|
1782 | }
|
1783 | }, _this.ref = function (container) {
|
1784 | _this.container = container;
|
1785 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1786 | }
|
1787 |
|
1788 | _createClass(Vimeo, [{
|
1789 | key: 'load',
|
1790 | value: function load(url) {
|
1791 | var _this2 = this;
|
1792 |
|
1793 | this.duration = null;
|
1794 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {
|
1795 | if (!_this2.container) return;
|
1796 | _this2.player = new Vimeo.Player(_this2.container, _extends({}, _this2.props.config.vimeo.playerOptions, {
|
1797 | url: url,
|
1798 | autoplay: _this2.props.playing,
|
1799 | muted: _this2.props.muted,
|
1800 | loop: _this2.props.loop,
|
1801 | playsinline: _this2.props.playsinline
|
1802 | }));
|
1803 | _this2.player.ready().then(function () {
|
1804 | var iframe = _this2.container.querySelector('iframe');
|
1805 | iframe.style.width = '100%';
|
1806 | iframe.style.height = '100%';
|
1807 | })['catch'](_this2.props.onError);
|
1808 | _this2.player.on('loaded', function () {
|
1809 | _this2.props.onReady();
|
1810 | _this2.refreshDuration();
|
1811 | });
|
1812 | _this2.player.on('play', function () {
|
1813 | _this2.props.onPlay();
|
1814 | _this2.refreshDuration();
|
1815 | });
|
1816 | _this2.player.on('pause', _this2.props.onPause);
|
1817 | _this2.player.on('seeked', function (e) {
|
1818 | return _this2.props.onSeek(e.seconds);
|
1819 | });
|
1820 | _this2.player.on('ended', _this2.props.onEnded);
|
1821 | _this2.player.on('error', _this2.props.onError);
|
1822 | _this2.player.on('timeupdate', function (_ref2) {
|
1823 | var seconds = _ref2.seconds;
|
1824 |
|
1825 | _this2.currentTime = seconds;
|
1826 | });
|
1827 | _this2.player.on('progress', function (_ref3) {
|
1828 | var seconds = _ref3.seconds;
|
1829 |
|
1830 | _this2.secondsLoaded = seconds;
|
1831 | });
|
1832 | }, this.props.onError);
|
1833 | }
|
1834 | }, {
|
1835 | key: 'refreshDuration',
|
1836 | value: function refreshDuration() {
|
1837 | var _this3 = this;
|
1838 |
|
1839 | this.player.getDuration().then(function (duration) {
|
1840 | _this3.duration = duration;
|
1841 | });
|
1842 | }
|
1843 | }, {
|
1844 | key: 'play',
|
1845 | value: function play() {
|
1846 | this.callPlayer('play');
|
1847 | }
|
1848 | }, {
|
1849 | key: 'pause',
|
1850 | value: function pause() {
|
1851 | this.callPlayer('pause');
|
1852 | }
|
1853 | }, {
|
1854 | key: 'stop',
|
1855 | value: function stop() {
|
1856 | this.callPlayer('unload');
|
1857 | }
|
1858 | }, {
|
1859 | key: 'seekTo',
|
1860 | value: function seekTo(seconds) {
|
1861 | this.callPlayer('setCurrentTime', seconds);
|
1862 | }
|
1863 | }, {
|
1864 | key: 'setVolume',
|
1865 | value: function setVolume(fraction) {
|
1866 | this.callPlayer('setVolume', fraction);
|
1867 | }
|
1868 | }, {
|
1869 | key: 'setLoop',
|
1870 | value: function setLoop(loop) {
|
1871 | this.callPlayer('setLoop', loop);
|
1872 | }
|
1873 | }, {
|
1874 | key: 'getDuration',
|
1875 | value: function getDuration() {
|
1876 | return this.duration;
|
1877 | }
|
1878 | }, {
|
1879 | key: 'getCurrentTime',
|
1880 | value: function getCurrentTime() {
|
1881 | return this.currentTime;
|
1882 | }
|
1883 | }, {
|
1884 | key: 'getSecondsLoaded',
|
1885 | value: function getSecondsLoaded() {
|
1886 | return this.secondsLoaded;
|
1887 | }
|
1888 | }, {
|
1889 | key: 'render',
|
1890 | value: function render() {
|
1891 | var style = _extends({
|
1892 | width: '100%',
|
1893 | height: '100%',
|
1894 | overflow: 'hidden',
|
1895 | backgroundColor: 'black'
|
1896 | }, this.props.style);
|
1897 | return _react2['default'].createElement('div', {
|
1898 | key: this.props.url,
|
1899 | ref: this.ref,
|
1900 | style: style
|
1901 | });
|
1902 | }
|
1903 | }]);
|
1904 |
|
1905 | return Vimeo;
|
1906 | }(_react.Component);
|
1907 |
|
1908 | Vimeo.displayName = 'Vimeo';
|
1909 |
|
1910 | Vimeo.canPlay = function (url) {
|
1911 | if (MATCH_FILE_URL.test(url)) {
|
1912 | return false;
|
1913 | }
|
1914 | return MATCH_URL.test(url);
|
1915 | };
|
1916 |
|
1917 | exports['default'] = (0, _singlePlayer2['default'])(Vimeo);
|
1918 |
|
1919 | }),
|
1920 |
|
1921 | (function(module, exports, __webpack_require__) {
|
1922 |
|
1923 | "use strict";
|
1924 |
|
1925 |
|
1926 | Object.defineProperty(exports, "__esModule", {
|
1927 | value: true
|
1928 | });
|
1929 | exports.DailyMotion = undefined;
|
1930 |
|
1931 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1932 |
|
1933 | var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
1934 |
|
1935 | 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; }; }();
|
1936 |
|
1937 | var _react = __webpack_require__(0);
|
1938 |
|
1939 | var _react2 = _interopRequireDefault(_react);
|
1940 |
|
1941 | var _utils = __webpack_require__(1);
|
1942 |
|
1943 | var _singlePlayer = __webpack_require__(2);
|
1944 |
|
1945 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
1946 |
|
1947 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
1948 |
|
1949 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1950 |
|
1951 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1952 |
|
1953 | 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; }
|
1954 |
|
1955 | var SDK_URL = 'https://api.dmcdn.net/all.js';
|
1956 | var SDK_GLOBAL = 'DM';
|
1957 | var SDK_GLOBAL_READY = 'dmAsyncInit';
|
1958 | var MATCH_URL = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/;
|
1959 |
|
1960 | var DailyMotion = exports.DailyMotion = function (_Component) {
|
1961 | _inherits(DailyMotion, _Component);
|
1962 |
|
1963 | function DailyMotion() {
|
1964 | var _ref;
|
1965 |
|
1966 | var _temp, _this, _ret;
|
1967 |
|
1968 | _classCallCheck(this, DailyMotion);
|
1969 |
|
1970 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1971 | args[_key] = arguments[_key];
|
1972 | }
|
1973 |
|
1974 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DailyMotion.__proto__ || Object.getPrototypeOf(DailyMotion)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.onDurationChange = function () {
|
1975 | var duration = _this.getDuration();
|
1976 | _this.props.onDuration(duration);
|
1977 | }, _this.mute = function () {
|
1978 | _this.callPlayer('setMuted', true);
|
1979 | }, _this.unmute = function () {
|
1980 | _this.callPlayer('setMuted', false);
|
1981 | }, _this.ref = function (container) {
|
1982 | _this.container = container;
|
1983 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1984 | }
|
1985 |
|
1986 | _createClass(DailyMotion, [{
|
1987 | key: 'load',
|
1988 | value: function load(url) {
|
1989 | var _this2 = this;
|
1990 |
|
1991 | var _props = this.props,
|
1992 | controls = _props.controls,
|
1993 | config = _props.config,
|
1994 | onError = _props.onError,
|
1995 | playing = _props.playing;
|
1996 |
|
1997 | var _url$match = url.match(MATCH_URL),
|
1998 | _url$match2 = _slicedToArray(_url$match, 2),
|
1999 | id = _url$match2[1];
|
2000 |
|
2001 | if (this.player) {
|
2002 | this.player.load(id, {
|
2003 | start: (0, _utils.parseStartTime)(url),
|
2004 | autoplay: playing
|
2005 | });
|
2006 | return;
|
2007 | }
|
2008 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {
|
2009 | return DM.player;
|
2010 | }).then(function (DM) {
|
2011 | if (!_this2.container) return;
|
2012 | var Player = DM.player;
|
2013 | _this2.player = new Player(_this2.container, {
|
2014 | width: '100%',
|
2015 | height: '100%',
|
2016 | video: id,
|
2017 | params: _extends({
|
2018 | controls: controls,
|
2019 | autoplay: _this2.props.playing,
|
2020 | mute: _this2.props.muted,
|
2021 | start: (0, _utils.parseStartTime)(url),
|
2022 | origin: window.location.origin
|
2023 | }, config.dailymotion.params),
|
2024 | events: {
|
2025 | apiready: _this2.props.onReady,
|
2026 | seeked: function seeked() {
|
2027 | return _this2.props.onSeek(_this2.player.currentTime);
|
2028 | },
|
2029 | video_end: _this2.props.onEnded,
|
2030 | durationchange: _this2.onDurationChange,
|
2031 | pause: _this2.props.onPause,
|
2032 | playing: _this2.props.onPlay,
|
2033 | waiting: _this2.props.onBuffer,
|
2034 | error: function error(event) {
|
2035 | return onError(event);
|
2036 | }
|
2037 | }
|
2038 | });
|
2039 | }, onError);
|
2040 | }
|
2041 | }, {
|
2042 | key: 'play',
|
2043 | value: function play() {
|
2044 | this.callPlayer('play');
|
2045 | }
|
2046 | }, {
|
2047 | key: 'pause',
|
2048 | value: function pause() {
|
2049 | this.callPlayer('pause');
|
2050 | }
|
2051 | }, {
|
2052 | key: 'stop',
|
2053 | value: function stop() {
|
2054 |
|
2055 | }
|
2056 | }, {
|
2057 | key: 'seekTo',
|
2058 | value: function seekTo(seconds) {
|
2059 | this.callPlayer('seek', seconds);
|
2060 | }
|
2061 | }, {
|
2062 | key: 'setVolume',
|
2063 | value: function setVolume(fraction) {
|
2064 | this.callPlayer('setVolume', fraction);
|
2065 | }
|
2066 | }, {
|
2067 | key: 'getDuration',
|
2068 | value: function getDuration() {
|
2069 | return this.player.duration || null;
|
2070 | }
|
2071 | }, {
|
2072 | key: 'getCurrentTime',
|
2073 | value: function getCurrentTime() {
|
2074 | return this.player.currentTime;
|
2075 | }
|
2076 | }, {
|
2077 | key: 'getSecondsLoaded',
|
2078 | value: function getSecondsLoaded() {
|
2079 | return this.player.bufferedTime;
|
2080 | }
|
2081 | }, {
|
2082 | key: 'render',
|
2083 | value: function render() {
|
2084 | var style = _extends({
|
2085 | width: '100%',
|
2086 | height: '100%',
|
2087 | backgroundColor: 'black'
|
2088 | }, this.props.style);
|
2089 | return _react2['default'].createElement(
|
2090 | 'div',
|
2091 | { style: style },
|
2092 | _react2['default'].createElement('div', { ref: this.ref })
|
2093 | );
|
2094 | }
|
2095 | }]);
|
2096 |
|
2097 | return DailyMotion;
|
2098 | }(_react.Component);
|
2099 |
|
2100 | DailyMotion.displayName = 'DailyMotion';
|
2101 |
|
2102 | DailyMotion.canPlay = function (url) {
|
2103 | return MATCH_URL.test(url);
|
2104 | };
|
2105 |
|
2106 | DailyMotion.loopOnEnded = true;
|
2107 | exports['default'] = (0, _singlePlayer2['default'])(DailyMotion);
|
2108 |
|
2109 | }),
|
2110 |
|
2111 | (function(module, exports, __webpack_require__) {
|
2112 |
|
2113 | "use strict";
|
2114 |
|
2115 |
|
2116 | Object.defineProperty(exports, "__esModule", {
|
2117 | value: true
|
2118 | });
|
2119 | exports.FilePlayer = undefined;
|
2120 |
|
2121 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
2122 |
|
2123 | 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; }; }();
|
2124 |
|
2125 | var _react = __webpack_require__(0);
|
2126 |
|
2127 | var _react2 = _interopRequireDefault(_react);
|
2128 |
|
2129 | var _utils = __webpack_require__(1);
|
2130 |
|
2131 | var _singlePlayer = __webpack_require__(2);
|
2132 |
|
2133 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
2134 |
|
2135 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
2136 |
|
2137 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2138 |
|
2139 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
2140 |
|
2141 | 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; }
|
2142 |
|
2143 | var IOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
2144 | var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
|
2145 | var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i;
|
2146 | var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
|
2147 | var HLS_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/hls.js/VERSION/hls.min.js';
|
2148 | var HLS_GLOBAL = 'Hls';
|
2149 | var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
|
2150 | var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js';
|
2151 | var DASH_GLOBAL = 'dashjs';
|
2152 | var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/;
|
2153 |
|
2154 | function canPlay(url) {
|
2155 | if (url instanceof Array) {
|
2156 | var _iteratorNormalCompletion = true;
|
2157 | var _didIteratorError = false;
|
2158 | var _iteratorError = undefined;
|
2159 |
|
2160 | try {
|
2161 | for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
2162 | var item = _step.value;
|
2163 |
|
2164 | if (typeof item === 'string' && canPlay(item)) {
|
2165 | return true;
|
2166 | }
|
2167 | if (canPlay(item.src)) {
|
2168 | return true;
|
2169 | }
|
2170 | }
|
2171 | } catch (err) {
|
2172 | _didIteratorError = true;
|
2173 | _iteratorError = err;
|
2174 | } finally {
|
2175 | try {
|
2176 | if (!_iteratorNormalCompletion && _iterator['return']) {
|
2177 | _iterator['return']();
|
2178 | }
|
2179 | } finally {
|
2180 | if (_didIteratorError) {
|
2181 | throw _iteratorError;
|
2182 | }
|
2183 | }
|
2184 | }
|
2185 |
|
2186 | return false;
|
2187 | }
|
2188 | if ((0, _utils.isMediaStream)(url)) {
|
2189 | return true;
|
2190 | }
|
2191 | return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);
|
2192 | }
|
2193 |
|
2194 | function canEnablePIP(url) {
|
2195 | return canPlay(url) && !!document.pictureInPictureEnabled && !AUDIO_EXTENSIONS.test(url);
|
2196 | }
|
2197 |
|
2198 | var FilePlayer = exports.FilePlayer = function (_Component) {
|
2199 | _inherits(FilePlayer, _Component);
|
2200 |
|
2201 | function FilePlayer() {
|
2202 | var _ref;
|
2203 |
|
2204 | var _temp, _this, _ret;
|
2205 |
|
2206 | _classCallCheck(this, FilePlayer);
|
2207 |
|
2208 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
2209 | args[_key] = arguments[_key];
|
2210 | }
|
2211 |
|
2212 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FilePlayer.__proto__ || Object.getPrototypeOf(FilePlayer)).call.apply(_ref, [this].concat(args))), _this), _this.onDisablePIP = function (e) {
|
2213 | var _this$props = _this.props,
|
2214 | onDisablePIP = _this$props.onDisablePIP,
|
2215 | playing = _this$props.playing;
|
2216 |
|
2217 | onDisablePIP(e);
|
2218 | if (playing) {
|
2219 | _this.play();
|
2220 | }
|
2221 | }, _this.onSeek = function (e) {
|
2222 | _this.props.onSeek(e.target.currentTime);
|
2223 | }, _this.mute = function () {
|
2224 | _this.player.muted = true;
|
2225 | }, _this.unmute = function () {
|
2226 | _this.player.muted = false;
|
2227 | }, _this.renderSourceElement = function (source, index) {
|
2228 | if (typeof source === 'string') {
|
2229 | return _react2['default'].createElement('source', { key: index, src: source });
|
2230 | }
|
2231 | return _react2['default'].createElement('source', _extends({ key: index }, source));
|
2232 | }, _this.renderTrack = function (track, index) {
|
2233 | return _react2['default'].createElement('track', _extends({ key: index }, track));
|
2234 | }, _this.ref = function (player) {
|
2235 | _this.player = player;
|
2236 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
2237 | }
|
2238 |
|
2239 | _createClass(FilePlayer, [{
|
2240 | key: 'componentDidMount',
|
2241 | value: function componentDidMount() {
|
2242 | this.addListeners();
|
2243 | if (IOS) {
|
2244 | this.player.load();
|
2245 | }
|
2246 | }
|
2247 | }, {
|
2248 | key: 'componentWillReceiveProps',
|
2249 | value: function componentWillReceiveProps(nextProps) {
|
2250 | if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(nextProps)) {
|
2251 | this.removeListeners();
|
2252 | }
|
2253 | }
|
2254 | }, {
|
2255 | key: 'componentDidUpdate',
|
2256 | value: function componentDidUpdate(prevProps) {
|
2257 | if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {
|
2258 | this.addListeners();
|
2259 | }
|
2260 | }
|
2261 | }, {
|
2262 | key: 'componentWillUnmount',
|
2263 | value: function componentWillUnmount() {
|
2264 | this.removeListeners();
|
2265 | }
|
2266 | }, {
|
2267 | key: 'addListeners',
|
2268 | value: function addListeners() {
|
2269 | var _props = this.props,
|
2270 | onReady = _props.onReady,
|
2271 | onPlay = _props.onPlay,
|
2272 | onBuffer = _props.onBuffer,
|
2273 | onBufferEnd = _props.onBufferEnd,
|
2274 | onPause = _props.onPause,
|
2275 | onEnded = _props.onEnded,
|
2276 | onError = _props.onError,
|
2277 | playsinline = _props.playsinline,
|
2278 | onEnablePIP = _props.onEnablePIP,
|
2279 | onVolumeChange = _props.onVolumeChange,
|
2280 | videoElementId = _props.videoElementId;
|
2281 |
|
2282 | this.player.addEventListener('canplay', onReady);
|
2283 | this.player.addEventListener('play', onPlay);
|
2284 | this.player.addEventListener('waiting', onBuffer);
|
2285 | this.player.addEventListener('playing', onBufferEnd);
|
2286 | this.player.addEventListener('pause', onPause);
|
2287 | this.player.addEventListener('seeked', this.onSeek);
|
2288 | this.player.addEventListener('ended', onEnded);
|
2289 | this.player.addEventListener('error', onError);
|
2290 | this.player.addEventListener('volumeChange', onVolumeChange);
|
2291 | this.player.setAttribute('id', videoElementId);
|
2292 | this.player.addEventListener('enterpictureinpicture', onEnablePIP);
|
2293 | this.player.addEventListener('leavepictureinpicture', this.onDisablePIP);
|
2294 | if (playsinline) {
|
2295 | this.player.setAttribute('playsinline', '');
|
2296 | this.player.setAttribute('webkit-playsinline', '');
|
2297 | this.player.setAttribute('x5-playsinline', '');
|
2298 | }
|
2299 | }
|
2300 | }, {
|
2301 | key: 'removeListeners',
|
2302 | value: function removeListeners() {
|
2303 | var _props2 = this.props,
|
2304 | onReady = _props2.onReady,
|
2305 | onPlay = _props2.onPlay,
|
2306 | onBuffer = _props2.onBuffer,
|
2307 | onBufferEnd = _props2.onBufferEnd,
|
2308 | onPause = _props2.onPause,
|
2309 | onEnded = _props2.onEnded,
|
2310 | onError = _props2.onError,
|
2311 | onEnablePIP = _props2.onEnablePIP,
|
2312 | onVolumeChange = _props2.onVolumeChange;
|
2313 |
|
2314 | this.player.removeEventListener('canplay', onReady);
|
2315 | this.player.removeEventListener('play', onPlay);
|
2316 | this.player.removeEventListener('waiting', onBuffer);
|
2317 | this.player.removeEventListener('playing', onBufferEnd);
|
2318 | this.player.removeEventListener('pause', onPause);
|
2319 | this.player.removeEventListener('seeked', this.onSeek);
|
2320 | this.player.removeEventListener('ended', onEnded);
|
2321 | this.player.removeEventListener('error', onError);
|
2322 | this.player.removeEventListener('volumeChange', onVolumeChange);
|
2323 | this.player.removeEventListener('enterpictureinpicture', onEnablePIP);
|
2324 | this.player.removeEventListener('leavepictureinpicture', this.onDisablePIP);
|
2325 | }
|
2326 | }, {
|
2327 | key: 'shouldUseAudio',
|
2328 | value: function shouldUseAudio(props) {
|
2329 | if (props.config.file.forceVideo) {
|
2330 | return false;
|
2331 | }
|
2332 | if (props.config.file.attributes.poster) {
|
2333 | return false;
|
2334 | }
|
2335 | return AUDIO_EXTENSIONS.test(props.url) || props.config.file.forceAudio;
|
2336 | }
|
2337 | }, {
|
2338 | key: 'shouldUseHLS',
|
2339 | value: function shouldUseHLS(url) {
|
2340 | return HLS_EXTENSIONS.test(url) && !IOS || this.props.config.file.forceHLS;
|
2341 | }
|
2342 | }, {
|
2343 | key: 'shouldUseDASH',
|
2344 | value: function shouldUseDASH(url) {
|
2345 | return DASH_EXTENSIONS.test(url) || this.props.config.file.forceDASH;
|
2346 | }
|
2347 | }, {
|
2348 | key: 'load',
|
2349 | value: function load(url) {
|
2350 | var _this2 = this;
|
2351 |
|
2352 | var _props$config$file = this.props.config.file,
|
2353 | hlsVersion = _props$config$file.hlsVersion,
|
2354 | dashVersion = _props$config$file.dashVersion;
|
2355 |
|
2356 | if (this.shouldUseHLS(url)) {
|
2357 | (0, _utils.getSDK)(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(function (Hls) {
|
2358 | _this2.hls = new Hls(_this2.props.config.file.hlsOptions);
|
2359 | _this2.hls.on(Hls.Events.ERROR, function (e, data) {
|
2360 | _this2.props.onError(e, data, _this2.hls, Hls);
|
2361 | });
|
2362 | _this2.hls.loadSource(url);
|
2363 | _this2.hls.attachMedia(_this2.player);
|
2364 | });
|
2365 | }
|
2366 | if (this.shouldUseDASH(url)) {
|
2367 | (0, _utils.getSDK)(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(function (dashjs) {
|
2368 | _this2.dash = dashjs.MediaPlayer().create();
|
2369 | _this2.dash.initialize(_this2.player, url, _this2.props.playing);
|
2370 | _this2.dash.getDebug().setLogToBrowserConsole(false);
|
2371 | });
|
2372 | }
|
2373 |
|
2374 | if (url instanceof Array) {
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 | this.player.load();
|
2380 | } else if ((0, _utils.isMediaStream)(url)) {
|
2381 | try {
|
2382 | this.player.srcObject = url;
|
2383 | } catch (e) {
|
2384 | this.player.src = window.URL.createObjectURL(url);
|
2385 | }
|
2386 | }
|
2387 | }
|
2388 | }, {
|
2389 | key: 'play',
|
2390 | value: function play() {
|
2391 | var promise = this.player.play();
|
2392 | if (promise) {
|
2393 | promise['catch'](this.props.onError);
|
2394 | }
|
2395 | }
|
2396 | }, {
|
2397 | key: 'pause',
|
2398 | value: function pause() {
|
2399 | this.player.pause();
|
2400 | }
|
2401 | }, {
|
2402 | key: 'stop',
|
2403 | value: function stop() {
|
2404 | this.player.removeAttribute('src');
|
2405 | if (this.hls) {
|
2406 | this.hls.destroy();
|
2407 | }
|
2408 | if (this.dash) {
|
2409 | this.dash.reset();
|
2410 | }
|
2411 | }
|
2412 | }, {
|
2413 | key: 'seekTo',
|
2414 | value: function seekTo(seconds) {
|
2415 | this.player.currentTime = seconds;
|
2416 | }
|
2417 | }, {
|
2418 | key: 'setVolume',
|
2419 | value: function setVolume(fraction) {
|
2420 | this.player.volume = fraction;
|
2421 | }
|
2422 | }, {
|
2423 | key: 'enablePIP',
|
2424 | value: function enablePIP() {
|
2425 | if (this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player) {
|
2426 | this.player.requestPictureInPicture();
|
2427 | }
|
2428 | }
|
2429 | }, {
|
2430 | key: 'disablePIP',
|
2431 | value: function disablePIP() {
|
2432 | if (document.exitPictureInPicture && document.pictureInPictureElement === this.player) {
|
2433 | document.exitPictureInPicture();
|
2434 | }
|
2435 | }
|
2436 | }, {
|
2437 | key: 'setPlaybackRate',
|
2438 | value: function setPlaybackRate(rate) {
|
2439 | this.player.playbackRate = rate;
|
2440 | }
|
2441 | }, {
|
2442 | key: 'getDuration',
|
2443 | value: function getDuration() {
|
2444 | if (!this.player) return null;
|
2445 | var _player = this.player,
|
2446 | duration = _player.duration,
|
2447 | seekable = _player.seekable;
|
2448 |
|
2449 |
|
2450 |
|
2451 | if (duration === Infinity && seekable.length > 0) {
|
2452 | return seekable.end(seekable.length - 1);
|
2453 | }
|
2454 | return duration;
|
2455 | }
|
2456 | }, {
|
2457 | key: 'getCurrentTime',
|
2458 | value: function getCurrentTime() {
|
2459 | if (!this.player) return null;
|
2460 | return this.player.currentTime;
|
2461 | }
|
2462 | }, {
|
2463 | key: 'getSecondsLoaded',
|
2464 | value: function getSecondsLoaded() {
|
2465 | if (!this.player) return null;
|
2466 | var buffered = this.player.buffered;
|
2467 |
|
2468 | if (buffered.length === 0) {
|
2469 | return 0;
|
2470 | }
|
2471 | var end = buffered.end(buffered.length - 1);
|
2472 | var duration = this.getDuration();
|
2473 | if (end > duration) {
|
2474 | return duration;
|
2475 | }
|
2476 | return end;
|
2477 | }
|
2478 | }, {
|
2479 | key: 'getSource',
|
2480 | value: function getSource(url) {
|
2481 | var useHLS = this.shouldUseHLS(url);
|
2482 | var useDASH = this.shouldUseDASH(url);
|
2483 | if (url instanceof Array || (0, _utils.isMediaStream)(url) || useHLS || useDASH) {
|
2484 | return undefined;
|
2485 | }
|
2486 | if (MATCH_DROPBOX_URL.test(url)) {
|
2487 | return url.replace('www.dropbox.com', 'dl.dropboxusercontent.com');
|
2488 | }
|
2489 | return url;
|
2490 | }
|
2491 | }, {
|
2492 | key: 'render',
|
2493 | value: function render() {
|
2494 | var _props3 = this.props,
|
2495 | url = _props3.url,
|
2496 | playing = _props3.playing,
|
2497 | loop = _props3.loop,
|
2498 | controls = _props3.controls,
|
2499 | muted = _props3.muted,
|
2500 | config = _props3.config,
|
2501 | width = _props3.width,
|
2502 | height = _props3.height;
|
2503 |
|
2504 | var useAudio = this.shouldUseAudio(this.props);
|
2505 | var Element = useAudio ? 'audio' : 'video';
|
2506 | var style = {
|
2507 | width: width === 'auto' ? width : '100%',
|
2508 | height: height === 'auto' ? height : '100%'
|
2509 | };
|
2510 | return _react2['default'].createElement(
|
2511 | Element,
|
2512 | _extends({
|
2513 | ref: this.ref,
|
2514 | src: this.getSource(url),
|
2515 | style: style,
|
2516 | preload: 'auto',
|
2517 | autoPlay: playing || undefined,
|
2518 | controls: controls,
|
2519 | muted: muted,
|
2520 | loop: loop
|
2521 | }, config.file.attributes),
|
2522 | url instanceof Array && url.map(this.renderSourceElement),
|
2523 | config.file.tracks.map(this.renderTrack)
|
2524 | );
|
2525 | }
|
2526 | }]);
|
2527 |
|
2528 | return FilePlayer;
|
2529 | }(_react.Component);
|
2530 |
|
2531 | FilePlayer.displayName = 'FilePlayer';
|
2532 | FilePlayer.canPlay = canPlay;
|
2533 | FilePlayer.canEnablePIP = canEnablePIP;
|
2534 | exports['default'] = (0, _singlePlayer2['default'])(FilePlayer);
|
2535 |
|
2536 | }),
|
2537 |
|
2538 | (function(module, exports, __webpack_require__) {
|
2539 |
|
2540 | "use strict";
|
2541 |
|
2542 |
|
2543 | Object.defineProperty(exports, "__esModule", {
|
2544 | value: true
|
2545 | });
|
2546 |
|
2547 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2548 |
|
2549 | var Creative = exports.Creative = function Creative() {
|
2550 | var creativeAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2551 |
|
2552 | _classCallCheck(this, Creative);
|
2553 |
|
2554 | this.id = creativeAttributes.id || null;
|
2555 | this.adId = creativeAttributes.adId || null;
|
2556 | this.sequence = creativeAttributes.sequence || null;
|
2557 | this.apiFramework = creativeAttributes.apiFramework || null;
|
2558 | this.trackingEvents = {};
|
2559 | };
|
2560 |
|
2561 | }),
|
2562 |
|
2563 | (function(module, exports, __webpack_require__) {
|
2564 |
|
2565 | "use strict";
|
2566 |
|
2567 |
|
2568 | Object.defineProperty(exports, "__esModule", {
|
2569 | value: true
|
2570 | });
|
2571 | function track(URLTemplates, variables, options) {
|
2572 | var URLs = resolveURLTemplates(URLTemplates, variables, options);
|
2573 |
|
2574 | URLs.forEach(function (URL) {
|
2575 | if (typeof window !== 'undefined' && window !== null) {
|
2576 | var i = new Image();
|
2577 | i.src = URL;
|
2578 | }
|
2579 | });
|
2580 | }
|
2581 |
|
2582 |
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 | function resolveURLTemplates(URLTemplates) {
|
2590 | var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2591 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
2592 |
|
2593 | var URLs = [];
|
2594 |
|
2595 |
|
2596 | if (variables['ASSETURI']) {
|
2597 | variables['ASSETURI'] = encodeURIComponentRFC3986(variables['ASSETURI']);
|
2598 | }
|
2599 | if (variables['CONTENTPLAYHEAD']) {
|
2600 | variables['CONTENTPLAYHEAD'] = encodeURIComponentRFC3986(variables['CONTENTPLAYHEAD']);
|
2601 | }
|
2602 |
|
2603 |
|
2604 | if (variables['ERRORCODE'] && !options.isCustomCode && !/^[0-9]{3}$/.test(variables['ERRORCODE'])) {
|
2605 | variables['ERRORCODE'] = 900;
|
2606 | }
|
2607 |
|
2608 |
|
2609 | variables['CACHEBUSTING'] = leftpad(Math.round(Math.random() * 1.0e8).toString());
|
2610 | variables['TIMESTAMP'] = encodeURIComponentRFC3986(new Date().toISOString());
|
2611 |
|
2612 |
|
2613 | variables['RANDOM'] = variables['random'] = variables['CACHEBUSTING'];
|
2614 |
|
2615 | for (var URLTemplateKey in URLTemplates) {
|
2616 | var resolveURL = URLTemplates[URLTemplateKey];
|
2617 |
|
2618 | if (typeof resolveURL !== 'string') {
|
2619 | continue;
|
2620 | }
|
2621 |
|
2622 | for (var key in variables) {
|
2623 | var value = variables[key];
|
2624 | var macro1 = '[' + key + ']';
|
2625 | var macro2 = '%%' + key + '%%';
|
2626 | resolveURL = resolveURL.replace(macro1, value);
|
2627 | resolveURL = resolveURL.replace(macro2, value);
|
2628 | }
|
2629 | URLs.push(resolveURL);
|
2630 | }
|
2631 |
|
2632 | return URLs;
|
2633 | }
|
2634 |
|
2635 |
|
2636 | function encodeURIComponentRFC3986(str) {
|
2637 | return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
2638 | return '%' + c.charCodeAt(0).toString(16);
|
2639 | });
|
2640 | }
|
2641 |
|
2642 | function leftpad(str) {
|
2643 | if (str.length < 8) {
|
2644 | return range(0, 8 - str.length, false).map(function () {
|
2645 | return '0';
|
2646 | }).join('') + str;
|
2647 | }
|
2648 | return str;
|
2649 | }
|
2650 |
|
2651 | function range(left, right, inclusive) {
|
2652 | var result = [];
|
2653 | var ascending = left < right;
|
2654 | var end = !inclusive ? right : ascending ? right + 1 : right - 1;
|
2655 |
|
2656 | for (var i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {
|
2657 | result.push(i);
|
2658 | }
|
2659 | return result;
|
2660 | }
|
2661 |
|
2662 | function isNumeric(n) {
|
2663 | return !isNaN(parseFloat(n)) && isFinite(n);
|
2664 | }
|
2665 |
|
2666 | function flatten(arr) {
|
2667 | return arr.reduce(function (flat, toFlatten) {
|
2668 | return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten);
|
2669 | }, []);
|
2670 | }
|
2671 |
|
2672 | var util = exports.util = {
|
2673 | track: track,
|
2674 | resolveURLTemplates: resolveURLTemplates,
|
2675 | encodeURIComponentRFC3986: encodeURIComponentRFC3986,
|
2676 | leftpad: leftpad,
|
2677 | range: range,
|
2678 | isNumeric: isNumeric,
|
2679 | flatten: flatten
|
2680 | };
|
2681 |
|
2682 | }),
|
2683 |
|
2684 | (function(module, exports, __webpack_require__) {
|
2685 |
|
2686 | "use strict";
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 |
|
2696 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
2697 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
2698 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
2699 |
|
2700 | function toObject(val) {
|
2701 | if (val === null || val === undefined) {
|
2702 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
2703 | }
|
2704 |
|
2705 | return Object(val);
|
2706 | }
|
2707 |
|
2708 | function shouldUseNative() {
|
2709 | try {
|
2710 | if (!Object.assign) {
|
2711 | return false;
|
2712 | }
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 | var test1 = new String('abc');
|
2718 | test1[5] = 'de';
|
2719 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
2720 | return false;
|
2721 | }
|
2722 |
|
2723 |
|
2724 | var test2 = {};
|
2725 | for (var i = 0; i < 10; i++) {
|
2726 | test2['_' + String.fromCharCode(i)] = i;
|
2727 | }
|
2728 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
2729 | return test2[n];
|
2730 | });
|
2731 | if (order2.join('') !== '0123456789') {
|
2732 | return false;
|
2733 | }
|
2734 |
|
2735 |
|
2736 | var test3 = {};
|
2737 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
2738 | test3[letter] = letter;
|
2739 | });
|
2740 | if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
2741 | return false;
|
2742 | }
|
2743 |
|
2744 | return true;
|
2745 | } catch (err) {
|
2746 |
|
2747 | return false;
|
2748 | }
|
2749 | }
|
2750 |
|
2751 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
2752 | var from;
|
2753 | var to = toObject(target);
|
2754 | var symbols;
|
2755 |
|
2756 | for (var s = 1; s < arguments.length; s++) {
|
2757 | from = Object(arguments[s]);
|
2758 |
|
2759 | for (var key in from) {
|
2760 | if (hasOwnProperty.call(from, key)) {
|
2761 | to[key] = from[key];
|
2762 | }
|
2763 | }
|
2764 |
|
2765 | if (getOwnPropertySymbols) {
|
2766 | symbols = getOwnPropertySymbols(from);
|
2767 | for (var i = 0; i < symbols.length; i++) {
|
2768 | if (propIsEnumerable.call(from, symbols[i])) {
|
2769 | to[symbols[i]] = from[symbols[i]];
|
2770 | }
|
2771 | }
|
2772 | }
|
2773 | }
|
2774 |
|
2775 | return to;
|
2776 | };
|
2777 |
|
2778 | }),
|
2779 |
|
2780 | (function(module, exports, __webpack_require__) {
|
2781 |
|
2782 | "use strict";
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 | var emptyObject = {};
|
2794 |
|
2795 | if (false) {
|
2796 | Object.freeze(emptyObject);
|
2797 | }
|
2798 |
|
2799 | module.exports = emptyObject;
|
2800 |
|
2801 | }),
|
2802 |
|
2803 | (function(module, exports, __webpack_require__) {
|
2804 |
|
2805 | "use strict";
|
2806 |
|
2807 |
|
2808 | Object.defineProperty(exports, "__esModule", {
|
2809 | value: true
|
2810 | });
|
2811 | exports.Facebook = undefined;
|
2812 |
|
2813 | 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; }; }();
|
2814 |
|
2815 | var _react = __webpack_require__(0);
|
2816 |
|
2817 | var _react2 = _interopRequireDefault(_react);
|
2818 |
|
2819 | var _utils = __webpack_require__(1);
|
2820 |
|
2821 | var _singlePlayer = __webpack_require__(2);
|
2822 |
|
2823 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
2824 |
|
2825 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
2826 |
|
2827 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2828 |
|
2829 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
2830 |
|
2831 | 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; }
|
2832 |
|
2833 | var SDK_URL = '//connect.facebook.net/en_US/sdk.js';
|
2834 | var SDK_GLOBAL = 'FB';
|
2835 | var SDK_GLOBAL_READY = 'fbAsyncInit';
|
2836 | var MATCH_URL = /facebook\.com\/([^/?].+\/)?video(s|\.php)[/?].*$/;
|
2837 | var PLAYER_ID_PREFIX = 'facebook-player-';
|
2838 |
|
2839 | var Facebook = exports.Facebook = function (_Component) {
|
2840 | _inherits(Facebook, _Component);
|
2841 |
|
2842 | function Facebook() {
|
2843 | var _ref;
|
2844 |
|
2845 | var _temp, _this, _ret;
|
2846 |
|
2847 | _classCallCheck(this, Facebook);
|
2848 |
|
2849 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
2850 | args[_key] = arguments[_key];
|
2851 | }
|
2852 |
|
2853 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Facebook.__proto__ || Object.getPrototypeOf(Facebook)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.mute = function () {
|
2854 | _this.callPlayer('mute');
|
2855 | }, _this.unmute = function () {
|
2856 | _this.callPlayer('unmute');
|
2857 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
2858 | }
|
2859 |
|
2860 | _createClass(Facebook, [{
|
2861 | key: 'load',
|
2862 | value: function load(url, isReady) {
|
2863 | var _this2 = this;
|
2864 |
|
2865 | if (isReady) {
|
2866 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
|
2867 | return FB.XFBML.parse();
|
2868 | });
|
2869 | return;
|
2870 | }
|
2871 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
|
2872 | FB.init({
|
2873 | appId: _this2.props.config.facebook.appId,
|
2874 | xfbml: true,
|
2875 | version: 'v2.5'
|
2876 | });
|
2877 | FB.Event.subscribe('xfbml.render', function (msg) {
|
2878 |
|
2879 |
|
2880 | _this2.props.onLoaded();
|
2881 | });
|
2882 | FB.Event.subscribe('xfbml.ready', function (msg) {
|
2883 | if (msg.type === 'video' && msg.id === _this2.playerID) {
|
2884 | _this2.player = msg.instance;
|
2885 | _this2.player.subscribe('startedPlaying', _this2.props.onPlay);
|
2886 | _this2.player.subscribe('paused', _this2.props.onPause);
|
2887 | _this2.player.subscribe('finishedPlaying', _this2.props.onEnded);
|
2888 | _this2.player.subscribe('startedBuffering', _this2.props.onBuffer);
|
2889 | _this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd);
|
2890 | _this2.player.subscribe('error', _this2.props.onError);
|
2891 | if (!_this2.props.muted) {
|
2892 |
|
2893 | _this2.callPlayer('unmute');
|
2894 | }
|
2895 | _this2.props.onReady();
|
2896 |
|
2897 |
|
2898 |
|
2899 | document.getElementById(_this2.playerID).querySelector('iframe').style.visibility = 'visible';
|
2900 | }
|
2901 | });
|
2902 | });
|
2903 | }
|
2904 | }, {
|
2905 | key: 'play',
|
2906 | value: function play() {
|
2907 | this.callPlayer('play');
|
2908 | }
|
2909 | }, {
|
2910 | key: 'pause',
|
2911 | value: function pause() {
|
2912 | this.callPlayer('pause');
|
2913 | }
|
2914 | }, {
|
2915 | key: 'stop',
|
2916 | value: function stop() {
|
2917 |
|
2918 | }
|
2919 | }, {
|
2920 | key: 'seekTo',
|
2921 | value: function seekTo(seconds) {
|
2922 | this.callPlayer('seek', seconds);
|
2923 | }
|
2924 | }, {
|
2925 | key: 'setVolume',
|
2926 | value: function setVolume(fraction) {
|
2927 | this.callPlayer('setVolume', fraction);
|
2928 | }
|
2929 | }, {
|
2930 | key: 'getDuration',
|
2931 | value: function getDuration() {
|
2932 | return this.callPlayer('getDuration');
|
2933 | }
|
2934 | }, {
|
2935 | key: 'getCurrentTime',
|
2936 | value: function getCurrentTime() {
|
2937 | return this.callPlayer('getCurrentPosition');
|
2938 | }
|
2939 | }, {
|
2940 | key: 'getSecondsLoaded',
|
2941 | value: function getSecondsLoaded() {
|
2942 | return null;
|
2943 | }
|
2944 | }, {
|
2945 | key: 'render',
|
2946 | value: function render() {
|
2947 | var style = {
|
2948 | width: '100%',
|
2949 | height: '100%',
|
2950 | backgroundColor: 'black'
|
2951 | };
|
2952 | return _react2['default'].createElement('div', {
|
2953 | style: style,
|
2954 | id: this.playerID,
|
2955 | className: 'fb-video',
|
2956 | 'data-href': this.props.url,
|
2957 | 'data-autoplay': this.props.playing ? 'true' : 'false',
|
2958 | 'data-allowfullscreen': 'true',
|
2959 | 'data-controls': this.props.controls ? 'true' : 'false'
|
2960 | });
|
2961 | }
|
2962 | }]);
|
2963 |
|
2964 | return Facebook;
|
2965 | }(_react.Component);
|
2966 |
|
2967 | Facebook.displayName = 'Facebook';
|
2968 |
|
2969 | Facebook.canPlay = function (url) {
|
2970 | return MATCH_URL.test(url);
|
2971 | };
|
2972 |
|
2973 | Facebook.loopOnEnded = true;
|
2974 | exports['default'] = (0, _singlePlayer2['default'])(Facebook);
|
2975 |
|
2976 | }),
|
2977 |
|
2978 | (function(module, exports, __webpack_require__) {
|
2979 |
|
2980 | "use strict";
|
2981 |
|
2982 |
|
2983 | Object.defineProperty(exports, "__esModule", {
|
2984 | value: true
|
2985 | });
|
2986 | exports.Streamable = undefined;
|
2987 |
|
2988 | 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; }; }();
|
2989 |
|
2990 | var _react = __webpack_require__(0);
|
2991 |
|
2992 | var _react2 = _interopRequireDefault(_react);
|
2993 |
|
2994 | var _utils = __webpack_require__(1);
|
2995 |
|
2996 | var _singlePlayer = __webpack_require__(2);
|
2997 |
|
2998 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
2999 |
|
3000 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3001 |
|
3002 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3003 |
|
3004 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3005 |
|
3006 | 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; }
|
3007 |
|
3008 | var SDK_URL = '//cdn.embed.ly/player-0.1.0.min.js';
|
3009 | var SDK_GLOBAL = 'playerjs';
|
3010 | var MATCH_URL = /streamable\.com\/([a-z0-9]+)$/;
|
3011 |
|
3012 | var Streamable = exports.Streamable = function (_Component) {
|
3013 | _inherits(Streamable, _Component);
|
3014 |
|
3015 | function Streamable() {
|
3016 | var _ref;
|
3017 |
|
3018 | var _temp, _this, _ret;
|
3019 |
|
3020 | _classCallCheck(this, Streamable);
|
3021 |
|
3022 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3023 | args[_key] = arguments[_key];
|
3024 | }
|
3025 |
|
3026 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Streamable.__proto__ || Object.getPrototypeOf(Streamable)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.mute = function () {
|
3027 | _this.callPlayer('mute');
|
3028 | }, _this.unmute = function () {
|
3029 | _this.callPlayer('unmute');
|
3030 | }, _this.ref = function (iframe) {
|
3031 | _this.iframe = iframe;
|
3032 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3033 | }
|
3034 |
|
3035 | _createClass(Streamable, [{
|
3036 | key: 'load',
|
3037 | value: function load(url) {
|
3038 | var _this2 = this;
|
3039 |
|
3040 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
|
3041 | if (!_this2.iframe) return;
|
3042 | _this2.player = new playerjs.Player(_this2.iframe);
|
3043 | _this2.player.setLoop(_this2.props.loop);
|
3044 | _this2.player.on('ready', _this2.props.onReady);
|
3045 | _this2.player.on('play', _this2.props.onPlay);
|
3046 | _this2.player.on('pause', _this2.props.onPause);
|
3047 | _this2.player.on('seeked', _this2.props.onSeek);
|
3048 | _this2.player.on('ended', _this2.props.onEnded);
|
3049 | _this2.player.on('error', _this2.props.onError);
|
3050 | _this2.player.on('timeupdate', function (_ref2) {
|
3051 | var duration = _ref2.duration,
|
3052 | seconds = _ref2.seconds;
|
3053 |
|
3054 | _this2.duration = duration;
|
3055 | _this2.currentTime = seconds;
|
3056 | });
|
3057 | _this2.player.on('buffered', function (_ref3) {
|
3058 | var percent = _ref3.percent;
|
3059 |
|
3060 | if (_this2.duration) {
|
3061 | _this2.secondsLoaded = _this2.duration * percent;
|
3062 | }
|
3063 | });
|
3064 | if (_this2.props.muted) {
|
3065 | _this2.player.mute();
|
3066 | }
|
3067 | }, this.props.onError);
|
3068 | }
|
3069 | }, {
|
3070 | key: 'play',
|
3071 | value: function play() {
|
3072 | this.callPlayer('play');
|
3073 | }
|
3074 | }, {
|
3075 | key: 'pause',
|
3076 | value: function pause() {
|
3077 | this.callPlayer('pause');
|
3078 | }
|
3079 | }, {
|
3080 | key: 'stop',
|
3081 | value: function stop() {
|
3082 |
|
3083 | }
|
3084 | }, {
|
3085 | key: 'seekTo',
|
3086 | value: function seekTo(seconds) {
|
3087 | this.callPlayer('setCurrentTime', seconds);
|
3088 | }
|
3089 | }, {
|
3090 | key: 'setVolume',
|
3091 | value: function setVolume(fraction) {
|
3092 | this.callPlayer('setVolume', fraction * 100);
|
3093 | }
|
3094 | }, {
|
3095 | key: 'setLoop',
|
3096 | value: function setLoop(loop) {
|
3097 | this.callPlayer('setLoop', loop);
|
3098 | }
|
3099 | }, {
|
3100 | key: 'getDuration',
|
3101 | value: function getDuration() {
|
3102 | return this.duration;
|
3103 | }
|
3104 | }, {
|
3105 | key: 'getCurrentTime',
|
3106 | value: function getCurrentTime() {
|
3107 | return this.currentTime;
|
3108 | }
|
3109 | }, {
|
3110 | key: 'getSecondsLoaded',
|
3111 | value: function getSecondsLoaded() {
|
3112 | return this.secondsLoaded;
|
3113 | }
|
3114 | }, {
|
3115 | key: 'render',
|
3116 | value: function render() {
|
3117 | var id = this.props.url.match(MATCH_URL)[1];
|
3118 | var style = {
|
3119 | width: '100%',
|
3120 | height: '100%'
|
3121 | };
|
3122 | return _react2['default'].createElement('iframe', {
|
3123 | ref: this.ref,
|
3124 | src: 'https://streamable.com/o/' + id,
|
3125 | frameBorder: '0',
|
3126 | scrolling: 'no',
|
3127 | style: style,
|
3128 | allowFullScreen: true
|
3129 | });
|
3130 | }
|
3131 | }]);
|
3132 |
|
3133 | return Streamable;
|
3134 | }(_react.Component);
|
3135 |
|
3136 | Streamable.displayName = 'Streamable';
|
3137 |
|
3138 | Streamable.canPlay = function (url) {
|
3139 | return MATCH_URL.test(url);
|
3140 | };
|
3141 |
|
3142 | exports['default'] = (0, _singlePlayer2['default'])(Streamable);
|
3143 |
|
3144 | }),
|
3145 |
|
3146 | (function(module, exports, __webpack_require__) {
|
3147 |
|
3148 | "use strict";
|
3149 |
|
3150 |
|
3151 | Object.defineProperty(exports, "__esModule", {
|
3152 | value: true
|
3153 | });
|
3154 | exports.FaceMask = undefined;
|
3155 |
|
3156 | 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; }; }();
|
3157 |
|
3158 | var _react = __webpack_require__(0);
|
3159 |
|
3160 | var _react2 = _interopRequireDefault(_react);
|
3161 |
|
3162 | var _utils = __webpack_require__(1);
|
3163 |
|
3164 | var _singlePlayer = __webpack_require__(2);
|
3165 |
|
3166 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
3167 |
|
3168 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3169 |
|
3170 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3171 |
|
3172 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3173 |
|
3174 | 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; }
|
3175 |
|
3176 | var SDK_URL = 'https://www.nfl.com/libs/playaction/api.js';
|
3177 | var SDK_GLOBAL = 'nfl';
|
3178 | var MATCH_FILE_URL = /nflent-vh\.akamaihd\.net\/.+\.m3u8/;
|
3179 | var PLAYER_ID_PREFIX = 'facemask-player-';
|
3180 |
|
3181 | var FaceMask = exports.FaceMask = function (_Component) {
|
3182 | _inherits(FaceMask, _Component);
|
3183 |
|
3184 | function FaceMask() {
|
3185 | var _ref;
|
3186 |
|
3187 | var _temp, _this, _ret;
|
3188 |
|
3189 | _classCallCheck(this, FaceMask);
|
3190 |
|
3191 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3192 | args[_key] = arguments[_key];
|
3193 | }
|
3194 |
|
3195 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FaceMask.__proto__ || Object.getPrototypeOf(FaceMask)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.volume = null, _this.currentTime = null, _this.secondsLoaded = null, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.ref = function (container) {
|
3196 | _this.container = container;
|
3197 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3198 | }
|
3199 |
|
3200 | _createClass(FaceMask, [{
|
3201 | key: 'load',
|
3202 | value: function load(url) {
|
3203 | var _this2 = this;
|
3204 |
|
3205 | this.duration = null;
|
3206 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (nfl) {
|
3207 | if (!_this2.container) return;
|
3208 |
|
3209 | _this2.player = new nfl.playaction({
|
3210 | containerId: _this2.playerID,
|
3211 | initialVideo: { url: url },
|
3212 | height: '100%',
|
3213 | width: '100%'
|
3214 | });
|
3215 | var _nfl$playaction$EVENT = nfl.playaction.EVENTS,
|
3216 | PLAYER_READY = _nfl$playaction$EVENT.PLAYER_READY,
|
3217 | STATUS = _nfl$playaction$EVENT.STATUS,
|
3218 | TIME_UPDATE = _nfl$playaction$EVENT.TIME_UPDATE,
|
3219 | VOLUME = _nfl$playaction$EVENT.VOLUME;
|
3220 | var _nfl$playaction$STATU = nfl.playaction.STATUS,
|
3221 | COMPLETE = _nfl$playaction$STATU.COMPLETE,
|
3222 | ERROR = _nfl$playaction$STATU.ERROR,
|
3223 | PAUSED = _nfl$playaction$STATU.PAUSED,
|
3224 | PLAYING = _nfl$playaction$STATU.PLAYING;
|
3225 |
|
3226 | _this2.player.on(PLAYER_READY, _this2.props.onReady);
|
3227 | _this2.player.on(VOLUME, _this2.props.onVolumeChange);
|
3228 | _this2.player.on(STATUS, function (e) {
|
3229 | switch (e.status) {
|
3230 | case COMPLETE:
|
3231 | {
|
3232 | _this2.props.onEnded();
|
3233 | break;
|
3234 | }
|
3235 | case ERROR:
|
3236 | {
|
3237 | _this2.props.onError(e);
|
3238 | break;
|
3239 | }
|
3240 | case PAUSED:
|
3241 | {
|
3242 | _this2.props.onPause();
|
3243 | break;
|
3244 | }
|
3245 | case PLAYING:
|
3246 | {
|
3247 | _this2.props.onPlay();
|
3248 | break;
|
3249 | }
|
3250 | }
|
3251 | });
|
3252 | _this2.player.on(TIME_UPDATE, function (_ref2) {
|
3253 | var currentTime = _ref2.currentTime,
|
3254 | duration = _ref2.duration;
|
3255 |
|
3256 | _this2.currentTime = currentTime;
|
3257 | _this2.duration = duration || Infinity;
|
3258 | });
|
3259 | }, this.props.onError);
|
3260 | }
|
3261 | }, {
|
3262 | key: 'play',
|
3263 | value: function play() {
|
3264 | this.callPlayer('play');
|
3265 | }
|
3266 | }, {
|
3267 | key: 'pause',
|
3268 | value: function pause() {
|
3269 | this.callPlayer('pause');
|
3270 | }
|
3271 | }, {
|
3272 | key: 'stop',
|
3273 | value: function stop() {
|
3274 | this.callPlayer('destroy');
|
3275 | }
|
3276 | }, {
|
3277 | key: 'seekTo',
|
3278 | value: function seekTo(seconds) {
|
3279 | this.callPlayer('seek', seconds);
|
3280 | }
|
3281 | }, {
|
3282 | key: 'setVolume',
|
3283 | value: function setVolume(fraction) {
|
3284 |
|
3285 | }
|
3286 | }, {
|
3287 | key: 'mute',
|
3288 | value: function mute() {
|
3289 | this.callPlayer('mute');
|
3290 | }
|
3291 | }, {
|
3292 | key: 'unmute',
|
3293 | value: function unmute() {
|
3294 | this.callPlayer('unmute');
|
3295 | }
|
3296 | }, {
|
3297 | key: 'getDuration',
|
3298 | value: function getDuration() {
|
3299 | return this.duration;
|
3300 | }
|
3301 | }, {
|
3302 | key: 'getCurrentTime',
|
3303 | value: function getCurrentTime() {
|
3304 | return this.currentTime;
|
3305 | }
|
3306 | }, {
|
3307 | key: 'getSecondsLoaded',
|
3308 | value: function getSecondsLoaded() {
|
3309 | return this.secondsLoaded;
|
3310 | }
|
3311 | }, {
|
3312 | key: 'render',
|
3313 | value: function render() {
|
3314 | var style = {
|
3315 | width: '100%',
|
3316 | height: '100%'
|
3317 | };
|
3318 | return _react2['default'].createElement('div', {
|
3319 | id: this.playerID,
|
3320 | ref: this.ref,
|
3321 | style: style
|
3322 | });
|
3323 | }
|
3324 | }]);
|
3325 |
|
3326 | return FaceMask;
|
3327 | }(_react.Component);
|
3328 |
|
3329 | FaceMask.displayName = 'FaceMask';
|
3330 |
|
3331 | FaceMask.canPlay = function (url) {
|
3332 | return MATCH_FILE_URL.test(url);
|
3333 | };
|
3334 |
|
3335 | exports['default'] = (0, _singlePlayer2['default'])(FaceMask);
|
3336 |
|
3337 | }),
|
3338 |
|
3339 | (function(module, exports, __webpack_require__) {
|
3340 |
|
3341 | "use strict";
|
3342 |
|
3343 |
|
3344 | Object.defineProperty(exports, "__esModule", {
|
3345 | value: true
|
3346 | });
|
3347 | exports.Wistia = undefined;
|
3348 |
|
3349 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
3350 |
|
3351 | 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; }; }();
|
3352 |
|
3353 | var _react = __webpack_require__(0);
|
3354 |
|
3355 | var _react2 = _interopRequireDefault(_react);
|
3356 |
|
3357 | var _utils = __webpack_require__(1);
|
3358 |
|
3359 | var _singlePlayer = __webpack_require__(2);
|
3360 |
|
3361 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
3362 |
|
3363 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3364 |
|
3365 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3366 |
|
3367 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3368 |
|
3369 | 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; }
|
3370 |
|
3371 | var SDK_URL = '//fast.wistia.com/assets/external/E-v1.js';
|
3372 | var SDK_GLOBAL = 'Wistia';
|
3373 | var MATCH_URL = /(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/;
|
3374 |
|
3375 | var Wistia = exports.Wistia = function (_Component) {
|
3376 | _inherits(Wistia, _Component);
|
3377 |
|
3378 | function Wistia() {
|
3379 | var _ref;
|
3380 |
|
3381 | var _temp, _this, _ret;
|
3382 |
|
3383 | _classCallCheck(this, Wistia);
|
3384 |
|
3385 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3386 | args[_key] = arguments[_key];
|
3387 | }
|
3388 |
|
3389 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Wistia.__proto__ || Object.getPrototypeOf(Wistia)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.mute = function () {
|
3390 | _this.callPlayer('mute');
|
3391 | }, _this.unmute = function () {
|
3392 | _this.callPlayer('unmute');
|
3393 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3394 | }
|
3395 |
|
3396 | _createClass(Wistia, [{
|
3397 | key: 'getID',
|
3398 | value: function getID(url) {
|
3399 | return url && url.match(MATCH_URL)[1];
|
3400 | }
|
3401 | }, {
|
3402 | key: 'load',
|
3403 | value: function load(url) {
|
3404 | var _this2 = this;
|
3405 |
|
3406 | var _props = this.props,
|
3407 | playing = _props.playing,
|
3408 | muted = _props.muted,
|
3409 | controls = _props.controls,
|
3410 | _onReady = _props.onReady,
|
3411 | onPlay = _props.onPlay,
|
3412 | onPause = _props.onPause,
|
3413 | onSeek = _props.onSeek,
|
3414 | onEnded = _props.onEnded,
|
3415 | config = _props.config,
|
3416 | onError = _props.onError;
|
3417 |
|
3418 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function () {
|
3419 | window._wq = window._wq || [];
|
3420 | window._wq.push({
|
3421 | id: _this2.getID(url),
|
3422 | options: _extends({
|
3423 | autoPlay: playing,
|
3424 | silentAutoPlay: 'allow',
|
3425 | muted: muted,
|
3426 | controlsVisibleOnLoad: controls
|
3427 | }, config.wistia.options),
|
3428 | onReady: function onReady(player) {
|
3429 | _this2.player = player;
|
3430 | _this2.unbind();
|
3431 | _this2.player.bind('play', onPlay);
|
3432 | _this2.player.bind('pause', onPause);
|
3433 | _this2.player.bind('seek', onSeek);
|
3434 | _this2.player.bind('end', onEnded);
|
3435 | _onReady();
|
3436 | }
|
3437 | });
|
3438 | }, onError);
|
3439 | }
|
3440 | }, {
|
3441 | key: 'play',
|
3442 | value: function play() {
|
3443 | this.callPlayer('play');
|
3444 | }
|
3445 | }, {
|
3446 | key: 'pause',
|
3447 | value: function pause() {
|
3448 | this.callPlayer('pause');
|
3449 | }
|
3450 | }, {
|
3451 | key: 'unbind',
|
3452 | value: function unbind() {
|
3453 | var _props2 = this.props,
|
3454 | onPlay = _props2.onPlay,
|
3455 | onPause = _props2.onPause,
|
3456 | onSeek = _props2.onSeek,
|
3457 | onEnded = _props2.onEnded;
|
3458 |
|
3459 | this.player.unbind('play', onPlay);
|
3460 | this.player.unbind('pause', onPause);
|
3461 | this.player.unbind('seek', onSeek);
|
3462 | this.player.unbind('end', onEnded);
|
3463 | }
|
3464 | }, {
|
3465 | key: 'stop',
|
3466 | value: function stop() {
|
3467 | this.unbind();
|
3468 | this.callPlayer('remove');
|
3469 | }
|
3470 | }, {
|
3471 | key: 'seekTo',
|
3472 | value: function seekTo(seconds) {
|
3473 | this.callPlayer('time', seconds);
|
3474 | }
|
3475 | }, {
|
3476 | key: 'setVolume',
|
3477 | value: function setVolume(fraction) {
|
3478 | this.callPlayer('volume', fraction);
|
3479 | }
|
3480 | }, {
|
3481 | key: 'setPlaybackRate',
|
3482 | value: function setPlaybackRate(rate) {
|
3483 | this.callPlayer('playbackRate', rate);
|
3484 | }
|
3485 | }, {
|
3486 | key: 'getDuration',
|
3487 | value: function getDuration() {
|
3488 | return this.callPlayer('duration');
|
3489 | }
|
3490 | }, {
|
3491 | key: 'getCurrentTime',
|
3492 | value: function getCurrentTime() {
|
3493 | return this.callPlayer('time');
|
3494 | }
|
3495 | }, {
|
3496 | key: 'getSecondsLoaded',
|
3497 | value: function getSecondsLoaded() {
|
3498 | return null;
|
3499 | }
|
3500 | }, {
|
3501 | key: 'render',
|
3502 | value: function render() {
|
3503 | var id = this.getID(this.props.url);
|
3504 | var className = 'wistia_embed wistia_async_' + id;
|
3505 | var style = {
|
3506 | width: '100%',
|
3507 | height: '100%'
|
3508 | };
|
3509 | return _react2['default'].createElement('div', { key: id, className: className, style: style });
|
3510 | }
|
3511 | }]);
|
3512 |
|
3513 | return Wistia;
|
3514 | }(_react.Component);
|
3515 |
|
3516 | Wistia.displayName = 'Wistia';
|
3517 |
|
3518 | Wistia.canPlay = function (url) {
|
3519 | return MATCH_URL.test(url);
|
3520 | };
|
3521 |
|
3522 | Wistia.loopOnEnded = true;
|
3523 | exports['default'] = (0, _singlePlayer2['default'])(Wistia);
|
3524 |
|
3525 | }),
|
3526 |
|
3527 | (function(module, exports, __webpack_require__) {
|
3528 |
|
3529 | "use strict";
|
3530 |
|
3531 |
|
3532 | Object.defineProperty(exports, "__esModule", {
|
3533 | value: true
|
3534 | });
|
3535 | exports.Twitch = undefined;
|
3536 |
|
3537 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
3538 |
|
3539 | 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; }; }();
|
3540 |
|
3541 | var _react = __webpack_require__(0);
|
3542 |
|
3543 | var _react2 = _interopRequireDefault(_react);
|
3544 |
|
3545 | var _utils = __webpack_require__(1);
|
3546 |
|
3547 | var _singlePlayer = __webpack_require__(2);
|
3548 |
|
3549 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
3550 |
|
3551 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3552 |
|
3553 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3554 |
|
3555 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3556 |
|
3557 | 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; }
|
3558 |
|
3559 | var SDK_URL = 'https://player.twitch.tv/js/embed/v1.js';
|
3560 | var SDK_GLOBAL = 'Twitch';
|
3561 | var MATCH_VIDEO_URL = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
|
3562 | var MATCH_CHANNEL_URL = /(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/;
|
3563 | var PLAYER_ID_PREFIX = 'twitch-player-';
|
3564 |
|
3565 | var Twitch = exports.Twitch = function (_Component) {
|
3566 | _inherits(Twitch, _Component);
|
3567 |
|
3568 | function Twitch() {
|
3569 | var _ref;
|
3570 |
|
3571 | var _temp, _this, _ret;
|
3572 |
|
3573 | _classCallCheck(this, Twitch);
|
3574 |
|
3575 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3576 | args[_key] = arguments[_key];
|
3577 | }
|
3578 |
|
3579 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Twitch.__proto__ || Object.getPrototypeOf(Twitch)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.mute = function () {
|
3580 | _this.callPlayer('setMuted', true);
|
3581 | }, _this.unmute = function () {
|
3582 | _this.callPlayer('setMuted', false);
|
3583 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3584 | }
|
3585 |
|
3586 | _createClass(Twitch, [{
|
3587 | key: 'load',
|
3588 | value: function load(url, isReady) {
|
3589 | var _this2 = this;
|
3590 |
|
3591 | var _props = this.props,
|
3592 | playsinline = _props.playsinline,
|
3593 | onError = _props.onError,
|
3594 | config = _props.config;
|
3595 |
|
3596 | var isChannel = MATCH_CHANNEL_URL.test(url);
|
3597 | var id = isChannel ? url.match(MATCH_CHANNEL_URL)[1] : url.match(MATCH_VIDEO_URL)[1];
|
3598 | if (isReady) {
|
3599 | if (isChannel) {
|
3600 | this.player.setChannel(id);
|
3601 | } else {
|
3602 | this.player.setVideo('v' + id);
|
3603 | }
|
3604 | return;
|
3605 | }
|
3606 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {
|
3607 | _this2.player = new Twitch.Player(_this2.playerID, _extends({
|
3608 | video: isChannel ? '' : id,
|
3609 | channel: isChannel ? id : '',
|
3610 | height: '100%',
|
3611 | width: '100%',
|
3612 | playsinline: playsinline,
|
3613 | autoplay: _this2.props.playing,
|
3614 | muted: _this2.props.muted
|
3615 | }, config.twitch.options));
|
3616 | var _Twitch$Player = Twitch.Player,
|
3617 | READY = _Twitch$Player.READY,
|
3618 | PLAYING = _Twitch$Player.PLAYING,
|
3619 | PAUSE = _Twitch$Player.PAUSE,
|
3620 | ENDED = _Twitch$Player.ENDED;
|
3621 |
|
3622 | _this2.player.addEventListener(READY, _this2.props.onReady);
|
3623 | _this2.player.addEventListener(PLAYING, _this2.props.onPlay);
|
3624 | _this2.player.addEventListener(PAUSE, _this2.props.onPause);
|
3625 | _this2.player.addEventListener(ENDED, _this2.props.onEnded);
|
3626 | }, onError);
|
3627 | }
|
3628 | }, {
|
3629 | key: 'play',
|
3630 | value: function play() {
|
3631 | this.callPlayer('play');
|
3632 | }
|
3633 | }, {
|
3634 | key: 'pause',
|
3635 | value: function pause() {
|
3636 | this.callPlayer('pause');
|
3637 | }
|
3638 | }, {
|
3639 | key: 'stop',
|
3640 | value: function stop() {
|
3641 | this.callPlayer('pause');
|
3642 | }
|
3643 | }, {
|
3644 | key: 'seekTo',
|
3645 | value: function seekTo(seconds) {
|
3646 | this.callPlayer('seek', seconds);
|
3647 | }
|
3648 | }, {
|
3649 | key: 'getVolume',
|
3650 | value: function getVolume() {
|
3651 | return this.callPlayer('getVolume');
|
3652 | }
|
3653 | }, {
|
3654 | key: 'getMuted',
|
3655 | value: function getMuted() {
|
3656 | return this.callPlayer('getMuted');
|
3657 | }
|
3658 | }, {
|
3659 | key: 'setVolume',
|
3660 | value: function setVolume(fraction) {
|
3661 | this.callPlayer('setVolume', fraction);
|
3662 | }
|
3663 | }, {
|
3664 | key: 'getDuration',
|
3665 | value: function getDuration() {
|
3666 | return this.callPlayer('getDuration');
|
3667 | }
|
3668 | }, {
|
3669 | key: 'getCurrentTime',
|
3670 | value: function getCurrentTime() {
|
3671 | return this.callPlayer('getCurrentTime');
|
3672 | }
|
3673 | }, {
|
3674 | key: 'getSecondsLoaded',
|
3675 | value: function getSecondsLoaded() {
|
3676 | return null;
|
3677 | }
|
3678 | }, {
|
3679 | key: 'render',
|
3680 | value: function render() {
|
3681 | var style = {
|
3682 | width: '100%',
|
3683 | height: '100%'
|
3684 | };
|
3685 | return _react2['default'].createElement('div', { style: style, id: this.playerID });
|
3686 | }
|
3687 | }]);
|
3688 |
|
3689 | return Twitch;
|
3690 | }(_react.Component);
|
3691 |
|
3692 | Twitch.displayName = 'Twitch';
|
3693 |
|
3694 | Twitch.canPlay = function (url) {
|
3695 | return MATCH_VIDEO_URL.test(url) || MATCH_CHANNEL_URL.test(url);
|
3696 | };
|
3697 |
|
3698 | Twitch.loopOnEnded = true;
|
3699 | exports['default'] = (0, _singlePlayer2['default'])(Twitch);
|
3700 |
|
3701 | }),
|
3702 |
|
3703 | (function(module, exports, __webpack_require__) {
|
3704 |
|
3705 | "use strict";
|
3706 |
|
3707 |
|
3708 | Object.defineProperty(exports, "__esModule", {
|
3709 | value: true
|
3710 | });
|
3711 | exports.UstreamLive = undefined;
|
3712 |
|
3713 | 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; }; }();
|
3714 |
|
3715 | var _react = __webpack_require__(0);
|
3716 |
|
3717 | var _react2 = _interopRequireDefault(_react);
|
3718 |
|
3719 | var _utils = __webpack_require__(1);
|
3720 |
|
3721 | var _singlePlayer = __webpack_require__(2);
|
3722 |
|
3723 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
3724 |
|
3725 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3726 |
|
3727 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3728 |
|
3729 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3730 |
|
3731 | 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; }
|
3732 |
|
3733 | var SDK_URL = 'https://developers.ustream.tv/js/ustream-embedapi.min.js';
|
3734 | var SDK_GLOBAL = 'UstreamEmbed';
|
3735 | var MATCH_URL = /(ustream.tv\/channel\/)([^#&?/]*)/;
|
3736 | var PLAYER_ID_PREFIX = 'UstreamLive-player-';
|
3737 |
|
3738 | var UstreamLive = exports.UstreamLive = function (_Component) {
|
3739 | _inherits(UstreamLive, _Component);
|
3740 |
|
3741 | function UstreamLive() {
|
3742 | var _ref;
|
3743 |
|
3744 | var _temp, _this, _ret;
|
3745 |
|
3746 | _classCallCheck(this, UstreamLive);
|
3747 |
|
3748 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3749 | args[_key] = arguments[_key];
|
3750 | }
|
3751 |
|
3752 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = UstreamLive.__proto__ || Object.getPrototypeOf(UstreamLive)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
3753 | ustreamSrc: null
|
3754 | }, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.callPlayer = _utils.callPlayer, _this.mute = function () {}, _this.unmute = function () {}, _this.ref = function (container) {
|
3755 | _this.container = container;
|
3756 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3757 | }
|
3758 |
|
3759 | _createClass(UstreamLive, [{
|
3760 | key: 'parseId',
|
3761 | value: function parseId(url) {
|
3762 | var m = url.match(MATCH_URL);
|
3763 | return m[2];
|
3764 | }
|
3765 | }, {
|
3766 | key: 'componentDidUpdate',
|
3767 | value: function componentDidUpdate(prevProps) {
|
3768 |
|
3769 | if (prevProps.url && prevProps.url !== this.props.url) {
|
3770 | this.setState({
|
3771 | ustreamSrc: null
|
3772 | });
|
3773 | }
|
3774 | }
|
3775 | }, {
|
3776 | key: 'load',
|
3777 | value: function load() {
|
3778 | var _this2 = this;
|
3779 |
|
3780 | var _props = this.props,
|
3781 | onEnded = _props.onEnded,
|
3782 | onError = _props.onError,
|
3783 | onPause = _props.onPause,
|
3784 | onPlay = _props.onPlay,
|
3785 | onReady = _props.onReady,
|
3786 | playing = _props.playing,
|
3787 | url = _props.url;
|
3788 |
|
3789 | var channelId = this.parseId(url);
|
3790 | this.setState({
|
3791 | ustreamSrc: 'https://www.ustream.tv/embed/' + channelId + '?html5ui=1&autoplay=' + playing + '&controls=false&showtitle=false'
|
3792 | });
|
3793 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (UstreamEmbed) {
|
3794 | if (!_this2.container) return;
|
3795 | _this2.currentTime = 0;
|
3796 | _this2.player = UstreamEmbed(_this2.playerID);
|
3797 | _this2.player.addListener('playing', function (type, playing) {
|
3798 | if (playing) {
|
3799 | _this2.playTime = Date.now();
|
3800 | onPlay();
|
3801 | } else {
|
3802 | _this2.currentTime = _this2.getCurrentTime();
|
3803 | _this2.playTime = null;
|
3804 | onPause();
|
3805 | }
|
3806 | });
|
3807 | _this2.player.addListener('live', onReady);
|
3808 | _this2.player.addListener('offline', onReady);
|
3809 | _this2.player.addListener('finished', onEnded);
|
3810 | _this2.player.getProperty('duration', function (duration) {
|
3811 | _this2.player.duration = duration || Infinity;
|
3812 | });
|
3813 | }, onError);
|
3814 | }
|
3815 |
|
3816 |
|
3817 |
|
3818 |
|
3819 | }, {
|
3820 | key: 'play',
|
3821 | value: function play() {
|
3822 | this.callPlayer('callMethod', 'play');
|
3823 | }
|
3824 | }, {
|
3825 | key: 'pause',
|
3826 | value: function pause() {
|
3827 | this.callPlayer('callMethod', 'pause');
|
3828 | }
|
3829 | }, {
|
3830 | key: 'stop',
|
3831 | value: function stop() {
|
3832 | this.callPlayer('callMethod', 'stop');
|
3833 | }
|
3834 | }, {
|
3835 | key: 'seekTo',
|
3836 | value: function seekTo(seconds) {
|
3837 | this.callPlayer('callMethod', 'seek', seconds);
|
3838 | }
|
3839 | }, {
|
3840 | key: 'setVolume',
|
3841 | value: function setVolume(fraction) {
|
3842 | this.callPlayer('callMethod', 'volume', fraction * 100);
|
3843 | }
|
3844 | }, {
|
3845 | key: 'getDuration',
|
3846 | value: function getDuration() {
|
3847 | return Infinity;
|
3848 | }
|
3849 | }, {
|
3850 | key: 'getCurrentTime',
|
3851 | value: function getCurrentTime() {
|
3852 | var playing = 0;
|
3853 | if (this.playTime) {
|
3854 | playing = (Date.now() - this.playTime) / 1000;
|
3855 | }
|
3856 | return this.currentTime + playing;
|
3857 | }
|
3858 | }, {
|
3859 | key: 'getSecondsLoaded',
|
3860 | value: function getSecondsLoaded() {
|
3861 | return null;
|
3862 | }
|
3863 | }, {
|
3864 | key: 'render',
|
3865 | value: function render() {
|
3866 | var style = {
|
3867 | width: '100%',
|
3868 | height: '100%'
|
3869 | };
|
3870 |
|
3871 | var ustreamSrc = this.state.ustreamSrc;
|
3872 |
|
3873 | return ustreamSrc && _react2['default'].createElement('iframe', {
|
3874 | id: this.playerID,
|
3875 | ref: this.ref,
|
3876 | src: ustreamSrc,
|
3877 | frameBorder: '0',
|
3878 | scrolling: 'no',
|
3879 | style: style,
|
3880 | allowFullScreen: true
|
3881 | });
|
3882 | }
|
3883 | }]);
|
3884 |
|
3885 | return UstreamLive;
|
3886 | }(_react.Component);
|
3887 |
|
3888 | UstreamLive.displayName = 'UstreamLive';
|
3889 |
|
3890 | UstreamLive.canPlay = function (url) {
|
3891 | return MATCH_URL.test(url);
|
3892 | };
|
3893 |
|
3894 | UstreamLive.loopOnEnded = false;
|
3895 | exports['default'] = (0, _singlePlayer2['default'])(UstreamLive);
|
3896 |
|
3897 | }),
|
3898 |
|
3899 | (function(module, exports, __webpack_require__) {
|
3900 |
|
3901 | "use strict";
|
3902 |
|
3903 |
|
3904 | Object.defineProperty(exports, "__esModule", {
|
3905 | value: true
|
3906 | });
|
3907 | exports.UstreamVideo = undefined;
|
3908 |
|
3909 | 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; }; }();
|
3910 |
|
3911 | var _react = __webpack_require__(0);
|
3912 |
|
3913 | var _react2 = _interopRequireDefault(_react);
|
3914 |
|
3915 | var _utils = __webpack_require__(1);
|
3916 |
|
3917 | var _singlePlayer = __webpack_require__(2);
|
3918 |
|
3919 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
3920 |
|
3921 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
3922 |
|
3923 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3924 |
|
3925 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3926 |
|
3927 | 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; }
|
3928 |
|
3929 | var SDK_URL = 'https://developers.ustream.tv/js/ustream-embedapi.min.js';
|
3930 | var SDK_GLOBAL = 'UstreamEmbed';
|
3931 | var MATCH_URL = /(ustream.tv\/recorded\/)([^#&?/]*)/;
|
3932 | var PLAYER_ID_PREFIX = 'UstreamVideo-player-';
|
3933 |
|
3934 | var UstreamVideo = exports.UstreamVideo = function (_Component) {
|
3935 | _inherits(UstreamVideo, _Component);
|
3936 |
|
3937 | function UstreamVideo() {
|
3938 | var _ref;
|
3939 |
|
3940 | var _temp, _this, _ret;
|
3941 |
|
3942 | _classCallCheck(this, UstreamVideo);
|
3943 |
|
3944 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
3945 | args[_key] = arguments[_key];
|
3946 | }
|
3947 |
|
3948 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = UstreamVideo.__proto__ || Object.getPrototypeOf(UstreamVideo)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
3949 | ustreamSrc: null
|
3950 | }, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.callPlayer = _utils.callPlayer, _this.mute = function () {}, _this.unmute = function () {}, _this.ref = function (container) {
|
3951 | _this.container = container;
|
3952 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
3953 | }
|
3954 |
|
3955 | _createClass(UstreamVideo, [{
|
3956 | key: 'parseId',
|
3957 | value: function parseId(url) {
|
3958 | var m = url.match(MATCH_URL);
|
3959 | return m[2];
|
3960 | }
|
3961 | }, {
|
3962 | key: 'componentDidUpdate',
|
3963 | value: function componentDidUpdate(prevProps) {
|
3964 |
|
3965 | if (prevProps.url && prevProps.url !== this.props.url) {
|
3966 | this.setState({
|
3967 | ustreamSrc: null
|
3968 | });
|
3969 | }
|
3970 | }
|
3971 | }, {
|
3972 | key: 'componentWillUnmount',
|
3973 | value: function componentWillUnmount() {
|
3974 |
|
3975 | if (this.currentTimeInterval) {
|
3976 | clearInterval(this.currentTimeInterval);
|
3977 | }
|
3978 | }
|
3979 |
|
3980 |
|
3981 |
|
3982 |
|
3983 |
|
3984 |
|
3985 | }, {
|
3986 | key: 'initInterval',
|
3987 | value: function initInterval() {
|
3988 | var _this2 = this;
|
3989 |
|
3990 | if (this.currentTimeInterval) {
|
3991 | return;
|
3992 | }
|
3993 | this.currentTimeInterval = setInterval(function () {
|
3994 | if (_this2.player) {
|
3995 | _this2.player.getProperty('progress', function (progress) {
|
3996 | _this2.player.currentTime = progress;
|
3997 | });
|
3998 | _this2.player.getProperty('duration', function (duration) {
|
3999 | _this2.player.duration = duration;
|
4000 | });
|
4001 | }
|
4002 | }, 500);
|
4003 | }
|
4004 | }, {
|
4005 | key: 'load',
|
4006 | value: function load() {
|
4007 | var _this3 = this;
|
4008 |
|
4009 | var _props = this.props,
|
4010 | onEnded = _props.onEnded,
|
4011 | onError = _props.onError,
|
4012 | onPause = _props.onPause,
|
4013 | onPlay = _props.onPlay,
|
4014 | onReady = _props.onReady,
|
4015 | playing = _props.playing,
|
4016 | url = _props.url;
|
4017 |
|
4018 | var videoId = this.parseId(url);
|
4019 | this.setState({
|
4020 | ustreamSrc: 'https://www.ustream.tv/embed/recorded/' + videoId + '?html5ui=1&autoplay=' + playing + '&controls=false&showtitle=false'
|
4021 | });
|
4022 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (UstreamEmbed) {
|
4023 | if (!_this3.container) return;
|
4024 | _this3.player = UstreamEmbed(_this3.playerID);
|
4025 | _this3.player.addListener('playing', function (type, playing) {
|
4026 | playing ? onPlay() : onPause();
|
4027 | });
|
4028 | _this3.player.addListener('ready', function () {
|
4029 | _this3.initInterval();
|
4030 | onReady();
|
4031 | });
|
4032 | _this3.player.addListener('finished', onEnded);
|
4033 | }, onError);
|
4034 | }
|
4035 |
|
4036 |
|
4037 |
|
4038 |
|
4039 | }, {
|
4040 | key: 'play',
|
4041 | value: function play() {
|
4042 | this.callPlayer('callMethod', 'play');
|
4043 | }
|
4044 | }, {
|
4045 | key: 'pause',
|
4046 | value: function pause() {
|
4047 | this.callPlayer('callMethod', 'pause');
|
4048 | }
|
4049 | }, {
|
4050 | key: 'stop',
|
4051 | value: function stop() {
|
4052 | this.callPlayer('callMethod', 'stop');
|
4053 | }
|
4054 | }, {
|
4055 | key: 'seekTo',
|
4056 | value: function seekTo(seconds) {
|
4057 | this.callPlayer('callMethod', 'seek', seconds);
|
4058 | }
|
4059 | }, {
|
4060 | key: 'setVolume',
|
4061 | value: function setVolume(fraction) {
|
4062 | this.callPlayer('callMethod', 'volume', fraction * 100);
|
4063 | }
|
4064 | }, {
|
4065 | key: 'getDuration',
|
4066 | value: function getDuration() {
|
4067 | return this.player.duration;
|
4068 | }
|
4069 | }, {
|
4070 | key: 'getCurrentTime',
|
4071 | value: function getCurrentTime() {
|
4072 | return this.player.currentTime;
|
4073 | }
|
4074 | }, {
|
4075 | key: 'getSecondsLoaded',
|
4076 | value: function getSecondsLoaded() {
|
4077 | return null;
|
4078 | }
|
4079 | }, {
|
4080 | key: 'render',
|
4081 | value: function render() {
|
4082 | var style = {
|
4083 | width: '100%',
|
4084 | height: '100%'
|
4085 | };
|
4086 |
|
4087 | var ustreamSrc = this.state.ustreamSrc;
|
4088 |
|
4089 | return ustreamSrc && _react2['default'].createElement('iframe', {
|
4090 | id: this.playerID,
|
4091 | ref: this.ref,
|
4092 | src: ustreamSrc,
|
4093 | frameBorder: '0',
|
4094 | scrolling: 'no',
|
4095 | style: style,
|
4096 | allowFullScreen: true
|
4097 | });
|
4098 | }
|
4099 | }]);
|
4100 |
|
4101 | return UstreamVideo;
|
4102 | }(_react.Component);
|
4103 |
|
4104 | UstreamVideo.displayName = 'UstreamVideo';
|
4105 |
|
4106 | UstreamVideo.canPlay = function (url) {
|
4107 | return MATCH_URL.test(url);
|
4108 | };
|
4109 |
|
4110 | UstreamVideo.loopOnEnded = false;
|
4111 | exports['default'] = (0, _singlePlayer2['default'])(UstreamVideo);
|
4112 |
|
4113 | }),
|
4114 |
|
4115 | (function(module, exports, __webpack_require__) {
|
4116 |
|
4117 | "use strict";
|
4118 |
|
4119 |
|
4120 | Object.defineProperty(exports, "__esModule", {
|
4121 | value: true
|
4122 | });
|
4123 | exports.Iframe = undefined;
|
4124 |
|
4125 | 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; }; }();
|
4126 |
|
4127 | var _react = __webpack_require__(0);
|
4128 |
|
4129 | var _react2 = _interopRequireDefault(_react);
|
4130 |
|
4131 | var _utils = __webpack_require__(1);
|
4132 |
|
4133 | var _singlePlayer = __webpack_require__(2);
|
4134 |
|
4135 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
4136 |
|
4137 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4138 |
|
4139 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4140 |
|
4141 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
4142 |
|
4143 | 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; }
|
4144 |
|
4145 | var PLAYER_ID_PREFIX = 'Iframe-player-';
|
4146 |
|
4147 | var Iframe = exports.Iframe = function (_Component) {
|
4148 | _inherits(Iframe, _Component);
|
4149 |
|
4150 | function Iframe() {
|
4151 | var _ref;
|
4152 |
|
4153 | var _temp, _this, _ret;
|
4154 |
|
4155 | _classCallCheck(this, Iframe);
|
4156 |
|
4157 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
4158 | args[_key] = arguments[_key];
|
4159 | }
|
4160 |
|
4161 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Iframe.__proto__ || Object.getPrototypeOf(Iframe)).call.apply(_ref, [this].concat(args))), _this), _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.player = {
|
4162 | currentTime: 0
|
4163 | }, _this.mute = function () {
|
4164 |
|
4165 | }, _this.unmute = function () {
|
4166 |
|
4167 | }, _this.ref = function (container) {
|
4168 | _this.container = container;
|
4169 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
4170 | }
|
4171 |
|
4172 | _createClass(Iframe, [{
|
4173 | key: 'load',
|
4174 | value: function load(url) {
|
4175 | var _this2 = this;
|
4176 |
|
4177 | if (!this.container) {
|
4178 | this.props.onReady();
|
4179 | } else {
|
4180 | setTimeout(function () {
|
4181 | return _this2.props.onReady();
|
4182 | }, 3000);
|
4183 | }
|
4184 | }
|
4185 | }, {
|
4186 | key: 'play',
|
4187 | value: function play() {
|
4188 | this.playTime = Date.now();
|
4189 | this.props.onPlay();
|
4190 | }
|
4191 | }, {
|
4192 | key: 'pause',
|
4193 | value: function pause() {
|
4194 | this.player.currentTime = this.getCurrentTime();
|
4195 | this.playTime = null;
|
4196 | this.props.onPause();
|
4197 | }
|
4198 | }, {
|
4199 | key: 'stop',
|
4200 | value: function stop() {
|
4201 | this.player.currentTime = this.getCurrentTime();
|
4202 | this.playTime = null;
|
4203 | this.props.onPause();
|
4204 | }
|
4205 | }, {
|
4206 | key: 'seekTo',
|
4207 | value: function seekTo(seconds) {
|
4208 |
|
4209 | }
|
4210 | }, {
|
4211 | key: 'setVolume',
|
4212 | value: function setVolume(fraction) {
|
4213 |
|
4214 | }
|
4215 | }, {
|
4216 | key: 'getDuration',
|
4217 | value: function getDuration() {
|
4218 | return Infinity;
|
4219 | }
|
4220 | }, {
|
4221 | key: 'getCurrentTime',
|
4222 | value: function getCurrentTime() {
|
4223 | var playing = 0;
|
4224 | if (this.playTime) {
|
4225 | playing = (Date.now() - this.playTime) / 1000;
|
4226 | }
|
4227 | return this.player.currentTime + playing;
|
4228 | }
|
4229 | }, {
|
4230 | key: 'getSecondsLoaded',
|
4231 | value: function getSecondsLoaded() {
|
4232 | return null;
|
4233 | }
|
4234 | }, {
|
4235 | key: 'render',
|
4236 | value: function render() {
|
4237 | var style = {
|
4238 | width: '100%',
|
4239 | height: '100%'
|
4240 | };
|
4241 | var _props = this.props,
|
4242 | url = _props.url,
|
4243 | playing = _props.playing;
|
4244 |
|
4245 | if (playing) {
|
4246 | return _react2['default'].createElement('iframe', {
|
4247 | id: this.playerID,
|
4248 | ref: this.ref,
|
4249 | src: playing && url,
|
4250 | frameBorder: '0',
|
4251 | scrolling: 'no',
|
4252 | style: style,
|
4253 | allowFullScreen: true
|
4254 | });
|
4255 | } else {
|
4256 |
|
4257 | return _react2['default'].createElement(
|
4258 | 'div',
|
4259 | { style: style },
|
4260 | _react2['default'].createElement(
|
4261 | 'div',
|
4262 | { style: {
|
4263 | alignItems: 'center',
|
4264 | background: 'rgba(255,255,255,0.3)',
|
4265 | display: 'flex',
|
4266 | height: '100%',
|
4267 | justifyContent: 'center',
|
4268 | width: '100%'
|
4269 | } },
|
4270 | _react2['default'].createElement('div', { className: 'pause', style: {
|
4271 | borderStyle: 'double',
|
4272 | borderWidth: '0px 0px 0px 50px',
|
4273 | color: 'gray',
|
4274 | height: '60px'
|
4275 | } })
|
4276 | )
|
4277 | );
|
4278 | }
|
4279 | }
|
4280 | }]);
|
4281 |
|
4282 | return Iframe;
|
4283 | }(_react.Component);
|
4284 |
|
4285 | Iframe.displayName = 'Iframe';
|
4286 |
|
4287 | Iframe.canPlay = function (url) {
|
4288 | return true;
|
4289 | };
|
4290 |
|
4291 | exports['default'] = (0, _singlePlayer2['default'])(Iframe);
|
4292 |
|
4293 | }),
|
4294 |
|
4295 | (function(module, exports, __webpack_require__) {
|
4296 |
|
4297 | "use strict";
|
4298 |
|
4299 |
|
4300 | Object.defineProperty(exports, "__esModule", {
|
4301 | value: true
|
4302 | });
|
4303 | exports.Mixcloud = undefined;
|
4304 |
|
4305 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
4306 |
|
4307 | 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; }; }();
|
4308 |
|
4309 | var _react = __webpack_require__(0);
|
4310 |
|
4311 | var _react2 = _interopRequireDefault(_react);
|
4312 |
|
4313 | var _utils = __webpack_require__(1);
|
4314 |
|
4315 | var _singlePlayer = __webpack_require__(2);
|
4316 |
|
4317 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
4318 |
|
4319 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4320 |
|
4321 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4322 |
|
4323 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
4324 |
|
4325 | 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; }
|
4326 |
|
4327 | var SDK_URL = '//widget.mixcloud.com/media/js/widgetApi.js';
|
4328 | var SDK_GLOBAL = 'Mixcloud';
|
4329 | var MATCH_URL = /mixcloud\.com\/([^/]+\/[^/]+)/;
|
4330 |
|
4331 | var Mixcloud = exports.Mixcloud = function (_Component) {
|
4332 | _inherits(Mixcloud, _Component);
|
4333 |
|
4334 | function Mixcloud() {
|
4335 | var _ref;
|
4336 |
|
4337 | var _temp, _this, _ret;
|
4338 |
|
4339 | _classCallCheck(this, Mixcloud);
|
4340 |
|
4341 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
4342 | args[_key] = arguments[_key];
|
4343 | }
|
4344 |
|
4345 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Mixcloud.__proto__ || Object.getPrototypeOf(Mixcloud)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.duration = null, _this.currentTime = null, _this.secondsLoaded = null, _this.mute = function () {
|
4346 |
|
4347 | }, _this.unmute = function () {
|
4348 |
|
4349 | }, _this.ref = function (iframe) {
|
4350 | _this.iframe = iframe;
|
4351 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
4352 | }
|
4353 |
|
4354 | _createClass(Mixcloud, [{
|
4355 | key: 'load',
|
4356 | value: function load(url) {
|
4357 | var _this2 = this;
|
4358 |
|
4359 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Mixcloud) {
|
4360 | _this2.player = Mixcloud.PlayerWidget(_this2.iframe);
|
4361 | _this2.player.ready.then(function () {
|
4362 | _this2.player.events.play.on(_this2.props.onPlay);
|
4363 | _this2.player.events.pause.on(_this2.props.onPause);
|
4364 | _this2.player.events.ended.on(_this2.props.onEnded);
|
4365 | _this2.player.events.error.on(_this2.props.error);
|
4366 | _this2.player.events.progress.on(function (seconds, duration) {
|
4367 | _this2.currentTime = seconds;
|
4368 | _this2.duration = duration;
|
4369 | });
|
4370 | _this2.props.onReady();
|
4371 | });
|
4372 | }, this.props.onError);
|
4373 | }
|
4374 | }, {
|
4375 | key: 'play',
|
4376 | value: function play() {
|
4377 | this.callPlayer('play');
|
4378 | }
|
4379 | }, {
|
4380 | key: 'pause',
|
4381 | value: function pause() {
|
4382 | this.callPlayer('pause');
|
4383 | }
|
4384 | }, {
|
4385 | key: 'stop',
|
4386 | value: function stop() {
|
4387 |
|
4388 | }
|
4389 | }, {
|
4390 | key: 'seekTo',
|
4391 | value: function seekTo(seconds) {
|
4392 | this.callPlayer('seek', seconds);
|
4393 | }
|
4394 | }, {
|
4395 | key: 'setVolume',
|
4396 | value: function setVolume(fraction) {
|
4397 |
|
4398 | }
|
4399 | }, {
|
4400 | key: 'getDuration',
|
4401 | value: function getDuration() {
|
4402 | return this.duration;
|
4403 | }
|
4404 | }, {
|
4405 | key: 'getCurrentTime',
|
4406 | value: function getCurrentTime() {
|
4407 | return this.currentTime;
|
4408 | }
|
4409 | }, {
|
4410 | key: 'getSecondsLoaded',
|
4411 | value: function getSecondsLoaded() {
|
4412 | return null;
|
4413 | }
|
4414 | }, {
|
4415 | key: 'render',
|
4416 | value: function render() {
|
4417 | var _props = this.props,
|
4418 | url = _props.url,
|
4419 | config = _props.config;
|
4420 |
|
4421 | var id = url.match(MATCH_URL)[1];
|
4422 | var style = {
|
4423 | width: '100%',
|
4424 | height: '100%'
|
4425 | };
|
4426 | var query = (0, _utils.queryString)(_extends({}, config.mixcloud.options, {
|
4427 | feed: '/' + id + '/'
|
4428 | }));
|
4429 |
|
4430 |
|
4431 | return _react2['default'].createElement('iframe', {
|
4432 | key: id,
|
4433 | ref: this.ref,
|
4434 | style: style,
|
4435 | src: 'https://www.mixcloud.com/widget/iframe/?' + query,
|
4436 | frameBorder: '0'
|
4437 | });
|
4438 | }
|
4439 | }]);
|
4440 |
|
4441 | return Mixcloud;
|
4442 | }(_react.Component);
|
4443 |
|
4444 | Mixcloud.displayName = 'Mixcloud';
|
4445 |
|
4446 | Mixcloud.canPlay = function (url) {
|
4447 | return MATCH_URL.test(url);
|
4448 | };
|
4449 |
|
4450 | Mixcloud.loopOnEnded = true;
|
4451 | exports['default'] = (0, _singlePlayer2['default'])(Mixcloud);
|
4452 |
|
4453 | }),
|
4454 |
|
4455 | (function(module, exports, __webpack_require__) {
|
4456 |
|
4457 | "use strict";
|
4458 |
|
4459 |
|
4460 | Object.defineProperty(exports, "__esModule", {
|
4461 | value: true
|
4462 | });
|
4463 | exports.VAST = undefined;
|
4464 |
|
4465 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
4466 |
|
4467 | 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; }; }();
|
4468 |
|
4469 | var _react = __webpack_require__(0);
|
4470 |
|
4471 | var _react2 = _interopRequireDefault(_react);
|
4472 |
|
4473 | var _vpaidHtml5Client = __webpack_require__(53);
|
4474 |
|
4475 | var _vpaidHtml5Client2 = _interopRequireDefault(_vpaidHtml5Client);
|
4476 |
|
4477 | var _vastClient = __webpack_require__(57);
|
4478 |
|
4479 | var _utils = __webpack_require__(1);
|
4480 |
|
4481 | var _singlePlayer = __webpack_require__(2);
|
4482 |
|
4483 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
4484 |
|
4485 | var _FilePlayer = __webpack_require__(11);
|
4486 |
|
4487 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
4488 |
|
4489 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4490 |
|
4491 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
4492 |
|
4493 | 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; }
|
4494 |
|
4495 | var PLAYER_ID_PREFIX = 'vast-player-';
|
4496 | var CONTENT_ID_PREFIX = 'vast-content-';
|
4497 | var SKIP_ID_PREFIX = 'vast-skip-';
|
4498 | var MATCH_URL = /^VAST:https:\/\//i;
|
4499 |
|
4500 | var VAST = exports.VAST = function (_Component) {
|
4501 | _inherits(VAST, _Component);
|
4502 |
|
4503 | function VAST() {
|
4504 | var _ref;
|
4505 |
|
4506 | var _temp, _this, _ret;
|
4507 |
|
4508 | _classCallCheck(this, VAST);
|
4509 |
|
4510 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
4511 | args[_key] = arguments[_key];
|
4512 | }
|
4513 |
|
4514 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = VAST.__proto__ || Object.getPrototypeOf(VAST)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
4515 | canSkip: false,
|
4516 | framework: null,
|
4517 | preMuteVolume: 0.0,
|
4518 | sources: [],
|
4519 | tracker: null,
|
4520 | type: null,
|
4521 | vastClient: new _vastClient.VASTClient(),
|
4522 | vpaidAdUnit: null,
|
4523 | vpaidClient: null
|
4524 | }, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.contentID = CONTENT_ID_PREFIX + (0, _utils.randomString)(), _this.skipID = SKIP_ID_PREFIX + (0, _utils.randomString)(), _this.callPlayer = _utils.callPlayer, _this.mute = function () {
|
4525 | var _this$state = _this.state,
|
4526 | framework = _this$state.framework,
|
4527 | vpaidAdUnit = _this$state.vpaidAdUnit;
|
4528 |
|
4529 | if (framework === 'VPAID') {
|
4530 | _this.setState({
|
4531 | preMuteVolume: _this.container.volume
|
4532 | });
|
4533 | vpaidAdUnit.setAdVolume(0.0);
|
4534 | } else {
|
4535 | _this.container.mute();
|
4536 | }
|
4537 | }, _this.unmute = function () {
|
4538 | var _this$state2 = _this.state,
|
4539 | framework = _this$state2.framework,
|
4540 | preMuteVolume = _this$state2.preMuteVolume,
|
4541 | vpaidAdUnit = _this$state2.vpaidAdUnit;
|
4542 |
|
4543 | if (framework === 'VPAID') {
|
4544 | vpaidAdUnit.setAdVolume(preMuteVolume);
|
4545 | } else {
|
4546 | _this.container.unmute();
|
4547 | }
|
4548 | }, _this.ref = function (container) {
|
4549 | _this.container = container;
|
4550 | }, _this.onAdClick = function () {
|
4551 | var _this$state3 = _this.state,
|
4552 | framework = _this$state3.framework,
|
4553 | tracker = _this$state3.tracker;
|
4554 |
|
4555 | if (framework === 'VAST' && tracker) {
|
4556 | tracker.click();
|
4557 | }
|
4558 | }, _this.onEnded = function (event) {
|
4559 | var onEnded = _this.props.onEnded;
|
4560 | var _this$state4 = _this.state,
|
4561 | framework = _this$state4.framework,
|
4562 | tracker = _this$state4.tracker;
|
4563 |
|
4564 | if (framework === 'VAST' && tracker) {
|
4565 | tracker.complete();
|
4566 | }
|
4567 | onEnded(event);
|
4568 | }, _this.onError = function (event) {
|
4569 | var onError = _this.props.onError;
|
4570 | var _this$state5 = _this.state,
|
4571 | framework = _this$state5.framework,
|
4572 | tracker = _this$state5.tracker;
|
4573 |
|
4574 | if (framework === 'VAST' && tracker) {
|
4575 | tracker.errorWithCode(405);
|
4576 | }
|
4577 | onError(event);
|
4578 | }, _this.onPause = function (event) {
|
4579 | var onPause = _this.props.onPause;
|
4580 | var _this$state6 = _this.state,
|
4581 | framework = _this$state6.framework,
|
4582 | tracker = _this$state6.tracker;
|
4583 |
|
4584 | if (framework === 'VAST' && tracker) {
|
4585 | tracker.setPaused(true);
|
4586 | }
|
4587 | onPause(event);
|
4588 | }, _this.onPlay = function (event) {
|
4589 | var onPlay = _this.props.onPlay;
|
4590 | var _this$state7 = _this.state,
|
4591 | framework = _this$state7.framework,
|
4592 | tracker = _this$state7.tracker;
|
4593 |
|
4594 | if (framework === 'VAST' && tracker) {
|
4595 | tracker.setPaused(false);
|
4596 | }
|
4597 | onPlay(event);
|
4598 | }, _this.onProgress = function (event) {
|
4599 | var onProgress = _this.props.onProgress;
|
4600 | var _this$state8 = _this.state,
|
4601 | framework = _this$state8.framework,
|
4602 | tracker = _this$state8.tracker;
|
4603 |
|
4604 | if (framework === 'VAST' && tracker) {
|
4605 | tracker.setProgress(event.playedSeconds);
|
4606 | }
|
4607 | onProgress(event);
|
4608 | }, _this.onReady = function (event) {
|
4609 | var onReady = _this.props.onReady;
|
4610 | var _this$state9 = _this.state,
|
4611 | framework = _this$state9.framework,
|
4612 | tracker = _this$state9.tracker;
|
4613 |
|
4614 | if (framework === 'VAST' && tracker) {
|
4615 | if (Number.isNaN(tracker.assetDuration)) {
|
4616 | tracker.assetDuration = _this.container.getDuration();
|
4617 | }
|
4618 | }
|
4619 |
|
4620 | onReady(event);
|
4621 | }, _this.onVolumeChange = function (event) {
|
4622 | var onVolumeChange = _this.props.onVolumeChange;
|
4623 | var _this$state10 = _this.state,
|
4624 | framework = _this$state10.framework,
|
4625 | tracker = _this$state10.tracker;
|
4626 |
|
4627 | if (framework === 'VAST' && tracker) {
|
4628 | tracker.setMuted(_this.container.muted);
|
4629 | }
|
4630 | onVolumeChange(event);
|
4631 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
4632 | }
|
4633 |
|
4634 | _createClass(VAST, [{
|
4635 | key: 'createSourceFiles',
|
4636 | value: function createSourceFiles() {
|
4637 | var mediaFiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
4638 |
|
4639 | return mediaFiles.map(function () {
|
4640 | var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
4641 | apiFramework = _ref2.apiFramework,
|
4642 | src = _ref2.fileURL,
|
4643 | type = _ref2.mimeType;
|
4644 |
|
4645 | return { apiFramework: apiFramework, src: src, type: type };
|
4646 | }).filter(function (_ref3) {
|
4647 | var apiFramework = _ref3.apiFramework,
|
4648 | src = _ref3.src;
|
4649 | return apiFramework === 'VPAID' || _FilePlayer.FilePlayer.canPlay(src);
|
4650 | });
|
4651 | }
|
4652 | }, {
|
4653 | key: 'componentWillUnmount',
|
4654 | value: function componentWillUnmount() {
|
4655 | if (this.state.framework === 'VPAID') {
|
4656 | this.removeVPAIDListeners();
|
4657 | }
|
4658 | }
|
4659 | }, {
|
4660 | key: 'parseResponse',
|
4661 | value: function parseResponse(response) {
|
4662 | var onEnded = this.props.onEnded;
|
4663 | var _response$ads = response.ads,
|
4664 | ads = _response$ads === undefined ? [] : _response$ads;
|
4665 |
|
4666 |
|
4667 |
|
4668 |
|
4669 | var _iteratorNormalCompletion = true;
|
4670 | var _didIteratorError = false;
|
4671 | var _iteratorError = undefined;
|
4672 |
|
4673 | try {
|
4674 | for (var _iterator = ads[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
4675 | var ad = _step.value;
|
4676 | var _ad$creatives = ad.creatives,
|
4677 | creatives = _ad$creatives === undefined ? [] : _ad$creatives;
|
4678 | var _iteratorNormalCompletion2 = true;
|
4679 | var _didIteratorError2 = false;
|
4680 | var _iteratorError2 = undefined;
|
4681 |
|
4682 | try {
|
4683 | for (var _iterator2 = creatives[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
4684 | var creative = _step2.value;
|
4685 | var _creative$mediaFiles = creative.mediaFiles,
|
4686 | mediaFiles = _creative$mediaFiles === undefined ? [] : _creative$mediaFiles,
|
4687 | type = creative.type;
|
4688 |
|
4689 | if (type === 'linear') {
|
4690 | var sources = this.createSourceFiles(mediaFiles);
|
4691 | if (sources.length) {
|
4692 | return this.setState({
|
4693 | framework: sources[0].apiFramework || 'VAST',
|
4694 | sources: sources,
|
4695 |
|
4696 | tracker: new _vastClient.VASTTracker(this.state.vastClient, ad, creative)
|
4697 | });
|
4698 | }
|
4699 | }
|
4700 | }
|
4701 | } catch (err) {
|
4702 | _didIteratorError2 = true;
|
4703 | _iteratorError2 = err;
|
4704 | } finally {
|
4705 | try {
|
4706 | if (!_iteratorNormalCompletion2 && _iterator2['return']) {
|
4707 | _iterator2['return']();
|
4708 | }
|
4709 | } finally {
|
4710 | if (_didIteratorError2) {
|
4711 | throw _iteratorError2;
|
4712 | }
|
4713 | }
|
4714 | }
|
4715 |
|
4716 | return onEnded();
|
4717 | }
|
4718 | } catch (err) {
|
4719 | _didIteratorError = true;
|
4720 | _iteratorError = err;
|
4721 | } finally {
|
4722 | try {
|
4723 | if (!_iteratorNormalCompletion && _iterator['return']) {
|
4724 | _iterator['return']();
|
4725 | }
|
4726 | } finally {
|
4727 | if (_didIteratorError) {
|
4728 | throw _iteratorError;
|
4729 | }
|
4730 | }
|
4731 | }
|
4732 | }
|
4733 | }, {
|
4734 | key: 'addVPAIDListeners',
|
4735 | value: function addVPAIDListeners() {
|
4736 | var framework = this.state.framework;
|
4737 |
|
4738 | if (framework !== 'VPAID') {
|
4739 | return null;
|
4740 | }
|
4741 | var _props = this.props,
|
4742 | onReady = _props.onReady,
|
4743 | onPlay = _props.onPlay,
|
4744 | onBuffer = _props.onBuffer,
|
4745 | onBufferEnd = _props.onBufferEnd,
|
4746 | onPause = _props.onPause,
|
4747 | onEnded = _props.onEnded,
|
4748 | onError = _props.onError,
|
4749 | onVolumeChange = _props.onVolumeChange;
|
4750 |
|
4751 |
|
4752 | this.container.addEventListener('canplay', onReady);
|
4753 | this.container.addEventListener('play', onPlay);
|
4754 | this.container.addEventListener('waiting', onBuffer);
|
4755 | this.container.addEventListener('playing', onBufferEnd);
|
4756 | this.container.addEventListener('pause', onPause);
|
4757 | this.container.addEventListener('ended', onEnded);
|
4758 | this.container.addEventListener('error', onError);
|
4759 | this.container.addEventListener('volumeChange', onVolumeChange);
|
4760 |
|
4761 |
|
4762 | this.state.vpaidAdUnit.subscribe('AdLoaded', this.onVPAIDAdLoaded.bind(this));
|
4763 | this.state.vpaidAdUnit.subscribe('AdSkippableStateChange', this.props.onAdSkippable.bind(this));
|
4764 | }
|
4765 | }, {
|
4766 | key: 'skip',
|
4767 | value: function skip() {
|
4768 | var _state = this.state,
|
4769 | framework = _state.framework,
|
4770 | tracker = _state.tracker,
|
4771 | vpaidAdUnit = _state.vpaidAdUnit;
|
4772 |
|
4773 | if (framework === 'VAST' && tracker) {
|
4774 | tracker.skip();
|
4775 | } else {
|
4776 | vpaidAdUnit.skipAd();
|
4777 | }
|
4778 | }
|
4779 | }, {
|
4780 | key: 'onVPAIDAdLoaded',
|
4781 | value: function onVPAIDAdLoaded() {
|
4782 | var _props2 = this.props,
|
4783 | onReady = _props2.onReady,
|
4784 | playing = _props2.playing;
|
4785 | var vpaidAdUnit = this.state.vpaidAdUnit;
|
4786 |
|
4787 | onReady();
|
4788 | if (playing) {
|
4789 | vpaidAdUnit.startAd();
|
4790 | this.setVolume(0.0);
|
4791 | }
|
4792 | }
|
4793 | }, {
|
4794 | key: 'removeVPAIDListeners',
|
4795 | value: function removeVPAIDListeners() {
|
4796 | var _props3 = this.props,
|
4797 | onReady = _props3.onReady,
|
4798 | onPlay = _props3.onPlay,
|
4799 | onBuffer = _props3.onBuffer,
|
4800 | onBufferEnd = _props3.onBufferEnd,
|
4801 | onPause = _props3.onPause,
|
4802 | onEnded = _props3.onEnded,
|
4803 | onError = _props3.onError,
|
4804 | onVolumeChange = _props3.onVolumeChange;
|
4805 |
|
4806 | this.container.removeEventListener('canplay', onReady);
|
4807 | this.container.removeEventListener('play', onPlay);
|
4808 | this.container.removeEventListener('waiting', onBuffer);
|
4809 | this.container.removeEventListener('playing', onBufferEnd);
|
4810 | this.container.removeEventListener('pause', onPause);
|
4811 | this.container.removeEventListener('ended', onEnded);
|
4812 | this.container.removeEventListener('error', onError);
|
4813 | this.container.removeEventListener('volumeChange', onVolumeChange);
|
4814 | this.state.vpaidAdUnit.unsubscribe('AdLoaded');
|
4815 | this.state.vpaidAdUnit.unsubscribe('AdSkippableStateChange');
|
4816 | }
|
4817 | }, {
|
4818 | key: 'loadVPAID',
|
4819 | value: function loadVPAID(url) {
|
4820 | var _this2 = this;
|
4821 |
|
4822 | this.state.vpaidClient = new _vpaidHtml5Client2['default'](document.getElementById(this.contentID), document.getElementById(this.playerID));
|
4823 | var onError = this.props.onError;
|
4824 | var vpaidClient = this.state.vpaidClient;
|
4825 |
|
4826 | vpaidClient.loadAdUnit(url, function (error, adUnit) {
|
4827 | if (error) {
|
4828 | return onError(error);
|
4829 | }
|
4830 | _this2.state.vpaidAdUnit = adUnit;
|
4831 | _this2.addVPAIDListeners();
|
4832 | adUnit.initAd('100%', '100%', 'normal', -1, {}, {});
|
4833 | });
|
4834 | }
|
4835 | }, {
|
4836 | key: 'load',
|
4837 | value: function load(rawUrl) {
|
4838 | var _this3 = this;
|
4839 |
|
4840 |
|
4841 | var ord = Math.random() * 10000000000000000;
|
4842 | var url = rawUrl.replace(/\[random]/ig, ord);
|
4843 | this.state.vastClient.get(url.slice('VAST:'.length), { withCredentials: true }).then(function (response) {
|
4844 | _this3.parseResponse(response);
|
4845 | var _state2 = _this3.state,
|
4846 | framework = _state2.framework,
|
4847 | sources = _state2.sources,
|
4848 | tracker = _state2.tracker;
|
4849 |
|
4850 | if (framework === 'VPAID') {
|
4851 | _this3.loadVPAID(sources[0].src);
|
4852 | } else {
|
4853 | if (tracker) {
|
4854 | tracker.on('clickthrough', _this3.openAdLink);
|
4855 | }
|
4856 | }
|
4857 | })['catch'](function (error) {
|
4858 | return _this3.props.onError(error);
|
4859 | });
|
4860 | }
|
4861 | }, {
|
4862 | key: 'play',
|
4863 | value: function play() {
|
4864 | var _state3 = this.state,
|
4865 | framework = _state3.framework,
|
4866 | vpaidAdUnit = _state3.vpaidAdUnit;
|
4867 |
|
4868 | if (framework === 'VPAID') {
|
4869 | vpaidAdUnit.resumeAd();
|
4870 | } else {
|
4871 | this.container.play();
|
4872 | }
|
4873 | }
|
4874 | }, {
|
4875 | key: 'pause',
|
4876 | value: function pause() {
|
4877 | var _state4 = this.state,
|
4878 | framework = _state4.framework,
|
4879 | vpaidAdUnit = _state4.vpaidAdUnit;
|
4880 |
|
4881 | if (framework === 'VPAID') {
|
4882 | vpaidAdUnit.pauseAd();
|
4883 | } else {
|
4884 | this.container.pause();
|
4885 | }
|
4886 | }
|
4887 | }, {
|
4888 | key: 'stop',
|
4889 | value: function stop() {
|
4890 | var _state5 = this.state,
|
4891 | framework = _state5.framework,
|
4892 | vpaidAdUnit = _state5.vpaidAdUnit;
|
4893 |
|
4894 | if (framework === 'VPAID') {
|
4895 | vpaidAdUnit.stopAd();
|
4896 | } else {
|
4897 | this.container.stop();
|
4898 | }
|
4899 | }
|
4900 |
|
4901 |
|
4902 |
|
4903 | }, {
|
4904 | key: 'seekTo',
|
4905 | value: function seekTo(seconds) {
|
4906 | var framework = this.state.framework;
|
4907 |
|
4908 | if (framework === 'VAST') {
|
4909 | if (seconds < this.getCurrentTime()) {
|
4910 | this.container.seekTo(seconds);
|
4911 | }
|
4912 | }
|
4913 | }
|
4914 | }, {
|
4915 | key: 'setVolume',
|
4916 | value: function setVolume(fraction) {
|
4917 | var _state6 = this.state,
|
4918 | framework = _state6.framework,
|
4919 | vpaidAdUnit = _state6.vpaidAdUnit;
|
4920 |
|
4921 | if (framework === 'VPAID') {
|
4922 | vpaidAdUnit.setAdVolume(fraction);
|
4923 | } else {
|
4924 | this.container.setVolume(fraction);
|
4925 | }
|
4926 | }
|
4927 | }, {
|
4928 | key: 'getDuration',
|
4929 | value: function getDuration() {
|
4930 | var framework = this.state.framework;
|
4931 |
|
4932 | if (framework === 'VPAID') {
|
4933 | if (!this.container) return null;
|
4934 | var duration = this.container.duration;
|
4935 |
|
4936 | return duration;
|
4937 | } else {
|
4938 | return this.container.getDuration();
|
4939 | }
|
4940 | }
|
4941 | }, {
|
4942 | key: 'getCurrentTime',
|
4943 | value: function getCurrentTime() {
|
4944 | var framework = this.state.framework;
|
4945 |
|
4946 | if (framework === 'VPAID') {
|
4947 | return this.container ? this.container.currentTime : null;
|
4948 | } else {
|
4949 | return this.container.getCurrentTime();
|
4950 | }
|
4951 | }
|
4952 | }, {
|
4953 | key: 'getSecondsLoaded',
|
4954 | value: function getSecondsLoaded() {
|
4955 | var framework = this.state.framework;
|
4956 |
|
4957 | if (framework === 'VPAID') {
|
4958 | if (!this.container) return null;
|
4959 | var buffered = this.container.buffered;
|
4960 |
|
4961 | if (buffered.length === 0) {
|
4962 | return 0;
|
4963 | }
|
4964 | var end = buffered.end(buffered.length - 1);
|
4965 | var duration = this.getDuration();
|
4966 | if (end > duration) {
|
4967 | return duration;
|
4968 | }
|
4969 | return end;
|
4970 | } else {
|
4971 | return this.container.getCurrentTime();
|
4972 | }
|
4973 | }
|
4974 | }, {
|
4975 | key: 'openAdLink',
|
4976 | value: function openAdLink(url) {
|
4977 | window.open(url, '_blank');
|
4978 | }
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 |
|
4987 |
|
4988 |
|
4989 |
|
4990 |
|
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 | }, {
|
4998 | key: 'renderVAST',
|
4999 | value: function renderVAST() {
|
5000 | var _state7 = this.state,
|
5001 | sources = _state7.sources,
|
5002 | clickTrackingURLTemplate = _state7.tracker;
|
5003 | var _props4 = this.props,
|
5004 | width = _props4.width,
|
5005 | height = _props4.height;
|
5006 |
|
5007 | var wrapperStyle = {
|
5008 | cursor: clickTrackingURLTemplate ? 'pointer' : 'default',
|
5009 | height: '100%'
|
5010 | };
|
5011 | var videoStyle = {
|
5012 | width: width === 'auto' ? width : '100%',
|
5013 | height: height === 'auto' ? height : '100%'
|
5014 | };
|
5015 | return sources.length ? _react2['default'].createElement(
|
5016 | 'div',
|
5017 | { onClick: this.onAdClick, style: wrapperStyle },
|
5018 | _react2['default'].createElement(_FilePlayer.FilePlayer, _extends({}, this.props, {
|
5019 | onEnded: this.onEnded,
|
5020 | onError: this.onError,
|
5021 | onPause: this.onPause,
|
5022 | onPlay: this.onPlay,
|
5023 | onProgress: this.onProgress,
|
5024 | onReady: this.onReady,
|
5025 | onVolumeChange: this.onVolumeChange,
|
5026 | ref: this.ref,
|
5027 | style: videoStyle,
|
5028 | url: this.state.sources[0].src
|
5029 | }))
|
5030 | ) : null;
|
5031 | }
|
5032 | }, {
|
5033 | key: 'renderVPAID',
|
5034 | value: function renderVPAID() {
|
5035 | var _this4 = this;
|
5036 |
|
5037 | var _props5 = this.props,
|
5038 | width = _props5.width,
|
5039 | height = _props5.height;
|
5040 | var canSkip = this.state.canSkip;
|
5041 |
|
5042 | var dimensions = {
|
5043 | width: width === 'auto' ? width : '100%',
|
5044 | height: height === 'auto' ? height : '100%'
|
5045 | };
|
5046 | var contentStyle = _extends({}, dimensions, {
|
5047 | top: 0,
|
5048 | left: 0,
|
5049 | position: 'absolute',
|
5050 | zIndex: 1
|
5051 | });
|
5052 | var skipStyle = {
|
5053 | cursor: 'pointer',
|
5054 | display: 'block',
|
5055 | position: 'absolute',
|
5056 | bottom: '10px',
|
5057 | right: '10px',
|
5058 | zIndex: 2
|
5059 | };
|
5060 | return _react2['default'].createElement(
|
5061 | 'div',
|
5062 | { style: _extends({}, dimensions, { position: 'relative' }) },
|
5063 | canSkip && _react2['default'].createElement(
|
5064 | 'button',
|
5065 | {
|
5066 | id: this.skipID,
|
5067 | style: skipStyle,
|
5068 | onClick: function onClick() {
|
5069 | return _this4.skip();
|
5070 | } },
|
5071 | 'Skip'
|
5072 | ),
|
5073 | _react2['default'].createElement('div', { id: this.contentID, style: contentStyle }),
|
5074 | _react2['default'].createElement('video', {
|
5075 | ref: this.ref,
|
5076 | controls: false,
|
5077 | style: dimensions,
|
5078 | id: this.playerID
|
5079 | })
|
5080 | );
|
5081 | }
|
5082 | }, {
|
5083 | key: 'render',
|
5084 | value: function render() {
|
5085 | var framework = this.state.framework;
|
5086 |
|
5087 | if (!framework) {
|
5088 | return null;
|
5089 | }
|
5090 | if (framework === 'VPAID') {
|
5091 | return this.renderVPAID();
|
5092 | } else {
|
5093 | return this.renderVAST();
|
5094 | }
|
5095 | }
|
5096 | }]);
|
5097 |
|
5098 | return VAST;
|
5099 | }(_react.Component);
|
5100 |
|
5101 | VAST.displayName = 'VAST';
|
5102 |
|
5103 | VAST.canPlay = function (url) {
|
5104 | return MATCH_URL.test(url);
|
5105 | };
|
5106 |
|
5107 | exports['default'] = (0, _singlePlayer2['default'])(VAST);
|
5108 |
|
5109 | }),
|
5110 |
|
5111 | (function(module, exports, __webpack_require__) {
|
5112 |
|
5113 | "use strict";
|
5114 |
|
5115 |
|
5116 |
|
5117 |
|
5118 |
|
5119 |
|
5120 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
5121 |
|
5122 | function noop() {}
|
5123 |
|
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 |
|
5129 |
|
5130 | function validate(isValid, message) {
|
5131 | return isValid ? null : new Error(message);
|
5132 | }
|
5133 |
|
5134 | var timeouts = {};
|
5135 |
|
5136 |
|
5137 |
|
5138 |
|
5139 |
|
5140 | function clearCallbackTimeout(func) {
|
5141 | var timeout = timeouts[func];
|
5142 | if (timeout) {
|
5143 | clearTimeout(timeout);
|
5144 | delete timeouts[func];
|
5145 | }
|
5146 | }
|
5147 |
|
5148 |
|
5149 |
|
5150 |
|
5151 |
|
5152 |
|
5153 |
|
5154 |
|
5155 | function callbackTimeout(timer, onSuccess, onTimeout) {
|
5156 | var _callback, timeout;
|
5157 |
|
5158 | timeout = setTimeout(function () {
|
5159 | onSuccess = noop;
|
5160 | delete timeout[_callback];
|
5161 | onTimeout();
|
5162 | }, timer);
|
5163 |
|
5164 | _callback = function callback() {
|
5165 |
|
5166 |
|
5167 | if (onSuccess.apply(this, arguments)) {
|
5168 | clearCallbackTimeout(_callback);
|
5169 | }
|
5170 | };
|
5171 |
|
5172 | timeouts[_callback] = timeout;
|
5173 |
|
5174 | return _callback;
|
5175 | }
|
5176 |
|
5177 |
|
5178 |
|
5179 |
|
5180 |
|
5181 |
|
5182 |
|
5183 |
|
5184 | function createElementInEl(parent, tagName, id) {
|
5185 | var nEl = document.createElement(tagName);
|
5186 | if (id) nEl.id = id;
|
5187 | parent.appendChild(nEl);
|
5188 | return nEl;
|
5189 | }
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 |
|
5197 |
|
5198 | function createIframeWithContent(parent, template, data) {
|
5199 | var iframe = createIframe(parent, null, data.zIndex);
|
5200 | if (!setIframeContent(iframe, simpleTemplate(template, data))) return;
|
5201 | return iframe;
|
5202 | }
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 | function createIframe(parent, url, zIndex) {
|
5211 | var nEl = document.createElement('iframe');
|
5212 | nEl.src = url || 'about:blank';
|
5213 | nEl.marginWidth = '0';
|
5214 | nEl.marginHeight = '0';
|
5215 | nEl.frameBorder = '0';
|
5216 | nEl.width = '100%';
|
5217 | nEl.height = '100%';
|
5218 | setFullSizeStyle(nEl);
|
5219 |
|
5220 | if (zIndex) {
|
5221 | nEl.style.zIndex = zIndex;
|
5222 | }
|
5223 |
|
5224 | nEl.setAttribute('SCROLLING', 'NO');
|
5225 | parent.innerHTML = '';
|
5226 | parent.appendChild(nEl);
|
5227 | return nEl;
|
5228 | }
|
5229 |
|
5230 | function setFullSizeStyle(element) {
|
5231 | element.style.position = 'absolute';
|
5232 | element.style.left = '0';
|
5233 | element.style.top = '0';
|
5234 | element.style.margin = '0px';
|
5235 | element.style.padding = '0px';
|
5236 | element.style.border = 'none';
|
5237 | element.style.width = '100%';
|
5238 | element.style.height = '100%';
|
5239 | }
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 | function simpleTemplate(template, data) {
|
5248 | Object.keys(data).forEach(function (key) {
|
5249 | var value = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' ? JSON.stringify(data[key]) : data[key];
|
5250 | template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);
|
5251 | });
|
5252 | return template;
|
5253 | }
|
5254 |
|
5255 |
|
5256 |
|
5257 |
|
5258 |
|
5259 |
|
5260 |
|
5261 | function setIframeContent(iframeEl, content) {
|
5262 | var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;
|
5263 | if (!iframeDoc) return false;
|
5264 |
|
5265 | iframeDoc.write(content);
|
5266 |
|
5267 | return true;
|
5268 | }
|
5269 |
|
5270 |
|
5271 |
|
5272 |
|
5273 |
|
5274 |
|
5275 |
|
5276 | function extend(toExtend, fromSource) {
|
5277 | Object.keys(fromSource).forEach(function (key) {
|
5278 | toExtend[key] = fromSource[key];
|
5279 | });
|
5280 | return toExtend;
|
5281 | }
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 | function unique(prefix) {
|
5289 | var count = -1;
|
5290 | return function () {
|
5291 | return prefix + '_' + ++count;
|
5292 | };
|
5293 | }
|
5294 |
|
5295 | module.exports = {
|
5296 | noop: noop,
|
5297 | validate: validate,
|
5298 | clearCallbackTimeout: clearCallbackTimeout,
|
5299 | callbackTimeout: callbackTimeout,
|
5300 | createElementInEl: createElementInEl,
|
5301 | createIframeWithContent: createIframeWithContent,
|
5302 | createIframe: createIframe,
|
5303 | setFullSizeStyle: setFullSizeStyle,
|
5304 | simpleTemplate: simpleTemplate,
|
5305 | setIframeContent: setIframeContent,
|
5306 | extend: extend,
|
5307 | unique: unique
|
5308 | };
|
5309 |
|
5310 | }),
|
5311 |
|
5312 | (function(module, exports, __webpack_require__) {
|
5313 |
|
5314 | "use strict";
|
5315 |
|
5316 |
|
5317 | Object.defineProperty(exports, "__esModule", {
|
5318 | value: true
|
5319 | });
|
5320 | exports.VASTParser = undefined;
|
5321 |
|
5322 | 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; }; }();
|
5323 |
|
5324 | var _ad_parser = __webpack_require__(58);
|
5325 |
|
5326 | var _events = __webpack_require__(31);
|
5327 |
|
5328 | var _parser_utils = __webpack_require__(3);
|
5329 |
|
5330 | var _url_handler = __webpack_require__(69);
|
5331 |
|
5332 | var _util = __webpack_require__(13);
|
5333 |
|
5334 | var _vast_response = __webpack_require__(73);
|
5335 |
|
5336 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5337 |
|
5338 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5339 |
|
5340 | 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; }
|
5341 |
|
5342 | var DEFAULT_MAX_WRAPPER_DEPTH = 10;
|
5343 | var DEFAULT_EVENT_DATA = {
|
5344 | ERRORCODE: 900,
|
5345 | extensions: []
|
5346 | };
|
5347 |
|
5348 |
|
5349 |
|
5350 |
|
5351 |
|
5352 |
|
5353 |
|
5354 |
|
5355 | var VASTParser = exports.VASTParser = function (_EventEmitter) {
|
5356 | _inherits(VASTParser, _EventEmitter);
|
5357 |
|
5358 | |
5359 |
|
5360 |
|
5361 |
|
5362 | function VASTParser() {
|
5363 | _classCallCheck(this, VASTParser);
|
5364 |
|
5365 | var _this = _possibleConstructorReturn(this, (VASTParser.__proto__ || Object.getPrototypeOf(VASTParser)).call(this));
|
5366 |
|
5367 | _this.remainingAds = [];
|
5368 | _this.parentURLs = [];
|
5369 | _this.errorURLTemplates = [];
|
5370 | _this.rootErrorURLTemplates = [];
|
5371 | _this.maxWrapperDepth = null;
|
5372 | _this.URLTemplateFilters = [];
|
5373 | _this.fetchingOptions = {};
|
5374 | return _this;
|
5375 | }
|
5376 |
|
5377 | |
5378 |
|
5379 |
|
5380 |
|
5381 |
|
5382 |
|
5383 |
|
5384 | _createClass(VASTParser, [{
|
5385 | key: 'addURLTemplateFilter',
|
5386 | value: function addURLTemplateFilter(filter) {
|
5387 | if (typeof filter === 'function') {
|
5388 | this.URLTemplateFilters.push(filter);
|
5389 | }
|
5390 | }
|
5391 |
|
5392 | |
5393 |
|
5394 |
|
5395 |
|
5396 |
|
5397 | }, {
|
5398 | key: 'removeURLTemplateFilter',
|
5399 | value: function removeURLTemplateFilter() {
|
5400 | this.URLTemplateFilters.pop();
|
5401 | }
|
5402 |
|
5403 | |
5404 |
|
5405 |
|
5406 |
|
5407 |
|
5408 | }, {
|
5409 | key: 'countURLTemplateFilters',
|
5410 | value: function countURLTemplateFilters() {
|
5411 | return this.URLTemplateFilters.length;
|
5412 | }
|
5413 |
|
5414 | |
5415 |
|
5416 |
|
5417 |
|
5418 |
|
5419 | }, {
|
5420 | key: 'clearURLTemplateFilters',
|
5421 | value: function clearURLTemplateFilters() {
|
5422 | this.URLTemplateFilters = [];
|
5423 | }
|
5424 |
|
5425 | |
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 |
|
5433 |
|
5434 | }, {
|
5435 | key: 'trackVastError',
|
5436 | value: function trackVastError(urlTemplates, errorCode) {
|
5437 | for (var _len = arguments.length, data = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
5438 | data[_key - 2] = arguments[_key];
|
5439 | }
|
5440 |
|
5441 | this.emit('VAST-error', Object.assign.apply(Object, [DEFAULT_EVENT_DATA, errorCode].concat(data)));
|
5442 | _util.util.track(urlTemplates, errorCode);
|
5443 | }
|
5444 |
|
5445 | |
5446 |
|
5447 |
|
5448 |
|
5449 |
|
5450 | }, {
|
5451 | key: 'getErrorURLTemplates',
|
5452 | value: function getErrorURLTemplates() {
|
5453 | return this.rootErrorURLTemplates.concat(this.errorURLTemplates);
|
5454 | }
|
5455 |
|
5456 | |
5457 |
|
5458 |
|
5459 |
|
5460 |
|
5461 |
|
5462 |
|
5463 |
|
5464 |
|
5465 |
|
5466 |
|
5467 | }, {
|
5468 | key: 'fetchVAST',
|
5469 | value: function fetchVAST(url, wrapperDepth, originalUrl) {
|
5470 | var _this2 = this;
|
5471 |
|
5472 | return new Promise(function (resolve, reject) {
|
5473 |
|
5474 | _this2.URLTemplateFilters.forEach(function (filter) {
|
5475 | url = filter(url);
|
5476 | });
|
5477 |
|
5478 | _this2.parentURLs.push(url);
|
5479 | _this2.emit('VAST-resolving', { url: url, wrapperDepth: wrapperDepth, originalUrl: originalUrl });
|
5480 |
|
5481 | _this2.urlHandler.get(url, _this2.fetchingOptions, function (err, xml) {
|
5482 | _this2.emit('VAST-resolved', { url: url, error: err });
|
5483 |
|
5484 | if (err) {
|
5485 | reject(err);
|
5486 | } else {
|
5487 | resolve(xml);
|
5488 | }
|
5489 | });
|
5490 | });
|
5491 | }
|
5492 |
|
5493 | |
5494 |
|
5495 |
|
5496 |
|
5497 |
|
5498 | }, {
|
5499 | key: 'initParsingStatus',
|
5500 | value: function initParsingStatus() {
|
5501 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5502 |
|
5503 | this.rootURL = '';
|
5504 | this.remainingAds = [];
|
5505 | this.parentURLs = [];
|
5506 | this.errorURLTemplates = [];
|
5507 | this.rootErrorURLTemplates = [];
|
5508 | this.maxWrapperDepth = options.wrapperLimit || DEFAULT_MAX_WRAPPER_DEPTH;
|
5509 | this.fetchingOptions = {
|
5510 | timeout: options.timeout,
|
5511 | withCredentials: options.withCredentials
|
5512 | };
|
5513 |
|
5514 | this.urlHandler = options.urlHandler || options.urlhandler || _url_handler.urlHandler;
|
5515 | }
|
5516 |
|
5517 | |
5518 |
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 | }, {
|
5524 | key: 'getRemainingAds',
|
5525 | value: function getRemainingAds(all) {
|
5526 | var _this3 = this;
|
5527 |
|
5528 | if (this.remainingAds.length === 0) {
|
5529 | return Promise.reject(new Error('No more ads are available for the given VAST'));
|
5530 | }
|
5531 |
|
5532 | var ads = all ? _util.util.flatten(this.remainingAds) : this.remainingAds.shift();
|
5533 | this.errorURLTemplates = [];
|
5534 | this.parentURLs = [];
|
5535 |
|
5536 | return this.resolveAds(ads, {
|
5537 | wrapperDepth: 0,
|
5538 | originalUrl: this.rootURL
|
5539 | }).then(function (resolvedAds) {
|
5540 | return _this3.buildVASTResponse(resolvedAds);
|
5541 | });
|
5542 | }
|
5543 |
|
5544 | |
5545 |
|
5546 |
|
5547 |
|
5548 |
|
5549 |
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 | }, {
|
5555 | key: 'getAndParseVAST',
|
5556 | value: function getAndParseVAST(url) {
|
5557 | var _this4 = this;
|
5558 |
|
5559 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5560 |
|
5561 | this.initParsingStatus(options);
|
5562 | this.rootURL = url;
|
5563 |
|
5564 | return this.fetchVAST(url).then(function (xml) {
|
5565 | options.originalUrl = url;
|
5566 | options.isRootVAST = true;
|
5567 |
|
5568 | return _this4.parse(xml, options).then(function (ads) {
|
5569 | return _this4.buildVASTResponse(ads);
|
5570 | });
|
5571 | });
|
5572 | }
|
5573 |
|
5574 | |
5575 |
|
5576 |
|
5577 |
|
5578 |
|
5579 |
|
5580 |
|
5581 |
|
5582 |
|
5583 |
|
5584 | }, {
|
5585 | key: 'parseVAST',
|
5586 | value: function parseVAST(vastXml) {
|
5587 | var _this5 = this;
|
5588 |
|
5589 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5590 |
|
5591 | this.initParsingStatus(options);
|
5592 |
|
5593 | options.isRootVAST = true;
|
5594 |
|
5595 | return this.parse(vastXml, options).then(function (ads) {
|
5596 | return _this5.buildVASTResponse(ads);
|
5597 | });
|
5598 | }
|
5599 |
|
5600 | |
5601 |
|
5602 |
|
5603 |
|
5604 |
|
5605 |
|
5606 | }, {
|
5607 | key: 'buildVASTResponse',
|
5608 | value: function buildVASTResponse(ads) {
|
5609 | var response = new _vast_response.VASTResponse();
|
5610 | response.ads = ads;
|
5611 | response.errorURLTemplates = this.getErrorURLTemplates();
|
5612 | this.completeWrapperResolving(response);
|
5613 |
|
5614 | return response;
|
5615 | }
|
5616 |
|
5617 | |
5618 |
|
5619 |
|
5620 |
|
5621 |
|
5622 |
|
5623 |
|
5624 |
|
5625 |
|
5626 | }, {
|
5627 | key: 'parseVastXml',
|
5628 | value: function parseVastXml(vastXml, _ref) {
|
5629 | var _ref$isRootVAST = _ref.isRootVAST,
|
5630 | isRootVAST = _ref$isRootVAST === undefined ? false : _ref$isRootVAST;
|
5631 |
|
5632 |
|
5633 | if (!vastXml || !vastXml.documentElement || vastXml.documentElement.nodeName !== 'VAST') {
|
5634 | throw new Error('Invalid VAST XMLDocument');
|
5635 | }
|
5636 |
|
5637 | var ads = [];
|
5638 | var childNodes = vastXml.documentElement.childNodes;
|
5639 |
|
5640 |
|
5641 | for (var nodeKey in childNodes) {
|
5642 | var node = childNodes[nodeKey];
|
5643 |
|
5644 | if (node.nodeName === 'Error') {
|
5645 | var errorURLTemplate = _parser_utils.parserUtils.parseNodeText(node);
|
5646 |
|
5647 |
|
5648 | isRootVAST ? this.rootErrorURLTemplates.push(errorURLTemplate) : this.errorURLTemplates.push(errorURLTemplate);
|
5649 | }
|
5650 |
|
5651 | if (node.nodeName === 'Ad') {
|
5652 | var ad = (0, _ad_parser.parseAd)(node);
|
5653 |
|
5654 | if (ad) {
|
5655 | ads.push(ad);
|
5656 | } else {
|
5657 |
|
5658 | this.trackVastError(this.getErrorURLTemplates(), {
|
5659 | ERRORCODE: 101
|
5660 | });
|
5661 | }
|
5662 | }
|
5663 | }
|
5664 |
|
5665 | return ads;
|
5666 | }
|
5667 |
|
5668 | |
5669 |
|
5670 |
|
5671 |
|
5672 |
|
5673 |
|
5674 |
|
5675 |
|
5676 |
|
5677 |
|
5678 | }, {
|
5679 | key: 'parse',
|
5680 | value: function parse(vastXml, _ref2) {
|
5681 | var _ref2$resolveAll = _ref2.resolveAll,
|
5682 | resolveAll = _ref2$resolveAll === undefined ? true : _ref2$resolveAll,
|
5683 | _ref2$wrapperSequence = _ref2.wrapperSequence,
|
5684 | wrapperSequence = _ref2$wrapperSequence === undefined ? null : _ref2$wrapperSequence,
|
5685 | _ref2$originalUrl = _ref2.originalUrl,
|
5686 | originalUrl = _ref2$originalUrl === undefined ? null : _ref2$originalUrl,
|
5687 | _ref2$wrapperDepth = _ref2.wrapperDepth,
|
5688 | wrapperDepth = _ref2$wrapperDepth === undefined ? 0 : _ref2$wrapperDepth,
|
5689 | _ref2$isRootVAST = _ref2.isRootVAST,
|
5690 | isRootVAST = _ref2$isRootVAST === undefined ? false : _ref2$isRootVAST;
|
5691 |
|
5692 | var ads = [];
|
5693 | try {
|
5694 | ads = this.parseVastXml(vastXml, { isRootVAST: isRootVAST });
|
5695 | } catch (e) {
|
5696 | return Promise.reject(e);
|
5697 | }
|
5698 |
|
5699 | var adsCount = ads.length;
|
5700 | var lastAddedAd = ads[adsCount - 1];
|
5701 |
|
5702 |
|
5703 |
|
5704 | if (adsCount === 1 && wrapperSequence !== undefined && wrapperSequence !== null && lastAddedAd && !lastAddedAd.sequence) {
|
5705 | lastAddedAd.sequence = wrapperSequence;
|
5706 | }
|
5707 |
|
5708 |
|
5709 | if (resolveAll === false) {
|
5710 | this.remainingAds = _parser_utils.parserUtils.splitVAST(ads);
|
5711 |
|
5712 | ads = this.remainingAds.shift();
|
5713 | }
|
5714 |
|
5715 | return this.resolveAds(ads, { wrapperDepth: wrapperDepth, originalUrl: originalUrl });
|
5716 | }
|
5717 |
|
5718 | |
5719 |
|
5720 |
|
5721 |
|
5722 |
|
5723 |
|
5724 |
|
5725 |
|
5726 | }, {
|
5727 | key: 'resolveAds',
|
5728 | value: function resolveAds() {
|
5729 | var _this6 = this;
|
5730 |
|
5731 | var ads = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
5732 | var _ref3 = arguments[1];
|
5733 | var wrapperDepth = _ref3.wrapperDepth,
|
5734 | originalUrl = _ref3.originalUrl;
|
5735 |
|
5736 | var resolveWrappersPromises = [];
|
5737 |
|
5738 | ads.forEach(function (ad) {
|
5739 | var resolveWrappersPromise = _this6.resolveWrappers(ad, wrapperDepth, originalUrl);
|
5740 |
|
5741 | resolveWrappersPromises.push(resolveWrappersPromise);
|
5742 | });
|
5743 |
|
5744 | return Promise.all(resolveWrappersPromises).then(function (unwrappedAds) {
|
5745 | var resolvedAds = _util.util.flatten(unwrappedAds);
|
5746 |
|
5747 | if (!resolvedAds && _this6.remainingAds.length > 0) {
|
5748 | var remainingAdsToResolve = _this6.remainingAds.shift();
|
5749 |
|
5750 | return _this6.resolveAds(remainingAdsToResolve, {
|
5751 | wrapperDepth: wrapperDepth,
|
5752 | originalUrl: originalUrl
|
5753 | });
|
5754 | }
|
5755 |
|
5756 | return resolvedAds;
|
5757 | });
|
5758 | }
|
5759 |
|
5760 | |
5761 |
|
5762 |
|
5763 |
|
5764 |
|
5765 |
|
5766 |
|
5767 |
|
5768 |
|
5769 | }, {
|
5770 | key: 'resolveWrappers',
|
5771 | value: function resolveWrappers(ad, wrapperDepth, originalUrl) {
|
5772 | var _this7 = this;
|
5773 |
|
5774 | return new Promise(function (resolve) {
|
5775 |
|
5776 | wrapperDepth++;
|
5777 |
|
5778 | if (!ad.nextWrapperURL) {
|
5779 | delete ad.nextWrapperURL;
|
5780 | return resolve(ad);
|
5781 | }
|
5782 |
|
5783 | if (wrapperDepth >= _this7.maxWrapperDepth || _this7.parentURLs.indexOf(ad.nextWrapperURL) !== -1) {
|
5784 |
|
5785 |
|
5786 | ad.errorCode = 302;
|
5787 | delete ad.nextWrapperURL;
|
5788 | return resolve(ad);
|
5789 | }
|
5790 |
|
5791 |
|
5792 | ad.nextWrapperURL = _parser_utils.parserUtils.resolveVastAdTagURI(ad.nextWrapperURL, originalUrl);
|
5793 |
|
5794 |
|
5795 | var wrapperSequence = ad.sequence;
|
5796 | originalUrl = ad.nextWrapperURL;
|
5797 |
|
5798 | _this7.fetchVAST(ad.nextWrapperURL, wrapperDepth, originalUrl).then(function (xml) {
|
5799 | return _this7.parse(xml, {
|
5800 | originalUrl: originalUrl,
|
5801 | wrapperSequence: wrapperSequence,
|
5802 | wrapperDepth: wrapperDepth
|
5803 | }).then(function (unwrappedAds) {
|
5804 | delete ad.nextWrapperURL;
|
5805 | if (unwrappedAds.length === 0) {
|
5806 |
|
5807 | ad.creatives = [];
|
5808 | return resolve(ad);
|
5809 | }
|
5810 |
|
5811 | unwrappedAds.forEach(function (unwrappedAd) {
|
5812 | if (unwrappedAd) {
|
5813 | _parser_utils.parserUtils.mergeWrapperAdData(unwrappedAd, ad);
|
5814 | }
|
5815 | });
|
5816 |
|
5817 | resolve(unwrappedAds);
|
5818 | });
|
5819 | }).catch(function (err) {
|
5820 |
|
5821 |
|
5822 | ad.errorCode = 301;
|
5823 | ad.errorMessage = err.message;
|
5824 |
|
5825 | resolve(ad);
|
5826 | });
|
5827 | });
|
5828 | }
|
5829 |
|
5830 | |
5831 |
|
5832 |
|
5833 |
|
5834 |
|
5835 | }, {
|
5836 | key: 'completeWrapperResolving',
|
5837 | value: function completeWrapperResolving(vastResponse) {
|
5838 |
|
5839 |
|
5840 |
|
5841 |
|
5842 |
|
5843 | if (vastResponse.ads.length === 0) {
|
5844 | this.trackVastError(vastResponse.errorURLTemplates, { ERRORCODE: 303 });
|
5845 | } else {
|
5846 | for (var index = vastResponse.ads.length - 1; index >= 0; index--) {
|
5847 |
|
5848 |
|
5849 |
|
5850 | var ad = vastResponse.ads[index];
|
5851 | if (ad.errorCode || ad.creatives.length === 0) {
|
5852 | this.trackVastError(ad.errorURLTemplates.concat(vastResponse.errorURLTemplates), { ERRORCODE: ad.errorCode || 303 }, { ERRORMESSAGE: ad.errorMessage || '' }, { extensions: ad.extensions }, { system: ad.system });
|
5853 | vastResponse.ads.splice(index, 1);
|
5854 | }
|
5855 | }
|
5856 | }
|
5857 | }
|
5858 | }]);
|
5859 |
|
5860 | return VASTParser;
|
5861 | }(_events.EventEmitter);
|
5862 |
|
5863 | }),
|
5864 |
|
5865 | (function(module, exports, __webpack_require__) {
|
5866 |
|
5867 | "use strict";
|
5868 |
|
5869 |
|
5870 | Object.defineProperty(exports, "__esModule", {
|
5871 | value: true
|
5872 | });
|
5873 |
|
5874 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5875 |
|
5876 | var CompanionAd = exports.CompanionAd = function CompanionAd() {
|
5877 | _classCallCheck(this, CompanionAd);
|
5878 |
|
5879 | this.id = null;
|
5880 | this.width = 0;
|
5881 | this.height = 0;
|
5882 | this.type = null;
|
5883 | this.staticResource = null;
|
5884 | this.htmlResource = null;
|
5885 | this.iframeResource = null;
|
5886 | this.altText = null;
|
5887 | this.companionClickThroughURLTemplate = null;
|
5888 | this.companionClickTrackingURLTemplates = [];
|
5889 | this.trackingEvents = {};
|
5890 | };
|
5891 |
|
5892 | }),
|
5893 |
|
5894 | (function(module, exports, __webpack_require__) {
|
5895 |
|
5896 | "use strict";
|
5897 |
|
5898 |
|
5899 | Object.defineProperty(exports, "__esModule", {
|
5900 | value: true
|
5901 | });
|
5902 | exports.CreativeLinear = undefined;
|
5903 |
|
5904 | var _creative = __webpack_require__(12);
|
5905 |
|
5906 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5907 |
|
5908 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5909 |
|
5910 | 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; }
|
5911 |
|
5912 | var CreativeLinear = exports.CreativeLinear = function (_Creative) {
|
5913 | _inherits(CreativeLinear, _Creative);
|
5914 |
|
5915 | function CreativeLinear() {
|
5916 | var creativeAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5917 |
|
5918 | _classCallCheck(this, CreativeLinear);
|
5919 |
|
5920 | var _this = _possibleConstructorReturn(this, (CreativeLinear.__proto__ || Object.getPrototypeOf(CreativeLinear)).call(this, creativeAttributes));
|
5921 |
|
5922 | _this.type = 'linear';
|
5923 | _this.duration = 0;
|
5924 | _this.skipDelay = null;
|
5925 | _this.mediaFiles = [];
|
5926 | _this.videoClickThroughURLTemplate = null;
|
5927 | _this.videoClickTrackingURLTemplates = [];
|
5928 | _this.videoCustomClickURLTemplates = [];
|
5929 | _this.adParameters = null;
|
5930 | _this.icons = [];
|
5931 | return _this;
|
5932 | }
|
5933 |
|
5934 | return CreativeLinear;
|
5935 | }(_creative.Creative);
|
5936 |
|
5937 | }),
|
5938 |
|
5939 | (function(module, exports, __webpack_require__) {
|
5940 |
|
5941 | "use strict";
|
5942 |
|
5943 |
|
5944 | Object.defineProperty(exports, "__esModule", {
|
5945 | value: true
|
5946 | });
|
5947 |
|
5948 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5949 |
|
5950 | var NonLinearAd = exports.NonLinearAd = function NonLinearAd() {
|
5951 | _classCallCheck(this, NonLinearAd);
|
5952 |
|
5953 | this.id = null;
|
5954 | this.width = 0;
|
5955 | this.height = 0;
|
5956 | this.expandedWidth = 0;
|
5957 | this.expandedHeight = 0;
|
5958 | this.scalable = true;
|
5959 | this.maintainAspectRatio = true;
|
5960 | this.minSuggestedDuration = 0;
|
5961 | this.apiFramework = 'static';
|
5962 | this.type = null;
|
5963 | this.staticResource = null;
|
5964 | this.htmlResource = null;
|
5965 | this.iframeResource = null;
|
5966 | this.nonlinearClickThroughURLTemplate = null;
|
5967 | this.nonlinearClickTrackingURLTemplates = [];
|
5968 | this.adParameters = null;
|
5969 | };
|
5970 |
|
5971 | }),
|
5972 |
|
5973 | (function(module, exports, __webpack_require__) {
|
5974 |
|
5975 | "use strict";
|
5976 |
|
5977 |
|
5978 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
5979 |
|
5980 |
|
5981 |
|
5982 |
|
5983 |
|
5984 |
|
5985 |
|
5986 |
|
5987 |
|
5988 |
|
5989 |
|
5990 |
|
5991 |
|
5992 |
|
5993 |
|
5994 |
|
5995 |
|
5996 |
|
5997 |
|
5998 |
|
5999 |
|
6000 |
|
6001 | function EventEmitter() {
|
6002 | this._events = this._events || {};
|
6003 | this._maxListeners = this._maxListeners || undefined;
|
6004 | }
|
6005 | module.exports = EventEmitter;
|
6006 |
|
6007 |
|
6008 | EventEmitter.EventEmitter = EventEmitter;
|
6009 |
|
6010 | EventEmitter.prototype._events = undefined;
|
6011 | EventEmitter.prototype._maxListeners = undefined;
|
6012 |
|
6013 |
|
6014 |
|
6015 | EventEmitter.defaultMaxListeners = 10;
|
6016 |
|
6017 |
|
6018 |
|
6019 | EventEmitter.prototype.setMaxListeners = function (n) {
|
6020 | if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');
|
6021 | this._maxListeners = n;
|
6022 | return this;
|
6023 | };
|
6024 |
|
6025 | EventEmitter.prototype.emit = function (type) {
|
6026 | var er, handler, len, args, i, listeners;
|
6027 |
|
6028 | if (!this._events) this._events = {};
|
6029 |
|
6030 |
|
6031 | if (type === 'error') {
|
6032 | if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {
|
6033 | er = arguments[1];
|
6034 | if (er instanceof Error) {
|
6035 | throw er;
|
6036 | } else {
|
6037 |
|
6038 | var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
|
6039 | err.context = er;
|
6040 | throw err;
|
6041 | }
|
6042 | }
|
6043 | }
|
6044 |
|
6045 | handler = this._events[type];
|
6046 |
|
6047 | if (isUndefined(handler)) return false;
|
6048 |
|
6049 | if (isFunction(handler)) {
|
6050 | switch (arguments.length) {
|
6051 |
|
6052 | case 1:
|
6053 | handler.call(this);
|
6054 | break;
|
6055 | case 2:
|
6056 | handler.call(this, arguments[1]);
|
6057 | break;
|
6058 | case 3:
|
6059 | handler.call(this, arguments[1], arguments[2]);
|
6060 | break;
|
6061 |
|
6062 | default:
|
6063 | args = Array.prototype.slice.call(arguments, 1);
|
6064 | handler.apply(this, args);
|
6065 | }
|
6066 | } else if (isObject(handler)) {
|
6067 | args = Array.prototype.slice.call(arguments, 1);
|
6068 | listeners = handler.slice();
|
6069 | len = listeners.length;
|
6070 | for (i = 0; i < len; i++) {
|
6071 | listeners[i].apply(this, args);
|
6072 | }
|
6073 | }
|
6074 |
|
6075 | return true;
|
6076 | };
|
6077 |
|
6078 | EventEmitter.prototype.addListener = function (type, listener) {
|
6079 | var m;
|
6080 |
|
6081 | if (!isFunction(listener)) throw TypeError('listener must be a function');
|
6082 |
|
6083 | if (!this._events) this._events = {};
|
6084 |
|
6085 |
|
6086 |
|
6087 | if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener);
|
6088 |
|
6089 | if (!this._events[type])
|
6090 |
|
6091 | this._events[type] = listener;else if (isObject(this._events[type]))
|
6092 |
|
6093 | this._events[type].push(listener);else
|
6094 |
|
6095 | this._events[type] = [this._events[type], listener];
|
6096 |
|
6097 |
|
6098 | if (isObject(this._events[type]) && !this._events[type].warned) {
|
6099 | if (!isUndefined(this._maxListeners)) {
|
6100 | m = this._maxListeners;
|
6101 | } else {
|
6102 | m = EventEmitter.defaultMaxListeners;
|
6103 | }
|
6104 |
|
6105 | if (m && m > 0 && this._events[type].length > m) {
|
6106 | this._events[type].warned = true;
|
6107 | console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);
|
6108 | if (typeof console.trace === 'function') {
|
6109 |
|
6110 | console.trace();
|
6111 | }
|
6112 | }
|
6113 | }
|
6114 |
|
6115 | return this;
|
6116 | };
|
6117 |
|
6118 | EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
6119 |
|
6120 | EventEmitter.prototype.once = function (type, listener) {
|
6121 | if (!isFunction(listener)) throw TypeError('listener must be a function');
|
6122 |
|
6123 | var fired = false;
|
6124 |
|
6125 | function g() {
|
6126 | this.removeListener(type, g);
|
6127 |
|
6128 | if (!fired) {
|
6129 | fired = true;
|
6130 | listener.apply(this, arguments);
|
6131 | }
|
6132 | }
|
6133 |
|
6134 | g.listener = listener;
|
6135 | this.on(type, g);
|
6136 |
|
6137 | return this;
|
6138 | };
|
6139 |
|
6140 |
|
6141 | EventEmitter.prototype.removeListener = function (type, listener) {
|
6142 | var list, position, length, i;
|
6143 |
|
6144 | if (!isFunction(listener)) throw TypeError('listener must be a function');
|
6145 |
|
6146 | if (!this._events || !this._events[type]) return this;
|
6147 |
|
6148 | list = this._events[type];
|
6149 | length = list.length;
|
6150 | position = -1;
|
6151 |
|
6152 | if (list === listener || isFunction(list.listener) && list.listener === listener) {
|
6153 | delete this._events[type];
|
6154 | if (this._events.removeListener) this.emit('removeListener', type, listener);
|
6155 | } else if (isObject(list)) {
|
6156 | for (i = length; i-- > 0;) {
|
6157 | if (list[i] === listener || list[i].listener && list[i].listener === listener) {
|
6158 | position = i;
|
6159 | break;
|
6160 | }
|
6161 | }
|
6162 |
|
6163 | if (position < 0) return this;
|
6164 |
|
6165 | if (list.length === 1) {
|
6166 | list.length = 0;
|
6167 | delete this._events[type];
|
6168 | } else {
|
6169 | list.splice(position, 1);
|
6170 | }
|
6171 |
|
6172 | if (this._events.removeListener) this.emit('removeListener', type, listener);
|
6173 | }
|
6174 |
|
6175 | return this;
|
6176 | };
|
6177 |
|
6178 | EventEmitter.prototype.removeAllListeners = function (type) {
|
6179 | var key, listeners;
|
6180 |
|
6181 | if (!this._events) return this;
|
6182 |
|
6183 |
|
6184 | if (!this._events.removeListener) {
|
6185 | if (arguments.length === 0) this._events = {};else if (this._events[type]) delete this._events[type];
|
6186 | return this;
|
6187 | }
|
6188 |
|
6189 |
|
6190 | if (arguments.length === 0) {
|
6191 | for (key in this._events) {
|
6192 | if (key === 'removeListener') continue;
|
6193 | this.removeAllListeners(key);
|
6194 | }
|
6195 | this.removeAllListeners('removeListener');
|
6196 | this._events = {};
|
6197 | return this;
|
6198 | }
|
6199 |
|
6200 | listeners = this._events[type];
|
6201 |
|
6202 | if (isFunction(listeners)) {
|
6203 | this.removeListener(type, listeners);
|
6204 | } else if (listeners) {
|
6205 |
|
6206 | while (listeners.length) {
|
6207 | this.removeListener(type, listeners[listeners.length - 1]);
|
6208 | }
|
6209 | }
|
6210 | delete this._events[type];
|
6211 |
|
6212 | return this;
|
6213 | };
|
6214 |
|
6215 | EventEmitter.prototype.listeners = function (type) {
|
6216 | var ret;
|
6217 | if (!this._events || !this._events[type]) ret = [];else if (isFunction(this._events[type])) ret = [this._events[type]];else ret = this._events[type].slice();
|
6218 | return ret;
|
6219 | };
|
6220 |
|
6221 | EventEmitter.prototype.listenerCount = function (type) {
|
6222 | if (this._events) {
|
6223 | var evlistener = this._events[type];
|
6224 |
|
6225 | if (isFunction(evlistener)) return 1;else if (evlistener) return evlistener.length;
|
6226 | }
|
6227 | return 0;
|
6228 | };
|
6229 |
|
6230 | EventEmitter.listenerCount = function (emitter, type) {
|
6231 | return emitter.listenerCount(type);
|
6232 | };
|
6233 |
|
6234 | function isFunction(arg) {
|
6235 | return typeof arg === 'function';
|
6236 | }
|
6237 |
|
6238 | function isNumber(arg) {
|
6239 | return typeof arg === 'number';
|
6240 | }
|
6241 |
|
6242 | function isObject(arg) {
|
6243 | return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null;
|
6244 | }
|
6245 |
|
6246 | function isUndefined(arg) {
|
6247 | return arg === void 0;
|
6248 | }
|
6249 |
|
6250 | }),
|
6251 |
|
6252 | (function(module, exports, __webpack_require__) {
|
6253 |
|
6254 | "use strict";
|
6255 |
|
6256 |
|
6257 | Object.defineProperty(exports, "__esModule", {
|
6258 | value: true
|
6259 | });
|
6260 | exports.JWPlayer = undefined;
|
6261 |
|
6262 | 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; }; }();
|
6263 |
|
6264 | var _react = __webpack_require__(0);
|
6265 |
|
6266 | var _react2 = _interopRequireDefault(_react);
|
6267 |
|
6268 | var _utils = __webpack_require__(1);
|
6269 |
|
6270 | var _singlePlayer = __webpack_require__(2);
|
6271 |
|
6272 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
6273 |
|
6274 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6275 |
|
6276 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6277 |
|
6278 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
6279 |
|
6280 | 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; }
|
6281 |
|
6282 | var SDK_URL = '//cdn.jwplayer.com/libraries/8DNY8ff0.js';
|
6283 | var SDK_GLOBAL = 'jwplayer';
|
6284 |
|
6285 | var MATCH_VIDEO_URL = /jwplayer/;
|
6286 | var PLAYER_ID_PREFIX = 'jw-player-';
|
6287 |
|
6288 | var JWPlayer = exports.JWPlayer = function (_Component) {
|
6289 | _inherits(JWPlayer, _Component);
|
6290 |
|
6291 | function JWPlayer() {
|
6292 | var _ref;
|
6293 |
|
6294 | var _temp, _this, _ret;
|
6295 |
|
6296 | _classCallCheck(this, JWPlayer);
|
6297 |
|
6298 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
6299 | args[_key] = arguments[_key];
|
6300 | }
|
6301 |
|
6302 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = JWPlayer.__proto__ || Object.getPrototypeOf(JWPlayer)).call.apply(_ref, [this].concat(args))), _this), _this.callPlayer = _utils.callPlayer, _this.playerID = PLAYER_ID_PREFIX + (0, _utils.randomString)(), _this.mute = function () {
|
6303 | _this.callPlayer('setMute', true);
|
6304 | }, _this.unmute = function () {
|
6305 | _this.callPlayer('setMute', false);
|
6306 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
6307 | }
|
6308 |
|
6309 | _createClass(JWPlayer, [{
|
6310 | key: 'load',
|
6311 | value: function load(url, isReady) {
|
6312 | var _this2 = this;
|
6313 |
|
6314 | var onError = this.props.onError;
|
6315 |
|
6316 | if (isReady) {
|
6317 | this.player.setup({
|
6318 | file: url
|
6319 | });
|
6320 | } else {
|
6321 | (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (jwplayer) {
|
6322 | _this2.player = jwplayer(_this2.playerID).setup({
|
6323 | file: url
|
6324 | });
|
6325 | _this2.player.on('ready', _this2.props.onReady);
|
6326 | _this2.player.on('play', _this2.props.onPlay);
|
6327 | _this2.player.on('pause', _this2.props.onPause);
|
6328 | _this2.player.on('error', onError);
|
6329 | }, onError);
|
6330 | }
|
6331 | }
|
6332 | }, {
|
6333 | key: 'handleUnmount',
|
6334 | value: function handleUnmount() {
|
6335 | this.callPlayer('remove');
|
6336 | }
|
6337 | }, {
|
6338 | key: 'play',
|
6339 | value: function play() {
|
6340 | this.callPlayer('play');
|
6341 | }
|
6342 | }, {
|
6343 | key: 'pause',
|
6344 | value: function pause() {
|
6345 | this.callPlayer('pause');
|
6346 | }
|
6347 | }, {
|
6348 | key: 'stop',
|
6349 | value: function stop() {
|
6350 | this.callPlayer('stop');
|
6351 | }
|
6352 | }, {
|
6353 | key: 'seekTo',
|
6354 | value: function seekTo(seconds) {
|
6355 | this.callPlayer('seek', seconds);
|
6356 | }
|
6357 | }, {
|
6358 | key: 'getVolume',
|
6359 | value: function getVolume() {
|
6360 | return this.callPlayer('getVolume') / 100;
|
6361 | }
|
6362 | }, {
|
6363 | key: 'getMuted',
|
6364 | value: function getMuted() {
|
6365 | return this.callPlayer('getMute');
|
6366 | }
|
6367 | }, {
|
6368 | key: 'setVolume',
|
6369 | value: function setVolume(fraction) {
|
6370 | this.callPlayer('setVolume', fraction * 100);
|
6371 | }
|
6372 | }, {
|
6373 | key: 'getDuration',
|
6374 | value: function getDuration() {
|
6375 | return this.callPlayer('getDuration');
|
6376 | }
|
6377 | }, {
|
6378 | key: 'getCurrentTime',
|
6379 | value: function getCurrentTime() {
|
6380 | return this.callPlayer('getCurrentPosition');
|
6381 | }
|
6382 | }, {
|
6383 | key: 'getSecondsLoaded',
|
6384 | value: function getSecondsLoaded() {
|
6385 | return null;
|
6386 | }
|
6387 | }, {
|
6388 | key: 'render',
|
6389 | value: function render() {
|
6390 | var style = {
|
6391 | width: '100%',
|
6392 | height: '100%'
|
6393 | };
|
6394 | return _react2['default'].createElement('div', { style: style, id: this.playerID });
|
6395 | }
|
6396 | }]);
|
6397 |
|
6398 | return JWPlayer;
|
6399 | }(_react.Component);
|
6400 |
|
6401 | JWPlayer.displayName = 'JWPlayer';
|
6402 |
|
6403 | JWPlayer.canPlay = function (url) {
|
6404 | return MATCH_VIDEO_URL.test(url);
|
6405 | };
|
6406 |
|
6407 | JWPlayer.loopOnEnded = true;
|
6408 | exports['default'] = (0, _singlePlayer2['default'])(JWPlayer);
|
6409 |
|
6410 | }),
|
6411 |
|
6412 | (function(module, exports, __webpack_require__) {
|
6413 |
|
6414 | "use strict";
|
6415 |
|
6416 |
|
6417 | Object.defineProperty(exports, "__esModule", {
|
6418 | value: true
|
6419 | });
|
6420 | exports.PhenixPlayer = undefined;
|
6421 |
|
6422 | 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; }; }();
|
6423 |
|
6424 | var _react = __webpack_require__(0);
|
6425 |
|
6426 | var _react2 = _interopRequireDefault(_react);
|
6427 |
|
6428 | var _utils = __webpack_require__(1);
|
6429 |
|
6430 | var _singlePlayer = __webpack_require__(2);
|
6431 |
|
6432 | var _singlePlayer2 = _interopRequireDefault(_singlePlayer);
|
6433 |
|
6434 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6435 |
|
6436 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6437 |
|
6438 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
6439 |
|
6440 | 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; }
|
6441 |
|
6442 |
|
6443 |
|
6444 | var PHENIX_SDK_URL = 'https://unpkg.com/phenix-web-sdk@2019.2.3/dist/phenix-web-sdk.min.js';
|
6445 | var PHENIX_SDK_GLOBAL = 'phenix-web-sdk';
|
6446 |
|
6447 |
|
6448 | var PHENIX_URL_REGEX = /^phenix:(.+?)\|(.+?)(?:\|(.+?))?$/i;
|
6449 |
|
6450 | function getPhenixSdk() {
|
6451 | return (0, _utils.getSDK)(PHENIX_SDK_URL, PHENIX_SDK_GLOBAL);
|
6452 | }
|
6453 |
|
6454 | function canPlay(url) {
|
6455 | return PHENIX_URL_REGEX.test(url);
|
6456 | }
|
6457 |
|
6458 | var PhenixPlayer = exports.PhenixPlayer = function (_Component) {
|
6459 | _inherits(PhenixPlayer, _Component);
|
6460 |
|
6461 | function PhenixPlayer() {
|
6462 | var _ref;
|
6463 |
|
6464 | var _temp, _this, _ret;
|
6465 |
|
6466 | _classCallCheck(this, PhenixPlayer);
|
6467 |
|
6468 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
6469 | args[_key] = arguments[_key];
|
6470 | }
|
6471 |
|
6472 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = PhenixPlayer.__proto__ || Object.getPrototypeOf(PhenixPlayer)).call.apply(_ref, [this].concat(args))), _this), _this.player = null, _this.channelExpress = null, _this.playerRef = function (player) {
|
6473 | if (player === _this.player) {
|
6474 | return;
|
6475 | }
|
6476 | if (_this.player) {
|
6477 | _this.removeListeners();
|
6478 | }
|
6479 | _this.player = player;
|
6480 | if (_this.player) {
|
6481 | _this.addListeners();
|
6482 | }
|
6483 | }, _this.onSeek = function (e) {
|
6484 | _this.props.onSeek(e.target.currentTime);
|
6485 | }, _this.mute = function () {
|
6486 | _this.player.muted = true;
|
6487 | }, _this.unmute = function () {
|
6488 | _this.player.muted = false;
|
6489 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
6490 | }
|
6491 |
|
6492 | _createClass(PhenixPlayer, [{
|
6493 | key: 'componentWillUnmount',
|
6494 | value: function componentWillUnmount() {
|
6495 |
|
6496 | if (this.player) {
|
6497 | this.removeListeners();
|
6498 | this.player = null;
|
6499 | }
|
6500 | if (this.channelExpress) {
|
6501 | this.channelExpress.dispose();
|
6502 | this.channelExpress = null;
|
6503 | }
|
6504 | }
|
6505 | }, {
|
6506 | key: 'addListeners',
|
6507 | value: function addListeners() {
|
6508 | var _props = this.props,
|
6509 | onReady = _props.onReady,
|
6510 | onPlay = _props.onPlay,
|
6511 | onPause = _props.onPause,
|
6512 | onEnded = _props.onEnded,
|
6513 | onVolumeChange = _props.onVolumeChange,
|
6514 | onError = _props.onError,
|
6515 | playsinline = _props.playsinline,
|
6516 | videoElementId = _props.videoElementId;
|
6517 |
|
6518 | this.player.addEventListener('canplay', onReady);
|
6519 | this.player.addEventListener('play', onPlay);
|
6520 | this.player.addEventListener('pause', onPause);
|
6521 | this.player.addEventListener('seeked', this.onSeek);
|
6522 | this.player.addEventListener('ended', onEnded);
|
6523 | this.player.addEventListener('error', onError);
|
6524 | this.player.addEventListener('volumechange', onVolumeChange);
|
6525 |
|
6526 | this.player.setAttribute('id', videoElementId);
|
6527 | if (playsinline) {
|
6528 | this.player.setAttribute('playsinline', '');
|
6529 | this.player.setAttribute('webkit-playsinline', '');
|
6530 | }
|
6531 | }
|
6532 | }, {
|
6533 | key: 'removeListeners',
|
6534 | value: function removeListeners() {
|
6535 | var _props2 = this.props,
|
6536 | onReady = _props2.onReady,
|
6537 | onPlay = _props2.onPlay,
|
6538 | onPause = _props2.onPause,
|
6539 | onEnded = _props2.onEnded,
|
6540 | onVolumeChange = _props2.onVolumeChange,
|
6541 | onError = _props2.onError;
|
6542 |
|
6543 | this.player.removeEventListener('canplay', onReady);
|
6544 | this.player.removeEventListener('play', onPlay);
|
6545 | this.player.removeEventListener('pause', onPause);
|
6546 | this.player.removeEventListener('seeked', this.onSeek);
|
6547 | this.player.removeEventListener('ended', onEnded);
|
6548 | this.player.removeEventListener('error', onError);
|
6549 | this.player.removeEventListener('volumechange', onVolumeChange);
|
6550 | }
|
6551 | }, {
|
6552 | key: 'getPhenixBackendUri',
|
6553 | value: function getPhenixBackendUri() {
|
6554 | var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.url;
|
6555 |
|
6556 | return PHENIX_URL_REGEX.exec(url)[1];
|
6557 | }
|
6558 | }, {
|
6559 | key: 'getPhenixChannelId',
|
6560 | value: function getPhenixChannelId() {
|
6561 | var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.url;
|
6562 |
|
6563 | return PHENIX_URL_REGEX.exec(url)[2];
|
6564 | }
|
6565 | }, {
|
6566 | key: 'getPhenixAuthenticationData',
|
6567 | value: function getPhenixAuthenticationData() {
|
6568 | var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.url;
|
6569 |
|
6570 | var match = PHENIX_URL_REGEX.exec(url)[3];
|
6571 | return match ? JSON.parse(match) : {};
|
6572 | }
|
6573 | }, {
|
6574 | key: 'load',
|
6575 | value: function load(url) {
|
6576 | var _this2 = this;
|
6577 |
|
6578 | var backendUri = this.getPhenixBackendUri(url);
|
6579 | var channelId = this.getPhenixChannelId(url);
|
6580 | var authenticationData = this.getPhenixAuthenticationData(url);
|
6581 |
|
6582 | var joinChannelCallback = function joinChannelCallback(err, response) {
|
6583 | var success = !err && response.status === 'ok';
|
6584 | if (!success) {
|
6585 | var error = err || new Error('Response status: ' + response.status);
|
6586 | _this2.props.onError(error);
|
6587 | }
|
6588 | };
|
6589 |
|
6590 | var subscriberCallback = function subscriberCallback(err, response) {
|
6591 | var success = !err && ['ok', 'no-stream-playing'].includes(response.status);
|
6592 | if (!success) {
|
6593 | var error = err || new Error('Response status: ' + response.status);
|
6594 | _this2.props.onError(error);
|
6595 | }
|
6596 |
|
6597 | };
|
6598 |
|
6599 | getPhenixSdk().then(function (phenix) {
|
6600 |
|
6601 | if (url !== _this2.props.url) {
|
6602 | return;
|
6603 | }
|
6604 | if (_this2.channelExpress) {
|
6605 | _this2.channelExpress.dispose();
|
6606 | _this2.channelExpress = null;
|
6607 | }
|
6608 | _this2.channelExpress = new phenix.express.ChannelExpress({
|
6609 | authenticationData: authenticationData,
|
6610 | backendUri: backendUri
|
6611 | });
|
6612 | _this2.channelExpress.joinChannel({
|
6613 | channelId: channelId,
|
6614 | videoElement: _this2.player
|
6615 | }, joinChannelCallback, subscriberCallback);
|
6616 | });
|
6617 | }
|
6618 | }, {
|
6619 | key: 'play',
|
6620 | value: function play() {
|
6621 | var promise = this.player.play();
|
6622 | if (promise) {
|
6623 | promise['catch'](this.props.onError);
|
6624 | }
|
6625 | }
|
6626 | }, {
|
6627 | key: 'pause',
|
6628 | value: function pause() {
|
6629 | this.player.pause();
|
6630 | }
|
6631 | }, {
|
6632 | key: 'stop',
|
6633 | value: function stop() {
|
6634 | if (this.channelExpress) {
|
6635 | this.channelExpress.dispose();
|
6636 | this.channelExpress = null;
|
6637 | }
|
6638 | }
|
6639 | }, {
|
6640 | key: 'seekTo',
|
6641 | value: function seekTo(seconds) {
|
6642 | if (seconds === Infinity || this.getDuration() === Infinity) {
|
6643 | return;
|
6644 | }
|
6645 | this.player.currentTime = seconds;
|
6646 | }
|
6647 | }, {
|
6648 | key: 'setVolume',
|
6649 | value: function setVolume(fraction) {
|
6650 | this.player.volume = fraction;
|
6651 | }
|
6652 | }, {
|
6653 | key: 'setPlaybackRate',
|
6654 | value: function setPlaybackRate(rate) {
|
6655 | this.player.playbackRate = rate;
|
6656 | }
|
6657 | }, {
|
6658 | key: 'getDuration',
|
6659 | value: function getDuration() {
|
6660 | return this.player.duration;
|
6661 | }
|
6662 | }, {
|
6663 | key: 'getCurrentTime',
|
6664 | value: function getCurrentTime() {
|
6665 | return this.player.currentTime;
|
6666 | }
|
6667 | }, {
|
6668 | key: 'getSecondsLoaded',
|
6669 | value: function getSecondsLoaded() {
|
6670 | var buffered = this.player.buffered;
|
6671 |
|
6672 | if (buffered.length === 0) {
|
6673 | return 0;
|
6674 | }
|
6675 | var end = buffered.end(buffered.length - 1);
|
6676 | var duration = this.getDuration();
|
6677 | if (end > duration) {
|
6678 | return duration;
|
6679 | }
|
6680 | return end;
|
6681 | }
|
6682 | }, {
|
6683 | key: 'render',
|
6684 | value: function render() {
|
6685 | var _props3 = this.props,
|
6686 | playing = _props3.playing,
|
6687 | loop = _props3.loop,
|
6688 | controls = _props3.controls,
|
6689 | muted = _props3.muted,
|
6690 | width = _props3.width,
|
6691 | height = _props3.height;
|
6692 |
|
6693 | var style = {
|
6694 | width: width === 'auto' ? width : '100%',
|
6695 | height: height === 'auto' ? height : '100%'
|
6696 | };
|
6697 | return _react2['default'].createElement('video', {
|
6698 | ref: this.playerRef,
|
6699 | style: style,
|
6700 | preload: 'auto'
|
6701 | , autoPlay: playing
|
6702 | , controls: controls
|
6703 | , muted: muted,
|
6704 | loop: loop
|
6705 | });
|
6706 | }
|
6707 | }]);
|
6708 |
|
6709 | return PhenixPlayer;
|
6710 | }(_react.Component);
|
6711 |
|
6712 | PhenixPlayer.displayName = 'PhenixPlayer';
|
6713 | PhenixPlayer.canPlay = canPlay;
|
6714 | exports['default'] = (0, _singlePlayer2['default'])(PhenixPlayer);
|
6715 |
|
6716 | }),
|
6717 |
|
6718 | (function(module, exports, __webpack_require__) {
|
6719 |
|
6720 | "use strict";
|
6721 |
|
6722 |
|
6723 | Object.defineProperty(exports, "__esModule", {
|
6724 | value: true
|
6725 | });
|
6726 | exports['default'] = renderReactPlayer;
|
6727 |
|
6728 | var _react = __webpack_require__(0);
|
6729 |
|
6730 | var _react2 = _interopRequireDefault(_react);
|
6731 |
|
6732 | var _reactDom = __webpack_require__(36);
|
6733 |
|
6734 | var _ReactPlayer = __webpack_require__(46);
|
6735 |
|
6736 | var _ReactPlayer2 = _interopRequireDefault(_ReactPlayer);
|
6737 |
|
6738 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
6739 |
|
6740 | function renderReactPlayer(container, props) {
|
6741 | (0, _reactDom.render)(_react2['default'].createElement(_ReactPlayer2['default'], props), container);
|
6742 | }
|
6743 |
|
6744 | }),
|
6745 |
|
6746 | (function(module, exports, __webpack_require__) {
|
6747 |
|
6748 | "use strict";
|
6749 |
|
6750 |
|
6751 |
|
6752 |
|
6753 |
|
6754 |
|
6755 |
|
6756 |
|
6757 |
|
6758 |
|
6759 |
|
6760 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
6761 |
|
6762 | var m = __webpack_require__(14),
|
6763 | n = __webpack_require__(15),
|
6764 | p = __webpack_require__(4),
|
6765 | q = "function" === typeof Symbol && Symbol["for"],
|
6766 | r = q ? Symbol["for"]("react.element") : 60103,
|
6767 | t = q ? Symbol["for"]("react.call") : 60104,
|
6768 | u = q ? Symbol["for"]("react.return") : 60105,
|
6769 | v = q ? Symbol["for"]("react.portal") : 60106,
|
6770 | w = q ? Symbol["for"]("react.fragment") : 60107,
|
6771 | x = "function" === typeof Symbol && Symbol.iterator;
|
6772 | function y(a) {
|
6773 | for (var b = arguments.length - 1, e = "Minified React error #" + a + "; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d" + a, c = 0; c < b; c++) {
|
6774 | e += "\x26args[]\x3d" + encodeURIComponent(arguments[c + 1]);
|
6775 | }b = Error(e + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name = "Invariant Violation";b.framesToPop = 1;throw b;
|
6776 | }
|
6777 | var z = { isMounted: function isMounted() {
|
6778 | return !1;
|
6779 | }, enqueueForceUpdate: function enqueueForceUpdate() {}, enqueueReplaceState: function enqueueReplaceState() {}, enqueueSetState: function enqueueSetState() {} };function A(a, b, e) {
|
6780 | this.props = a;this.context = b;this.refs = n;this.updater = e || z;
|
6781 | }A.prototype.isReactComponent = {};A.prototype.setState = function (a, b) {
|
6782 | "object" !== (typeof a === "undefined" ? "undefined" : _typeof(a)) && "function" !== typeof a && null != a ? y("85") : void 0;this.updater.enqueueSetState(this, a, b, "setState");
|
6783 | };A.prototype.forceUpdate = function (a) {
|
6784 | this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
6785 | };
|
6786 | function B(a, b, e) {
|
6787 | this.props = a;this.context = b;this.refs = n;this.updater = e || z;
|
6788 | }function C() {}C.prototype = A.prototype;var D = B.prototype = new C();D.constructor = B;m(D, A.prototype);D.isPureReactComponent = !0;function E(a, b, e) {
|
6789 | this.props = a;this.context = b;this.refs = n;this.updater = e || z;
|
6790 | }var F = E.prototype = new C();F.constructor = E;m(F, A.prototype);F.unstable_isAsyncReactComponent = !0;F.render = function () {
|
6791 | return this.props.children;
|
6792 | };var G = { current: null },
|
6793 | H = Object.prototype.hasOwnProperty,
|
6794 | I = { key: !0, ref: !0, __self: !0, __source: !0 };
|
6795 | function J(a, b, e) {
|
6796 | var c,
|
6797 | d = {},
|
6798 | g = null,
|
6799 | k = null;if (null != b) for (c in void 0 !== b.ref && (k = b.ref), void 0 !== b.key && (g = "" + b.key), b) {
|
6800 | H.call(b, c) && !I.hasOwnProperty(c) && (d[c] = b[c]);
|
6801 | }var f = arguments.length - 2;if (1 === f) d.children = e;else if (1 < f) {
|
6802 | for (var h = Array(f), l = 0; l < f; l++) {
|
6803 | h[l] = arguments[l + 2];
|
6804 | }d.children = h;
|
6805 | }if (a && a.defaultProps) for (c in f = a.defaultProps, f) {
|
6806 | void 0 === d[c] && (d[c] = f[c]);
|
6807 | }return { $$typeof: r, type: a, key: g, ref: k, props: d, _owner: G.current };
|
6808 | }function K(a) {
|
6809 | return "object" === (typeof a === "undefined" ? "undefined" : _typeof(a)) && null !== a && a.$$typeof === r;
|
6810 | }
|
6811 | function escape(a) {
|
6812 | var b = { "\x3d": "\x3d0", ":": "\x3d2" };return "$" + ("" + a).replace(/[=:]/g, function (a) {
|
6813 | return b[a];
|
6814 | });
|
6815 | }var L = /\/+/g,
|
6816 | M = [];function N(a, b, e, c) {
|
6817 | if (M.length) {
|
6818 | var d = M.pop();d.result = a;d.keyPrefix = b;d.func = e;d.context = c;d.count = 0;return d;
|
6819 | }return { result: a, keyPrefix: b, func: e, context: c, count: 0 };
|
6820 | }function O(a) {
|
6821 | a.result = null;a.keyPrefix = null;a.func = null;a.context = null;a.count = 0;10 > M.length && M.push(a);
|
6822 | }
|
6823 | function P(a, b, e, c) {
|
6824 | var d = typeof a === "undefined" ? "undefined" : _typeof(a);if ("undefined" === d || "boolean" === d) a = null;var g = !1;if (null === a) g = !0;else switch (d) {case "string":case "number":
|
6825 | g = !0;break;case "object":
|
6826 | switch (a.$$typeof) {case r:case t:case u:case v:
|
6827 | g = !0;}}if (g) return e(c, a, "" === b ? "." + Q(a, 0) : b), 1;g = 0;b = "" === b ? "." : b + ":";if (Array.isArray(a)) for (var k = 0; k < a.length; k++) {
|
6828 | d = a[k];var f = b + Q(d, k);g += P(d, f, e, c);
|
6829 | } else if (null === a || "undefined" === typeof a ? f = null : (f = x && a[x] || a["@@iterator"], f = "function" === typeof f ? f : null), "function" === typeof f) for (a = f.call(a), k = 0; !(d = a.next()).done;) {
|
6830 | d = d.value, f = b + Q(d, k++), g += P(d, f, e, c);
|
6831 | } else "object" === d && (e = "" + a, y("31", "[object Object]" === e ? "object with keys {" + Object.keys(a).join(", ") + "}" : e, ""));return g;
|
6832 | }function Q(a, b) {
|
6833 | return "object" === (typeof a === "undefined" ? "undefined" : _typeof(a)) && null !== a && null != a.key ? escape(a.key) : b.toString(36);
|
6834 | }function R(a, b) {
|
6835 | a.func.call(a.context, b, a.count++);
|
6836 | }
|
6837 | function S(a, b, e) {
|
6838 | var c = a.result,
|
6839 | d = a.keyPrefix;a = a.func.call(a.context, b, a.count++);Array.isArray(a) ? T(a, c, e, p.thatReturnsArgument) : null != a && (K(a) && (b = d + (!a.key || b && b.key === a.key ? "" : ("" + a.key).replace(L, "$\x26/") + "/") + e, a = { $$typeof: r, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }), c.push(a));
|
6840 | }function T(a, b, e, c, d) {
|
6841 | var g = "";null != e && (g = ("" + e).replace(L, "$\x26/") + "/");b = N(b, g, c, d);null == a || P(a, "", S, b);O(b);
|
6842 | }
|
6843 | var U = { Children: { map: function map(a, b, e) {
|
6844 | if (null == a) return a;var c = [];T(a, c, null, b, e);return c;
|
6845 | }, forEach: function forEach(a, b, e) {
|
6846 | if (null == a) return a;b = N(null, null, b, e);null == a || P(a, "", R, b);O(b);
|
6847 | }, count: function count(a) {
|
6848 | return null == a ? 0 : P(a, "", p.thatReturnsNull, null);
|
6849 | }, toArray: function toArray(a) {
|
6850 | var b = [];T(a, b, null, p.thatReturnsArgument);return b;
|
6851 | }, only: function only(a) {
|
6852 | K(a) ? void 0 : y("143");return a;
|
6853 | } }, Component: A, PureComponent: B, unstable_AsyncComponent: E, Fragment: w, createElement: J, cloneElement: function cloneElement(a, b, e) {
|
6854 | var c = m({}, a.props),
|
6855 | d = a.key,
|
6856 | g = a.ref,
|
6857 | k = a._owner;if (null != b) {
|
6858 | void 0 !== b.ref && (g = b.ref, k = G.current);void 0 !== b.key && (d = "" + b.key);if (a.type && a.type.defaultProps) var f = a.type.defaultProps;for (h in b) {
|
6859 | H.call(b, h) && !I.hasOwnProperty(h) && (c[h] = void 0 === b[h] && void 0 !== f ? f[h] : b[h]);
|
6860 | }
|
6861 | }var h = arguments.length - 2;if (1 === h) c.children = e;else if (1 < h) {
|
6862 | f = Array(h);for (var l = 0; l < h; l++) {
|
6863 | f[l] = arguments[l + 2];
|
6864 | }c.children = f;
|
6865 | }return { $$typeof: r, type: a.type, key: d, ref: g, props: c, _owner: k };
|
6866 | }, createFactory: function createFactory(a) {
|
6867 | var b = J.bind(null, a);b.type = a;return b;
|
6868 | },
|
6869 | isValidElement: K, version: "16.2.0", __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { ReactCurrentOwner: G, assign: m } },
|
6870 | V = Object.freeze({ "default": U }),
|
6871 | W = V && U || V;module.exports = W["default"] ? W["default"] : W;
|
6872 |
|
6873 | }),
|
6874 |
|
6875 | (function(module, exports, __webpack_require__) {
|
6876 |
|
6877 | "use strict";
|
6878 |
|
6879 |
|
6880 | function checkDCE() {
|
6881 |
|
6882 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {
|
6883 | return;
|
6884 | }
|
6885 | if (false) {
|
6886 |
|
6887 |
|
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 | throw new Error('^_^');
|
6894 | }
|
6895 | try {
|
6896 |
|
6897 | __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
6898 | } catch (err) {
|
6899 |
|
6900 |
|
6901 | console.error(err);
|
6902 | }
|
6903 | }
|
6904 |
|
6905 | if (true) {
|
6906 |
|
6907 |
|
6908 | checkDCE();
|
6909 | module.exports = __webpack_require__(37);
|
6910 | } else {
|
6911 | module.exports = require('./cjs/react-dom.development.js');
|
6912 | }
|
6913 |
|
6914 | }),
|
6915 |
|
6916 | (function(module, exports, __webpack_require__) {
|
6917 |
|
6918 | "use strict";
|
6919 |
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 |
|
6932 |
|
6933 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
6934 |
|
6935 | var aa = __webpack_require__(0),
|
6936 | l = __webpack_require__(38),
|
6937 | B = __webpack_require__(14),
|
6938 | C = __webpack_require__(4),
|
6939 | ba = __webpack_require__(39),
|
6940 | da = __webpack_require__(40),
|
6941 | ea = __webpack_require__(41),
|
6942 | fa = __webpack_require__(42),
|
6943 | ia = __webpack_require__(45),
|
6944 | D = __webpack_require__(15);
|
6945 | function E(a) {
|
6946 | for (var b = arguments.length - 1, c = "Minified React error #" + a + "; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d" + a, d = 0; d < b; d++) {
|
6947 | c += "\x26args[]\x3d" + encodeURIComponent(arguments[d + 1]);
|
6948 | }b = Error(c + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name = "Invariant Violation";b.framesToPop = 1;throw b;
|
6949 | }aa ? void 0 : E("227");
|
6950 | var oa = { children: !0, dangerouslySetInnerHTML: !0, defaultValue: !0, defaultChecked: !0, innerHTML: !0, suppressContentEditableWarning: !0, suppressHydrationWarning: !0, style: !0 };function pa(a, b) {
|
6951 | return (a & b) === b;
|
6952 | }
|
6953 | var ta = { MUST_USE_PROPERTY: 1, HAS_BOOLEAN_VALUE: 4, HAS_NUMERIC_VALUE: 8, HAS_POSITIVE_NUMERIC_VALUE: 24, HAS_OVERLOADED_BOOLEAN_VALUE: 32, HAS_STRING_BOOLEAN_VALUE: 64, injectDOMPropertyConfig: function injectDOMPropertyConfig(a) {
|
6954 | var b = ta,
|
6955 | c = a.Properties || {},
|
6956 | d = a.DOMAttributeNamespaces || {},
|
6957 | e = a.DOMAttributeNames || {};a = a.DOMMutationMethods || {};for (var f in c) {
|
6958 | ua.hasOwnProperty(f) ? E("48", f) : void 0;var g = f.toLowerCase(),
|
6959 | h = c[f];g = { attributeName: g, attributeNamespace: null, propertyName: f, mutationMethod: null, mustUseProperty: pa(h, b.MUST_USE_PROPERTY),
|
6960 | hasBooleanValue: pa(h, b.HAS_BOOLEAN_VALUE), hasNumericValue: pa(h, b.HAS_NUMERIC_VALUE), hasPositiveNumericValue: pa(h, b.HAS_POSITIVE_NUMERIC_VALUE), hasOverloadedBooleanValue: pa(h, b.HAS_OVERLOADED_BOOLEAN_VALUE), hasStringBooleanValue: pa(h, b.HAS_STRING_BOOLEAN_VALUE) };1 >= g.hasBooleanValue + g.hasNumericValue + g.hasOverloadedBooleanValue ? void 0 : E("50", f);e.hasOwnProperty(f) && (g.attributeName = e[f]);d.hasOwnProperty(f) && (g.attributeNamespace = d[f]);a.hasOwnProperty(f) && (g.mutationMethod = a[f]);ua[f] = g;
|
6961 | }
|
6962 | } },
|
6963 | ua = {};
|
6964 | function va(a, b) {
|
6965 | if (oa.hasOwnProperty(a) || 2 < a.length && ("o" === a[0] || "O" === a[0]) && ("n" === a[1] || "N" === a[1])) return !1;if (null === b) return !0;switch (typeof b === "undefined" ? "undefined" : _typeof(b)) {case "boolean":
|
6966 | return oa.hasOwnProperty(a) ? a = !0 : (b = wa(a)) ? a = b.hasBooleanValue || b.hasStringBooleanValue || b.hasOverloadedBooleanValue : (a = a.toLowerCase().slice(0, 5), a = "data-" === a || "aria-" === a), a;case "undefined":case "number":case "string":case "object":
|
6967 | return !0;default:
|
6968 | return !1;}
|
6969 | }function wa(a) {
|
6970 | return ua.hasOwnProperty(a) ? ua[a] : null;
|
6971 | }
|
6972 | var xa = ta,
|
6973 | ya = xa.MUST_USE_PROPERTY,
|
6974 | K = xa.HAS_BOOLEAN_VALUE,
|
6975 | za = xa.HAS_NUMERIC_VALUE,
|
6976 | Aa = xa.HAS_POSITIVE_NUMERIC_VALUE,
|
6977 | Ba = xa.HAS_OVERLOADED_BOOLEAN_VALUE,
|
6978 | Ca = xa.HAS_STRING_BOOLEAN_VALUE,
|
6979 | Da = { Properties: { allowFullScreen: K, async: K, autoFocus: K, autoPlay: K, capture: Ba, checked: ya | K, cols: Aa, contentEditable: Ca, controls: K, "default": K, defer: K, disabled: K, download: Ba, draggable: Ca, formNoValidate: K, hidden: K, loop: K, multiple: ya | K, muted: ya | K, noValidate: K, open: K, playsInline: K, readOnly: K, required: K, reversed: K, rows: Aa, rowSpan: za,
|
6980 | scoped: K, seamless: K, selected: ya | K, size: Aa, start: za, span: Aa, spellCheck: Ca, style: 0, tabIndex: 0, itemScope: K, acceptCharset: 0, className: 0, htmlFor: 0, httpEquiv: 0, value: Ca }, DOMAttributeNames: { acceptCharset: "accept-charset", className: "class", htmlFor: "for", httpEquiv: "http-equiv" }, DOMMutationMethods: { value: function value(a, b) {
|
6981 | if (null == b) return a.removeAttribute("value");"number" !== a.type || !1 === a.hasAttribute("value") ? a.setAttribute("value", "" + b) : a.validity && !a.validity.badInput && a.ownerDocument.activeElement !== a && a.setAttribute("value", "" + b);
|
6982 | } } },
|
6983 | Ea = xa.HAS_STRING_BOOLEAN_VALUE,
|
6984 | M = { xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace" },
|
6985 | Ga = { Properties: { autoReverse: Ea, externalResourcesRequired: Ea, preserveAlpha: Ea }, DOMAttributeNames: { autoReverse: "autoReverse", externalResourcesRequired: "externalResourcesRequired", preserveAlpha: "preserveAlpha" }, DOMAttributeNamespaces: { xlinkActuate: M.xlink, xlinkArcrole: M.xlink, xlinkHref: M.xlink, xlinkRole: M.xlink, xlinkShow: M.xlink, xlinkTitle: M.xlink, xlinkType: M.xlink,
|
6986 | xmlBase: M.xml, xmlLang: M.xml, xmlSpace: M.xml } },
|
6987 | Ha = /[\-\:]([a-z])/g;function Ia(a) {
|
6988 | return a[1].toUpperCase();
|
6989 | }
|
6990 | "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode x-height xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xmlns:xlink xml:lang xml:space".split(" ").forEach(function (a) {
|
6991 | var b = a.replace(Ha, Ia);Ga.Properties[b] = 0;Ga.DOMAttributeNames[b] = a;
|
6992 | });xa.injectDOMPropertyConfig(Da);xa.injectDOMPropertyConfig(Ga);
|
6993 | var P = { _caughtError: null, _hasCaughtError: !1, _rethrowError: null, _hasRethrowError: !1, injection: { injectErrorUtils: function injectErrorUtils(a) {
|
6994 | "function" !== typeof a.invokeGuardedCallback ? E("197") : void 0;Ja = a.invokeGuardedCallback;
|
6995 | } }, invokeGuardedCallback: function invokeGuardedCallback(a, b, c, d, e, f, g, h, k) {
|
6996 | Ja.apply(P, arguments);
|
6997 | }, invokeGuardedCallbackAndCatchFirstError: function invokeGuardedCallbackAndCatchFirstError(a, b, c, d, e, f, g, h, k) {
|
6998 | P.invokeGuardedCallback.apply(this, arguments);if (P.hasCaughtError()) {
|
6999 | var q = P.clearCaughtError();P._hasRethrowError || (P._hasRethrowError = !0, P._rethrowError = q);
|
7000 | }
|
7001 | }, rethrowCaughtError: function rethrowCaughtError() {
|
7002 | return Ka.apply(P, arguments);
|
7003 | }, hasCaughtError: function hasCaughtError() {
|
7004 | return P._hasCaughtError;
|
7005 | }, clearCaughtError: function clearCaughtError() {
|
7006 | if (P._hasCaughtError) {
|
7007 | var a = P._caughtError;P._caughtError = null;P._hasCaughtError = !1;return a;
|
7008 | }E("198");
|
7009 | } };function Ja(a, b, c, d, e, f, g, h, k) {
|
7010 | P._hasCaughtError = !1;P._caughtError = null;var q = Array.prototype.slice.call(arguments, 3);try {
|
7011 | b.apply(c, q);
|
7012 | } catch (v) {
|
7013 | P._caughtError = v, P._hasCaughtError = !0;
|
7014 | }
|
7015 | }
|
7016 | function Ka() {
|
7017 | if (P._hasRethrowError) {
|
7018 | var a = P._rethrowError;P._rethrowError = null;P._hasRethrowError = !1;throw a;
|
7019 | }
|
7020 | }var La = null,
|
7021 | Ma = {};
|
7022 | function Na() {
|
7023 | if (La) for (var a in Ma) {
|
7024 | var b = Ma[a],
|
7025 | c = La.indexOf(a);-1 < c ? void 0 : E("96", a);if (!Oa[c]) {
|
7026 | b.extractEvents ? void 0 : E("97", a);Oa[c] = b;c = b.eventTypes;for (var d in c) {
|
7027 | var e = void 0;var f = c[d],
|
7028 | g = b,
|
7029 | h = d;Pa.hasOwnProperty(h) ? E("99", h) : void 0;Pa[h] = f;var k = f.phasedRegistrationNames;if (k) {
|
7030 | for (e in k) {
|
7031 | k.hasOwnProperty(e) && Qa(k[e], g, h);
|
7032 | }e = !0;
|
7033 | } else f.registrationName ? (Qa(f.registrationName, g, h), e = !0) : e = !1;e ? void 0 : E("98", d, a);
|
7034 | }
|
7035 | }
|
7036 | }
|
7037 | }
|
7038 | function Qa(a, b, c) {
|
7039 | Ra[a] ? E("100", a) : void 0;Ra[a] = b;Sa[a] = b.eventTypes[c].dependencies;
|
7040 | }var Oa = [],
|
7041 | Pa = {},
|
7042 | Ra = {},
|
7043 | Sa = {};function Ta(a) {
|
7044 | La ? E("101") : void 0;La = Array.prototype.slice.call(a);Na();
|
7045 | }function Ua(a) {
|
7046 | var b = !1,
|
7047 | c;for (c in a) {
|
7048 | if (a.hasOwnProperty(c)) {
|
7049 | var d = a[c];Ma.hasOwnProperty(c) && Ma[c] === d || (Ma[c] ? E("102", c) : void 0, Ma[c] = d, b = !0);
|
7050 | }
|
7051 | }b && Na();
|
7052 | }
|
7053 | var Va = Object.freeze({ plugins: Oa, eventNameDispatchConfigs: Pa, registrationNameModules: Ra, registrationNameDependencies: Sa, possibleRegistrationNames: null, injectEventPluginOrder: Ta, injectEventPluginsByName: Ua }),
|
7054 | Wa = null,
|
7055 | Xa = null,
|
7056 | Ya = null;function Za(a, b, c, d) {
|
7057 | b = a.type || "unknown-event";a.currentTarget = Ya(d);P.invokeGuardedCallbackAndCatchFirstError(b, c, void 0, a);a.currentTarget = null;
|
7058 | }
|
7059 | function $a(a, b) {
|
7060 | null == b ? E("30") : void 0;if (null == a) return b;if (Array.isArray(a)) {
|
7061 | if (Array.isArray(b)) return a.push.apply(a, b), a;a.push(b);return a;
|
7062 | }return Array.isArray(b) ? [a].concat(b) : [a, b];
|
7063 | }function ab(a, b, c) {
|
7064 | Array.isArray(a) ? a.forEach(b, c) : a && b.call(c, a);
|
7065 | }var bb = null;
|
7066 | function cb(a, b) {
|
7067 | if (a) {
|
7068 | var c = a._dispatchListeners,
|
7069 | d = a._dispatchInstances;if (Array.isArray(c)) for (var e = 0; e < c.length && !a.isPropagationStopped(); e++) {
|
7070 | Za(a, b, c[e], d[e]);
|
7071 | } else c && Za(a, b, c, d);a._dispatchListeners = null;a._dispatchInstances = null;a.isPersistent() || a.constructor.release(a);
|
7072 | }
|
7073 | }function db(a) {
|
7074 | return cb(a, !0);
|
7075 | }function gb(a) {
|
7076 | return cb(a, !1);
|
7077 | }var hb = { injectEventPluginOrder: Ta, injectEventPluginsByName: Ua };
|
7078 | function ib(a, b) {
|
7079 | var c = a.stateNode;if (!c) return null;var d = Wa(c);if (!d) return null;c = d[b];a: switch (b) {case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":
|
7080 | (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a));a = !d;break a;default:
|
7081 | a = !1;}if (a) return null;c && "function" !== typeof c ? E("231", b, typeof c === "undefined" ? "undefined" : _typeof(c)) : void 0;
|
7082 | return c;
|
7083 | }function jb(a, b, c, d) {
|
7084 | for (var e, f = 0; f < Oa.length; f++) {
|
7085 | var g = Oa[f];g && (g = g.extractEvents(a, b, c, d)) && (e = $a(e, g));
|
7086 | }return e;
|
7087 | }function kb(a) {
|
7088 | a && (bb = $a(bb, a));
|
7089 | }function lb(a) {
|
7090 | var b = bb;bb = null;b && (a ? ab(b, db) : ab(b, gb), bb ? E("95") : void 0, P.rethrowCaughtError());
|
7091 | }var mb = Object.freeze({ injection: hb, getListener: ib, extractEvents: jb, enqueueEvents: kb, processEventQueue: lb }),
|
7092 | nb = Math.random().toString(36).slice(2),
|
7093 | Q = "__reactInternalInstance$" + nb,
|
7094 | ob = "__reactEventHandlers$" + nb;
|
7095 | function pb(a) {
|
7096 | if (a[Q]) return a[Q];for (var b = []; !a[Q];) {
|
7097 | if (b.push(a), a.parentNode) a = a.parentNode;else return null;
|
7098 | }var c = void 0,
|
7099 | d = a[Q];if (5 === d.tag || 6 === d.tag) return d;for (; a && (d = a[Q]); a = b.pop()) {
|
7100 | c = d;
|
7101 | }return c;
|
7102 | }function qb(a) {
|
7103 | if (5 === a.tag || 6 === a.tag) return a.stateNode;E("33");
|
7104 | }function rb(a) {
|
7105 | return a[ob] || null;
|
7106 | }
|
7107 | var sb = Object.freeze({ precacheFiberNode: function precacheFiberNode(a, b) {
|
7108 | b[Q] = a;
|
7109 | }, getClosestInstanceFromNode: pb, getInstanceFromNode: function getInstanceFromNode(a) {
|
7110 | a = a[Q];return !a || 5 !== a.tag && 6 !== a.tag ? null : a;
|
7111 | }, getNodeFromInstance: qb, getFiberCurrentPropsFromNode: rb, updateFiberProps: function updateFiberProps(a, b) {
|
7112 | a[ob] = b;
|
7113 | } });function tb(a) {
|
7114 | do {
|
7115 | a = a["return"];
|
7116 | } while (a && 5 !== a.tag);return a ? a : null;
|
7117 | }function ub(a, b, c) {
|
7118 | for (var d = []; a;) {
|
7119 | d.push(a), a = tb(a);
|
7120 | }for (a = d.length; 0 < a--;) {
|
7121 | b(d[a], "captured", c);
|
7122 | }for (a = 0; a < d.length; a++) {
|
7123 | b(d[a], "bubbled", c);
|
7124 | }
|
7125 | }
|
7126 | function vb(a, b, c) {
|
7127 | if (b = ib(a, c.dispatchConfig.phasedRegistrationNames[b])) c._dispatchListeners = $a(c._dispatchListeners, b), c._dispatchInstances = $a(c._dispatchInstances, a);
|
7128 | }function wb(a) {
|
7129 | a && a.dispatchConfig.phasedRegistrationNames && ub(a._targetInst, vb, a);
|
7130 | }function xb(a) {
|
7131 | if (a && a.dispatchConfig.phasedRegistrationNames) {
|
7132 | var b = a._targetInst;b = b ? tb(b) : null;ub(b, vb, a);
|
7133 | }
|
7134 | }
|
7135 | function yb(a, b, c) {
|
7136 | a && c && c.dispatchConfig.registrationName && (b = ib(a, c.dispatchConfig.registrationName)) && (c._dispatchListeners = $a(c._dispatchListeners, b), c._dispatchInstances = $a(c._dispatchInstances, a));
|
7137 | }function zb(a) {
|
7138 | a && a.dispatchConfig.registrationName && yb(a._targetInst, null, a);
|
7139 | }function Ab(a) {
|
7140 | ab(a, wb);
|
7141 | }
|
7142 | function Bb(a, b, c, d) {
|
7143 | if (c && d) a: {
|
7144 | var e = c;for (var f = d, g = 0, h = e; h; h = tb(h)) {
|
7145 | g++;
|
7146 | }h = 0;for (var k = f; k; k = tb(k)) {
|
7147 | h++;
|
7148 | }for (; 0 < g - h;) {
|
7149 | e = tb(e), g--;
|
7150 | }for (; 0 < h - g;) {
|
7151 | f = tb(f), h--;
|
7152 | }for (; g--;) {
|
7153 | if (e === f || e === f.alternate) break a;e = tb(e);f = tb(f);
|
7154 | }e = null;
|
7155 | } else e = null;f = e;for (e = []; c && c !== f;) {
|
7156 | g = c.alternate;if (null !== g && g === f) break;e.push(c);c = tb(c);
|
7157 | }for (c = []; d && d !== f;) {
|
7158 | g = d.alternate;if (null !== g && g === f) break;c.push(d);d = tb(d);
|
7159 | }for (d = 0; d < e.length; d++) {
|
7160 | yb(e[d], "bubbled", a);
|
7161 | }for (a = c.length; 0 < a--;) {
|
7162 | yb(c[a], "captured", b);
|
7163 | }
|
7164 | }
|
7165 | var Cb = Object.freeze({ accumulateTwoPhaseDispatches: Ab, accumulateTwoPhaseDispatchesSkipTarget: function accumulateTwoPhaseDispatchesSkipTarget(a) {
|
7166 | ab(a, xb);
|
7167 | }, accumulateEnterLeaveDispatches: Bb, accumulateDirectDispatches: function accumulateDirectDispatches(a) {
|
7168 | ab(a, zb);
|
7169 | } }),
|
7170 | Db = null;function Eb() {
|
7171 | !Db && l.canUseDOM && (Db = "textContent" in document.documentElement ? "textContent" : "innerText");return Db;
|
7172 | }var S = { _root: null, _startText: null, _fallbackText: null };
|
7173 | function Fb() {
|
7174 | if (S._fallbackText) return S._fallbackText;var a,
|
7175 | b = S._startText,
|
7176 | c = b.length,
|
7177 | d,
|
7178 | e = Gb(),
|
7179 | f = e.length;for (a = 0; a < c && b[a] === e[a]; a++) {}var g = c - a;for (d = 1; d <= g && b[c - d] === e[f - d]; d++) {}S._fallbackText = e.slice(a, 1 < d ? 1 - d : void 0);return S._fallbackText;
|
7180 | }function Gb() {
|
7181 | return "value" in S._root ? S._root.value : S._root[Eb()];
|
7182 | }
|
7183 | var Hb = "dispatchConfig _targetInst nativeEvent isDefaultPrevented isPropagationStopped _dispatchListeners _dispatchInstances".split(" "),
|
7184 | Ib = { type: null, target: null, currentTarget: C.thatReturnsNull, eventPhase: null, bubbles: null, cancelable: null, timeStamp: function timeStamp(a) {
|
7185 | return a.timeStamp || Date.now();
|
7186 | }, defaultPrevented: null, isTrusted: null };
|
7187 | function T(a, b, c, d) {
|
7188 | this.dispatchConfig = a;this._targetInst = b;this.nativeEvent = c;a = this.constructor.Interface;for (var e in a) {
|
7189 | a.hasOwnProperty(e) && ((b = a[e]) ? this[e] = b(c) : "target" === e ? this.target = d : this[e] = c[e]);
|
7190 | }this.isDefaultPrevented = (null != c.defaultPrevented ? c.defaultPrevented : !1 === c.returnValue) ? C.thatReturnsTrue : C.thatReturnsFalse;this.isPropagationStopped = C.thatReturnsFalse;return this;
|
7191 | }
|
7192 | B(T.prototype, { preventDefault: function preventDefault() {
|
7193 | this.defaultPrevented = !0;var a = this.nativeEvent;a && (a.preventDefault ? a.preventDefault() : "unknown" !== typeof a.returnValue && (a.returnValue = !1), this.isDefaultPrevented = C.thatReturnsTrue);
|
7194 | }, stopPropagation: function stopPropagation() {
|
7195 | var a = this.nativeEvent;a && (a.stopPropagation ? a.stopPropagation() : "unknown" !== typeof a.cancelBubble && (a.cancelBubble = !0), this.isPropagationStopped = C.thatReturnsTrue);
|
7196 | }, persist: function persist() {
|
7197 | this.isPersistent = C.thatReturnsTrue;
|
7198 | }, isPersistent: C.thatReturnsFalse,
|
7199 | destructor: function destructor() {
|
7200 | var a = this.constructor.Interface,
|
7201 | b;for (b in a) {
|
7202 | this[b] = null;
|
7203 | }for (a = 0; a < Hb.length; a++) {
|
7204 | this[Hb[a]] = null;
|
7205 | }
|
7206 | } });T.Interface = Ib;T.augmentClass = function (a, b) {
|
7207 | function c() {}c.prototype = this.prototype;var d = new c();B(d, a.prototype);a.prototype = d;a.prototype.constructor = a;a.Interface = B({}, this.Interface, b);a.augmentClass = this.augmentClass;Jb(a);
|
7208 | };Jb(T);function Kb(a, b, c, d) {
|
7209 | if (this.eventPool.length) {
|
7210 | var e = this.eventPool.pop();this.call(e, a, b, c, d);return e;
|
7211 | }return new this(a, b, c, d);
|
7212 | }
|
7213 | function Lb(a) {
|
7214 | a instanceof this ? void 0 : E("223");a.destructor();10 > this.eventPool.length && this.eventPool.push(a);
|
7215 | }function Jb(a) {
|
7216 | a.eventPool = [];a.getPooled = Kb;a.release = Lb;
|
7217 | }function Mb(a, b, c, d) {
|
7218 | return T.call(this, a, b, c, d);
|
7219 | }T.augmentClass(Mb, { data: null });function Nb(a, b, c, d) {
|
7220 | return T.call(this, a, b, c, d);
|
7221 | }T.augmentClass(Nb, { data: null });var Pb = [9, 13, 27, 32],
|
7222 | Vb = l.canUseDOM && "CompositionEvent" in window,
|
7223 | Wb = null;l.canUseDOM && "documentMode" in document && (Wb = document.documentMode);var Xb;
|
7224 | if (Xb = l.canUseDOM && "TextEvent" in window && !Wb) {
|
7225 | var Yb = window.opera;Xb = !("object" === (typeof Yb === "undefined" ? "undefined" : _typeof(Yb)) && "function" === typeof Yb.version && 12 >= parseInt(Yb.version(), 10));
|
7226 | }
|
7227 | var Zb = Xb,
|
7228 | $b = l.canUseDOM && (!Vb || Wb && 8 < Wb && 11 >= Wb),
|
7229 | ac = String.fromCharCode(32),
|
7230 | bc = { beforeInput: { phasedRegistrationNames: { bubbled: "onBeforeInput", captured: "onBeforeInputCapture" }, dependencies: ["topCompositionEnd", "topKeyPress", "topTextInput", "topPaste"] }, compositionEnd: { phasedRegistrationNames: { bubbled: "onCompositionEnd", captured: "onCompositionEndCapture" }, dependencies: "topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ") }, compositionStart: { phasedRegistrationNames: { bubbled: "onCompositionStart",
|
7231 | captured: "onCompositionStartCapture" }, dependencies: "topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ") }, compositionUpdate: { phasedRegistrationNames: { bubbled: "onCompositionUpdate", captured: "onCompositionUpdateCapture" }, dependencies: "topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ") } },
|
7232 | cc = !1;
|
7233 | function dc(a, b) {
|
7234 | switch (a) {case "topKeyUp":
|
7235 | return -1 !== Pb.indexOf(b.keyCode);case "topKeyDown":
|
7236 | return 229 !== b.keyCode;case "topKeyPress":case "topMouseDown":case "topBlur":
|
7237 | return !0;default:
|
7238 | return !1;}
|
7239 | }function ec(a) {
|
7240 | a = a.detail;return "object" === (typeof a === "undefined" ? "undefined" : _typeof(a)) && "data" in a ? a.data : null;
|
7241 | }var fc = !1;function gc(a, b) {
|
7242 | switch (a) {case "topCompositionEnd":
|
7243 | return ec(b);case "topKeyPress":
|
7244 | if (32 !== b.which) return null;cc = !0;return ac;case "topTextInput":
|
7245 | return a = b.data, a === ac && cc ? null : a;default:
|
7246 | return null;}
|
7247 | }
|
7248 | function hc(a, b) {
|
7249 | if (fc) return "topCompositionEnd" === a || !Vb && dc(a, b) ? (a = Fb(), S._root = null, S._startText = null, S._fallbackText = null, fc = !1, a) : null;switch (a) {case "topPaste":
|
7250 | return null;case "topKeyPress":
|
7251 | if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) {
|
7252 | if (b.char && 1 < b.char.length) return b.char;if (b.which) return String.fromCharCode(b.which);
|
7253 | }return null;case "topCompositionEnd":
|
7254 | return $b ? null : b.data;default:
|
7255 | return null;}
|
7256 | }
|
7257 | var ic = { eventTypes: bc, extractEvents: function extractEvents(a, b, c, d) {
|
7258 | var e;if (Vb) b: {
|
7259 | switch (a) {case "topCompositionStart":
|
7260 | var f = bc.compositionStart;break b;case "topCompositionEnd":
|
7261 | f = bc.compositionEnd;break b;case "topCompositionUpdate":
|
7262 | f = bc.compositionUpdate;break b;}f = void 0;
|
7263 | } else fc ? dc(a, c) && (f = bc.compositionEnd) : "topKeyDown" === a && 229 === c.keyCode && (f = bc.compositionStart);f ? ($b && (fc || f !== bc.compositionStart ? f === bc.compositionEnd && fc && (e = Fb()) : (S._root = d, S._startText = Gb(), fc = !0)), f = Mb.getPooled(f, b, c, d), e ? f.data = e : (e = ec(c), null !== e && (f.data = e)), Ab(f), e = f) : e = null;(a = Zb ? gc(a, c) : hc(a, c)) ? (b = Nb.getPooled(bc.beforeInput, b, c, d), b.data = a, Ab(b)) : b = null;return [e, b];
|
7264 | } },
|
7265 | jc = null,
|
7266 | kc = null,
|
7267 | lc = null;function mc(a) {
|
7268 | if (a = Xa(a)) {
|
7269 | jc && "function" === typeof jc.restoreControlledState ? void 0 : E("194");var b = Wa(a.stateNode);jc.restoreControlledState(a.stateNode, a.type, b);
|
7270 | }
|
7271 | }var nc = { injectFiberControlledHostComponent: function injectFiberControlledHostComponent(a) {
|
7272 | jc = a;
|
7273 | } };function oc(a) {
|
7274 | kc ? lc ? lc.push(a) : lc = [a] : kc = a;
|
7275 | }
|
7276 | function pc() {
|
7277 | if (kc) {
|
7278 | var a = kc,
|
7279 | b = lc;lc = kc = null;mc(a);if (b) for (a = 0; a < b.length; a++) {
|
7280 | mc(b[a]);
|
7281 | }
|
7282 | }
|
7283 | }var qc = Object.freeze({ injection: nc, enqueueStateRestore: oc, restoreStateIfNeeded: pc });function rc(a, b) {
|
7284 | return a(b);
|
7285 | }var sc = !1;function tc(a, b) {
|
7286 | if (sc) return rc(a, b);sc = !0;try {
|
7287 | return rc(a, b);
|
7288 | } finally {
|
7289 | sc = !1, pc();
|
7290 | }
|
7291 | }var uc = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 };
|
7292 | function vc(a) {
|
7293 | var b = a && a.nodeName && a.nodeName.toLowerCase();return "input" === b ? !!uc[a.type] : "textarea" === b ? !0 : !1;
|
7294 | }function wc(a) {
|
7295 | a = a.target || a.srcElement || window;a.correspondingUseElement && (a = a.correspondingUseElement);return 3 === a.nodeType ? a.parentNode : a;
|
7296 | }var xc;l.canUseDOM && (xc = document.implementation && document.implementation.hasFeature && !0 !== document.implementation.hasFeature("", ""));
|
7297 | function yc(a, b) {
|
7298 | if (!l.canUseDOM || b && !("addEventListener" in document)) return !1;b = "on" + a;var c = b in document;c || (c = document.createElement("div"), c.setAttribute(b, "return;"), c = "function" === typeof c[b]);!c && xc && "wheel" === a && (c = document.implementation.hasFeature("Events.wheel", "3.0"));return c;
|
7299 | }function zc(a) {
|
7300 | var b = a.type;return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b);
|
7301 | }
|
7302 | function Ac(a) {
|
7303 | var b = zc(a) ? "checked" : "value",
|
7304 | c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b),
|
7305 | d = "" + a[b];if (!a.hasOwnProperty(b) && "function" === typeof c.get && "function" === typeof c.set) return Object.defineProperty(a, b, { enumerable: c.enumerable, configurable: !0, get: function get() {
|
7306 | return c.get.call(this);
|
7307 | }, set: function set(a) {
|
7308 | d = "" + a;c.set.call(this, a);
|
7309 | } }), { getValue: function getValue() {
|
7310 | return d;
|
7311 | }, setValue: function setValue(a) {
|
7312 | d = "" + a;
|
7313 | }, stopTracking: function stopTracking() {
|
7314 | a._valueTracker = null;delete a[b];
|
7315 | } };
|
7316 | }
|
7317 | function Bc(a) {
|
7318 | a._valueTracker || (a._valueTracker = Ac(a));
|
7319 | }function Cc(a) {
|
7320 | if (!a) return !1;var b = a._valueTracker;if (!b) return !0;var c = b.getValue();var d = "";a && (d = zc(a) ? a.checked ? "true" : "false" : a.value);a = d;return a !== c ? (b.setValue(a), !0) : !1;
|
7321 | }var Dc = { change: { phasedRegistrationNames: { bubbled: "onChange", captured: "onChangeCapture" }, dependencies: "topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ") } };
|
7322 | function Ec(a, b, c) {
|
7323 | a = T.getPooled(Dc.change, a, b, c);a.type = "change";oc(c);Ab(a);return a;
|
7324 | }var Fc = null,
|
7325 | Gc = null;function Hc(a) {
|
7326 | kb(a);lb(!1);
|
7327 | }function Ic(a) {
|
7328 | var b = qb(a);if (Cc(b)) return a;
|
7329 | }function Jc(a, b) {
|
7330 | if ("topChange" === a) return b;
|
7331 | }var Kc = !1;l.canUseDOM && (Kc = yc("input") && (!document.documentMode || 9 < document.documentMode));function Lc() {
|
7332 | Fc && (Fc.detachEvent("onpropertychange", Mc), Gc = Fc = null);
|
7333 | }function Mc(a) {
|
7334 | "value" === a.propertyName && Ic(Gc) && (a = Ec(Gc, a, wc(a)), tc(Hc, a));
|
7335 | }
|
7336 | function Nc(a, b, c) {
|
7337 | "topFocus" === a ? (Lc(), Fc = b, Gc = c, Fc.attachEvent("onpropertychange", Mc)) : "topBlur" === a && Lc();
|
7338 | }function Oc(a) {
|
7339 | if ("topSelectionChange" === a || "topKeyUp" === a || "topKeyDown" === a) return Ic(Gc);
|
7340 | }function Pc(a, b) {
|
7341 | if ("topClick" === a) return Ic(b);
|
7342 | }function $c(a, b) {
|
7343 | if ("topInput" === a || "topChange" === a) return Ic(b);
|
7344 | }
|
7345 | var ad = { eventTypes: Dc, _isInputEventSupported: Kc, extractEvents: function extractEvents(a, b, c, d) {
|
7346 | var e = b ? qb(b) : window,
|
7347 | f = e.nodeName && e.nodeName.toLowerCase();if ("select" === f || "input" === f && "file" === e.type) var g = Jc;else if (vc(e)) {
|
7348 | if (Kc) g = $c;else {
|
7349 | g = Oc;var h = Nc;
|
7350 | }
|
7351 | } else f = e.nodeName, !f || "input" !== f.toLowerCase() || "checkbox" !== e.type && "radio" !== e.type || (g = Pc);if (g && (g = g(a, b))) return Ec(g, c, d);h && h(a, e, b);"topBlur" === a && null != b && (a = b._wrapperState || e._wrapperState) && a.controlled && "number" === e.type && (a = "" + e.value, e.getAttribute("value") !== a && e.setAttribute("value", a));
|
7352 | } };function bd(a, b, c, d) {
|
7353 | return T.call(this, a, b, c, d);
|
7354 | }T.augmentClass(bd, { view: null, detail: null });var cd = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };function dd(a) {
|
7355 | var b = this.nativeEvent;return b.getModifierState ? b.getModifierState(a) : (a = cd[a]) ? !!b[a] : !1;
|
7356 | }function ed() {
|
7357 | return dd;
|
7358 | }function fd(a, b, c, d) {
|
7359 | return T.call(this, a, b, c, d);
|
7360 | }
|
7361 | bd.augmentClass(fd, { screenX: null, screenY: null, clientX: null, clientY: null, pageX: null, pageY: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, getModifierState: ed, button: null, buttons: null, relatedTarget: function relatedTarget(a) {
|
7362 | return a.relatedTarget || (a.fromElement === a.srcElement ? a.toElement : a.fromElement);
|
7363 | } });
|
7364 | var gd = { mouseEnter: { registrationName: "onMouseEnter", dependencies: ["topMouseOut", "topMouseOver"] }, mouseLeave: { registrationName: "onMouseLeave", dependencies: ["topMouseOut", "topMouseOver"] } },
|
7365 | hd = { eventTypes: gd, extractEvents: function extractEvents(a, b, c, d) {
|
7366 | if ("topMouseOver" === a && (c.relatedTarget || c.fromElement) || "topMouseOut" !== a && "topMouseOver" !== a) return null;var e = d.window === d ? d : (e = d.ownerDocument) ? e.defaultView || e.parentWindow : window;"topMouseOut" === a ? (a = b, b = (b = c.relatedTarget || c.toElement) ? pb(b) : null) : a = null;if (a === b) return null;var f = null == a ? e : qb(a);e = null == b ? e : qb(b);var g = fd.getPooled(gd.mouseLeave, a, c, d);g.type = "mouseleave";g.target = f;g.relatedTarget = e;c = fd.getPooled(gd.mouseEnter, b, c, d);c.type = "mouseenter";c.target = e;c.relatedTarget = f;Bb(g, c, a, b);return [g, c];
|
7367 | } },
|
7368 | id = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;function jd(a) {
|
7369 | a = a.type;return "string" === typeof a ? a : "function" === typeof a ? a.displayName || a.name : null;
|
7370 | }
|
7371 | function kd(a) {
|
7372 | var b = a;if (a.alternate) for (; b["return"];) {
|
7373 | b = b["return"];
|
7374 | } else {
|
7375 | if (0 !== (b.effectTag & 2)) return 1;for (; b["return"];) {
|
7376 | if (b = b["return"], 0 !== (b.effectTag & 2)) return 1;
|
7377 | }
|
7378 | }return 3 === b.tag ? 2 : 3;
|
7379 | }function ld(a) {
|
7380 | return (a = a._reactInternalFiber) ? 2 === kd(a) : !1;
|
7381 | }function md(a) {
|
7382 | 2 !== kd(a) ? E("188") : void 0;
|
7383 | }
|
7384 | function nd(a) {
|
7385 | var b = a.alternate;if (!b) return b = kd(a), 3 === b ? E("188") : void 0, 1 === b ? null : a;for (var c = a, d = b;;) {
|
7386 | var e = c["return"],
|
7387 | f = e ? e.alternate : null;if (!e || !f) break;if (e.child === f.child) {
|
7388 | for (var g = e.child; g;) {
|
7389 | if (g === c) return md(e), a;if (g === d) return md(e), b;g = g.sibling;
|
7390 | }E("188");
|
7391 | }if (c["return"] !== d["return"]) c = e, d = f;else {
|
7392 | g = !1;for (var h = e.child; h;) {
|
7393 | if (h === c) {
|
7394 | g = !0;c = e;d = f;break;
|
7395 | }if (h === d) {
|
7396 | g = !0;d = e;c = f;break;
|
7397 | }h = h.sibling;
|
7398 | }if (!g) {
|
7399 | for (h = f.child; h;) {
|
7400 | if (h === c) {
|
7401 | g = !0;c = f;d = e;break;
|
7402 | }if (h === d) {
|
7403 | g = !0;d = f;c = e;break;
|
7404 | }h = h.sibling;
|
7405 | }g ? void 0 : E("189");
|
7406 | }
|
7407 | }c.alternate !== d ? E("190") : void 0;
|
7408 | }3 !== c.tag ? E("188") : void 0;return c.stateNode.current === c ? a : b;
|
7409 | }function od(a) {
|
7410 | a = nd(a);if (!a) return null;for (var b = a;;) {
|
7411 | if (5 === b.tag || 6 === b.tag) return b;if (b.child) b.child["return"] = b, b = b.child;else {
|
7412 | if (b === a) break;for (; !b.sibling;) {
|
7413 | if (!b["return"] || b["return"] === a) return null;b = b["return"];
|
7414 | }b.sibling["return"] = b["return"];b = b.sibling;
|
7415 | }
|
7416 | }return null;
|
7417 | }
|
7418 | function pd(a) {
|
7419 | a = nd(a);if (!a) return null;for (var b = a;;) {
|
7420 | if (5 === b.tag || 6 === b.tag) return b;if (b.child && 4 !== b.tag) b.child["return"] = b, b = b.child;else {
|
7421 | if (b === a) break;for (; !b.sibling;) {
|
7422 | if (!b["return"] || b["return"] === a) return null;b = b["return"];
|
7423 | }b.sibling["return"] = b["return"];b = b.sibling;
|
7424 | }
|
7425 | }return null;
|
7426 | }var qd = [];
|
7427 | function rd(a) {
|
7428 | var b = a.targetInst;do {
|
7429 | if (!b) {
|
7430 | a.ancestors.push(b);break;
|
7431 | }var c;for (c = b; c["return"];) {
|
7432 | c = c["return"];
|
7433 | }c = 3 !== c.tag ? null : c.stateNode.containerInfo;if (!c) break;a.ancestors.push(b);b = pb(c);
|
7434 | } while (b);for (c = 0; c < a.ancestors.length; c++) {
|
7435 | b = a.ancestors[c], sd(a.topLevelType, b, a.nativeEvent, wc(a.nativeEvent));
|
7436 | }
|
7437 | }var td = !0,
|
7438 | sd = void 0;function ud(a) {
|
7439 | td = !!a;
|
7440 | }function U(a, b, c) {
|
7441 | return c ? ba.listen(c, b, vd.bind(null, a)) : null;
|
7442 | }function wd(a, b, c) {
|
7443 | return c ? ba.capture(c, b, vd.bind(null, a)) : null;
|
7444 | }
|
7445 | function vd(a, b) {
|
7446 | if (td) {
|
7447 | var c = wc(b);c = pb(c);null === c || "number" !== typeof c.tag || 2 === kd(c) || (c = null);if (qd.length) {
|
7448 | var d = qd.pop();d.topLevelType = a;d.nativeEvent = b;d.targetInst = c;a = d;
|
7449 | } else a = { topLevelType: a, nativeEvent: b, targetInst: c, ancestors: [] };try {
|
7450 | tc(rd, a);
|
7451 | } finally {
|
7452 | a.topLevelType = null, a.nativeEvent = null, a.targetInst = null, a.ancestors.length = 0, 10 > qd.length && qd.push(a);
|
7453 | }
|
7454 | }
|
7455 | }
|
7456 | var xd = Object.freeze({ get _enabled() {
|
7457 | return td;
|
7458 | }, get _handleTopLevel() {
|
7459 | return sd;
|
7460 | }, setHandleTopLevel: function setHandleTopLevel(a) {
|
7461 | sd = a;
|
7462 | }, setEnabled: ud, isEnabled: function isEnabled() {
|
7463 | return td;
|
7464 | }, trapBubbledEvent: U, trapCapturedEvent: wd, dispatchEvent: vd });function yd(a, b) {
|
7465 | var c = {};c[a.toLowerCase()] = b.toLowerCase();c["Webkit" + a] = "webkit" + b;c["Moz" + a] = "moz" + b;c["ms" + a] = "MS" + b;c["O" + a] = "o" + b.toLowerCase();return c;
|
7466 | }
|
7467 | var zd = { animationend: yd("Animation", "AnimationEnd"), animationiteration: yd("Animation", "AnimationIteration"), animationstart: yd("Animation", "AnimationStart"), transitionend: yd("Transition", "TransitionEnd") },
|
7468 | Ad = {},
|
7469 | Bd = {};l.canUseDOM && (Bd = document.createElement("div").style, "AnimationEvent" in window || (delete zd.animationend.animation, delete zd.animationiteration.animation, delete zd.animationstart.animation), "TransitionEvent" in window || delete zd.transitionend.transition);
|
7470 | function Cd(a) {
|
7471 | if (Ad[a]) return Ad[a];if (!zd[a]) return a;var b = zd[a],
|
7472 | c;for (c in b) {
|
7473 | if (b.hasOwnProperty(c) && c in Bd) return Ad[a] = b[c];
|
7474 | }return "";
|
7475 | }
|
7476 | var Dd = { topAbort: "abort", topAnimationEnd: Cd("animationend") || "animationend", topAnimationIteration: Cd("animationiteration") || "animationiteration", topAnimationStart: Cd("animationstart") || "animationstart", topBlur: "blur", topCancel: "cancel", topCanPlay: "canplay", topCanPlayThrough: "canplaythrough", topChange: "change", topClick: "click", topClose: "close", topCompositionEnd: "compositionend", topCompositionStart: "compositionstart", topCompositionUpdate: "compositionupdate", topContextMenu: "contextmenu", topCopy: "copy",
|
7477 | topCut: "cut", topDoubleClick: "dblclick", topDrag: "drag", topDragEnd: "dragend", topDragEnter: "dragenter", topDragExit: "dragexit", topDragLeave: "dragleave", topDragOver: "dragover", topDragStart: "dragstart", topDrop: "drop", topDurationChange: "durationchange", topEmptied: "emptied", topEncrypted: "encrypted", topEnded: "ended", topError: "error", topFocus: "focus", topInput: "input", topKeyDown: "keydown", topKeyPress: "keypress", topKeyUp: "keyup", topLoadedData: "loadeddata", topLoad: "load", topLoadedMetadata: "loadedmetadata", topLoadStart: "loadstart",
|
7478 | topMouseDown: "mousedown", topMouseMove: "mousemove", topMouseOut: "mouseout", topMouseOver: "mouseover", topMouseUp: "mouseup", topPaste: "paste", topPause: "pause", topPlay: "play", topPlaying: "playing", topProgress: "progress", topRateChange: "ratechange", topScroll: "scroll", topSeeked: "seeked", topSeeking: "seeking", topSelectionChange: "selectionchange", topStalled: "stalled", topSuspend: "suspend", topTextInput: "textInput", topTimeUpdate: "timeupdate", topToggle: "toggle", topTouchCancel: "touchcancel", topTouchEnd: "touchend", topTouchMove: "touchmove",
|
7479 | topTouchStart: "touchstart", topTransitionEnd: Cd("transitionend") || "transitionend", topVolumeChange: "volumechange", topWaiting: "waiting", topWheel: "wheel" },
|
7480 | Ed = {},
|
7481 | Fd = 0,
|
7482 | Gd = "_reactListenersID" + ("" + Math.random()).slice(2);function Hd(a) {
|
7483 | Object.prototype.hasOwnProperty.call(a, Gd) || (a[Gd] = Fd++, Ed[a[Gd]] = {});return Ed[a[Gd]];
|
7484 | }function Id(a) {
|
7485 | for (; a && a.firstChild;) {
|
7486 | a = a.firstChild;
|
7487 | }return a;
|
7488 | }
|
7489 | function Jd(a, b) {
|
7490 | var c = Id(a);a = 0;for (var d; c;) {
|
7491 | if (3 === c.nodeType) {
|
7492 | d = a + c.textContent.length;if (a <= b && d >= b) return { node: c, offset: b - a };a = d;
|
7493 | }a: {
|
7494 | for (; c;) {
|
7495 | if (c.nextSibling) {
|
7496 | c = c.nextSibling;break a;
|
7497 | }c = c.parentNode;
|
7498 | }c = void 0;
|
7499 | }c = Id(c);
|
7500 | }
|
7501 | }function Kd(a) {
|
7502 | var b = a && a.nodeName && a.nodeName.toLowerCase();return b && ("input" === b && "text" === a.type || "textarea" === b || "true" === a.contentEditable);
|
7503 | }
|
7504 | var Ld = l.canUseDOM && "documentMode" in document && 11 >= document.documentMode,
|
7505 | Md = { select: { phasedRegistrationNames: { bubbled: "onSelect", captured: "onSelectCapture" }, dependencies: "topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ") } },
|
7506 | Nd = null,
|
7507 | Od = null,
|
7508 | Pd = null,
|
7509 | Qd = !1;
|
7510 | function Rd(a, b) {
|
7511 | if (Qd || null == Nd || Nd !== da()) return null;var c = Nd;"selectionStart" in c && Kd(c) ? c = { start: c.selectionStart, end: c.selectionEnd } : window.getSelection ? (c = window.getSelection(), c = { anchorNode: c.anchorNode, anchorOffset: c.anchorOffset, focusNode: c.focusNode, focusOffset: c.focusOffset }) : c = void 0;return Pd && ea(Pd, c) ? null : (Pd = c, a = T.getPooled(Md.select, Od, a, b), a.type = "select", a.target = Nd, Ab(a), a);
|
7512 | }
|
7513 | var Sd = { eventTypes: Md, extractEvents: function extractEvents(a, b, c, d) {
|
7514 | var e = d.window === d ? d.document : 9 === d.nodeType ? d : d.ownerDocument,
|
7515 | f;if (!(f = !e)) {
|
7516 | a: {
|
7517 | e = Hd(e);f = Sa.onSelect;for (var g = 0; g < f.length; g++) {
|
7518 | var h = f[g];if (!e.hasOwnProperty(h) || !e[h]) {
|
7519 | e = !1;break a;
|
7520 | }
|
7521 | }e = !0;
|
7522 | }f = !e;
|
7523 | }if (f) return null;e = b ? qb(b) : window;switch (a) {case "topFocus":
|
7524 | if (vc(e) || "true" === e.contentEditable) Nd = e, Od = b, Pd = null;break;case "topBlur":
|
7525 | Pd = Od = Nd = null;break;case "topMouseDown":
|
7526 | Qd = !0;break;case "topContextMenu":case "topMouseUp":
|
7527 | return Qd = !1, Rd(c, d);case "topSelectionChange":
|
7528 | if (Ld) break;
|
7529 | case "topKeyDown":case "topKeyUp":
|
7530 | return Rd(c, d);}return null;
|
7531 | } };function Td(a, b, c, d) {
|
7532 | return T.call(this, a, b, c, d);
|
7533 | }T.augmentClass(Td, { animationName: null, elapsedTime: null, pseudoElement: null });function Ud(a, b, c, d) {
|
7534 | return T.call(this, a, b, c, d);
|
7535 | }T.augmentClass(Ud, { clipboardData: function clipboardData(a) {
|
7536 | return "clipboardData" in a ? a.clipboardData : window.clipboardData;
|
7537 | } });function Vd(a, b, c, d) {
|
7538 | return T.call(this, a, b, c, d);
|
7539 | }bd.augmentClass(Vd, { relatedTarget: null });
|
7540 | function Wd(a) {
|
7541 | var b = a.keyCode;"charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b;return 32 <= a || 13 === a ? a : 0;
|
7542 | }
|
7543 | var Xd = { Esc: "Escape", Spacebar: " ", Left: "ArrowLeft", Up: "ArrowUp", Right: "ArrowRight", Down: "ArrowDown", Del: "Delete", Win: "OS", Menu: "ContextMenu", Apps: "ContextMenu", Scroll: "ScrollLock", MozPrintableKey: "Unidentified" },
|
7544 | Yd = { 8: "Backspace", 9: "Tab", 12: "Clear", 13: "Enter", 16: "Shift", 17: "Control", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Escape", 32: " ", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete", 112: "F1", 113: "F2", 114: "F3", 115: "F4",
|
7545 | 116: "F5", 117: "F6", 118: "F7", 119: "F8", 120: "F9", 121: "F10", 122: "F11", 123: "F12", 144: "NumLock", 145: "ScrollLock", 224: "Meta" };function Zd(a, b, c, d) {
|
7546 | return T.call(this, a, b, c, d);
|
7547 | }
|
7548 | bd.augmentClass(Zd, { key: function key(a) {
|
7549 | if (a.key) {
|
7550 | var b = Xd[a.key] || a.key;if ("Unidentified" !== b) return b;
|
7551 | }return "keypress" === a.type ? (a = Wd(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? Yd[a.keyCode] || "Unidentified" : "";
|
7552 | }, location: null, ctrlKey: null, shiftKey: null, altKey: null, metaKey: null, repeat: null, locale: null, getModifierState: ed, charCode: function charCode(a) {
|
7553 | return "keypress" === a.type ? Wd(a) : 0;
|
7554 | }, keyCode: function keyCode(a) {
|
7555 | return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
|
7556 | }, which: function which(a) {
|
7557 | return "keypress" === a.type ? Wd(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
|
7558 | } });function $d(a, b, c, d) {
|
7559 | return T.call(this, a, b, c, d);
|
7560 | }fd.augmentClass($d, { dataTransfer: null });function ae(a, b, c, d) {
|
7561 | return T.call(this, a, b, c, d);
|
7562 | }bd.augmentClass(ae, { touches: null, targetTouches: null, changedTouches: null, altKey: null, metaKey: null, ctrlKey: null, shiftKey: null, getModifierState: ed });function be(a, b, c, d) {
|
7563 | return T.call(this, a, b, c, d);
|
7564 | }T.augmentClass(be, { propertyName: null, elapsedTime: null, pseudoElement: null });
|
7565 | function ce(a, b, c, d) {
|
7566 | return T.call(this, a, b, c, d);
|
7567 | }fd.augmentClass(ce, { deltaX: function deltaX(a) {
|
7568 | return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0;
|
7569 | }, deltaY: function deltaY(a) {
|
7570 | return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0;
|
7571 | }, deltaZ: null, deltaMode: null });var de = {},
|
7572 | ee = {};
|
7573 | "abort animationEnd animationIteration animationStart blur cancel canPlay canPlayThrough click close contextMenu copy cut doubleClick drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error focus input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing progress rateChange reset scroll seeked seeking stalled submit suspend timeUpdate toggle touchCancel touchEnd touchMove touchStart transitionEnd volumeChange waiting wheel".split(" ").forEach(function (a) {
|
7574 | var b = a[0].toUpperCase() + a.slice(1),
|
7575 | c = "on" + b;b = "top" + b;c = { phasedRegistrationNames: { bubbled: c, captured: c + "Capture" }, dependencies: [b] };de[a] = c;ee[b] = c;
|
7576 | });
|
7577 | var fe = { eventTypes: de, extractEvents: function extractEvents(a, b, c, d) {
|
7578 | var e = ee[a];if (!e) return null;switch (a) {case "topKeyPress":
|
7579 | if (0 === Wd(c)) return null;case "topKeyDown":case "topKeyUp":
|
7580 | a = Zd;break;case "topBlur":case "topFocus":
|
7581 | a = Vd;break;case "topClick":
|
7582 | if (2 === c.button) return null;case "topDoubleClick":case "topMouseDown":case "topMouseMove":case "topMouseUp":case "topMouseOut":case "topMouseOver":case "topContextMenu":
|
7583 | a = fd;break;case "topDrag":case "topDragEnd":case "topDragEnter":case "topDragExit":case "topDragLeave":case "topDragOver":case "topDragStart":case "topDrop":
|
7584 | a = $d;break;case "topTouchCancel":case "topTouchEnd":case "topTouchMove":case "topTouchStart":
|
7585 | a = ae;break;case "topAnimationEnd":case "topAnimationIteration":case "topAnimationStart":
|
7586 | a = Td;break;case "topTransitionEnd":
|
7587 | a = be;break;case "topScroll":
|
7588 | a = bd;break;case "topWheel":
|
7589 | a = ce;break;case "topCopy":case "topCut":case "topPaste":
|
7590 | a = Ud;break;default:
|
7591 | a = T;}b = a.getPooled(e, b, c, d);Ab(b);return b;
|
7592 | } };sd = function sd(a, b, c, d) {
|
7593 | a = jb(a, b, c, d);kb(a);lb(!1);
|
7594 | };hb.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin TapEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));
|
7595 | Wa = sb.getFiberCurrentPropsFromNode;Xa = sb.getInstanceFromNode;Ya = sb.getNodeFromInstance;hb.injectEventPluginsByName({ SimpleEventPlugin: fe, EnterLeaveEventPlugin: hd, ChangeEventPlugin: ad, SelectEventPlugin: Sd, BeforeInputEventPlugin: ic });var ge = [],
|
7596 | he = -1;function V(a) {
|
7597 | 0 > he || (a.current = ge[he], ge[he] = null, he--);
|
7598 | }function W(a, b) {
|
7599 | he++;ge[he] = a.current;a.current = b;
|
7600 | }new Set();var ie = { current: D },
|
7601 | X = { current: !1 },
|
7602 | je = D;function ke(a) {
|
7603 | return le(a) ? je : ie.current;
|
7604 | }
|
7605 | function me(a, b) {
|
7606 | var c = a.type.contextTypes;if (!c) return D;var d = a.stateNode;if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext;var e = {},
|
7607 | f;for (f in c) {
|
7608 | e[f] = b[f];
|
7609 | }d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e);return e;
|
7610 | }function le(a) {
|
7611 | return 2 === a.tag && null != a.type.childContextTypes;
|
7612 | }function ne(a) {
|
7613 | le(a) && (V(X, a), V(ie, a));
|
7614 | }
|
7615 | function oe(a, b, c) {
|
7616 | null != ie.cursor ? E("168") : void 0;W(ie, b, a);W(X, c, a);
|
7617 | }function pe(a, b) {
|
7618 | var c = a.stateNode,
|
7619 | d = a.type.childContextTypes;if ("function" !== typeof c.getChildContext) return b;c = c.getChildContext();for (var e in c) {
|
7620 | e in d ? void 0 : E("108", jd(a) || "Unknown", e);
|
7621 | }return B({}, b, c);
|
7622 | }function qe(a) {
|
7623 | if (!le(a)) return !1;var b = a.stateNode;b = b && b.__reactInternalMemoizedMergedChildContext || D;je = ie.current;W(ie, b, a);W(X, X.current, a);return !0;
|
7624 | }
|
7625 | function re(a, b) {
|
7626 | var c = a.stateNode;c ? void 0 : E("169");if (b) {
|
7627 | var d = pe(a, je);c.__reactInternalMemoizedMergedChildContext = d;V(X, a);V(ie, a);W(ie, d, a);
|
7628 | } else V(X, a);W(X, b, a);
|
7629 | }
|
7630 | function Y(a, b, c) {
|
7631 | this.tag = a;this.key = b;this.stateNode = this.type = null;this.sibling = this.child = this["return"] = null;this.index = 0;this.memoizedState = this.updateQueue = this.memoizedProps = this.pendingProps = this.ref = null;this.internalContextTag = c;this.effectTag = 0;this.lastEffect = this.firstEffect = this.nextEffect = null;this.expirationTime = 0;this.alternate = null;
|
7632 | }
|
7633 | function se(a, b, c) {
|
7634 | var d = a.alternate;null === d ? (d = new Y(a.tag, a.key, a.internalContextTag), d.type = a.type, d.stateNode = a.stateNode, d.alternate = a, a.alternate = d) : (d.effectTag = 0, d.nextEffect = null, d.firstEffect = null, d.lastEffect = null);d.expirationTime = c;d.pendingProps = b;d.child = a.child;d.memoizedProps = a.memoizedProps;d.memoizedState = a.memoizedState;d.updateQueue = a.updateQueue;d.sibling = a.sibling;d.index = a.index;d.ref = a.ref;return d;
|
7635 | }
|
7636 | function te(a, b, c) {
|
7637 | var d = void 0,
|
7638 | e = a.type,
|
7639 | f = a.key;"function" === typeof e ? (d = e.prototype && e.prototype.isReactComponent ? new Y(2, f, b) : new Y(0, f, b), d.type = e, d.pendingProps = a.props) : "string" === typeof e ? (d = new Y(5, f, b), d.type = e, d.pendingProps = a.props) : "object" === (typeof e === "undefined" ? "undefined" : _typeof(e)) && null !== e && "number" === typeof e.tag ? (d = e, d.pendingProps = a.props) : E("130", null == e ? e : typeof e === "undefined" ? "undefined" : _typeof(e), "");d.expirationTime = c;return d;
|
7640 | }function ue(a, b, c, d) {
|
7641 | b = new Y(10, d, b);b.pendingProps = a;b.expirationTime = c;return b;
|
7642 | }
|
7643 | function ve(a, b, c) {
|
7644 | b = new Y(6, null, b);b.pendingProps = a;b.expirationTime = c;return b;
|
7645 | }function we(a, b, c) {
|
7646 | b = new Y(7, a.key, b);b.type = a.handler;b.pendingProps = a;b.expirationTime = c;return b;
|
7647 | }function xe(a, b, c) {
|
7648 | a = new Y(9, null, b);a.expirationTime = c;return a;
|
7649 | }function ye(a, b, c) {
|
7650 | b = new Y(4, a.key, b);b.pendingProps = a.children || [];b.expirationTime = c;b.stateNode = { containerInfo: a.containerInfo, pendingChildren: null, implementation: a.implementation };return b;
|
7651 | }var ze = null,
|
7652 | Ae = null;
|
7653 | function Be(a) {
|
7654 | return function (b) {
|
7655 | try {
|
7656 | return a(b);
|
7657 | } catch (c) {}
|
7658 | };
|
7659 | }function Ce(a) {
|
7660 | if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;var b = __REACT_DEVTOOLS_GLOBAL_HOOK__;if (b.isDisabled || !b.supportsFiber) return !0;try {
|
7661 | var c = b.inject(a);ze = Be(function (a) {
|
7662 | return b.onCommitFiberRoot(c, a);
|
7663 | });Ae = Be(function (a) {
|
7664 | return b.onCommitFiberUnmount(c, a);
|
7665 | });
|
7666 | } catch (d) {}return !0;
|
7667 | }function De(a) {
|
7668 | "function" === typeof ze && ze(a);
|
7669 | }function Ee(a) {
|
7670 | "function" === typeof Ae && Ae(a);
|
7671 | }
|
7672 | function Fe(a) {
|
7673 | return { baseState: a, expirationTime: 0, first: null, last: null, callbackList: null, hasForceUpdate: !1, isInitialized: !1 };
|
7674 | }function Ge(a, b) {
|
7675 | null === a.last ? a.first = a.last = b : (a.last.next = b, a.last = b);if (0 === a.expirationTime || a.expirationTime > b.expirationTime) a.expirationTime = b.expirationTime;
|
7676 | }
|
7677 | function He(a, b) {
|
7678 | var c = a.alternate,
|
7679 | d = a.updateQueue;null === d && (d = a.updateQueue = Fe(null));null !== c ? (a = c.updateQueue, null === a && (a = c.updateQueue = Fe(null))) : a = null;a = a !== d ? a : null;null === a ? Ge(d, b) : null === d.last || null === a.last ? (Ge(d, b), Ge(a, b)) : (Ge(d, b), a.last = b);
|
7680 | }function Ie(a, b, c, d) {
|
7681 | a = a.partialState;return "function" === typeof a ? a.call(b, c, d) : a;
|
7682 | }
|
7683 | function Je(a, b, c, d, e, f) {
|
7684 | null !== a && a.updateQueue === c && (c = b.updateQueue = { baseState: c.baseState, expirationTime: c.expirationTime, first: c.first, last: c.last, isInitialized: c.isInitialized, callbackList: null, hasForceUpdate: !1 });c.expirationTime = 0;c.isInitialized ? a = c.baseState : (a = c.baseState = b.memoizedState, c.isInitialized = !0);for (var g = !0, h = c.first, k = !1; null !== h;) {
|
7685 | var q = h.expirationTime;if (q > f) {
|
7686 | var v = c.expirationTime;if (0 === v || v > q) c.expirationTime = q;k || (k = !0, c.baseState = a);
|
7687 | } else {
|
7688 | k || (c.first = h.next, null === c.first && (c.last = null));if (h.isReplace) a = Ie(h, d, a, e), g = !0;else if (q = Ie(h, d, a, e)) a = g ? B({}, a, q) : B(a, q), g = !1;h.isForced && (c.hasForceUpdate = !0);null !== h.callback && (q = c.callbackList, null === q && (q = c.callbackList = []), q.push(h));
|
7689 | }h = h.next;
|
7690 | }null !== c.callbackList ? b.effectTag |= 32 : null !== c.first || c.hasForceUpdate || (b.updateQueue = null);k || (c.baseState = a);return a;
|
7691 | }
|
7692 | function Ke(a, b) {
|
7693 | var c = a.callbackList;if (null !== c) for (a.callbackList = null, a = 0; a < c.length; a++) {
|
7694 | var d = c[a],
|
7695 | e = d.callback;d.callback = null;"function" !== typeof e ? E("191", e) : void 0;e.call(b);
|
7696 | }
|
7697 | }
|
7698 | function Le(a, b, c, d) {
|
7699 | function e(a, b) {
|
7700 | b.updater = f;a.stateNode = b;b._reactInternalFiber = a;
|
7701 | }var f = { isMounted: ld, enqueueSetState: function enqueueSetState(c, d, e) {
|
7702 | c = c._reactInternalFiber;e = void 0 === e ? null : e;var g = b(c);He(c, { expirationTime: g, partialState: d, callback: e, isReplace: !1, isForced: !1, nextCallback: null, next: null });a(c, g);
|
7703 | }, enqueueReplaceState: function enqueueReplaceState(c, d, e) {
|
7704 | c = c._reactInternalFiber;e = void 0 === e ? null : e;var g = b(c);He(c, { expirationTime: g, partialState: d, callback: e, isReplace: !0, isForced: !1, nextCallback: null, next: null });
|
7705 | a(c, g);
|
7706 | }, enqueueForceUpdate: function enqueueForceUpdate(c, d) {
|
7707 | c = c._reactInternalFiber;d = void 0 === d ? null : d;var e = b(c);He(c, { expirationTime: e, partialState: null, callback: d, isReplace: !1, isForced: !0, nextCallback: null, next: null });a(c, e);
|
7708 | } };return { adoptClassInstance: e, constructClassInstance: function constructClassInstance(a, b) {
|
7709 | var c = a.type,
|
7710 | d = ke(a),
|
7711 | f = 2 === a.tag && null != a.type.contextTypes,
|
7712 | g = f ? me(a, d) : D;b = new c(b, g);e(a, b);f && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = d, a.__reactInternalMemoizedMaskedChildContext = g);return b;
|
7713 | }, mountClassInstance: function mountClassInstance(a, b) {
|
7714 | var c = a.alternate,
|
7715 | d = a.stateNode,
|
7716 | e = d.state || null,
|
7717 | g = a.pendingProps;g ? void 0 : E("158");var h = ke(a);d.props = g;d.state = a.memoizedState = e;d.refs = D;d.context = me(a, h);null != a.type && null != a.type.prototype && !0 === a.type.prototype.unstable_isAsyncReactComponent && (a.internalContextTag |= 1);"function" === typeof d.componentWillMount && (e = d.state, d.componentWillMount(), e !== d.state && f.enqueueReplaceState(d, d.state, null), e = a.updateQueue, null !== e && (d.state = Je(c, a, e, d, g, b)));"function" === typeof d.componentDidMount && (a.effectTag |= 4);
|
7718 | }, updateClassInstance: function updateClassInstance(a, b, e) {
|
7719 | var g = b.stateNode;g.props = b.memoizedProps;g.state = b.memoizedState;var h = b.memoizedProps,
|
7720 | k = b.pendingProps;k || (k = h, null == k ? E("159") : void 0);var u = g.context,
|
7721 | z = ke(b);z = me(b, z);"function" !== typeof g.componentWillReceiveProps || h === k && u === z || (u = g.state, g.componentWillReceiveProps(k, z), g.state !== u && f.enqueueReplaceState(g, g.state, null));u = b.memoizedState;e = null !== b.updateQueue ? Je(a, b, b.updateQueue, g, k, e) : u;if (!(h !== k || u !== e || X.current || null !== b.updateQueue && b.updateQueue.hasForceUpdate)) return "function" !== typeof g.componentDidUpdate || h === a.memoizedProps && u === a.memoizedState || (b.effectTag |= 4), !1;var G = k;if (null === h || null !== b.updateQueue && b.updateQueue.hasForceUpdate) G = !0;else {
|
7722 | var I = b.stateNode,
|
7723 | L = b.type;G = "function" === typeof I.shouldComponentUpdate ? I.shouldComponentUpdate(G, e, z) : L.prototype && L.prototype.isPureReactComponent ? !ea(h, G) || !ea(u, e) : !0;
|
7724 | }G ? ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(k, e, z), "function" === typeof g.componentDidUpdate && (b.effectTag |= 4)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && u === a.memoizedState || (b.effectTag |= 4), c(b, k), d(b, e));g.props = k;g.state = e;g.context = z;return G;
|
7725 | } };
|
7726 | }var Qe = "function" === typeof Symbol && Symbol["for"],
|
7727 | Re = Qe ? Symbol["for"]("react.element") : 60103,
|
7728 | Se = Qe ? Symbol["for"]("react.call") : 60104,
|
7729 | Te = Qe ? Symbol["for"]("react.return") : 60105,
|
7730 | Ue = Qe ? Symbol["for"]("react.portal") : 60106,
|
7731 | Ve = Qe ? Symbol["for"]("react.fragment") : 60107,
|
7732 | We = "function" === typeof Symbol && Symbol.iterator;
|
7733 | function Xe(a) {
|
7734 | if (null === a || "undefined" === typeof a) return null;a = We && a[We] || a["@@iterator"];return "function" === typeof a ? a : null;
|
7735 | }var Ye = Array.isArray;
|
7736 | function Ze(a, b) {
|
7737 | var c = b.ref;if (null !== c && "function" !== typeof c) {
|
7738 | if (b._owner) {
|
7739 | b = b._owner;var d = void 0;b && (2 !== b.tag ? E("110") : void 0, d = b.stateNode);d ? void 0 : E("147", c);var e = "" + c;if (null !== a && null !== a.ref && a.ref._stringRef === e) return a.ref;a = function a(_a) {
|
7740 | var b = d.refs === D ? d.refs = {} : d.refs;null === _a ? delete b[e] : b[e] = _a;
|
7741 | };a._stringRef = e;return a;
|
7742 | }"string" !== typeof c ? E("148") : void 0;b._owner ? void 0 : E("149", c);
|
7743 | }return c;
|
7744 | }
|
7745 | function $e(a, b) {
|
7746 | "textarea" !== a.type && E("31", "[object Object]" === Object.prototype.toString.call(b) ? "object with keys {" + Object.keys(b).join(", ") + "}" : b, "");
|
7747 | }
|
7748 | function af(a) {
|
7749 | function b(b, c) {
|
7750 | if (a) {
|
7751 | var d = b.lastEffect;null !== d ? (d.nextEffect = c, b.lastEffect = c) : b.firstEffect = b.lastEffect = c;c.nextEffect = null;c.effectTag = 8;
|
7752 | }
|
7753 | }function c(c, d) {
|
7754 | if (!a) return null;for (; null !== d;) {
|
7755 | b(c, d), d = d.sibling;
|
7756 | }return null;
|
7757 | }function d(a, b) {
|
7758 | for (a = new Map(); null !== b;) {
|
7759 | null !== b.key ? a.set(b.key, b) : a.set(b.index, b), b = b.sibling;
|
7760 | }return a;
|
7761 | }function e(a, b, c) {
|
7762 | a = se(a, b, c);a.index = 0;a.sibling = null;return a;
|
7763 | }function f(b, c, d) {
|
7764 | b.index = d;if (!a) return c;d = b.alternate;if (null !== d) return d = d.index, d < c ? (b.effectTag = 2, c) : d;b.effectTag = 2;return c;
|
7765 | }function g(b) {
|
7766 | a && null === b.alternate && (b.effectTag = 2);return b;
|
7767 | }function h(a, b, c, d) {
|
7768 | if (null === b || 6 !== b.tag) return b = ve(c, a.internalContextTag, d), b["return"] = a, b;b = e(b, c, d);b["return"] = a;return b;
|
7769 | }function k(a, b, c, d) {
|
7770 | if (null !== b && b.type === c.type) return d = e(b, c.props, d), d.ref = Ze(b, c), d["return"] = a, d;d = te(c, a.internalContextTag, d);d.ref = Ze(b, c);d["return"] = a;return d;
|
7771 | }function q(a, b, c, d) {
|
7772 | if (null === b || 7 !== b.tag) return b = we(c, a.internalContextTag, d), b["return"] = a, b;b = e(b, c, d);
|
7773 | b["return"] = a;return b;
|
7774 | }function v(a, b, c, d) {
|
7775 | if (null === b || 9 !== b.tag) return b = xe(c, a.internalContextTag, d), b.type = c.value, b["return"] = a, b;b = e(b, null, d);b.type = c.value;b["return"] = a;return b;
|
7776 | }function y(a, b, c, d) {
|
7777 | if (null === b || 4 !== b.tag || b.stateNode.containerInfo !== c.containerInfo || b.stateNode.implementation !== c.implementation) return b = ye(c, a.internalContextTag, d), b["return"] = a, b;b = e(b, c.children || [], d);b["return"] = a;return b;
|
7778 | }function u(a, b, c, d, f) {
|
7779 | if (null === b || 10 !== b.tag) return b = ue(c, a.internalContextTag, d, f), b["return"] = a, b;b = e(b, c, d);b["return"] = a;return b;
|
7780 | }function z(a, b, c) {
|
7781 | if ("string" === typeof b || "number" === typeof b) return b = ve("" + b, a.internalContextTag, c), b["return"] = a, b;if ("object" === (typeof b === "undefined" ? "undefined" : _typeof(b)) && null !== b) {
|
7782 | switch (b.$$typeof) {case Re:
|
7783 | if (b.type === Ve) return b = ue(b.props.children, a.internalContextTag, c, b.key), b["return"] = a, b;c = te(b, a.internalContextTag, c);c.ref = Ze(null, b);c["return"] = a;return c;case Se:
|
7784 | return b = we(b, a.internalContextTag, c), b["return"] = a, b;case Te:
|
7785 | return c = xe(b, a.internalContextTag, c), c.type = b.value, c["return"] = a, c;case Ue:
|
7786 | return b = ye(b, a.internalContextTag, c), b["return"] = a, b;}if (Ye(b) || Xe(b)) return b = ue(b, a.internalContextTag, c, null), b["return"] = a, b;$e(a, b);
|
7787 | }return null;
|
7788 | }function G(a, b, c, d) {
|
7789 | var e = null !== b ? b.key : null;if ("string" === typeof c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);if ("object" === (typeof c === "undefined" ? "undefined" : _typeof(c)) && null !== c) {
|
7790 | switch (c.$$typeof) {case Re:
|
7791 | return c.key === e ? c.type === Ve ? u(a, b, c.props.children, d, e) : k(a, b, c, d) : null;case Se:
|
7792 | return c.key === e ? q(a, b, c, d) : null;case Te:
|
7793 | return null === e ? v(a, b, c, d) : null;case Ue:
|
7794 | return c.key === e ? y(a, b, c, d) : null;}if (Ye(c) || Xe(c)) return null !== e ? null : u(a, b, c, d, null);$e(a, c);
|
7795 | }return null;
|
7796 | }function I(a, b, c, d, e) {
|
7797 | if ("string" === typeof d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);if ("object" === (typeof d === "undefined" ? "undefined" : _typeof(d)) && null !== d) {
|
7798 | switch (d.$$typeof) {case Re:
|
7799 | return a = a.get(null === d.key ? c : d.key) || null, d.type === Ve ? u(b, a, d.props.children, e, d.key) : k(b, a, d, e);case Se:
|
7800 | return a = a.get(null === d.key ? c : d.key) || null, q(b, a, d, e);case Te:
|
7801 | return a = a.get(c) || null, v(b, a, d, e);case Ue:
|
7802 | return a = a.get(null === d.key ? c : d.key) || null, y(b, a, d, e);}if (Ye(d) || Xe(d)) return a = a.get(c) || null, u(b, a, d, e, null);$e(b, d);
|
7803 | }return null;
|
7804 | }function L(e, g, m, A) {
|
7805 | for (var h = null, r = null, n = g, w = g = 0, k = null; null !== n && w < m.length; w++) {
|
7806 | n.index > w ? (k = n, n = null) : k = n.sibling;var x = G(e, n, m[w], A);if (null === x) {
|
7807 | null === n && (n = k);break;
|
7808 | }a && n && null === x.alternate && b(e, n);g = f(x, g, w);null === r ? h = x : r.sibling = x;r = x;n = k;
|
7809 | }if (w === m.length) return c(e, n), h;if (null === n) {
|
7810 | for (; w < m.length; w++) {
|
7811 | if (n = z(e, m[w], A)) g = f(n, g, w), null === r ? h = n : r.sibling = n, r = n;
|
7812 | }return h;
|
7813 | }for (n = d(e, n); w < m.length; w++) {
|
7814 | if (k = I(n, e, w, m[w], A)) {
|
7815 | if (a && null !== k.alternate) n["delete"](null === k.key ? w : k.key);g = f(k, g, w);null === r ? h = k : r.sibling = k;r = k;
|
7816 | }
|
7817 | }a && n.forEach(function (a) {
|
7818 | return b(e, a);
|
7819 | });return h;
|
7820 | }function N(e, g, m, A) {
|
7821 | var h = Xe(m);"function" !== typeof h ? E("150") : void 0;m = h.call(m);null == m ? E("151") : void 0;for (var r = h = null, n = g, w = g = 0, k = null, x = m.next(); null !== n && !x.done; w++, x = m.next()) {
|
7822 | n.index > w ? (k = n, n = null) : k = n.sibling;var J = G(e, n, x.value, A);if (null === J) {
|
7823 | n || (n = k);break;
|
7824 | }a && n && null === J.alternate && b(e, n);g = f(J, g, w);null === r ? h = J : r.sibling = J;r = J;n = k;
|
7825 | }if (x.done) return c(e, n), h;if (null === n) {
|
7826 | for (; !x.done; w++, x = m.next()) {
|
7827 | x = z(e, x.value, A), null !== x && (g = f(x, g, w), null === r ? h = x : r.sibling = x, r = x);
|
7828 | }return h;
|
7829 | }for (n = d(e, n); !x.done; w++, x = m.next()) {
|
7830 | if (x = I(n, e, w, x.value, A), null !== x) {
|
7831 | if (a && null !== x.alternate) n["delete"](null === x.key ? w : x.key);g = f(x, g, w);null === r ? h = x : r.sibling = x;r = x;
|
7832 | }
|
7833 | }a && n.forEach(function (a) {
|
7834 | return b(e, a);
|
7835 | });return h;
|
7836 | }return function (a, d, f, h) {
|
7837 | "object" === (typeof f === "undefined" ? "undefined" : _typeof(f)) && null !== f && f.type === Ve && null === f.key && (f = f.props.children);
|
7838 | var m = "object" === (typeof f === "undefined" ? "undefined" : _typeof(f)) && null !== f;if (m) switch (f.$$typeof) {case Re:
|
7839 | a: {
|
7840 | var r = f.key;for (m = d; null !== m;) {
|
7841 | if (m.key === r) {
|
7842 | if (10 === m.tag ? f.type === Ve : m.type === f.type) {
|
7843 | c(a, m.sibling);d = e(m, f.type === Ve ? f.props.children : f.props, h);d.ref = Ze(m, f);d["return"] = a;a = d;break a;
|
7844 | } else {
|
7845 | c(a, m);break;
|
7846 | }
|
7847 | } else b(a, m);m = m.sibling;
|
7848 | }f.type === Ve ? (d = ue(f.props.children, a.internalContextTag, h, f.key), d["return"] = a, a = d) : (h = te(f, a.internalContextTag, h), h.ref = Ze(d, f), h["return"] = a, a = h);
|
7849 | }return g(a);case Se:
|
7850 | a: {
|
7851 | for (m = f.key; null !== d;) {
|
7852 | if (d.key === m) {
|
7853 | if (7 === d.tag) {
|
7854 | c(a, d.sibling);d = e(d, f, h);d["return"] = a;a = d;break a;
|
7855 | } else {
|
7856 | c(a, d);break;
|
7857 | }
|
7858 | } else b(a, d);d = d.sibling;
|
7859 | }d = we(f, a.internalContextTag, h);d["return"] = a;a = d;
|
7860 | }return g(a);case Te:
|
7861 | a: {
|
7862 | if (null !== d) if (9 === d.tag) {
|
7863 | c(a, d.sibling);d = e(d, null, h);d.type = f.value;d["return"] = a;a = d;break a;
|
7864 | } else c(a, d);d = xe(f, a.internalContextTag, h);d.type = f.value;d["return"] = a;a = d;
|
7865 | }return g(a);case Ue:
|
7866 | a: {
|
7867 | for (m = f.key; null !== d;) {
|
7868 | if (d.key === m) {
|
7869 | if (4 === d.tag && d.stateNode.containerInfo === f.containerInfo && d.stateNode.implementation === f.implementation) {
|
7870 | c(a, d.sibling);d = e(d, f.children || [], h);d["return"] = a;a = d;break a;
|
7871 | } else {
|
7872 | c(a, d);break;
|
7873 | }
|
7874 | } else b(a, d);d = d.sibling;
|
7875 | }d = ye(f, a.internalContextTag, h);d["return"] = a;a = d;
|
7876 | }return g(a);}if ("string" === typeof f || "number" === typeof f) return f = "" + f, null !== d && 6 === d.tag ? (c(a, d.sibling), d = e(d, f, h)) : (c(a, d), d = ve(f, a.internalContextTag, h)), d["return"] = a, a = d, g(a);if (Ye(f)) return L(a, d, f, h);if (Xe(f)) return N(a, d, f, h);m && $e(a, f);if ("undefined" === typeof f) switch (a.tag) {case 2:case 1:
|
7877 | h = a.type, E("152", h.displayName || h.name || "Component");}return c(a, d);
|
7878 | };
|
7879 | }var bf = af(!0),
|
7880 | cf = af(!1);
|
7881 | function df(a, b, c, d, e) {
|
7882 | function f(a, b, c) {
|
7883 | var d = b.expirationTime;b.child = null === a ? cf(b, null, c, d) : bf(b, a.child, c, d);
|
7884 | }function g(a, b) {
|
7885 | var c = b.ref;null === c || a && a.ref === c || (b.effectTag |= 128);
|
7886 | }function h(a, b, c, d) {
|
7887 | g(a, b);if (!c) return d && re(b, !1), q(a, b);c = b.stateNode;id.current = b;var e = c.render();b.effectTag |= 1;f(a, b, e);b.memoizedState = c.state;b.memoizedProps = c.props;d && re(b, !0);return b.child;
|
7888 | }function k(a) {
|
7889 | var b = a.stateNode;b.pendingContext ? oe(a, b.pendingContext, b.pendingContext !== b.context) : b.context && oe(a, b.context, !1);I(a, b.containerInfo);
|
7890 | }function q(a, b) {
|
7891 | null !== a && b.child !== a.child ? E("153") : void 0;if (null !== b.child) {
|
7892 | a = b.child;var c = se(a, a.pendingProps, a.expirationTime);b.child = c;for (c["return"] = b; null !== a.sibling;) {
|
7893 | a = a.sibling, c = c.sibling = se(a, a.pendingProps, a.expirationTime), c["return"] = b;
|
7894 | }c.sibling = null;
|
7895 | }return b.child;
|
7896 | }function v(a, b) {
|
7897 | switch (b.tag) {case 3:
|
7898 | k(b);break;case 2:
|
7899 | qe(b);break;case 4:
|
7900 | I(b, b.stateNode.containerInfo);}return null;
|
7901 | }var y = a.shouldSetTextContent,
|
7902 | u = a.useSyncScheduling,
|
7903 | z = a.shouldDeprioritizeSubtree,
|
7904 | G = b.pushHostContext,
|
7905 | I = b.pushHostContainer,
|
7906 | L = c.enterHydrationState,
|
7907 | N = c.resetHydrationState,
|
7908 | J = c.tryToClaimNextHydratableInstance;a = Le(d, e, function (a, b) {
|
7909 | a.memoizedProps = b;
|
7910 | }, function (a, b) {
|
7911 | a.memoizedState = b;
|
7912 | });var w = a.adoptClassInstance,
|
7913 | m = a.constructClassInstance,
|
7914 | A = a.mountClassInstance,
|
7915 | Ob = a.updateClassInstance;return { beginWork: function beginWork(a, b, c) {
|
7916 | if (0 === b.expirationTime || b.expirationTime > c) return v(a, b);switch (b.tag) {case 0:
|
7917 | null !== a ? E("155") : void 0;var d = b.type,
|
7918 | e = b.pendingProps,
|
7919 | r = ke(b);r = me(b, r);d = d(e, r);b.effectTag |= 1;"object" === (typeof d === "undefined" ? "undefined" : _typeof(d)) && null !== d && "function" === typeof d.render ? (b.tag = 2, e = qe(b), w(b, d), A(b, c), b = h(a, b, !0, e)) : (b.tag = 1, f(a, b, d), b.memoizedProps = e, b = b.child);return b;case 1:
|
7920 | a: {
|
7921 | e = b.type;c = b.pendingProps;d = b.memoizedProps;if (X.current) null === c && (c = d);else if (null === c || d === c) {
|
7922 | b = q(a, b);break a;
|
7923 | }d = ke(b);d = me(b, d);e = e(c, d);b.effectTag |= 1;f(a, b, e);b.memoizedProps = c;b = b.child;
|
7924 | }return b;case 2:
|
7925 | return e = qe(b), d = void 0, null === a ? b.stateNode ? E("153") : (m(b, b.pendingProps), A(b, c), d = !0) : d = Ob(a, b, c), h(a, b, d, e);case 3:
|
7926 | return k(b), e = b.updateQueue, null !== e ? (d = b.memoizedState, e = Je(a, b, e, null, null, c), d === e ? (N(), b = q(a, b)) : (d = e.element, r = b.stateNode, (null === a || null === a.child) && r.hydrate && L(b) ? (b.effectTag |= 2, b.child = cf(b, null, d, c)) : (N(), f(a, b, d)), b.memoizedState = e, b = b.child)) : (N(), b = q(a, b)), b;case 5:
|
7927 | G(b);null === a && J(b);e = b.type;var n = b.memoizedProps;d = b.pendingProps;null === d && (d = n, null === d ? E("154") : void 0);r = null !== a ? a.memoizedProps : null;X.current || null !== d && n !== d ? (n = d.children, y(e, d) ? n = null : r && y(e, r) && (b.effectTag |= 16), g(a, b), 2147483647 !== c && !u && z(e, d) ? (b.expirationTime = 2147483647, b = null) : (f(a, b, n), b.memoizedProps = d, b = b.child)) : b = q(a, b);return b;case 6:
|
7928 | return null === a && J(b), a = b.pendingProps, null === a && (a = b.memoizedProps), b.memoizedProps = a, null;case 8:
|
7929 | b.tag = 7;case 7:
|
7930 | e = b.pendingProps;if (X.current) null === e && (e = a && a.memoizedProps, null === e ? E("154") : void 0);else if (null === e || b.memoizedProps === e) e = b.memoizedProps;d = e.children;b.stateNode = null === a ? cf(b, b.stateNode, d, c) : bf(b, b.stateNode, d, c);b.memoizedProps = e;return b.stateNode;
|
7931 | case 9:
|
7932 | return null;case 4:
|
7933 | a: {
|
7934 | I(b, b.stateNode.containerInfo);e = b.pendingProps;if (X.current) null === e && (e = a && a.memoizedProps, null == e ? E("154") : void 0);else if (null === e || b.memoizedProps === e) {
|
7935 | b = q(a, b);break a;
|
7936 | }null === a ? b.child = bf(b, null, e, c) : f(a, b, e);b.memoizedProps = e;b = b.child;
|
7937 | }return b;case 10:
|
7938 | a: {
|
7939 | c = b.pendingProps;if (X.current) null === c && (c = b.memoizedProps);else if (null === c || b.memoizedProps === c) {
|
7940 | b = q(a, b);break a;
|
7941 | }f(a, b, c);b.memoizedProps = c;b = b.child;
|
7942 | }return b;default:
|
7943 | E("156");}
|
7944 | }, beginFailedWork: function beginFailedWork(a, b, c) {
|
7945 | switch (b.tag) {case 2:
|
7946 | qe(b);break;case 3:
|
7947 | k(b);break;default:
|
7948 | E("157");}b.effectTag |= 64;null === a ? b.child = null : b.child !== a.child && (b.child = a.child);if (0 === b.expirationTime || b.expirationTime > c) return v(a, b);b.firstEffect = null;b.lastEffect = null;b.child = null === a ? cf(b, null, null, c) : bf(b, a.child, null, c);2 === b.tag && (a = b.stateNode, b.memoizedProps = a.props, b.memoizedState = a.state);return b.child;
|
7949 | } };
|
7950 | }
|
7951 | function ef(a, b, c) {
|
7952 | function d(a) {
|
7953 | a.effectTag |= 4;
|
7954 | }var e = a.createInstance,
|
7955 | f = a.createTextInstance,
|
7956 | g = a.appendInitialChild,
|
7957 | h = a.finalizeInitialChildren,
|
7958 | k = a.prepareUpdate,
|
7959 | q = a.persistence,
|
7960 | v = b.getRootHostContainer,
|
7961 | y = b.popHostContext,
|
7962 | u = b.getHostContext,
|
7963 | z = b.popHostContainer,
|
7964 | G = c.prepareToHydrateHostInstance,
|
7965 | I = c.prepareToHydrateHostTextInstance,
|
7966 | L = c.popHydrationState,
|
7967 | N = void 0,
|
7968 | J = void 0,
|
7969 | w = void 0;a.mutation ? (N = function N() {}, J = function J(a, b, c) {
|
7970 | (b.updateQueue = c) && d(b);
|
7971 | }, w = function w(a, b, c, e) {
|
7972 | c !== e && d(b);
|
7973 | }) : q ? E("235") : E("236");
|
7974 | return { completeWork: function completeWork(a, b, c) {
|
7975 | var m = b.pendingProps;if (null === m) m = b.memoizedProps;else if (2147483647 !== b.expirationTime || 2147483647 === c) b.pendingProps = null;switch (b.tag) {case 1:
|
7976 | return null;case 2:
|
7977 | return ne(b), null;case 3:
|
7978 | z(b);V(X, b);V(ie, b);m = b.stateNode;m.pendingContext && (m.context = m.pendingContext, m.pendingContext = null);if (null === a || null === a.child) L(b), b.effectTag &= -3;N(b);return null;case 5:
|
7979 | y(b);c = v();var A = b.type;if (null !== a && null != b.stateNode) {
|
7980 | var p = a.memoizedProps,
|
7981 | q = b.stateNode,
|
7982 | x = u();q = k(q, A, p, m, c, x);J(a, b, q, A, p, m, c);a.ref !== b.ref && (b.effectTag |= 128);
|
7983 | } else {
|
7984 | if (!m) return null === b.stateNode ? E("166") : void 0, null;a = u();if (L(b)) G(b, c, a) && d(b);else {
|
7985 | a = e(A, m, c, a, b);a: for (p = b.child; null !== p;) {
|
7986 | if (5 === p.tag || 6 === p.tag) g(a, p.stateNode);else if (4 !== p.tag && null !== p.child) {
|
7987 | p.child["return"] = p;p = p.child;continue;
|
7988 | }if (p === b) break;for (; null === p.sibling;) {
|
7989 | if (null === p["return"] || p["return"] === b) break a;p = p["return"];
|
7990 | }p.sibling["return"] = p["return"];p = p.sibling;
|
7991 | }h(a, A, m, c) && d(b);b.stateNode = a;
|
7992 | }null !== b.ref && (b.effectTag |= 128);
|
7993 | }return null;case 6:
|
7994 | if (a && null != b.stateNode) w(a, b, a.memoizedProps, m);else {
|
7995 | if ("string" !== typeof m) return null === b.stateNode ? E("166") : void 0, null;a = v();c = u();L(b) ? I(b) && d(b) : b.stateNode = f(m, a, c, b);
|
7996 | }return null;case 7:
|
7997 | (m = b.memoizedProps) ? void 0 : E("165");b.tag = 8;A = [];a: for ((p = b.stateNode) && (p["return"] = b); null !== p;) {
|
7998 | if (5 === p.tag || 6 === p.tag || 4 === p.tag) E("247");else if (9 === p.tag) A.push(p.type);else if (null !== p.child) {
|
7999 | p.child["return"] = p;p = p.child;continue;
|
8000 | }for (; null === p.sibling;) {
|
8001 | if (null === p["return"] || p["return"] === b) break a;p = p["return"];
|
8002 | }p.sibling["return"] = p["return"];p = p.sibling;
|
8003 | }p = m.handler;m = p(m.props, A);b.child = bf(b, null !== a ? a.child : null, m, c);return b.child;case 8:
|
8004 | return b.tag = 7, null;case 9:
|
8005 | return null;case 10:
|
8006 | return null;case 4:
|
8007 | return z(b), N(b), null;case 0:
|
8008 | E("167");default:
|
8009 | E("156");}
|
8010 | } };
|
8011 | }
|
8012 | function ff(a, b) {
|
8013 | function c(a) {
|
8014 | var c = a.ref;if (null !== c) try {
|
8015 | c(null);
|
8016 | } catch (A) {
|
8017 | b(a, A);
|
8018 | }
|
8019 | }function d(a) {
|
8020 | "function" === typeof Ee && Ee(a);switch (a.tag) {case 2:
|
8021 | c(a);var d = a.stateNode;if ("function" === typeof d.componentWillUnmount) try {
|
8022 | d.props = a.memoizedProps, d.state = a.memoizedState, d.componentWillUnmount();
|
8023 | } catch (A) {
|
8024 | b(a, A);
|
8025 | }break;case 5:
|
8026 | c(a);break;case 7:
|
8027 | e(a.stateNode);break;case 4:
|
8028 | k && g(a);}
|
8029 | }function e(a) {
|
8030 | for (var b = a;;) {
|
8031 | if (d(b), null === b.child || k && 4 === b.tag) {
|
8032 | if (b === a) break;for (; null === b.sibling;) {
|
8033 | if (null === b["return"] || b["return"] === a) return;b = b["return"];
|
8034 | }b.sibling["return"] = b["return"];b = b.sibling;
|
8035 | } else b.child["return"] = b, b = b.child;
|
8036 | }
|
8037 | }function f(a) {
|
8038 | return 5 === a.tag || 3 === a.tag || 4 === a.tag;
|
8039 | }function g(a) {
|
8040 | for (var b = a, c = !1, f = void 0, g = void 0;;) {
|
8041 | if (!c) {
|
8042 | c = b["return"];a: for (;;) {
|
8043 | null === c ? E("160") : void 0;switch (c.tag) {case 5:
|
8044 | f = c.stateNode;g = !1;break a;case 3:
|
8045 | f = c.stateNode.containerInfo;g = !0;break a;case 4:
|
8046 | f = c.stateNode.containerInfo;g = !0;break a;}c = c["return"];
|
8047 | }c = !0;
|
8048 | }if (5 === b.tag || 6 === b.tag) e(b), g ? J(f, b.stateNode) : N(f, b.stateNode);else if (4 === b.tag ? f = b.stateNode.containerInfo : d(b), null !== b.child) {
|
8049 | b.child["return"] = b;b = b.child;continue;
|
8050 | }if (b === a) break;for (; null === b.sibling;) {
|
8051 | if (null === b["return"] || b["return"] === a) return;b = b["return"];4 === b.tag && (c = !1);
|
8052 | }b.sibling["return"] = b["return"];b = b.sibling;
|
8053 | }
|
8054 | }var h = a.getPublicInstance,
|
8055 | k = a.mutation;a = a.persistence;k || (a ? E("235") : E("236"));var q = k.commitMount,
|
8056 | v = k.commitUpdate,
|
8057 | y = k.resetTextContent,
|
8058 | u = k.commitTextUpdate,
|
8059 | z = k.appendChild,
|
8060 | G = k.appendChildToContainer,
|
8061 | I = k.insertBefore,
|
8062 | L = k.insertInContainerBefore,
|
8063 | N = k.removeChild,
|
8064 | J = k.removeChildFromContainer;return { commitResetTextContent: function commitResetTextContent(a) {
|
8065 | y(a.stateNode);
|
8066 | }, commitPlacement: function commitPlacement(a) {
|
8067 | a: {
|
8068 | for (var b = a["return"]; null !== b;) {
|
8069 | if (f(b)) {
|
8070 | var c = b;break a;
|
8071 | }b = b["return"];
|
8072 | }E("160");c = void 0;
|
8073 | }var d = b = void 0;switch (c.tag) {case 5:
|
8074 | b = c.stateNode;d = !1;break;case 3:
|
8075 | b = c.stateNode.containerInfo;d = !0;break;case 4:
|
8076 | b = c.stateNode.containerInfo;d = !0;break;default:
|
8077 | E("161");}c.effectTag & 16 && (y(b), c.effectTag &= -17);a: b: for (c = a;;) {
|
8078 | for (; null === c.sibling;) {
|
8079 | if (null === c["return"] || f(c["return"])) {
|
8080 | c = null;break a;
|
8081 | }c = c["return"];
|
8082 | }c.sibling["return"] = c["return"];for (c = c.sibling; 5 !== c.tag && 6 !== c.tag;) {
|
8083 | if (c.effectTag & 2) continue b;if (null === c.child || 4 === c.tag) continue b;else c.child["return"] = c, c = c.child;
|
8084 | }if (!(c.effectTag & 2)) {
|
8085 | c = c.stateNode;break a;
|
8086 | }
|
8087 | }for (var e = a;;) {
|
8088 | if (5 === e.tag || 6 === e.tag) c ? d ? L(b, e.stateNode, c) : I(b, e.stateNode, c) : d ? G(b, e.stateNode) : z(b, e.stateNode);else if (4 !== e.tag && null !== e.child) {
|
8089 | e.child["return"] = e;e = e.child;continue;
|
8090 | }if (e === a) break;for (; null === e.sibling;) {
|
8091 | if (null === e["return"] || e["return"] === a) return;e = e["return"];
|
8092 | }e.sibling["return"] = e["return"];e = e.sibling;
|
8093 | }
|
8094 | }, commitDeletion: function commitDeletion(a) {
|
8095 | g(a);a["return"] = null;a.child = null;a.alternate && (a.alternate.child = null, a.alternate["return"] = null);
|
8096 | }, commitWork: function commitWork(a, b) {
|
8097 | switch (b.tag) {case 2:
|
8098 | break;case 5:
|
8099 | var c = b.stateNode;if (null != c) {
|
8100 | var d = b.memoizedProps;a = null !== a ? a.memoizedProps : d;var e = b.type,
|
8101 | f = b.updateQueue;b.updateQueue = null;null !== f && v(c, f, e, a, d, b);
|
8102 | }break;case 6:
|
8103 | null === b.stateNode ? E("162") : void 0;c = b.memoizedProps;u(b.stateNode, null !== a ? a.memoizedProps : c, c);break;case 3:
|
8104 | break;default:
|
8105 | E("163");}
|
8106 | }, commitLifeCycles: function commitLifeCycles(a, b) {
|
8107 | switch (b.tag) {case 2:
|
8108 | var c = b.stateNode;if (b.effectTag & 4) if (null === a) c.props = b.memoizedProps, c.state = b.memoizedState, c.componentDidMount();else {
|
8109 | var d = a.memoizedProps;a = a.memoizedState;c.props = b.memoizedProps;c.state = b.memoizedState;c.componentDidUpdate(d, a);
|
8110 | }b = b.updateQueue;null !== b && Ke(b, c);break;case 3:
|
8111 | c = b.updateQueue;null !== c && Ke(c, null !== b.child ? b.child.stateNode : null);break;case 5:
|
8112 | c = b.stateNode;null === a && b.effectTag & 4 && q(c, b.type, b.memoizedProps, b);break;case 6:
|
8113 | break;case 4:
|
8114 | break;default:
|
8115 | E("163");}
|
8116 | }, commitAttachRef: function commitAttachRef(a) {
|
8117 | var b = a.ref;if (null !== b) {
|
8118 | var c = a.stateNode;switch (a.tag) {case 5:
|
8119 | b(h(c));break;default:
|
8120 | b(c);}
|
8121 | }
|
8122 | }, commitDetachRef: function commitDetachRef(a) {
|
8123 | a = a.ref;null !== a && a(null);
|
8124 | } };
|
8125 | }var gf = {};
|
8126 | function hf(a) {
|
8127 | function b(a) {
|
8128 | a === gf ? E("174") : void 0;return a;
|
8129 | }var c = a.getChildHostContext,
|
8130 | d = a.getRootHostContext,
|
8131 | e = { current: gf },
|
8132 | f = { current: gf },
|
8133 | g = { current: gf };return { getHostContext: function getHostContext() {
|
8134 | return b(e.current);
|
8135 | }, getRootHostContainer: function getRootHostContainer() {
|
8136 | return b(g.current);
|
8137 | }, popHostContainer: function popHostContainer(a) {
|
8138 | V(e, a);V(f, a);V(g, a);
|
8139 | }, popHostContext: function popHostContext(a) {
|
8140 | f.current === a && (V(e, a), V(f, a));
|
8141 | }, pushHostContainer: function pushHostContainer(a, b) {
|
8142 | W(g, b, a);b = d(b);W(f, a, a);W(e, b, a);
|
8143 | }, pushHostContext: function pushHostContext(a) {
|
8144 | var d = b(g.current),
|
8145 | h = b(e.current);
|
8146 | d = c(h, a.type, d);h !== d && (W(f, a, a), W(e, d, a));
|
8147 | }, resetHostContainer: function resetHostContainer() {
|
8148 | e.current = gf;g.current = gf;
|
8149 | } };
|
8150 | }
|
8151 | function jf(a) {
|
8152 | function b(a, b) {
|
8153 | var c = new Y(5, null, 0);c.type = "DELETED";c.stateNode = b;c["return"] = a;c.effectTag = 8;null !== a.lastEffect ? (a.lastEffect.nextEffect = c, a.lastEffect = c) : a.firstEffect = a.lastEffect = c;
|
8154 | }function c(a, b) {
|
8155 | switch (a.tag) {case 5:
|
8156 | return b = f(b, a.type, a.pendingProps), null !== b ? (a.stateNode = b, !0) : !1;case 6:
|
8157 | return b = g(b, a.pendingProps), null !== b ? (a.stateNode = b, !0) : !1;default:
|
8158 | return !1;}
|
8159 | }function d(a) {
|
8160 | for (a = a["return"]; null !== a && 5 !== a.tag && 3 !== a.tag;) {
|
8161 | a = a["return"];
|
8162 | }y = a;
|
8163 | }var e = a.shouldSetTextContent;
|
8164 | a = a.hydration;if (!a) return { enterHydrationState: function enterHydrationState() {
|
8165 | return !1;
|
8166 | }, resetHydrationState: function resetHydrationState() {}, tryToClaimNextHydratableInstance: function tryToClaimNextHydratableInstance() {}, prepareToHydrateHostInstance: function prepareToHydrateHostInstance() {
|
8167 | E("175");
|
8168 | }, prepareToHydrateHostTextInstance: function prepareToHydrateHostTextInstance() {
|
8169 | E("176");
|
8170 | }, popHydrationState: function popHydrationState() {
|
8171 | return !1;
|
8172 | } };var f = a.canHydrateInstance,
|
8173 | g = a.canHydrateTextInstance,
|
8174 | h = a.getNextHydratableSibling,
|
8175 | k = a.getFirstHydratableChild,
|
8176 | q = a.hydrateInstance,
|
8177 | v = a.hydrateTextInstance,
|
8178 | y = null,
|
8179 | u = null,
|
8180 | z = !1;return { enterHydrationState: function enterHydrationState(a) {
|
8181 | u = k(a.stateNode.containerInfo);y = a;return z = !0;
|
8182 | }, resetHydrationState: function resetHydrationState() {
|
8183 | u = y = null;z = !1;
|
8184 | }, tryToClaimNextHydratableInstance: function tryToClaimNextHydratableInstance(a) {
|
8185 | if (z) {
|
8186 | var d = u;if (d) {
|
8187 | if (!c(a, d)) {
|
8188 | d = h(d);if (!d || !c(a, d)) {
|
8189 | a.effectTag |= 2;z = !1;y = a;return;
|
8190 | }b(y, u);
|
8191 | }y = a;u = k(d);
|
8192 | } else a.effectTag |= 2, z = !1, y = a;
|
8193 | }
|
8194 | }, prepareToHydrateHostInstance: function prepareToHydrateHostInstance(a, b, c) {
|
8195 | b = q(a.stateNode, a.type, a.memoizedProps, b, c, a);a.updateQueue = b;return null !== b ? !0 : !1;
|
8196 | }, prepareToHydrateHostTextInstance: function prepareToHydrateHostTextInstance(a) {
|
8197 | return v(a.stateNode, a.memoizedProps, a);
|
8198 | }, popHydrationState: function popHydrationState(a) {
|
8199 | if (a !== y) return !1;if (!z) return d(a), z = !0, !1;var c = a.type;if (5 !== a.tag || "head" !== c && "body" !== c && !e(c, a.memoizedProps)) for (c = u; c;) {
|
8200 | b(a, c), c = h(c);
|
8201 | }d(a);u = y ? h(a.stateNode) : null;return !0;
|
8202 | } };
|
8203 | }
|
8204 | function kf(a) {
|
8205 | function b(a) {
|
8206 | Qb = ja = !0;var b = a.stateNode;b.current === a ? E("177") : void 0;b.isReadyForCommit = !1;id.current = null;if (1 < a.effectTag) {
|
8207 | if (null !== a.lastEffect) {
|
8208 | a.lastEffect.nextEffect = a;var c = a.firstEffect;
|
8209 | } else c = a;
|
8210 | } else c = a.firstEffect;yg();for (t = c; null !== t;) {
|
8211 | var d = !1,
|
8212 | e = void 0;try {
|
8213 | for (; null !== t;) {
|
8214 | var f = t.effectTag;f & 16 && zg(t);if (f & 128) {
|
8215 | var g = t.alternate;null !== g && Ag(g);
|
8216 | }switch (f & -242) {case 2:
|
8217 | Ne(t);t.effectTag &= -3;break;case 6:
|
8218 | Ne(t);t.effectTag &= -3;Oe(t.alternate, t);break;case 4:
|
8219 | Oe(t.alternate, t);break;case 8:
|
8220 | Sc = !0, Bg(t), Sc = !1;}t = t.nextEffect;
|
8221 | }
|
8222 | } catch (Tc) {
|
8223 | d = !0, e = Tc;
|
8224 | }d && (null === t ? E("178") : void 0, h(t, e), null !== t && (t = t.nextEffect));
|
8225 | }Cg();b.current = a;for (t = c; null !== t;) {
|
8226 | c = !1;d = void 0;try {
|
8227 | for (; null !== t;) {
|
8228 | var k = t.effectTag;k & 36 && Dg(t.alternate, t);k & 128 && Eg(t);if (k & 64) switch (e = t, f = void 0, null !== R && (f = R.get(e), R["delete"](e), null == f && null !== e.alternate && (e = e.alternate, f = R.get(e), R["delete"](e))), null == f ? E("184") : void 0, e.tag) {case 2:
|
8229 | e.stateNode.componentDidCatch(f.error, { componentStack: f.componentStack });
|
8230 | break;case 3:
|
8231 | null === ca && (ca = f.error);break;default:
|
8232 | E("157");}var Qc = t.nextEffect;t.nextEffect = null;t = Qc;
|
8233 | }
|
8234 | } catch (Tc) {
|
8235 | c = !0, d = Tc;
|
8236 | }c && (null === t ? E("178") : void 0, h(t, d), null !== t && (t = t.nextEffect));
|
8237 | }ja = Qb = !1;"function" === typeof De && De(a.stateNode);ha && (ha.forEach(G), ha = null);null !== ca && (a = ca, ca = null, Ob(a));b = b.current.expirationTime;0 === b && (qa = R = null);return b;
|
8238 | }function c(a) {
|
8239 | for (;;) {
|
8240 | var b = Fg(a.alternate, a, H),
|
8241 | c = a["return"],
|
8242 | d = a.sibling;var e = a;if (2147483647 === H || 2147483647 !== e.expirationTime) {
|
8243 | if (2 !== e.tag && 3 !== e.tag) var f = 0;else f = e.updateQueue, f = null === f ? 0 : f.expirationTime;for (var g = e.child; null !== g;) {
|
8244 | 0 !== g.expirationTime && (0 === f || f > g.expirationTime) && (f = g.expirationTime), g = g.sibling;
|
8245 | }e.expirationTime = f;
|
8246 | }if (null !== b) return b;null !== c && (null === c.firstEffect && (c.firstEffect = a.firstEffect), null !== a.lastEffect && (null !== c.lastEffect && (c.lastEffect.nextEffect = a.firstEffect), c.lastEffect = a.lastEffect), 1 < a.effectTag && (null !== c.lastEffect ? c.lastEffect.nextEffect = a : c.firstEffect = a, c.lastEffect = a));if (null !== d) return d;
|
8247 | if (null !== c) a = c;else {
|
8248 | a.stateNode.isReadyForCommit = !0;break;
|
8249 | }
|
8250 | }return null;
|
8251 | }function d(a) {
|
8252 | var b = rg(a.alternate, a, H);null === b && (b = c(a));id.current = null;return b;
|
8253 | }function e(a) {
|
8254 | var b = Gg(a.alternate, a, H);null === b && (b = c(a));id.current = null;return b;
|
8255 | }function f(a) {
|
8256 | if (null !== R) {
|
8257 | if (!(0 === H || H > a)) if (H <= Uc) for (; null !== F;) {
|
8258 | F = k(F) ? e(F) : d(F);
|
8259 | } else for (; null !== F && !A();) {
|
8260 | F = k(F) ? e(F) : d(F);
|
8261 | }
|
8262 | } else if (!(0 === H || H > a)) if (H <= Uc) for (; null !== F;) {
|
8263 | F = d(F);
|
8264 | } else for (; null !== F && !A();) {
|
8265 | F = d(F);
|
8266 | }
|
8267 | }function g(a, b) {
|
8268 | ja ? E("243") : void 0;ja = !0;a.isReadyForCommit = !1;if (a !== ra || b !== H || null === F) {
|
8269 | for (; -1 < he;) {
|
8270 | ge[he] = null, he--;
|
8271 | }je = D;ie.current = D;X.current = !1;x();ra = a;H = b;F = se(ra.current, null, b);
|
8272 | }var c = !1,
|
8273 | d = null;try {
|
8274 | f(b);
|
8275 | } catch (Rc) {
|
8276 | c = !0, d = Rc;
|
8277 | }for (; c;) {
|
8278 | if (eb) {
|
8279 | ca = d;break;
|
8280 | }var g = F;if (null === g) eb = !0;else {
|
8281 | var k = h(g, d);null === k ? E("183") : void 0;if (!eb) {
|
8282 | try {
|
8283 | c = k;d = b;for (k = c; null !== g;) {
|
8284 | switch (g.tag) {case 2:
|
8285 | ne(g);break;case 5:
|
8286 | qg(g);break;case 3:
|
8287 | p(g);break;case 4:
|
8288 | p(g);}if (g === k || g.alternate === k) break;g = g["return"];
|
8289 | }F = e(c);f(d);
|
8290 | } catch (Rc) {
|
8291 | c = !0;d = Rc;continue;
|
8292 | }break;
|
8293 | }
|
8294 | }
|
8295 | }b = ca;eb = ja = !1;ca = null;null !== b && Ob(b);return a.isReadyForCommit ? a.current.alternate : null;
|
8296 | }function h(a, b) {
|
8297 | var c = id.current = null,
|
8298 | d = !1,
|
8299 | e = !1,
|
8300 | f = null;if (3 === a.tag) c = a, q(a) && (eb = !0);else for (var g = a["return"]; null !== g && null === c;) {
|
8301 | 2 === g.tag ? "function" === typeof g.stateNode.componentDidCatch && (d = !0, f = jd(g), c = g, e = !0) : 3 === g.tag && (c = g);if (q(g)) {
|
8302 | if (Sc || null !== ha && (ha.has(g) || null !== g.alternate && ha.has(g.alternate))) return null;c = null;e = !1;
|
8303 | }g = g["return"];
|
8304 | }if (null !== c) {
|
8305 | null === qa && (qa = new Set());qa.add(c);var h = "";g = a;do {
|
8306 | a: switch (g.tag) {case 0:case 1:case 2:case 5:
|
8307 | var k = g._debugOwner,
|
8308 | Qc = g._debugSource;var m = jd(g);var n = null;k && (n = jd(k));k = Qc;m = "\n in " + (m || "Unknown") + (k ? " (at " + k.fileName.replace(/^.*[\\\/]/, "") + ":" + k.lineNumber + ")" : n ? " (created by " + n + ")" : "");break a;default:
|
8309 | m = "";}h += m;g = g["return"];
|
8310 | } while (g);g = h;a = jd(a);null === R && (R = new Map());b = { componentName: a, componentStack: g, error: b, errorBoundary: d ? c.stateNode : null, errorBoundaryFound: d, errorBoundaryName: f, willRetry: e };R.set(c, b);try {
|
8311 | var p = b.error;p && p.suppressReactErrorLogging || console.error(p);
|
8312 | } catch (Vc) {
|
8313 | Vc && Vc.suppressReactErrorLogging || console.error(Vc);
|
8314 | }Qb ? (null === ha && (ha = new Set()), ha.add(c)) : G(c);return c;
|
8315 | }null === ca && (ca = b);return null;
|
8316 | }function k(a) {
|
8317 | return null !== R && (R.has(a) || null !== a.alternate && R.has(a.alternate));
|
8318 | }function q(a) {
|
8319 | return null !== qa && (qa.has(a) || null !== a.alternate && qa.has(a.alternate));
|
8320 | }function v() {
|
8321 | return 20 * (((I() + 100) / 20 | 0) + 1);
|
8322 | }function y(a) {
|
8323 | return 0 !== ka ? ka : ja ? Qb ? 1 : H : !Hg || a.internalContextTag & 1 ? v() : 1;
|
8324 | }function u(a, b) {
|
8325 | return z(a, b, !1);
|
8326 | }function z(a, b) {
|
8327 | for (; null !== a;) {
|
8328 | if (0 === a.expirationTime || a.expirationTime > b) a.expirationTime = b;null !== a.alternate && (0 === a.alternate.expirationTime || a.alternate.expirationTime > b) && (a.alternate.expirationTime = b);if (null === a["return"]) if (3 === a.tag) {
|
8329 | var c = a.stateNode;!ja && c === ra && b < H && (F = ra = null, H = 0);var d = c,
|
8330 | e = b;Rb > Ig && E("185");if (null === d.nextScheduledRoot) d.remainingExpirationTime = e, null === O ? (sa = O = d, d.nextScheduledRoot = d) : (O = O.nextScheduledRoot = d, O.nextScheduledRoot = sa);else {
|
8331 | var f = d.remainingExpirationTime;if (0 === f || e < f) d.remainingExpirationTime = e;
|
8332 | }Fa || (la ? Sb && (ma = d, na = 1, m(ma, na)) : 1 === e ? w(1, null) : L(e));!ja && c === ra && b < H && (F = ra = null, H = 0);
|
8333 | } else break;a = a["return"];
|
8334 | }
|
8335 | }function G(a) {
|
8336 | z(a, 1, !0);
|
8337 | }function I() {
|
8338 | return Uc = ((Wc() - Pe) / 10 | 0) + 2;
|
8339 | }function L(a) {
|
8340 | if (0 !== Tb) {
|
8341 | if (a > Tb) return;Jg(Xc);
|
8342 | }var b = Wc() - Pe;Tb = a;Xc = Kg(J, { timeout: 10 * (a - 2) - b });
|
8343 | }function N() {
|
8344 | var a = 0,
|
8345 | b = null;if (null !== O) for (var c = O, d = sa; null !== d;) {
|
8346 | var e = d.remainingExpirationTime;if (0 === e) {
|
8347 | null === c || null === O ? E("244") : void 0;if (d === d.nextScheduledRoot) {
|
8348 | sa = O = d.nextScheduledRoot = null;break;
|
8349 | } else if (d === sa) sa = e = d.nextScheduledRoot, O.nextScheduledRoot = e, d.nextScheduledRoot = null;else if (d === O) {
|
8350 | O = c;O.nextScheduledRoot = sa;d.nextScheduledRoot = null;break;
|
8351 | } else c.nextScheduledRoot = d.nextScheduledRoot, d.nextScheduledRoot = null;d = c.nextScheduledRoot;
|
8352 | } else {
|
8353 | if (0 === a || e < a) a = e, b = d;if (d === O) break;c = d;d = d.nextScheduledRoot;
|
8354 | }
|
8355 | }c = ma;null !== c && c === b ? Rb++ : Rb = 0;ma = b;na = a;
|
8356 | }function J(a) {
|
8357 | w(0, a);
|
8358 | }function w(a, b) {
|
8359 | fb = b;for (N(); null !== ma && 0 !== na && (0 === a || na <= a) && !Yc;) {
|
8360 | m(ma, na), N();
|
8361 | }null !== fb && (Tb = 0, Xc = -1);0 !== na && L(na);fb = null;Yc = !1;Rb = 0;if (Ub) throw a = Zc, Zc = null, Ub = !1, a;
|
8362 | }function m(a, c) {
|
8363 | Fa ? E("245") : void 0;Fa = !0;if (c <= I()) {
|
8364 | var d = a.finishedWork;null !== d ? (a.finishedWork = null, a.remainingExpirationTime = b(d)) : (a.finishedWork = null, d = g(a, c), null !== d && (a.remainingExpirationTime = b(d)));
|
8365 | } else d = a.finishedWork, null !== d ? (a.finishedWork = null, a.remainingExpirationTime = b(d)) : (a.finishedWork = null, d = g(a, c), null !== d && (A() ? a.finishedWork = d : a.remainingExpirationTime = b(d)));Fa = !1;
|
8366 | }function A() {
|
8367 | return null === fb || fb.timeRemaining() > Lg ? !1 : Yc = !0;
|
8368 | }function Ob(a) {
|
8369 | null === ma ? E("246") : void 0;ma.remainingExpirationTime = 0;Ub || (Ub = !0, Zc = a);
|
8370 | }var r = hf(a),
|
8371 | n = jf(a),
|
8372 | p = r.popHostContainer,
|
8373 | qg = r.popHostContext,
|
8374 | x = r.resetHostContainer,
|
8375 | Me = df(a, r, n, u, y),
|
8376 | rg = Me.beginWork,
|
8377 | Gg = Me.beginFailedWork,
|
8378 | Fg = ef(a, r, n).completeWork;r = ff(a, h);var zg = r.commitResetTextContent,
|
8379 | Ne = r.commitPlacement,
|
8380 | Bg = r.commitDeletion,
|
8381 | Oe = r.commitWork,
|
8382 | Dg = r.commitLifeCycles,
|
8383 | Eg = r.commitAttachRef,
|
8384 | Ag = r.commitDetachRef,
|
8385 | Wc = a.now,
|
8386 | Kg = a.scheduleDeferredCallback,
|
8387 | Jg = a.cancelDeferredCallback,
|
8388 | Hg = a.useSyncScheduling,
|
8389 | yg = a.prepareForCommit,
|
8390 | Cg = a.resetAfterCommit,
|
8391 | Pe = Wc(),
|
8392 | Uc = 2,
|
8393 | ka = 0,
|
8394 | ja = !1,
|
8395 | F = null,
|
8396 | ra = null,
|
8397 | H = 0,
|
8398 | t = null,
|
8399 | R = null,
|
8400 | qa = null,
|
8401 | ha = null,
|
8402 | ca = null,
|
8403 | eb = !1,
|
8404 | Qb = !1,
|
8405 | Sc = !1,
|
8406 | sa = null,
|
8407 | O = null,
|
8408 | Tb = 0,
|
8409 | Xc = -1,
|
8410 | Fa = !1,
|
8411 | ma = null,
|
8412 | na = 0,
|
8413 | Yc = !1,
|
8414 | Ub = !1,
|
8415 | Zc = null,
|
8416 | fb = null,
|
8417 | la = !1,
|
8418 | Sb = !1,
|
8419 | Ig = 1E3,
|
8420 | Rb = 0,
|
8421 | Lg = 1;return { computeAsyncExpiration: v, computeExpirationForFiber: y, scheduleWork: u, batchedUpdates: function batchedUpdates(a, b) {
|
8422 | var c = la;la = !0;try {
|
8423 | return a(b);
|
8424 | } finally {
|
8425 | (la = c) || Fa || w(1, null);
|
8426 | }
|
8427 | }, unbatchedUpdates: function unbatchedUpdates(a) {
|
8428 | if (la && !Sb) {
|
8429 | Sb = !0;try {
|
8430 | return a();
|
8431 | } finally {
|
8432 | Sb = !1;
|
8433 | }
|
8434 | }return a();
|
8435 | }, flushSync: function flushSync(a) {
|
8436 | var b = la;la = !0;try {
|
8437 | a: {
|
8438 | var c = ka;ka = 1;try {
|
8439 | var d = a();break a;
|
8440 | } finally {
|
8441 | ka = c;
|
8442 | }d = void 0;
|
8443 | }return d;
|
8444 | } finally {
|
8445 | la = b, Fa ? E("187") : void 0, w(1, null);
|
8446 | }
|
8447 | }, deferredUpdates: function deferredUpdates(a) {
|
8448 | var b = ka;ka = v();try {
|
8449 | return a();
|
8450 | } finally {
|
8451 | ka = b;
|
8452 | }
|
8453 | } };
|
8454 | }
|
8455 | function lf(a) {
|
8456 | function b(a) {
|
8457 | a = od(a);return null === a ? null : a.stateNode;
|
8458 | }var c = a.getPublicInstance;a = kf(a);var d = a.computeAsyncExpiration,
|
8459 | e = a.computeExpirationForFiber,
|
8460 | f = a.scheduleWork;return { createContainer: function createContainer(a, b) {
|
8461 | var c = new Y(3, null, 0);a = { current: c, containerInfo: a, pendingChildren: null, remainingExpirationTime: 0, isReadyForCommit: !1, finishedWork: null, context: null, pendingContext: null, hydrate: b, nextScheduledRoot: null };return c.stateNode = a;
|
8462 | }, updateContainer: function updateContainer(a, b, c, q) {
|
8463 | var g = b.current;if (c) {
|
8464 | c = c._reactInternalFiber;var h;b: {
|
8465 | 2 === kd(c) && 2 === c.tag ? void 0 : E("170");for (h = c; 3 !== h.tag;) {
|
8466 | if (le(h)) {
|
8467 | h = h.stateNode.__reactInternalMemoizedMergedChildContext;break b;
|
8468 | }(h = h["return"]) ? void 0 : E("171");
|
8469 | }h = h.stateNode.context;
|
8470 | }c = le(c) ? pe(c, h) : h;
|
8471 | } else c = D;null === b.context ? b.context = c : b.pendingContext = c;b = q;b = void 0 === b ? null : b;q = null != a && null != a.type && null != a.type.prototype && !0 === a.type.prototype.unstable_isAsyncReactComponent ? d() : e(g);He(g, { expirationTime: q, partialState: { element: a }, callback: b, isReplace: !1, isForced: !1,
|
8472 | nextCallback: null, next: null });f(g, q);
|
8473 | }, batchedUpdates: a.batchedUpdates, unbatchedUpdates: a.unbatchedUpdates, deferredUpdates: a.deferredUpdates, flushSync: a.flushSync, getPublicRootInstance: function getPublicRootInstance(a) {
|
8474 | a = a.current;if (!a.child) return null;switch (a.child.tag) {case 5:
|
8475 | return c(a.child.stateNode);default:
|
8476 | return a.child.stateNode;}
|
8477 | }, findHostInstance: b, findHostInstanceWithNoPortals: function findHostInstanceWithNoPortals(a) {
|
8478 | a = pd(a);return null === a ? null : a.stateNode;
|
8479 | }, injectIntoDevTools: function injectIntoDevTools(a) {
|
8480 | var c = a.findFiberByHostInstance;return Ce(B({}, a, { findHostInstanceByFiber: function findHostInstanceByFiber(a) {
|
8481 | return b(a);
|
8482 | }, findFiberByHostInstance: function findFiberByHostInstance(a) {
|
8483 | return c ? c(a) : null;
|
8484 | } }));
|
8485 | } };
|
8486 | }var mf = Object.freeze({ "default": lf }),
|
8487 | nf = mf && lf || mf,
|
8488 | of = nf["default"] ? nf["default"] : nf;function pf(a, b, c) {
|
8489 | var d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;return { $$typeof: Ue, key: null == d ? null : "" + d, children: a, containerInfo: b, implementation: c };
|
8490 | }var qf = "object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now,
|
8491 | rf = void 0;rf = qf ? function () {
|
8492 | return performance.now();
|
8493 | } : function () {
|
8494 | return Date.now();
|
8495 | };
|
8496 | var sf = void 0,
|
8497 | tf = void 0;
|
8498 | if (l.canUseDOM) {
|
8499 | if ("function" !== typeof requestIdleCallback || "function" !== typeof cancelIdleCallback) {
|
8500 | var uf = null,
|
8501 | vf = !1,
|
8502 | wf = -1,
|
8503 | xf = !1,
|
8504 | yf = 0,
|
8505 | zf = 33,
|
8506 | Af = 33,
|
8507 | Bf;Bf = qf ? { didTimeout: !1, timeRemaining: function timeRemaining() {
|
8508 | var a = yf - performance.now();return 0 < a ? a : 0;
|
8509 | } } : { didTimeout: !1, timeRemaining: function timeRemaining() {
|
8510 | var a = yf - Date.now();return 0 < a ? a : 0;
|
8511 | } };var Cf = "__reactIdleCallback$" + Math.random().toString(36).slice(2);window.addEventListener("message", function (a) {
|
8512 | if (a.source === window && a.data === Cf) {
|
8513 | vf = !1;a = rf();if (0 >= yf - a) {
|
8514 | if (-1 !== wf && wf <= a) Bf.didTimeout = !0;else {
|
8515 | xf || (xf = !0, requestAnimationFrame(Df));return;
|
8516 | }
|
8517 | } else Bf.didTimeout = !1;wf = -1;a = uf;uf = null;null !== a && a(Bf);
|
8518 | }
|
8519 | }, !1);var Df = function Df(a) {
|
8520 | xf = !1;var b = a - yf + Af;b < Af && zf < Af ? (8 > b && (b = 8), Af = b < zf ? zf : b) : zf = b;yf = a + Af;vf || (vf = !0, window.postMessage(Cf, "*"));
|
8521 | };sf = function sf(a, b) {
|
8522 | uf = a;null != b && "number" === typeof b.timeout && (wf = rf() + b.timeout);xf || (xf = !0, requestAnimationFrame(Df));return 0;
|
8523 | };tf = function tf() {
|
8524 | uf = null;vf = !1;wf = -1;
|
8525 | };
|
8526 | } else sf = window.requestIdleCallback, tf = window.cancelIdleCallback;
|
8527 | } else sf = function sf(a) {
|
8528 | return setTimeout(function () {
|
8529 | a({ timeRemaining: function timeRemaining() {
|
8530 | return Infinity;
|
8531 | } });
|
8532 | });
|
8533 | }, tf = function tf(a) {
|
8534 | clearTimeout(a);
|
8535 | };var Ef = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
|
8536 | Ff = {},
|
8537 | Gf = {};
|
8538 | function Hf(a) {
|
8539 | if (Gf.hasOwnProperty(a)) return !0;if (Ff.hasOwnProperty(a)) return !1;if (Ef.test(a)) return Gf[a] = !0;Ff[a] = !0;return !1;
|
8540 | }
|
8541 | function If(a, b, c) {
|
8542 | var d = wa(b);if (d && va(b, c)) {
|
8543 | var e = d.mutationMethod;e ? e(a, c) : null == c || d.hasBooleanValue && !c || d.hasNumericValue && isNaN(c) || d.hasPositiveNumericValue && 1 > c || d.hasOverloadedBooleanValue && !1 === c ? Jf(a, b) : d.mustUseProperty ? a[d.propertyName] = c : (b = d.attributeName, (e = d.attributeNamespace) ? a.setAttributeNS(e, b, "" + c) : d.hasBooleanValue || d.hasOverloadedBooleanValue && !0 === c ? a.setAttribute(b, "") : a.setAttribute(b, "" + c));
|
8544 | } else Kf(a, b, va(b, c) ? c : null);
|
8545 | }
|
8546 | function Kf(a, b, c) {
|
8547 | Hf(b) && (null == c ? a.removeAttribute(b) : a.setAttribute(b, "" + c));
|
8548 | }function Jf(a, b) {
|
8549 | var c = wa(b);c ? (b = c.mutationMethod) ? b(a, void 0) : c.mustUseProperty ? a[c.propertyName] = c.hasBooleanValue ? !1 : "" : a.removeAttribute(c.attributeName) : a.removeAttribute(b);
|
8550 | }
|
8551 | function Lf(a, b) {
|
8552 | var c = b.value,
|
8553 | d = b.checked;return B({ type: void 0, step: void 0, min: void 0, max: void 0 }, b, { defaultChecked: void 0, defaultValue: void 0, value: null != c ? c : a._wrapperState.initialValue, checked: null != d ? d : a._wrapperState.initialChecked });
|
8554 | }function Mf(a, b) {
|
8555 | var c = b.defaultValue;a._wrapperState = { initialChecked: null != b.checked ? b.checked : b.defaultChecked, initialValue: null != b.value ? b.value : c, controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value };
|
8556 | }
|
8557 | function Nf(a, b) {
|
8558 | b = b.checked;null != b && If(a, "checked", b);
|
8559 | }function Of(a, b) {
|
8560 | Nf(a, b);var c = b.value;if (null != c) {
|
8561 | if (0 === c && "" === a.value) a.value = "0";else if ("number" === b.type) {
|
8562 | if (b = parseFloat(a.value) || 0, c != b || c == b && a.value != c) a.value = "" + c;
|
8563 | } else a.value !== "" + c && (a.value = "" + c);
|
8564 | } else null == b.value && null != b.defaultValue && a.defaultValue !== "" + b.defaultValue && (a.defaultValue = "" + b.defaultValue), null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked);
|
8565 | }
|
8566 | function Pf(a, b) {
|
8567 | switch (b.type) {case "submit":case "reset":
|
8568 | break;case "color":case "date":case "datetime":case "datetime-local":case "month":case "time":case "week":
|
8569 | a.value = "";a.value = a.defaultValue;break;default:
|
8570 | a.value = a.value;}b = a.name;"" !== b && (a.name = "");a.defaultChecked = !a.defaultChecked;a.defaultChecked = !a.defaultChecked;"" !== b && (a.name = b);
|
8571 | }function Qf(a) {
|
8572 | var b = "";aa.Children.forEach(a, function (a) {
|
8573 | null == a || "string" !== typeof a && "number" !== typeof a || (b += a);
|
8574 | });return b;
|
8575 | }
|
8576 | function Rf(a, b) {
|
8577 | a = B({ children: void 0 }, b);if (b = Qf(b.children)) a.children = b;return a;
|
8578 | }function Sf(a, b, c, d) {
|
8579 | a = a.options;if (b) {
|
8580 | b = {};for (var e = 0; e < c.length; e++) {
|
8581 | b["$" + c[e]] = !0;
|
8582 | }for (c = 0; c < a.length; c++) {
|
8583 | e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = !0);
|
8584 | }
|
8585 | } else {
|
8586 | c = "" + c;b = null;for (e = 0; e < a.length; e++) {
|
8587 | if (a[e].value === c) {
|
8588 | a[e].selected = !0;d && (a[e].defaultSelected = !0);return;
|
8589 | }null !== b || a[e].disabled || (b = a[e]);
|
8590 | }null !== b && (b.selected = !0);
|
8591 | }
|
8592 | }
|
8593 | function Tf(a, b) {
|
8594 | var c = b.value;a._wrapperState = { initialValue: null != c ? c : b.defaultValue, wasMultiple: !!b.multiple };
|
8595 | }function Uf(a, b) {
|
8596 | null != b.dangerouslySetInnerHTML ? E("91") : void 0;return B({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue });
|
8597 | }function Vf(a, b) {
|
8598 | var c = b.value;null == c && (c = b.defaultValue, b = b.children, null != b && (null != c ? E("92") : void 0, Array.isArray(b) && (1 >= b.length ? void 0 : E("93"), b = b[0]), c = "" + b), null == c && (c = ""));a._wrapperState = { initialValue: "" + c };
|
8599 | }
|
8600 | function Wf(a, b) {
|
8601 | var c = b.value;null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && (a.defaultValue = c));null != b.defaultValue && (a.defaultValue = b.defaultValue);
|
8602 | }function Xf(a) {
|
8603 | var b = a.textContent;b === a._wrapperState.initialValue && (a.value = b);
|
8604 | }var Yf = { html: "http://www.w3.org/1999/xhtml", mathml: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg" };
|
8605 | function Zf(a) {
|
8606 | switch (a) {case "svg":
|
8607 | return "http://www.w3.org/2000/svg";case "math":
|
8608 | return "http://www.w3.org/1998/Math/MathML";default:
|
8609 | return "http://www.w3.org/1999/xhtml";}
|
8610 | }function $f(a, b) {
|
8611 | return null == a || "http://www.w3.org/1999/xhtml" === a ? Zf(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a;
|
8612 | }
|
8613 | var ag = void 0,
|
8614 | bg = function (a) {
|
8615 | return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function (b, c, d, e) {
|
8616 | MSApp.execUnsafeLocalFunction(function () {
|
8617 | return a(b, c, d, e);
|
8618 | });
|
8619 | } : a;
|
8620 | }(function (a, b) {
|
8621 | if (a.namespaceURI !== Yf.svg || "innerHTML" in a) a.innerHTML = b;else {
|
8622 | ag = ag || document.createElement("div");ag.innerHTML = "\x3csvg\x3e" + b + "\x3c/svg\x3e";for (b = ag.firstChild; a.firstChild;) {
|
8623 | a.removeChild(a.firstChild);
|
8624 | }for (; b.firstChild;) {
|
8625 | a.appendChild(b.firstChild);
|
8626 | }
|
8627 | }
|
8628 | });
|
8629 | function cg(a, b) {
|
8630 | if (b) {
|
8631 | var c = a.firstChild;if (c && c === a.lastChild && 3 === c.nodeType) {
|
8632 | c.nodeValue = b;return;
|
8633 | }
|
8634 | }a.textContent = b;
|
8635 | }
|
8636 | var dg = { animationIterationCount: !0, borderImageOutset: !0, borderImageSlice: !0, borderImageWidth: !0, boxFlex: !0, boxFlexGroup: !0, boxOrdinalGroup: !0, columnCount: !0, columns: !0, flex: !0, flexGrow: !0, flexPositive: !0, flexShrink: !0, flexNegative: !0, flexOrder: !0, gridRow: !0, gridRowEnd: !0, gridRowSpan: !0, gridRowStart: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnSpan: !0, gridColumnStart: !0, fontWeight: !0, lineClamp: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, tabSize: !0, widows: !0, zIndex: !0, zoom: !0, fillOpacity: !0, floodOpacity: !0,
|
8637 | stopOpacity: !0, strokeDasharray: !0, strokeDashoffset: !0, strokeMiterlimit: !0, strokeOpacity: !0, strokeWidth: !0 },
|
8638 | eg = ["Webkit", "ms", "Moz", "O"];Object.keys(dg).forEach(function (a) {
|
8639 | eg.forEach(function (b) {
|
8640 | b = b + a.charAt(0).toUpperCase() + a.substring(1);dg[b] = dg[a];
|
8641 | });
|
8642 | });
|
8643 | function fg(a, b) {
|
8644 | a = a.style;for (var c in b) {
|
8645 | if (b.hasOwnProperty(c)) {
|
8646 | var d = 0 === c.indexOf("--");var e = c;var f = b[c];e = null == f || "boolean" === typeof f || "" === f ? "" : d || "number" !== typeof f || 0 === f || dg.hasOwnProperty(e) && dg[e] ? ("" + f).trim() : f + "px";"float" === c && (c = "cssFloat");d ? a.setProperty(c, e) : a[c] = e;
|
8647 | }
|
8648 | }
|
8649 | }var gg = B({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
|
8650 | function hg(a, b, c) {
|
8651 | b && (gg[a] && (null != b.children || null != b.dangerouslySetInnerHTML ? E("137", a, c()) : void 0), null != b.dangerouslySetInnerHTML && (null != b.children ? E("60") : void 0, "object" === _typeof(b.dangerouslySetInnerHTML) && "__html" in b.dangerouslySetInnerHTML ? void 0 : E("61")), null != b.style && "object" !== _typeof(b.style) ? E("62", c()) : void 0);
|
8652 | }
|
8653 | function ig(a, b) {
|
8654 | if (-1 === a.indexOf("-")) return "string" === typeof b.is;switch (a) {case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":
|
8655 | return !1;default:
|
8656 | return !0;}
|
8657 | }var jg = Yf.html,
|
8658 | kg = C.thatReturns("");
|
8659 | function lg(a, b) {
|
8660 | a = 9 === a.nodeType || 11 === a.nodeType ? a : a.ownerDocument;var c = Hd(a);b = Sa[b];for (var d = 0; d < b.length; d++) {
|
8661 | var e = b[d];c.hasOwnProperty(e) && c[e] || ("topScroll" === e ? wd("topScroll", "scroll", a) : "topFocus" === e || "topBlur" === e ? (wd("topFocus", "focus", a), wd("topBlur", "blur", a), c.topBlur = !0, c.topFocus = !0) : "topCancel" === e ? (yc("cancel", !0) && wd("topCancel", "cancel", a), c.topCancel = !0) : "topClose" === e ? (yc("close", !0) && wd("topClose", "close", a), c.topClose = !0) : Dd.hasOwnProperty(e) && U(e, Dd[e], a), c[e] = !0);
|
8662 | }
|
8663 | }
|
8664 | var mg = { topAbort: "abort", topCanPlay: "canplay", topCanPlayThrough: "canplaythrough", topDurationChange: "durationchange", topEmptied: "emptied", topEncrypted: "encrypted", topEnded: "ended", topError: "error", topLoadedData: "loadeddata", topLoadedMetadata: "loadedmetadata", topLoadStart: "loadstart", topPause: "pause", topPlay: "play", topPlaying: "playing", topProgress: "progress", topRateChange: "ratechange", topSeeked: "seeked", topSeeking: "seeking", topStalled: "stalled", topSuspend: "suspend", topTimeUpdate: "timeupdate", topVolumeChange: "volumechange",
|
8665 | topWaiting: "waiting" };function ng(a, b, c, d) {
|
8666 | c = 9 === c.nodeType ? c : c.ownerDocument;d === jg && (d = Zf(a));d === jg ? "script" === a ? (a = c.createElement("div"), a.innerHTML = "\x3cscript\x3e\x3c/script\x3e", a = a.removeChild(a.firstChild)) : a = "string" === typeof b.is ? c.createElement(a, { is: b.is }) : c.createElement(a) : a = c.createElementNS(d, a);return a;
|
8667 | }function og(a, b) {
|
8668 | return (9 === b.nodeType ? b : b.ownerDocument).createTextNode(a);
|
8669 | }
|
8670 | function pg(a, b, c, d) {
|
8671 | var e = ig(b, c);switch (b) {case "iframe":case "object":
|
8672 | U("topLoad", "load", a);var f = c;break;case "video":case "audio":
|
8673 | for (f in mg) {
|
8674 | mg.hasOwnProperty(f) && U(f, mg[f], a);
|
8675 | }f = c;break;case "source":
|
8676 | U("topError", "error", a);f = c;break;case "img":case "image":
|
8677 | U("topError", "error", a);U("topLoad", "load", a);f = c;break;case "form":
|
8678 | U("topReset", "reset", a);U("topSubmit", "submit", a);f = c;break;case "details":
|
8679 | U("topToggle", "toggle", a);f = c;break;case "input":
|
8680 | Mf(a, c);f = Lf(a, c);U("topInvalid", "invalid", a);
|
8681 | lg(d, "onChange");break;case "option":
|
8682 | f = Rf(a, c);break;case "select":
|
8683 | Tf(a, c);f = B({}, c, { value: void 0 });U("topInvalid", "invalid", a);lg(d, "onChange");break;case "textarea":
|
8684 | Vf(a, c);f = Uf(a, c);U("topInvalid", "invalid", a);lg(d, "onChange");break;default:
|
8685 | f = c;}hg(b, f, kg);var g = f,
|
8686 | h;for (h in g) {
|
8687 | if (g.hasOwnProperty(h)) {
|
8688 | var k = g[h];"style" === h ? fg(a, k, kg) : "dangerouslySetInnerHTML" === h ? (k = k ? k.__html : void 0, null != k && bg(a, k)) : "children" === h ? "string" === typeof k ? ("textarea" !== b || "" !== k) && cg(a, k) : "number" === typeof k && cg(a, "" + k) : "suppressContentEditableWarning" !== h && "suppressHydrationWarning" !== h && "autoFocus" !== h && (Ra.hasOwnProperty(h) ? null != k && lg(d, h) : e ? Kf(a, h, k) : null != k && If(a, h, k));
|
8689 | }
|
8690 | }switch (b) {case "input":
|
8691 | Bc(a);Pf(a, c);break;case "textarea":
|
8692 | Bc(a);Xf(a, c);break;case "option":
|
8693 | null != c.value && a.setAttribute("value", c.value);break;case "select":
|
8694 | a.multiple = !!c.multiple;b = c.value;null != b ? Sf(a, !!c.multiple, b, !1) : null != c.defaultValue && Sf(a, !!c.multiple, c.defaultValue, !0);break;default:
|
8695 | "function" === typeof f.onClick && (a.onclick = C);}
|
8696 | }
|
8697 | function sg(a, b, c, d, e) {
|
8698 | var f = null;switch (b) {case "input":
|
8699 | c = Lf(a, c);d = Lf(a, d);f = [];break;case "option":
|
8700 | c = Rf(a, c);d = Rf(a, d);f = [];break;case "select":
|
8701 | c = B({}, c, { value: void 0 });d = B({}, d, { value: void 0 });f = [];break;case "textarea":
|
8702 | c = Uf(a, c);d = Uf(a, d);f = [];break;default:
|
8703 | "function" !== typeof c.onClick && "function" === typeof d.onClick && (a.onclick = C);}hg(b, d, kg);var g, h;a = null;for (g in c) {
|
8704 | if (!d.hasOwnProperty(g) && c.hasOwnProperty(g) && null != c[g]) if ("style" === g) for (h in b = c[g], b) {
|
8705 | b.hasOwnProperty(h) && (a || (a = {}), a[h] = "");
|
8706 | } else "dangerouslySetInnerHTML" !== g && "children" !== g && "suppressContentEditableWarning" !== g && "suppressHydrationWarning" !== g && "autoFocus" !== g && (Ra.hasOwnProperty(g) ? f || (f = []) : (f = f || []).push(g, null));
|
8707 | }for (g in d) {
|
8708 | var k = d[g];b = null != c ? c[g] : void 0;if (d.hasOwnProperty(g) && k !== b && (null != k || null != b)) if ("style" === g) {
|
8709 | if (b) {
|
8710 | for (h in b) {
|
8711 | !b.hasOwnProperty(h) || k && k.hasOwnProperty(h) || (a || (a = {}), a[h] = "");
|
8712 | }for (h in k) {
|
8713 | k.hasOwnProperty(h) && b[h] !== k[h] && (a || (a = {}), a[h] = k[h]);
|
8714 | }
|
8715 | } else a || (f || (f = []), f.push(g, a)), a = k;
|
8716 | } else "dangerouslySetInnerHTML" === g ? (k = k ? k.__html : void 0, b = b ? b.__html : void 0, null != k && b !== k && (f = f || []).push(g, "" + k)) : "children" === g ? b === k || "string" !== typeof k && "number" !== typeof k || (f = f || []).push(g, "" + k) : "suppressContentEditableWarning" !== g && "suppressHydrationWarning" !== g && (Ra.hasOwnProperty(g) ? (null != k && lg(e, g), f || b === k || (f = [])) : (f = f || []).push(g, k));
|
8717 | }a && (f = f || []).push("style", a);return f;
|
8718 | }
|
8719 | function tg(a, b, c, d, e) {
|
8720 | "input" === c && "radio" === e.type && null != e.name && Nf(a, e);ig(c, d);d = ig(c, e);for (var f = 0; f < b.length; f += 2) {
|
8721 | var g = b[f],
|
8722 | h = b[f + 1];"style" === g ? fg(a, h, kg) : "dangerouslySetInnerHTML" === g ? bg(a, h) : "children" === g ? cg(a, h) : d ? null != h ? Kf(a, g, h) : a.removeAttribute(g) : null != h ? If(a, g, h) : Jf(a, g);
|
8723 | }switch (c) {case "input":
|
8724 | Of(a, e);break;case "textarea":
|
8725 | Wf(a, e);break;case "select":
|
8726 | a._wrapperState.initialValue = void 0, b = a._wrapperState.wasMultiple, a._wrapperState.wasMultiple = !!e.multiple, c = e.value, null != c ? Sf(a, !!e.multiple, c, !1) : b !== !!e.multiple && (null != e.defaultValue ? Sf(a, !!e.multiple, e.defaultValue, !0) : Sf(a, !!e.multiple, e.multiple ? [] : "", !1));}
|
8727 | }
|
8728 | function ug(a, b, c, d, e) {
|
8729 | switch (b) {case "iframe":case "object":
|
8730 | U("topLoad", "load", a);break;case "video":case "audio":
|
8731 | for (var f in mg) {
|
8732 | mg.hasOwnProperty(f) && U(f, mg[f], a);
|
8733 | }break;case "source":
|
8734 | U("topError", "error", a);break;case "img":case "image":
|
8735 | U("topError", "error", a);U("topLoad", "load", a);break;case "form":
|
8736 | U("topReset", "reset", a);U("topSubmit", "submit", a);break;case "details":
|
8737 | U("topToggle", "toggle", a);break;case "input":
|
8738 | Mf(a, c);U("topInvalid", "invalid", a);lg(e, "onChange");break;case "select":
|
8739 | Tf(a, c);
|
8740 | U("topInvalid", "invalid", a);lg(e, "onChange");break;case "textarea":
|
8741 | Vf(a, c), U("topInvalid", "invalid", a), lg(e, "onChange");}hg(b, c, kg);d = null;for (var g in c) {
|
8742 | c.hasOwnProperty(g) && (f = c[g], "children" === g ? "string" === typeof f ? a.textContent !== f && (d = ["children", f]) : "number" === typeof f && a.textContent !== "" + f && (d = ["children", "" + f]) : Ra.hasOwnProperty(g) && null != f && lg(e, g));
|
8743 | }switch (b) {case "input":
|
8744 | Bc(a);Pf(a, c);break;case "textarea":
|
8745 | Bc(a);Xf(a, c);break;case "select":case "option":
|
8746 | break;default:
|
8747 | "function" === typeof c.onClick && (a.onclick = C);}return d;
|
8748 | }function vg(a, b) {
|
8749 | return a.nodeValue !== b;
|
8750 | }
|
8751 | var wg = Object.freeze({ createElement: ng, createTextNode: og, setInitialProperties: pg, diffProperties: sg, updateProperties: tg, diffHydratedProperties: ug, diffHydratedText: vg, warnForUnmatchedText: function warnForUnmatchedText() {}, warnForDeletedHydratableElement: function warnForDeletedHydratableElement() {}, warnForDeletedHydratableText: function warnForDeletedHydratableText() {}, warnForInsertedHydratedElement: function warnForInsertedHydratedElement() {}, warnForInsertedHydratedText: function warnForInsertedHydratedText() {}, restoreControlledState: function restoreControlledState(a, b, c) {
|
8752 | switch (b) {case "input":
|
8753 | Of(a, c);b = c.name;if ("radio" === c.type && null != b) {
|
8754 | for (c = a; c.parentNode;) {
|
8755 | c = c.parentNode;
|
8756 | }c = c.querySelectorAll("input[name\x3d" + JSON.stringify("" + b) + '][type\x3d"radio"]');for (b = 0; b < c.length; b++) {
|
8757 | var d = c[b];if (d !== a && d.form === a.form) {
|
8758 | var e = rb(d);e ? void 0 : E("90");Cc(d);Of(d, e);
|
8759 | }
|
8760 | }
|
8761 | }break;case "textarea":
|
8762 | Wf(a, c);break;case "select":
|
8763 | b = c.value, null != b && Sf(a, !!c.multiple, b, !1);}
|
8764 | } });nc.injectFiberControlledHostComponent(wg);var xg = null,
|
8765 | Mg = null;function Ng(a) {
|
8766 | return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType && (8 !== a.nodeType || " react-mount-point-unstable " !== a.nodeValue));
|
8767 | }
|
8768 | function Og(a) {
|
8769 | a = a ? 9 === a.nodeType ? a.documentElement : a.firstChild : null;return !(!a || 1 !== a.nodeType || !a.hasAttribute("data-reactroot"));
|
8770 | }
|
8771 | var Z = of({ getRootHostContext: function getRootHostContext(a) {
|
8772 | var b = a.nodeType;switch (b) {case 9:case 11:
|
8773 | a = (a = a.documentElement) ? a.namespaceURI : $f(null, "");break;default:
|
8774 | b = 8 === b ? a.parentNode : a, a = b.namespaceURI || null, b = b.tagName, a = $f(a, b);}return a;
|
8775 | }, getChildHostContext: function getChildHostContext(a, b) {
|
8776 | return $f(a, b);
|
8777 | }, getPublicInstance: function getPublicInstance(a) {
|
8778 | return a;
|
8779 | }, prepareForCommit: function prepareForCommit() {
|
8780 | xg = td;var a = da();if (Kd(a)) {
|
8781 | if ("selectionStart" in a) var b = { start: a.selectionStart, end: a.selectionEnd };else a: {
|
8782 | var c = window.getSelection && window.getSelection();
|
8783 | if (c && 0 !== c.rangeCount) {
|
8784 | b = c.anchorNode;var d = c.anchorOffset,
|
8785 | e = c.focusNode;c = c.focusOffset;try {
|
8786 | b.nodeType, e.nodeType;
|
8787 | } catch (z) {
|
8788 | b = null;break a;
|
8789 | }var f = 0,
|
8790 | g = -1,
|
8791 | h = -1,
|
8792 | k = 0,
|
8793 | q = 0,
|
8794 | v = a,
|
8795 | y = null;b: for (;;) {
|
8796 | for (var u;;) {
|
8797 | v !== b || 0 !== d && 3 !== v.nodeType || (g = f + d);v !== e || 0 !== c && 3 !== v.nodeType || (h = f + c);3 === v.nodeType && (f += v.nodeValue.length);if (null === (u = v.firstChild)) break;y = v;v = u;
|
8798 | }for (;;) {
|
8799 | if (v === a) break b;y === b && ++k === d && (g = f);y === e && ++q === c && (h = f);if (null !== (u = v.nextSibling)) break;v = y;y = v.parentNode;
|
8800 | }v = u;
|
8801 | }b = -1 === g || -1 === h ? null : { start: g, end: h };
|
8802 | } else b = null;
|
8803 | }b = b || { start: 0, end: 0 };
|
8804 | } else b = null;Mg = { focusedElem: a, selectionRange: b };ud(!1);
|
8805 | }, resetAfterCommit: function resetAfterCommit() {
|
8806 | var a = Mg,
|
8807 | b = da(),
|
8808 | c = a.focusedElem,
|
8809 | d = a.selectionRange;if (b !== c && fa(document.documentElement, c)) {
|
8810 | if (Kd(c)) if (b = d.start, a = d.end, void 0 === a && (a = b), "selectionStart" in c) c.selectionStart = b, c.selectionEnd = Math.min(a, c.value.length);else if (window.getSelection) {
|
8811 | b = window.getSelection();var e = c[Eb()].length;a = Math.min(d.start, e);d = void 0 === d.end ? a : Math.min(d.end, e);!b.extend && a > d && (e = d, d = a, a = e);e = Jd(c, a);var f = Jd(c, d);if (e && f && (1 !== b.rangeCount || b.anchorNode !== e.node || b.anchorOffset !== e.offset || b.focusNode !== f.node || b.focusOffset !== f.offset)) {
|
8812 | var g = document.createRange();g.setStart(e.node, e.offset);b.removeAllRanges();a > d ? (b.addRange(g), b.extend(f.node, f.offset)) : (g.setEnd(f.node, f.offset), b.addRange(g));
|
8813 | }
|
8814 | }b = [];for (a = c; a = a.parentNode;) {
|
8815 | 1 === a.nodeType && b.push({ element: a, left: a.scrollLeft, top: a.scrollTop });
|
8816 | }ia(c);for (c = 0; c < b.length; c++) {
|
8817 | a = b[c], a.element.scrollLeft = a.left, a.element.scrollTop = a.top;
|
8818 | }
|
8819 | }Mg = null;ud(xg);xg = null;
|
8820 | }, createInstance: function createInstance(a, b, c, d, e) {
|
8821 | a = ng(a, b, c, d);a[Q] = e;a[ob] = b;return a;
|
8822 | }, appendInitialChild: function appendInitialChild(a, b) {
|
8823 | a.appendChild(b);
|
8824 | }, finalizeInitialChildren: function finalizeInitialChildren(a, b, c, d) {
|
8825 | pg(a, b, c, d);a: {
|
8826 | switch (b) {case "button":case "input":case "select":case "textarea":
|
8827 | a = !!c.autoFocus;break a;}a = !1;
|
8828 | }return a;
|
8829 | }, prepareUpdate: function prepareUpdate(a, b, c, d, e) {
|
8830 | return sg(a, b, c, d, e);
|
8831 | }, shouldSetTextContent: function shouldSetTextContent(a, b) {
|
8832 | return "textarea" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && "string" === typeof b.dangerouslySetInnerHTML.__html;
|
8833 | }, shouldDeprioritizeSubtree: function shouldDeprioritizeSubtree(a, b) {
|
8834 | return !!b.hidden;
|
8835 | }, createTextInstance: function createTextInstance(a, b, c, d) {
|
8836 | a = og(a, b);a[Q] = d;return a;
|
8837 | }, now: rf, mutation: { commitMount: function commitMount(a) {
|
8838 | a.focus();
|
8839 | }, commitUpdate: function commitUpdate(a, b, c, d, e) {
|
8840 | a[ob] = e;tg(a, b, c, d, e);
|
8841 | }, resetTextContent: function resetTextContent(a) {
|
8842 | a.textContent = "";
|
8843 | }, commitTextUpdate: function commitTextUpdate(a, b, c) {
|
8844 | a.nodeValue = c;
|
8845 | }, appendChild: function appendChild(a, b) {
|
8846 | a.appendChild(b);
|
8847 | }, appendChildToContainer: function appendChildToContainer(a, b) {
|
8848 | 8 === a.nodeType ? a.parentNode.insertBefore(b, a) : a.appendChild(b);
|
8849 | }, insertBefore: function insertBefore(a, b, c) {
|
8850 | a.insertBefore(b, c);
|
8851 | }, insertInContainerBefore: function insertInContainerBefore(a, b, c) {
|
8852 | 8 === a.nodeType ? a.parentNode.insertBefore(b, c) : a.insertBefore(b, c);
|
8853 | }, removeChild: function removeChild(a, b) {
|
8854 | a.removeChild(b);
|
8855 | }, removeChildFromContainer: function removeChildFromContainer(a, b) {
|
8856 | 8 === a.nodeType ? a.parentNode.removeChild(b) : a.removeChild(b);
|
8857 | } }, hydration: { canHydrateInstance: function canHydrateInstance(a, b) {
|
8858 | return 1 !== a.nodeType || b.toLowerCase() !== a.nodeName.toLowerCase() ? null : a;
|
8859 | }, canHydrateTextInstance: function canHydrateTextInstance(a, b) {
|
8860 | return "" === b || 3 !== a.nodeType ? null : a;
|
8861 | }, getNextHydratableSibling: function getNextHydratableSibling(a) {
|
8862 | for (a = a.nextSibling; a && 1 !== a.nodeType && 3 !== a.nodeType;) {
|
8863 | a = a.nextSibling;
|
8864 | }return a;
|
8865 | }, getFirstHydratableChild: function getFirstHydratableChild(a) {
|
8866 | for (a = a.firstChild; a && 1 !== a.nodeType && 3 !== a.nodeType;) {
|
8867 | a = a.nextSibling;
|
8868 | }return a;
|
8869 | }, hydrateInstance: function hydrateInstance(a, b, c, d, e, f) {
|
8870 | a[Q] = f;a[ob] = c;return ug(a, b, c, e, d);
|
8871 | }, hydrateTextInstance: function hydrateTextInstance(a, b, c) {
|
8872 | a[Q] = c;return vg(a, b);
|
8873 | }, didNotMatchHydratedContainerTextInstance: function didNotMatchHydratedContainerTextInstance() {}, didNotMatchHydratedTextInstance: function didNotMatchHydratedTextInstance() {},
|
8874 | didNotHydrateContainerInstance: function didNotHydrateContainerInstance() {}, didNotHydrateInstance: function didNotHydrateInstance() {}, didNotFindHydratableContainerInstance: function didNotFindHydratableContainerInstance() {}, didNotFindHydratableContainerTextInstance: function didNotFindHydratableContainerTextInstance() {}, didNotFindHydratableInstance: function didNotFindHydratableInstance() {}, didNotFindHydratableTextInstance: function didNotFindHydratableTextInstance() {} }, scheduleDeferredCallback: sf, cancelDeferredCallback: tf, useSyncScheduling: !0 });rc = Z.batchedUpdates;
|
8875 | function Pg(a, b, c, d, e) {
|
8876 | Ng(c) ? void 0 : E("200");var f = c._reactRootContainer;if (f) Z.updateContainer(b, f, a, e);else {
|
8877 | d = d || Og(c);if (!d) for (f = void 0; f = c.lastChild;) {
|
8878 | c.removeChild(f);
|
8879 | }var g = Z.createContainer(c, d);f = c._reactRootContainer = g;Z.unbatchedUpdates(function () {
|
8880 | Z.updateContainer(b, g, a, e);
|
8881 | });
|
8882 | }return Z.getPublicRootInstance(f);
|
8883 | }function Qg(a, b) {
|
8884 | var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;Ng(b) ? void 0 : E("200");return pf(a, b, null, c);
|
8885 | }
|
8886 | function Rg(a, b) {
|
8887 | this._reactRootContainer = Z.createContainer(a, b);
|
8888 | }Rg.prototype.render = function (a, b) {
|
8889 | Z.updateContainer(a, this._reactRootContainer, null, b);
|
8890 | };Rg.prototype.unmount = function (a) {
|
8891 | Z.updateContainer(null, this._reactRootContainer, null, a);
|
8892 | };
|
8893 | var Sg = { createPortal: Qg, findDOMNode: function findDOMNode(a) {
|
8894 | if (null == a) return null;if (1 === a.nodeType) return a;var b = a._reactInternalFiber;if (b) return Z.findHostInstance(b);"function" === typeof a.render ? E("188") : E("213", Object.keys(a));
|
8895 | }, hydrate: function hydrate(a, b, c) {
|
8896 | return Pg(null, a, b, !0, c);
|
8897 | }, render: function render(a, b, c) {
|
8898 | return Pg(null, a, b, !1, c);
|
8899 | }, unstable_renderSubtreeIntoContainer: function unstable_renderSubtreeIntoContainer(a, b, c, d) {
|
8900 | null == a || void 0 === a._reactInternalFiber ? E("38") : void 0;return Pg(a, b, c, !1, d);
|
8901 | }, unmountComponentAtNode: function unmountComponentAtNode(a) {
|
8902 | Ng(a) ? void 0 : E("40");return a._reactRootContainer ? (Z.unbatchedUpdates(function () {
|
8903 | Pg(null, null, a, !1, function () {
|
8904 | a._reactRootContainer = null;
|
8905 | });
|
8906 | }), !0) : !1;
|
8907 | }, unstable_createPortal: Qg, unstable_batchedUpdates: tc, unstable_deferredUpdates: Z.deferredUpdates, flushSync: Z.flushSync, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { EventPluginHub: mb, EventPluginRegistry: Va, EventPropagators: Cb, ReactControlledComponent: qc, ReactDOMComponentTree: sb, ReactDOMEventListener: xd } };
|
8908 | Z.injectIntoDevTools({ findFiberByHostInstance: pb, bundleType: 0, version: "16.2.0", rendererPackageName: "react-dom" });var Tg = Object.freeze({ "default": Sg }),
|
8909 | Ug = Tg && Sg || Tg;module.exports = Ug["default"] ? Ug["default"] : Ug;
|
8910 |
|
8911 | }),
|
8912 |
|
8913 | (function(module, exports, __webpack_require__) {
|
8914 |
|
8915 | "use strict";
|
8916 |
|
8917 |
|
8918 |
|
8919 |
|
8920 |
|
8921 |
|
8922 |
|
8923 |
|
8924 |
|
8925 |
|
8926 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
8927 |
|
8928 |
|
8929 |
|
8930 |
|
8931 |
|
8932 |
|
8933 |
|
8934 | var ExecutionEnvironment = {
|
8935 |
|
8936 | canUseDOM: canUseDOM,
|
8937 |
|
8938 | canUseWorkers: typeof Worker !== 'undefined',
|
8939 |
|
8940 | canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
8941 |
|
8942 | canUseViewport: canUseDOM && !!window.screen,
|
8943 |
|
8944 | isInWorker: !canUseDOM
|
8945 |
|
8946 | };
|
8947 |
|
8948 | module.exports = ExecutionEnvironment;
|
8949 |
|
8950 | }),
|
8951 |
|
8952 | (function(module, exports, __webpack_require__) {
|
8953 |
|
8954 | "use strict";
|
8955 |
|
8956 |
|
8957 |
|
8958 |
|
8959 |
|
8960 |
|
8961 |
|
8962 |
|
8963 |
|
8964 |
|
8965 |
|
8966 | var emptyFunction = __webpack_require__(4);
|
8967 |
|
8968 |
|
8969 |
|
8970 |
|
8971 |
|
8972 | var EventListener = {
|
8973 | |
8974 |
|
8975 |
|
8976 |
|
8977 |
|
8978 |
|
8979 |
|
8980 |
|
8981 | listen: function listen(target, eventType, callback) {
|
8982 | if (target.addEventListener) {
|
8983 | target.addEventListener(eventType, callback, false);
|
8984 | return {
|
8985 | remove: function remove() {
|
8986 | target.removeEventListener(eventType, callback, false);
|
8987 | }
|
8988 | };
|
8989 | } else if (target.attachEvent) {
|
8990 | target.attachEvent('on' + eventType, callback);
|
8991 | return {
|
8992 | remove: function remove() {
|
8993 | target.detachEvent('on' + eventType, callback);
|
8994 | }
|
8995 | };
|
8996 | }
|
8997 | },
|
8998 |
|
8999 | |
9000 |
|
9001 |
|
9002 |
|
9003 |
|
9004 |
|
9005 |
|
9006 |
|
9007 | capture: function capture(target, eventType, callback) {
|
9008 | if (target.addEventListener) {
|
9009 | target.addEventListener(eventType, callback, true);
|
9010 | return {
|
9011 | remove: function remove() {
|
9012 | target.removeEventListener(eventType, callback, true);
|
9013 | }
|
9014 | };
|
9015 | } else {
|
9016 | if (false) {
|
9017 | console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
|
9018 | }
|
9019 | return {
|
9020 | remove: emptyFunction
|
9021 | };
|
9022 | }
|
9023 | },
|
9024 |
|
9025 | registerDefault: function registerDefault() {}
|
9026 | };
|
9027 |
|
9028 | module.exports = EventListener;
|
9029 |
|
9030 | }),
|
9031 |
|
9032 | (function(module, exports, __webpack_require__) {
|
9033 |
|
9034 | "use strict";
|
9035 |
|
9036 |
|
9037 |
|
9038 |
|
9039 |
|
9040 |
|
9041 |
|
9042 |
|
9043 |
|
9044 |
|
9045 |
|
9046 |
|
9047 |
|
9048 |
|
9049 |
|
9050 |
|
9051 |
|
9052 |
|
9053 |
|
9054 |
|
9055 |
|
9056 |
|
9057 |
|
9058 |
|
9059 | function getActiveElement(doc) /*?DOMElement*/{
|
9060 | doc = doc || (typeof document !== 'undefined' ? document : undefined);
|
9061 | if (typeof doc === 'undefined') {
|
9062 | return null;
|
9063 | }
|
9064 | try {
|
9065 | return doc.activeElement || doc.body;
|
9066 | } catch (e) {
|
9067 | return doc.body;
|
9068 | }
|
9069 | }
|
9070 |
|
9071 | module.exports = getActiveElement;
|
9072 |
|
9073 | }),
|
9074 |
|
9075 | (function(module, exports, __webpack_require__) {
|
9076 |
|
9077 | "use strict";
|
9078 |
|
9079 |
|
9080 |
|
9081 |
|
9082 |
|
9083 |
|
9084 |
|
9085 |
|
9086 |
|
9087 |
|
9088 |
|
9089 |
|
9090 |
|
9091 |
|
9092 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
9093 |
|
9094 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
9095 |
|
9096 |
|
9097 |
|
9098 |
|
9099 |
|
9100 | function is(x, y) {
|
9101 |
|
9102 | if (x === y) {
|
9103 |
|
9104 |
|
9105 |
|
9106 | return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
9107 | } else {
|
9108 |
|
9109 | return x !== x && y !== y;
|
9110 | }
|
9111 | }
|
9112 |
|
9113 |
|
9114 |
|
9115 |
|
9116 |
|
9117 |
|
9118 | function shallowEqual(objA, objB) {
|
9119 | if (is(objA, objB)) {
|
9120 | return true;
|
9121 | }
|
9122 |
|
9123 | if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
|
9124 | return false;
|
9125 | }
|
9126 |
|
9127 | var keysA = Object.keys(objA);
|
9128 | var keysB = Object.keys(objB);
|
9129 |
|
9130 | if (keysA.length !== keysB.length) {
|
9131 | return false;
|
9132 | }
|
9133 |
|
9134 |
|
9135 | for (var i = 0; i < keysA.length; i++) {
|
9136 | if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
9137 | return false;
|
9138 | }
|
9139 | }
|
9140 |
|
9141 | return true;
|
9142 | }
|
9143 |
|
9144 | module.exports = shallowEqual;
|
9145 |
|
9146 | }),
|
9147 |
|
9148 | (function(module, exports, __webpack_require__) {
|
9149 |
|
9150 | "use strict";
|
9151 |
|
9152 |
|
9153 |
|
9154 |
|
9155 |
|
9156 |
|
9157 |
|
9158 |
|
9159 |
|
9160 |
|
9161 |
|
9162 | var isTextNode = __webpack_require__(43);
|
9163 |
|
9164 |
|
9165 |
|
9166 |
|
9167 |
|
9168 |
|
9169 | function containsNode(outerNode, innerNode) {
|
9170 | if (!outerNode || !innerNode) {
|
9171 | return false;
|
9172 | } else if (outerNode === innerNode) {
|
9173 | return true;
|
9174 | } else if (isTextNode(outerNode)) {
|
9175 | return false;
|
9176 | } else if (isTextNode(innerNode)) {
|
9177 | return containsNode(outerNode, innerNode.parentNode);
|
9178 | } else if ('contains' in outerNode) {
|
9179 | return outerNode.contains(innerNode);
|
9180 | } else if (outerNode.compareDocumentPosition) {
|
9181 | return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
9182 | } else {
|
9183 | return false;
|
9184 | }
|
9185 | }
|
9186 |
|
9187 | module.exports = containsNode;
|
9188 |
|
9189 | }),
|
9190 |
|
9191 | (function(module, exports, __webpack_require__) {
|
9192 |
|
9193 | "use strict";
|
9194 |
|
9195 |
|
9196 |
|
9197 |
|
9198 |
|
9199 |
|
9200 |
|
9201 |
|
9202 |
|
9203 |
|
9204 |
|
9205 | var isNode = __webpack_require__(44);
|
9206 |
|
9207 |
|
9208 |
|
9209 |
|
9210 |
|
9211 | function isTextNode(object) {
|
9212 | return isNode(object) && object.nodeType == 3;
|
9213 | }
|
9214 |
|
9215 | module.exports = isTextNode;
|
9216 |
|
9217 | }),
|
9218 |
|
9219 | (function(module, exports, __webpack_require__) {
|
9220 |
|
9221 | "use strict";
|
9222 |
|
9223 |
|
9224 |
|
9225 |
|
9226 |
|
9227 |
|
9228 |
|
9229 |
|
9230 |
|
9231 |
|
9232 |
|
9233 |
|
9234 |
|
9235 |
|
9236 |
|
9237 |
|
9238 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
9239 |
|
9240 | function isNode(object) {
|
9241 | var doc = object ? object.ownerDocument || object : document;
|
9242 | var defaultView = doc.defaultView || window;
|
9243 | return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
|
9244 | }
|
9245 |
|
9246 | module.exports = isNode;
|
9247 |
|
9248 | }),
|
9249 |
|
9250 | (function(module, exports, __webpack_require__) {
|
9251 |
|
9252 | "use strict";
|
9253 |
|
9254 |
|
9255 |
|
9256 |
|
9257 |
|
9258 |
|
9259 |
|
9260 |
|
9261 |
|
9262 |
|
9263 |
|
9264 |
|
9265 |
|
9266 |
|
9267 | function focusNode(node) {
|
9268 |
|
9269 |
|
9270 |
|
9271 | try {
|
9272 | node.focus();
|
9273 | } catch (e) {}
|
9274 | }
|
9275 |
|
9276 | module.exports = focusNode;
|
9277 |
|
9278 | }),
|
9279 |
|
9280 | (function(module, exports, __webpack_require__) {
|
9281 |
|
9282 | "use strict";
|
9283 |
|
9284 |
|
9285 | Object.defineProperty(exports, "__esModule", {
|
9286 | value: true
|
9287 | });
|
9288 | exports.PhenixPlayer = exports.JWPlayer = exports.VAST = exports.FilePlayer = exports.Mixcloud = exports.Iframe = exports.UstreamVideo = exports.UstreamLive = exports.DailyMotion = exports.Twitch = exports.Wistia = exports.FaceMask = exports.Streamable = exports.Facebook = exports.Vimeo = exports.SoundCloud = exports.YouTube = undefined;
|
9289 |
|
9290 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
9291 |
|
9292 | 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; }; }();
|
9293 |
|
9294 | var _YouTube = __webpack_require__(6);
|
9295 |
|
9296 | Object.defineProperty(exports, 'YouTube', {
|
9297 | enumerable: true,
|
9298 | get: function get() {
|
9299 | return _interopRequireDefault(_YouTube)['default'];
|
9300 | }
|
9301 | });
|
9302 |
|
9303 | var _SoundCloud = __webpack_require__(8);
|
9304 |
|
9305 | Object.defineProperty(exports, 'SoundCloud', {
|
9306 | enumerable: true,
|
9307 | get: function get() {
|
9308 | return _interopRequireDefault(_SoundCloud)['default'];
|
9309 | }
|
9310 | });
|
9311 |
|
9312 | var _Vimeo = __webpack_require__(9);
|
9313 |
|
9314 | Object.defineProperty(exports, 'Vimeo', {
|
9315 | enumerable: true,
|
9316 | get: function get() {
|
9317 | return _interopRequireDefault(_Vimeo)['default'];
|
9318 | }
|
9319 | });
|
9320 |
|
9321 | var _Facebook = __webpack_require__(16);
|
9322 |
|
9323 | Object.defineProperty(exports, 'Facebook', {
|
9324 | enumerable: true,
|
9325 | get: function get() {
|
9326 | return _interopRequireDefault(_Facebook)['default'];
|
9327 | }
|
9328 | });
|
9329 |
|
9330 | var _Streamable = __webpack_require__(17);
|
9331 |
|
9332 | Object.defineProperty(exports, 'Streamable', {
|
9333 | enumerable: true,
|
9334 | get: function get() {
|
9335 | return _interopRequireDefault(_Streamable)['default'];
|
9336 | }
|
9337 | });
|
9338 |
|
9339 | var _FaceMask = __webpack_require__(18);
|
9340 |
|
9341 | Object.defineProperty(exports, 'FaceMask', {
|
9342 | enumerable: true,
|
9343 | get: function get() {
|
9344 | return _interopRequireDefault(_FaceMask)['default'];
|
9345 | }
|
9346 | });
|
9347 |
|
9348 | var _Wistia = __webpack_require__(19);
|
9349 |
|
9350 | Object.defineProperty(exports, 'Wistia', {
|
9351 | enumerable: true,
|
9352 | get: function get() {
|
9353 | return _interopRequireDefault(_Wistia)['default'];
|
9354 | }
|
9355 | });
|
9356 |
|
9357 | var _Twitch = __webpack_require__(20);
|
9358 |
|
9359 | Object.defineProperty(exports, 'Twitch', {
|
9360 | enumerable: true,
|
9361 | get: function get() {
|
9362 | return _interopRequireDefault(_Twitch)['default'];
|
9363 | }
|
9364 | });
|
9365 |
|
9366 | var _DailyMotion = __webpack_require__(10);
|
9367 |
|
9368 | Object.defineProperty(exports, 'DailyMotion', {
|
9369 | enumerable: true,
|
9370 | get: function get() {
|
9371 | return _interopRequireDefault(_DailyMotion)['default'];
|
9372 | }
|
9373 | });
|
9374 |
|
9375 | var _UstreamLive = __webpack_require__(21);
|
9376 |
|
9377 | Object.defineProperty(exports, 'UstreamLive', {
|
9378 | enumerable: true,
|
9379 | get: function get() {
|
9380 | return _interopRequireDefault(_UstreamLive)['default'];
|
9381 | }
|
9382 | });
|
9383 |
|
9384 | var _UstreamVideo = __webpack_require__(22);
|
9385 |
|
9386 | Object.defineProperty(exports, 'UstreamVideo', {
|
9387 | enumerable: true,
|
9388 | get: function get() {
|
9389 | return _interopRequireDefault(_UstreamVideo)['default'];
|
9390 | }
|
9391 | });
|
9392 |
|
9393 | var _Iframe = __webpack_require__(23);
|
9394 |
|
9395 | Object.defineProperty(exports, 'Iframe', {
|
9396 | enumerable: true,
|
9397 | get: function get() {
|
9398 | return _interopRequireDefault(_Iframe)['default'];
|
9399 | }
|
9400 | });
|
9401 |
|
9402 | var _Mixcloud = __webpack_require__(24);
|
9403 |
|
9404 | Object.defineProperty(exports, 'Mixcloud', {
|
9405 | enumerable: true,
|
9406 | get: function get() {
|
9407 | return _interopRequireDefault(_Mixcloud)['default'];
|
9408 | }
|
9409 | });
|
9410 |
|
9411 | var _FilePlayer = __webpack_require__(11);
|
9412 |
|
9413 | Object.defineProperty(exports, 'FilePlayer', {
|
9414 | enumerable: true,
|
9415 | get: function get() {
|
9416 | return _interopRequireDefault(_FilePlayer)['default'];
|
9417 | }
|
9418 | });
|
9419 |
|
9420 | var _VAST = __webpack_require__(25);
|
9421 |
|
9422 | Object.defineProperty(exports, 'VAST', {
|
9423 | enumerable: true,
|
9424 | get: function get() {
|
9425 | return _interopRequireDefault(_VAST)['default'];
|
9426 | }
|
9427 | });
|
9428 |
|
9429 | var _JWPlayer = __webpack_require__(32);
|
9430 |
|
9431 | Object.defineProperty(exports, 'JWPlayer', {
|
9432 | enumerable: true,
|
9433 | get: function get() {
|
9434 | return _interopRequireDefault(_JWPlayer)['default'];
|
9435 | }
|
9436 | });
|
9437 |
|
9438 | var _PhenixPlayer = __webpack_require__(33);
|
9439 |
|
9440 | Object.defineProperty(exports, 'PhenixPlayer', {
|
9441 | enumerable: true,
|
9442 | get: function get() {
|
9443 | return _interopRequireDefault(_PhenixPlayer)['default'];
|
9444 | }
|
9445 | });
|
9446 |
|
9447 | var _react = __webpack_require__(0);
|
9448 |
|
9449 | var _react2 = _interopRequireDefault(_react);
|
9450 |
|
9451 | var _props2 = __webpack_require__(5);
|
9452 |
|
9453 | var _utils = __webpack_require__(1);
|
9454 |
|
9455 | var _players = __webpack_require__(77);
|
9456 |
|
9457 | var _players2 = _interopRequireDefault(_players);
|
9458 |
|
9459 | var _Player4 = __webpack_require__(7);
|
9460 |
|
9461 | var _Player5 = _interopRequireDefault(_Player4);
|
9462 |
|
9463 | var _Preview = __webpack_require__(78);
|
9464 |
|
9465 | var _Preview2 = _interopRequireDefault(_Preview);
|
9466 |
|
9467 | var _preload = __webpack_require__(79);
|
9468 |
|
9469 | var _preload2 = _interopRequireDefault(_preload);
|
9470 |
|
9471 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
9472 |
|
9473 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
9474 |
|
9475 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9476 |
|
9477 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
9478 |
|
9479 | 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; }
|
9480 |
|
9481 | var SUPPORTED_PROPS = Object.keys(_props2.propTypes);
|
9482 |
|
9483 | var customPlayers = [];
|
9484 |
|
9485 | var ReactPlayer = function (_Component) {
|
9486 | _inherits(ReactPlayer, _Component);
|
9487 |
|
9488 | function ReactPlayer() {
|
9489 | var _ref;
|
9490 |
|
9491 | var _temp, _this, _ret;
|
9492 |
|
9493 | _classCallCheck(this, ReactPlayer);
|
9494 |
|
9495 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
9496 | args[_key] = arguments[_key];
|
9497 | }
|
9498 |
|
9499 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReactPlayer.__proto__ || Object.getPrototypeOf(ReactPlayer)).call.apply(_ref, [this].concat(args))), _this), _this.config = (0, _utils.getConfig)(_this.props, _props2.defaultProps, true), _this.state = {
|
9500 | showPreview: !!_this.props.light
|
9501 | }, _this.onClickPreview = function () {
|
9502 | _this.setState({ showPreview: false });
|
9503 | }, _this.getDuration = function () {
|
9504 | if (!_this.player) return null;
|
9505 | return _this.player.getDuration();
|
9506 | }, _this.getCurrentTime = function () {
|
9507 | if (!_this.player) return null;
|
9508 | return _this.player.getCurrentTime();
|
9509 | }, _this.getSecondsLoaded = function () {
|
9510 | if (!_this.player) return null;
|
9511 | return _this.player.getSecondsLoaded();
|
9512 | }, _this.getInternalPlayer = function () {
|
9513 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
|
9514 |
|
9515 | if (!_this.player) return null;
|
9516 | return _this.player.getInternalPlayer(key);
|
9517 | }, _this.seekTo = function (fraction, type) {
|
9518 | if (!_this.player) return null;
|
9519 | _this.player.seekTo(fraction, type);
|
9520 | }, _this.onReady = function () {
|
9521 | _this.props.onReady(_this);
|
9522 | }, _this.wrapperRef = function (wrapper) {
|
9523 | _this.wrapper = wrapper;
|
9524 | }, _this.activePlayerRef = function (player) {
|
9525 | _this.player = player;
|
9526 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
9527 | }
|
9528 |
|
9529 | _createClass(ReactPlayer, [{
|
9530 | key: 'componentDidMount',
|
9531 | value: function componentDidMount() {
|
9532 | if (this.props.progressFrequency) {
|
9533 | var message = 'ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead';
|
9534 | console.warn(message, 'font-weight: bold', '', 'font-weight: bold', '');
|
9535 | }
|
9536 | }
|
9537 | }, {
|
9538 | key: 'shouldComponentUpdate',
|
9539 | value: function shouldComponentUpdate(nextProps, nextState) {
|
9540 | return !(0, _utils.isEqual)(this.props, nextProps) || !(0, _utils.isEqual)(this.state, nextState);
|
9541 | }
|
9542 | }, {
|
9543 | key: 'componentWillUpdate',
|
9544 | value: function componentWillUpdate(nextProps) {
|
9545 | this.config = (0, _utils.getConfig)(nextProps, _props2.defaultProps);
|
9546 | if (!this.props.light && nextProps.light) {
|
9547 | this.setState({ showPreview: true });
|
9548 | }
|
9549 | }
|
9550 | }, {
|
9551 | key: 'getActivePlayer',
|
9552 | value: function getActivePlayer(url) {
|
9553 | var _arr = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players2['default']));
|
9554 |
|
9555 | for (var _i = 0; _i < _arr.length; _i++) {
|
9556 | var _Player = _arr[_i];
|
9557 | if (_Player.canPlay(url)) {
|
9558 | return _Player;
|
9559 | }
|
9560 | }
|
9561 |
|
9562 | return _Iframe.Iframe;
|
9563 | }
|
9564 | }, {
|
9565 | key: 'renderActivePlayer',
|
9566 | value: function renderActivePlayer(url, activePlayer) {
|
9567 | if (!url) return null;
|
9568 | return _react2['default'].createElement(_Player5['default'], _extends({}, this.props, {
|
9569 | key: activePlayer.displayName,
|
9570 | ref: this.activePlayerRef,
|
9571 | config: this.config,
|
9572 | activePlayer: activePlayer,
|
9573 | onReady: this.onReady
|
9574 | }));
|
9575 | }
|
9576 | }, {
|
9577 | key: 'sortPlayers',
|
9578 | value: function sortPlayers(a, b) {
|
9579 |
|
9580 | if (a && b) {
|
9581 | return a.key < b.key ? -1 : 1;
|
9582 | }
|
9583 | return 0;
|
9584 | }
|
9585 | }, {
|
9586 | key: 'render',
|
9587 | value: function render() {
|
9588 | var _props = this.props,
|
9589 | url = _props.url,
|
9590 | controls = _props.controls,
|
9591 | style = _props.style,
|
9592 | width = _props.width,
|
9593 | height = _props.height,
|
9594 | light = _props.light,
|
9595 | Wrapper = _props.wrapper;
|
9596 |
|
9597 | var showPreview = this.state.showPreview && url;
|
9598 | var otherProps = (0, _utils.omit)(this.props, SUPPORTED_PROPS, _props2.DEPRECATED_CONFIG_PROPS);
|
9599 | var activePlayer = this.getActivePlayer(url);
|
9600 | var renderedActivePlayer = this.renderActivePlayer(url, activePlayer);
|
9601 | var preloadPlayers = (0, _preload2['default'])(url, controls, this.config);
|
9602 | var players = [renderedActivePlayer].concat(_toConsumableArray(preloadPlayers)).sort(this.sortPlayers);
|
9603 | var preview = _react2['default'].createElement(_Preview2['default'], { url: url, light: light, onClick: this.onClickPreview });
|
9604 | return _react2['default'].createElement(
|
9605 | Wrapper,
|
9606 | _extends({ ref: this.wrapperRef, style: _extends({}, style, { width: width, height: height }) }, otherProps),
|
9607 | showPreview ? preview : players
|
9608 | );
|
9609 | }
|
9610 | }]);
|
9611 |
|
9612 | return ReactPlayer;
|
9613 | }(_react.Component);
|
9614 |
|
9615 | ReactPlayer.addCustomPlayer = function (player) {
|
9616 | customPlayers.push(player);
|
9617 | };
|
9618 |
|
9619 | ReactPlayer.removeCustomPlayers = function () {
|
9620 | customPlayers = [];
|
9621 | };
|
9622 |
|
9623 | ReactPlayer.displayName = 'ReactPlayer';
|
9624 | ReactPlayer.propTypes = _props2.propTypes;
|
9625 | ReactPlayer.defaultProps = _props2.defaultProps;
|
9626 |
|
9627 | ReactPlayer.canPlay = function (url) {
|
9628 | var _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players2['default']));
|
9629 |
|
9630 | for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
9631 | var _Player2 = _arr2[_i2];
|
9632 | if (_Player2.canPlay(url)) {
|
9633 | return true;
|
9634 | }
|
9635 | }
|
9636 | return false;
|
9637 | };
|
9638 |
|
9639 | ReactPlayer.canEnablePIP = function (url) {
|
9640 | var _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players2['default']));
|
9641 |
|
9642 | for (var _i3 = 0; _i3 < _arr3.length; _i3++) {
|
9643 | var _Player3 = _arr3[_i3];
|
9644 | if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
9645 | return true;
|
9646 | }
|
9647 | }
|
9648 | return false;
|
9649 | };
|
9650 |
|
9651 | exports['default'] = ReactPlayer;
|
9652 |
|
9653 | }),
|
9654 |
|
9655 | (function(module, exports, __webpack_require__) {
|
9656 |
|
9657 | "use strict";
|
9658 |
|
9659 |
|
9660 | module.exports = function load(src, opts, cb) {
|
9661 | var head = document.head || document.getElementsByTagName('head')[0];
|
9662 | var script = document.createElement('script');
|
9663 |
|
9664 | if (typeof opts === 'function') {
|
9665 | cb = opts;
|
9666 | opts = {};
|
9667 | }
|
9668 |
|
9669 | opts = opts || {};
|
9670 | cb = cb || function () {};
|
9671 |
|
9672 | script.type = opts.type || 'text/javascript';
|
9673 | script.charset = opts.charset || 'utf8';
|
9674 | script.async = 'async' in opts ? !!opts.async : true;
|
9675 | script.src = src;
|
9676 |
|
9677 | if (opts.attrs) {
|
9678 | setAttributes(script, opts.attrs);
|
9679 | }
|
9680 |
|
9681 | if (opts.text) {
|
9682 | script.text = '' + opts.text;
|
9683 | }
|
9684 |
|
9685 | var onend = 'onload' in script ? stdOnEnd : ieOnEnd;
|
9686 | onend(script, cb);
|
9687 |
|
9688 |
|
9689 |
|
9690 |
|
9691 | if (!script.onload) {
|
9692 | stdOnEnd(script, cb);
|
9693 | }
|
9694 |
|
9695 | head.appendChild(script);
|
9696 | };
|
9697 |
|
9698 | function setAttributes(script, attrs) {
|
9699 | for (var attr in attrs) {
|
9700 | script.setAttribute(attr, attrs[attr]);
|
9701 | }
|
9702 | }
|
9703 |
|
9704 | function stdOnEnd(script, cb) {
|
9705 | script.onload = function () {
|
9706 | this.onerror = this.onload = null;
|
9707 | cb(null, script);
|
9708 | };
|
9709 | script.onerror = function () {
|
9710 |
|
9711 |
|
9712 | this.onerror = this.onload = null;
|
9713 | cb(new Error('Failed to load ' + this.src), script);
|
9714 | };
|
9715 | }
|
9716 |
|
9717 | function ieOnEnd(script, cb) {
|
9718 | script.onreadystatechange = function () {
|
9719 | if (this.readyState != 'complete' && this.readyState != 'loaded') return;
|
9720 | this.onreadystatechange = null;
|
9721 | cb(null, script);
|
9722 | };
|
9723 | }
|
9724 |
|
9725 | }),
|
9726 |
|
9727 | (function(module, exports, __webpack_require__) {
|
9728 |
|
9729 | "use strict";
|
9730 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
9731 |
|
9732 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
9733 |
|
9734 | (function (global, factory) {
|
9735 | ( false ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
9736 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
9737 | (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
|
9738 | __WEBPACK_AMD_DEFINE_FACTORY__),
|
9739 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : global.deepmerge = factory();
|
9740 | })(undefined, function () {
|
9741 | 'use strict';
|
9742 |
|
9743 | var isMergeableObject = function isMergeableObject(value) {
|
9744 | return isNonNullObject(value) && !isSpecial(value);
|
9745 | };
|
9746 |
|
9747 | function isNonNullObject(value) {
|
9748 | return !!value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';
|
9749 | }
|
9750 |
|
9751 | function isSpecial(value) {
|
9752 | var stringValue = Object.prototype.toString.call(value);
|
9753 |
|
9754 | return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value);
|
9755 | }
|
9756 |
|
9757 |
|
9758 | var canUseSymbol = typeof Symbol === 'function' && Symbol['for'];
|
9759 | var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol['for']('react.element') : 0xeac7;
|
9760 |
|
9761 | function isReactElement(value) {
|
9762 | return value.$$typeof === REACT_ELEMENT_TYPE;
|
9763 | }
|
9764 |
|
9765 | function emptyTarget(val) {
|
9766 | return Array.isArray(val) ? [] : {};
|
9767 | }
|
9768 |
|
9769 | function cloneUnlessOtherwiseSpecified(value, options) {
|
9770 | return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
9771 | }
|
9772 |
|
9773 | function defaultArrayMerge(target, source, options) {
|
9774 | return target.concat(source).map(function (element) {
|
9775 | return cloneUnlessOtherwiseSpecified(element, options);
|
9776 | });
|
9777 | }
|
9778 |
|
9779 | function mergeObject(target, source, options) {
|
9780 | var destination = {};
|
9781 | if (options.isMergeableObject(target)) {
|
9782 | Object.keys(target).forEach(function (key) {
|
9783 | destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
9784 | });
|
9785 | }
|
9786 | Object.keys(source).forEach(function (key) {
|
9787 | if (!options.isMergeableObject(source[key]) || !target[key]) {
|
9788 | destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
9789 | } else {
|
9790 | destination[key] = deepmerge(target[key], source[key], options);
|
9791 | }
|
9792 | });
|
9793 | return destination;
|
9794 | }
|
9795 |
|
9796 | function deepmerge(target, source, options) {
|
9797 | options = options || {};
|
9798 | options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
9799 | options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
9800 |
|
9801 | var sourceIsArray = Array.isArray(source);
|
9802 | var targetIsArray = Array.isArray(target);
|
9803 | var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
9804 |
|
9805 | if (!sourceAndTargetTypesMatch) {
|
9806 | return cloneUnlessOtherwiseSpecified(source, options);
|
9807 | } else if (sourceIsArray) {
|
9808 | return options.arrayMerge(target, source, options);
|
9809 | } else {
|
9810 | return mergeObject(target, source, options);
|
9811 | }
|
9812 | }
|
9813 |
|
9814 | deepmerge.all = function deepmergeAll(array, options) {
|
9815 | if (!Array.isArray(array)) {
|
9816 | throw new Error('first argument should be an array');
|
9817 | }
|
9818 |
|
9819 | return array.reduce(function (prev, next) {
|
9820 | return deepmerge(prev, next, options);
|
9821 | }, {});
|
9822 | };
|
9823 |
|
9824 | var deepmerge_1 = deepmerge;
|
9825 |
|
9826 | return deepmerge_1;
|
9827 | });
|
9828 |
|
9829 | }),
|
9830 |
|
9831 | (function(module, exports, __webpack_require__) {
|
9832 |
|
9833 | "use strict";
|
9834 |
|
9835 |
|
9836 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
9837 |
|
9838 |
|
9839 |
|
9840 |
|
9841 |
|
9842 |
|
9843 |
|
9844 |
|
9845 | if (false) {
|
9846 | var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
9847 |
|
9848 | var isValidElement = function isValidElement(object) {
|
9849 | return (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
9850 | };
|
9851 |
|
9852 |
|
9853 |
|
9854 | var throwOnDirectAccess = true;
|
9855 | module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
|
9856 | } else {
|
9857 |
|
9858 |
|
9859 | module.exports = __webpack_require__(50)();
|
9860 | }
|
9861 |
|
9862 | }),
|
9863 |
|
9864 | (function(module, exports, __webpack_require__) {
|
9865 |
|
9866 | "use strict";
|
9867 |
|
9868 |
|
9869 |
|
9870 |
|
9871 |
|
9872 |
|
9873 |
|
9874 |
|
9875 |
|
9876 | var emptyFunction = __webpack_require__(4);
|
9877 | var invariant = __webpack_require__(51);
|
9878 | var ReactPropTypesSecret = __webpack_require__(52);
|
9879 |
|
9880 | module.exports = function () {
|
9881 | function shim(props, propName, componentName, location, propFullName, secret) {
|
9882 | if (secret === ReactPropTypesSecret) {
|
9883 |
|
9884 | return;
|
9885 | }
|
9886 | invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
9887 | };
|
9888 | shim.isRequired = shim;
|
9889 | function getShim() {
|
9890 | return shim;
|
9891 | };
|
9892 |
|
9893 |
|
9894 | var ReactPropTypes = {
|
9895 | array: shim,
|
9896 | bool: shim,
|
9897 | func: shim,
|
9898 | number: shim,
|
9899 | object: shim,
|
9900 | string: shim,
|
9901 | symbol: shim,
|
9902 |
|
9903 | any: shim,
|
9904 | arrayOf: getShim,
|
9905 | element: shim,
|
9906 | instanceOf: getShim,
|
9907 | node: shim,
|
9908 | objectOf: getShim,
|
9909 | oneOf: getShim,
|
9910 | oneOfType: getShim,
|
9911 | shape: getShim,
|
9912 | exact: getShim
|
9913 | };
|
9914 |
|
9915 | ReactPropTypes.checkPropTypes = emptyFunction;
|
9916 | ReactPropTypes.PropTypes = ReactPropTypes;
|
9917 |
|
9918 | return ReactPropTypes;
|
9919 | };
|
9920 |
|
9921 | }),
|
9922 |
|
9923 | (function(module, exports, __webpack_require__) {
|
9924 |
|
9925 | "use strict";
|
9926 |
|
9927 |
|
9928 |
|
9929 |
|
9930 |
|
9931 |
|
9932 |
|
9933 |
|
9934 |
|
9935 |
|
9936 |
|
9937 |
|
9938 |
|
9939 |
|
9940 |
|
9941 |
|
9942 |
|
9943 |
|
9944 |
|
9945 |
|
9946 |
|
9947 | var validateFormat = function validateFormat(format) {};
|
9948 |
|
9949 | if (false) {
|
9950 | validateFormat = function validateFormat(format) {
|
9951 | if (format === undefined) {
|
9952 | throw new Error('invariant requires an error message argument');
|
9953 | }
|
9954 | };
|
9955 | }
|
9956 |
|
9957 | function invariant(condition, format, a, b, c, d, e, f) {
|
9958 | validateFormat(format);
|
9959 |
|
9960 | if (!condition) {
|
9961 | var error;
|
9962 | if (format === undefined) {
|
9963 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
9964 | } else {
|
9965 | var args = [a, b, c, d, e, f];
|
9966 | var argIndex = 0;
|
9967 | error = new Error(format.replace(/%s/g, function () {
|
9968 | return args[argIndex++];
|
9969 | }));
|
9970 | error.name = 'Invariant Violation';
|
9971 | }
|
9972 |
|
9973 | error.framesToPop = 1;
|
9974 | throw error;
|
9975 | }
|
9976 | }
|
9977 |
|
9978 | module.exports = invariant;
|
9979 |
|
9980 | }),
|
9981 |
|
9982 | (function(module, exports, __webpack_require__) {
|
9983 |
|
9984 | "use strict";
|
9985 |
|
9986 |
|
9987 |
|
9988 |
|
9989 |
|
9990 |
|
9991 |
|
9992 |
|
9993 |
|
9994 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
9995 |
|
9996 | module.exports = ReactPropTypesSecret;
|
9997 |
|
9998 | }),
|
9999 |
|
10000 | (function(module, exports, __webpack_require__) {
|
10001 |
|
10002 | "use strict";
|
10003 |
|
10004 |
|
10005 | var utils = __webpack_require__(26);
|
10006 | var unique = utils.unique('vpaidIframe');
|
10007 | var VPAIDAdUnit = __webpack_require__(54);
|
10008 |
|
10009 | var defaultTemplate = '<!DOCTYPE html>' + '<html lang="en">' + '<head><meta charset="UTF-8"></head>' + '<body style="margin:0;padding:0"><div class="ad-element"></div>' + '<script type="text/javascript" src="{{iframeURL_JS}}"></script>' + '<script type="text/javascript">' + 'window.parent.postMessage(\'{"event": "ready", "id": "{{iframeID}}"}\', \'{{origin}}\');' + '</script>' + '</body>' + '</html>';
|
10010 |
|
10011 | var AD_STOPPED = 'AdStopped';
|
10012 |
|
10013 |
|
10014 |
|
10015 |
|
10016 |
|
10017 |
|
10018 |
|
10019 |
|
10020 |
|
10021 |
|
10022 |
|
10023 |
|
10024 |
|
10025 |
|
10026 |
|
10027 |
|
10028 |
|
10029 | function VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {
|
10030 | templateConfig = templateConfig || {};
|
10031 |
|
10032 | this._id = unique();
|
10033 | this._destroyed = false;
|
10034 |
|
10035 | this._frameContainer = utils.createElementInEl(el, 'div');
|
10036 | this._videoEl = video;
|
10037 | this._vpaidOptions = vpaidOptions || { timeout: 10000 };
|
10038 |
|
10039 | this._templateConfig = {
|
10040 | template: templateConfig.template || defaultTemplate,
|
10041 | extraOptions: templateConfig.extraOptions || {}
|
10042 | };
|
10043 | }
|
10044 |
|
10045 |
|
10046 |
|
10047 |
|
10048 |
|
10049 | VPAIDHTML5Client.prototype.destroy = function destroy() {
|
10050 | if (this._destroyed) {
|
10051 | return;
|
10052 | }
|
10053 | this._destroyed = true;
|
10054 | $unloadPreviousAdUnit.call(this);
|
10055 | };
|
10056 |
|
10057 |
|
10058 |
|
10059 |
|
10060 |
|
10061 |
|
10062 | VPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {
|
10063 | return this._destroyed;
|
10064 | };
|
10065 |
|
10066 |
|
10067 |
|
10068 |
|
10069 |
|
10070 |
|
10071 |
|
10072 | VPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {
|
10073 | $throwIfDestroyed.call(this);
|
10074 | $unloadPreviousAdUnit.call(this);
|
10075 | var that = this;
|
10076 |
|
10077 | var frame = utils.createIframeWithContent(this._frameContainer, this._templateConfig.template, utils.extend({
|
10078 | iframeURL_JS: adURL,
|
10079 | iframeID: this.getID(),
|
10080 | origin: getOrigin()
|
10081 | }, this._templateConfig.extraOptions));
|
10082 |
|
10083 | this._frame = frame;
|
10084 |
|
10085 | this._onLoad = utils.callbackTimeout(this._vpaidOptions.timeout, onLoad.bind(this), onTimeout.bind(this));
|
10086 |
|
10087 | window.addEventListener('message', this._onLoad);
|
10088 |
|
10089 | function onLoad(e) {
|
10090 |
|
10091 |
|
10092 | if (e.origin !== getOrigin()) return;
|
10093 | var result = JSON.parse(e.data);
|
10094 |
|
10095 |
|
10096 | if (result.id !== that.getID()) return;
|
10097 |
|
10098 | var adUnit, error, createAd;
|
10099 | if (!that._frame.contentWindow) {
|
10100 |
|
10101 | error = 'the iframe is not anymore in the DOM tree';
|
10102 | } else {
|
10103 | createAd = that._frame.contentWindow.getVPAIDAd;
|
10104 | error = utils.validate(typeof createAd === 'function', 'the ad didn\'t return a function to create an ad');
|
10105 | }
|
10106 |
|
10107 | if (!error) {
|
10108 | var adEl = that._frame.contentWindow.document.querySelector('.ad-element');
|
10109 | adUnit = new VPAIDAdUnit(createAd(), adEl, that._videoEl, that._frame);
|
10110 | adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(that));
|
10111 | error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');
|
10112 | }
|
10113 |
|
10114 | that._adUnit = adUnit;
|
10115 | $destroyLoadListener.call(that);
|
10116 | callback(error, error ? null : adUnit);
|
10117 |
|
10118 |
|
10119 | return true;
|
10120 | }
|
10121 |
|
10122 | function onTimeout() {
|
10123 | callback('timeout', null);
|
10124 | }
|
10125 | };
|
10126 |
|
10127 |
|
10128 |
|
10129 |
|
10130 |
|
10131 | VPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {
|
10132 | $unloadPreviousAdUnit.call(this);
|
10133 | };
|
10134 |
|
10135 |
|
10136 |
|
10137 |
|
10138 |
|
10139 |
|
10140 | VPAIDHTML5Client.prototype.getID = function () {
|
10141 | return this._id;
|
10142 | };
|
10143 |
|
10144 |
|
10145 |
|
10146 |
|
10147 |
|
10148 |
|
10149 | function $removeEl(key) {
|
10150 | var el = this[key];
|
10151 | if (el) {
|
10152 | el.remove();
|
10153 | delete this[key];
|
10154 | }
|
10155 | }
|
10156 |
|
10157 | function $adDestroyed() {
|
10158 | $removeAdElements.call(this);
|
10159 | delete this._adUnit;
|
10160 | }
|
10161 |
|
10162 | function $unloadPreviousAdUnit() {
|
10163 | $removeAdElements.call(this);
|
10164 | $destroyAdUnit.call(this);
|
10165 | }
|
10166 |
|
10167 | function $removeAdElements() {
|
10168 | $removeEl.call(this, '_frame');
|
10169 | $destroyLoadListener.call(this);
|
10170 | }
|
10171 |
|
10172 |
|
10173 |
|
10174 |
|
10175 |
|
10176 | function $destroyLoadListener() {
|
10177 | if (this._onLoad) {
|
10178 | window.removeEventListener('message', this._onLoad);
|
10179 | utils.clearCallbackTimeout(this._onLoad);
|
10180 | delete this._onLoad;
|
10181 | }
|
10182 | }
|
10183 |
|
10184 | function $destroyAdUnit() {
|
10185 | if (this._adUnit) {
|
10186 | this._adUnit.stopAd();
|
10187 | delete this._adUnit;
|
10188 | }
|
10189 | }
|
10190 |
|
10191 |
|
10192 |
|
10193 |
|
10194 |
|
10195 | function $throwIfDestroyed() {
|
10196 | if (this._destroyed) {
|
10197 | throw new Error('VPAIDHTML5Client already destroyed!');
|
10198 | }
|
10199 | }
|
10200 |
|
10201 | function getOrigin() {
|
10202 | if (window.location.origin) {
|
10203 | return window.location.origin;
|
10204 | } else {
|
10205 | return window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
|
10206 | }
|
10207 | }
|
10208 |
|
10209 | module.exports = VPAIDHTML5Client;
|
10210 |
|
10211 | }),
|
10212 |
|
10213 | (function(module, exports, __webpack_require__) {
|
10214 |
|
10215 | "use strict";
|
10216 |
|
10217 |
|
10218 | var IVPAIDAdUnit = __webpack_require__(55);
|
10219 | var Subscriber = __webpack_require__(56);
|
10220 | var checkVPAIDInterface = IVPAIDAdUnit.checkVPAIDInterface;
|
10221 | var utils = __webpack_require__(26);
|
10222 | var METHODS = IVPAIDAdUnit.METHODS;
|
10223 | var ERROR = 'AdError';
|
10224 | var AD_CLICK = 'AdClickThru';
|
10225 | var FILTERED_EVENTS = IVPAIDAdUnit.EVENTS.filter(function (event) {
|
10226 | return event != AD_CLICK;
|
10227 | });
|
10228 |
|
10229 |
|
10230 |
|
10231 |
|
10232 |
|
10233 |
|
10234 |
|
10235 |
|
10236 |
|
10237 |
|
10238 |
|
10239 |
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 | function VPAIDAdUnit(VPAIDCreative, el, video, iframe) {
|
10245 | this._isValid = checkVPAIDInterface(VPAIDCreative);
|
10246 | if (this._isValid) {
|
10247 | this._creative = VPAIDCreative;
|
10248 | this._el = el;
|
10249 | this._videoEl = video;
|
10250 | this._iframe = iframe;
|
10251 | this._subscribers = new Subscriber();
|
10252 | utils.setFullSizeStyle(el);
|
10253 | $addEventsSubscribers.call(this);
|
10254 | }
|
10255 | }
|
10256 |
|
10257 | VPAIDAdUnit.prototype = Object.create(IVPAIDAdUnit.prototype);
|
10258 |
|
10259 |
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 | VPAIDAdUnit.prototype.isValidVPAIDAd = function isValidVPAIDAd() {
|
10265 | return this._isValid;
|
10266 | };
|
10267 |
|
10268 | IVPAIDAdUnit.METHODS.forEach(function (method) {
|
10269 |
|
10270 | var ignores = ['subscribe', 'unsubscribe', 'initAd'];
|
10271 |
|
10272 | if (ignores.indexOf(method) !== -1) return;
|
10273 |
|
10274 | VPAIDAdUnit.prototype[method] = function () {
|
10275 | var ariaty = IVPAIDAdUnit.prototype[method].length;
|
10276 |
|
10277 |
|
10278 | var args = Array.prototype.slice.call(arguments);
|
10279 | var callback = ariaty === args.length ? args.pop() : undefined;
|
10280 |
|
10281 | setTimeout(function () {
|
10282 | var result,
|
10283 | error = null;
|
10284 | try {
|
10285 | result = this._creative[method].apply(this._creative, args);
|
10286 | } catch (e) {
|
10287 | error = e;
|
10288 | }
|
10289 |
|
10290 | callOrTriggerEvent(callback, this._subscribers, error, result);
|
10291 | }.bind(this), 0);
|
10292 | };
|
10293 | });
|
10294 |
|
10295 |
|
10296 |
|
10297 |
|
10298 |
|
10299 |
|
10300 |
|
10301 |
|
10302 |
|
10303 |
|
10304 |
|
10305 |
|
10306 | VPAIDAdUnit.prototype.initAd = function initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {
|
10307 | creativeData = creativeData || {};
|
10308 | environmentVars = utils.extend({
|
10309 | slot: this._el,
|
10310 | videoSlot: this._videoEl
|
10311 | }, environmentVars || {});
|
10312 |
|
10313 | setTimeout(function () {
|
10314 | var error;
|
10315 | try {
|
10316 | this._creative.initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars);
|
10317 | } catch (e) {
|
10318 | error = e;
|
10319 | }
|
10320 |
|
10321 | callOrTriggerEvent(callback, this._subscribers, error);
|
10322 | }.bind(this), 0);
|
10323 | };
|
10324 |
|
10325 |
|
10326 |
|
10327 |
|
10328 |
|
10329 |
|
10330 |
|
10331 |
|
10332 | VPAIDAdUnit.prototype.subscribe = function subscribe(event, handler, context) {
|
10333 | this._subscribers.subscribe(handler, event, context);
|
10334 | };
|
10335 |
|
10336 |
|
10337 |
|
10338 |
|
10339 |
|
10340 |
|
10341 |
|
10342 | VPAIDAdUnit.prototype.unsubscribe = function unsubscribe(event, handler) {
|
10343 | this._subscribers.unsubscribe(handler, event);
|
10344 | };
|
10345 |
|
10346 |
|
10347 | VPAIDAdUnit.prototype.on = VPAIDAdUnit.prototype.subscribe;
|
10348 | VPAIDAdUnit.prototype.off = VPAIDAdUnit.prototype.unsubscribe;
|
10349 |
|
10350 | IVPAIDAdUnit.GETTERS.forEach(function (getter) {
|
10351 | VPAIDAdUnit.prototype[getter] = function (callback) {
|
10352 | setTimeout(function () {
|
10353 |
|
10354 | var result,
|
10355 | error = null;
|
10356 | try {
|
10357 | result = this._creative[getter]();
|
10358 | } catch (e) {
|
10359 | error = e;
|
10360 | }
|
10361 |
|
10362 | callOrTriggerEvent(callback, this._subscribers, error, result);
|
10363 | }.bind(this), 0);
|
10364 | };
|
10365 | });
|
10366 |
|
10367 |
|
10368 |
|
10369 |
|
10370 |
|
10371 |
|
10372 |
|
10373 | VPAIDAdUnit.prototype.setAdVolume = function setAdVolume(volume, callback) {
|
10374 | setTimeout(function () {
|
10375 |
|
10376 | var result,
|
10377 | error = null;
|
10378 | try {
|
10379 | this._creative.setAdVolume(volume);
|
10380 | result = this._creative.getAdVolume();
|
10381 | } catch (e) {
|
10382 | error = e;
|
10383 | }
|
10384 |
|
10385 | if (!error) {
|
10386 | error = utils.validate(result === volume, 'failed to apply volume: ' + volume);
|
10387 | }
|
10388 | callOrTriggerEvent(callback, this._subscribers, error, result);
|
10389 | }.bind(this), 0);
|
10390 | };
|
10391 |
|
10392 | VPAIDAdUnit.prototype._destroy = function destroy() {
|
10393 | this.stopAd();
|
10394 | this._subscribers.unsubscribeAll();
|
10395 | };
|
10396 |
|
10397 | function $addEventsSubscribers() {
|
10398 |
|
10399 |
|
10400 |
|
10401 | FILTERED_EVENTS.forEach(function (event) {
|
10402 | this._creative.subscribe($trigger.bind(this, event), event);
|
10403 | }.bind(this));
|
10404 |
|
10405 |
|
10406 |
|
10407 | this._creative.subscribe($clickThruHook.bind(this), AD_CLICK);
|
10408 |
|
10409 |
|
10410 |
|
10411 | if (this._videoEl) {
|
10412 | var documentElement = this._iframe.contentDocument.documentElement;
|
10413 | var videoEl = this._videoEl;
|
10414 | documentElement.addEventListener('click', function (e) {
|
10415 | if (e.target === documentElement) {
|
10416 | videoEl.click();
|
10417 | }
|
10418 | });
|
10419 | }
|
10420 | }
|
10421 |
|
10422 | function $clickThruHook(url, id, playerHandles) {
|
10423 | this._subscribers.triggerSync(AD_CLICK, { url: url, id: id, playerHandles: playerHandles });
|
10424 | }
|
10425 |
|
10426 | function $trigger(event) {
|
10427 |
|
10428 |
|
10429 | this._subscribers.trigger(event, Array.prototype.slice(arguments, 1));
|
10430 | }
|
10431 |
|
10432 | function callOrTriggerEvent(callback, subscribers, error, result) {
|
10433 | if (callback) {
|
10434 | callback(error, result);
|
10435 | } else if (error) {
|
10436 | subscribers.trigger(ERROR, error);
|
10437 | }
|
10438 | }
|
10439 |
|
10440 | module.exports = VPAIDAdUnit;
|
10441 |
|
10442 | }),
|
10443 |
|
10444 | (function(module, exports, __webpack_require__) {
|
10445 |
|
10446 | "use strict";
|
10447 |
|
10448 |
|
10449 | var METHODS = ['handshakeVersion', 'initAd', 'startAd', 'stopAd', 'skipAd',
|
10450 | 'resizeAd', 'pauseAd', 'resumeAd', 'expandAd', 'collapseAd', 'subscribe', 'unsubscribe'];
|
10451 |
|
10452 | var EVENTS = ['AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange',
|
10453 | 'AdSizeChange',
|
10454 | 'AdLinearChange', 'AdDurationChange',
|
10455 | 'AdExpandedChange', 'AdRemainingTimeChange',
|
10456 | 'AdVolumeChange', 'AdImpression', 'AdVideoStart', 'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile', 'AdVideoComplete', 'AdClickThru', 'AdInteraction',
|
10457 | 'AdUserAcceptInvitation', 'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'];
|
10458 |
|
10459 | var GETTERS = ['getAdLinear', 'getAdWidth',
|
10460 | 'getAdHeight',
|
10461 | 'getAdExpanded', 'getAdSkippableState',
|
10462 | 'getAdRemainingTime', 'getAdDuration',
|
10463 | 'getAdVolume', 'getAdCompanions',
|
10464 | 'getAdIcons'
|
10465 | ];
|
10466 |
|
10467 | var SETTERS = ['setAdVolume'];
|
10468 |
|
10469 |
|
10470 |
|
10471 |
|
10472 |
|
10473 |
|
10474 |
|
10475 |
|
10476 |
|
10477 |
|
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 |
|
10483 |
|
10484 |
|
10485 | function IVPAIDAdUnit(creative, el, video) {}
|
10486 |
|
10487 |
|
10488 |
|
10489 |
|
10490 |
|
10491 |
|
10492 |
|
10493 | IVPAIDAdUnit.prototype.handshakeVersion = function (VPAIDVersion, callback) {};
|
10494 |
|
10495 |
|
10496 |
|
10497 |
|
10498 |
|
10499 |
|
10500 |
|
10501 |
|
10502 |
|
10503 |
|
10504 |
|
10505 |
|
10506 | IVPAIDAdUnit.prototype.initAd = function (width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {};
|
10507 |
|
10508 |
|
10509 |
|
10510 |
|
10511 |
|
10512 |
|
10513 | IVPAIDAdUnit.prototype.startAd = function (callback) {};
|
10514 |
|
10515 |
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 | IVPAIDAdUnit.prototype.stopAd = function (callback) {};
|
10521 |
|
10522 |
|
10523 |
|
10524 |
|
10525 |
|
10526 |
|
10527 | IVPAIDAdUnit.prototype.skipAd = function (callback) {};
|
10528 |
|
10529 |
|
10530 |
|
10531 |
|
10532 |
|
10533 |
|
10534 | IVPAIDAdUnit.prototype.resizeAd = function (width, height, viewMode, callback) {};
|
10535 |
|
10536 |
|
10537 |
|
10538 |
|
10539 |
|
10540 |
|
10541 | IVPAIDAdUnit.prototype.pauseAd = function (callback) {};
|
10542 |
|
10543 |
|
10544 |
|
10545 |
|
10546 |
|
10547 |
|
10548 | IVPAIDAdUnit.prototype.resumeAd = function (callback) {};
|
10549 |
|
10550 |
|
10551 |
|
10552 |
|
10553 |
|
10554 |
|
10555 | IVPAIDAdUnit.prototype.expandAd = function (callback) {};
|
10556 |
|
10557 |
|
10558 |
|
10559 |
|
10560 |
|
10561 |
|
10562 | IVPAIDAdUnit.prototype.collapseAd = function (callback) {};
|
10563 |
|
10564 |
|
10565 |
|
10566 |
|
10567 |
|
10568 |
|
10569 |
|
10570 |
|
10571 | IVPAIDAdUnit.prototype.subscribe = function (event, handler, context) {};
|
10572 |
|
10573 |
|
10574 |
|
10575 |
|
10576 |
|
10577 |
|
10578 |
|
10579 | IVPAIDAdUnit.prototype.unsubscribe = function (event, handler) {};
|
10580 |
|
10581 |
|
10582 |
|
10583 |
|
10584 |
|
10585 |
|
10586 | IVPAIDAdUnit.prototype.getAdLinear = function (callback) {};
|
10587 |
|
10588 |
|
10589 |
|
10590 |
|
10591 |
|
10592 |
|
10593 | IVPAIDAdUnit.prototype.getAdWidth = function (callback) {};
|
10594 |
|
10595 |
|
10596 |
|
10597 |
|
10598 |
|
10599 |
|
10600 | IVPAIDAdUnit.prototype.getAdHeight = function (callback) {};
|
10601 |
|
10602 |
|
10603 |
|
10604 |
|
10605 |
|
10606 |
|
10607 | IVPAIDAdUnit.prototype.getAdExpanded = function (callback) {};
|
10608 |
|
10609 |
|
10610 |
|
10611 |
|
10612 |
|
10613 |
|
10614 | IVPAIDAdUnit.prototype.getAdSkippableState = function (callback) {};
|
10615 |
|
10616 |
|
10617 |
|
10618 |
|
10619 |
|
10620 |
|
10621 | IVPAIDAdUnit.prototype.getAdRemainingTime = function (callback) {};
|
10622 |
|
10623 |
|
10624 |
|
10625 |
|
10626 |
|
10627 |
|
10628 | IVPAIDAdUnit.prototype.getAdDuration = function (callback) {};
|
10629 |
|
10630 |
|
10631 |
|
10632 |
|
10633 |
|
10634 |
|
10635 | IVPAIDAdUnit.prototype.getAdVolume = function (callback) {};
|
10636 |
|
10637 |
|
10638 |
|
10639 |
|
10640 |
|
10641 |
|
10642 | IVPAIDAdUnit.prototype.getAdCompanions = function (callback) {};
|
10643 |
|
10644 |
|
10645 |
|
10646 |
|
10647 |
|
10648 |
|
10649 | IVPAIDAdUnit.prototype.getAdIcons = function (callback) {};
|
10650 |
|
10651 |
|
10652 |
|
10653 |
|
10654 |
|
10655 |
|
10656 |
|
10657 | IVPAIDAdUnit.prototype.setAdVolume = function (volume, callback) {};
|
10658 |
|
10659 | addStaticToInterface(IVPAIDAdUnit, 'METHODS', METHODS);
|
10660 | addStaticToInterface(IVPAIDAdUnit, 'GETTERS', GETTERS);
|
10661 | addStaticToInterface(IVPAIDAdUnit, 'SETTERS', SETTERS);
|
10662 | addStaticToInterface(IVPAIDAdUnit, 'EVENTS', EVENTS);
|
10663 |
|
10664 | var VPAID1_METHODS = METHODS.filter(function (method) {
|
10665 | return ['skipAd'].indexOf(method) === -1;
|
10666 | });
|
10667 |
|
10668 | addStaticToInterface(IVPAIDAdUnit, 'checkVPAIDInterface', function checkVPAIDInterface(creative) {
|
10669 | var result = VPAID1_METHODS.every(function (key) {
|
10670 | return typeof creative[key] === 'function';
|
10671 | });
|
10672 | return result;
|
10673 | });
|
10674 |
|
10675 | module.exports = IVPAIDAdUnit;
|
10676 |
|
10677 | function addStaticToInterface(Interface, name, value) {
|
10678 | Object.defineProperty(Interface, name, {
|
10679 | writable: false,
|
10680 | configurable: false,
|
10681 | value: value
|
10682 | });
|
10683 | }
|
10684 |
|
10685 | }),
|
10686 |
|
10687 | (function(module, exports, __webpack_require__) {
|
10688 |
|
10689 | "use strict";
|
10690 |
|
10691 |
|
10692 | function Subscriber() {
|
10693 | this._subscribers = {};
|
10694 | }
|
10695 |
|
10696 | Subscriber.prototype.subscribe = function subscribe(handler, eventName, context) {
|
10697 | if (!this.isHandlerAttached(handler, eventName)) {
|
10698 | this.get(eventName).push({ handler: handler, context: context, eventName: eventName });
|
10699 | }
|
10700 | };
|
10701 |
|
10702 | Subscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {
|
10703 | this._subscribers[eventName] = this.get(eventName).filter(function (subscriber) {
|
10704 | return handler !== subscriber.handler;
|
10705 | });
|
10706 | };
|
10707 |
|
10708 | Subscriber.prototype.unsubscribeAll = function unsubscribeAll() {
|
10709 | this._subscribers = {};
|
10710 | };
|
10711 |
|
10712 | Subscriber.prototype.trigger = function (eventName, data) {
|
10713 | var that = this;
|
10714 | var subscribers = this.get(eventName).concat(this.get('*'));
|
10715 |
|
10716 | subscribers.forEach(function (subscriber) {
|
10717 | setTimeout(function () {
|
10718 | if (that.isHandlerAttached(subscriber.handler, subscriber.eventName)) {
|
10719 | subscriber.handler.call(subscriber.context, data);
|
10720 | }
|
10721 | }, 0);
|
10722 | });
|
10723 | };
|
10724 |
|
10725 | Subscriber.prototype.triggerSync = function (eventName, data) {
|
10726 | var subscribers = this.get(eventName).concat(this.get('*'));
|
10727 |
|
10728 | subscribers.forEach(function (subscriber) {
|
10729 | subscriber.handler.call(subscriber.context, data);
|
10730 | });
|
10731 | };
|
10732 |
|
10733 | Subscriber.prototype.get = function get(eventName) {
|
10734 | if (!this._subscribers[eventName]) {
|
10735 | this._subscribers[eventName] = [];
|
10736 | }
|
10737 | return this._subscribers[eventName];
|
10738 | };
|
10739 |
|
10740 | Subscriber.prototype.isHandlerAttached = function isHandlerAttached(handler, eventName) {
|
10741 | return this.get(eventName).some(function (subscriber) {
|
10742 | return handler === subscriber.handler;
|
10743 | });
|
10744 | };
|
10745 |
|
10746 | module.exports = Subscriber;
|
10747 |
|
10748 | }),
|
10749 |
|
10750 | (function(module, exports, __webpack_require__) {
|
10751 |
|
10752 | "use strict";
|
10753 |
|
10754 |
|
10755 | Object.defineProperty(exports, "__esModule", {
|
10756 | value: true
|
10757 | });
|
10758 | exports.VASTTracker = exports.VASTParser = exports.VASTClient = undefined;
|
10759 |
|
10760 | var _vast_parser = __webpack_require__(27);
|
10761 |
|
10762 | var _vast_client = __webpack_require__(74);
|
10763 |
|
10764 | var _vast_tracker = __webpack_require__(76);
|
10765 |
|
10766 | exports.VASTClient = _vast_client.VASTClient;
|
10767 | exports.VASTParser = _vast_parser.VASTParser;
|
10768 | exports.VASTTracker = _vast_tracker.VASTTracker;
|
10769 |
|
10770 | }),
|
10771 |
|
10772 | (function(module, exports, __webpack_require__) {
|
10773 |
|
10774 | "use strict";
|
10775 |
|
10776 |
|
10777 | Object.defineProperty(exports, "__esModule", {
|
10778 | value: true
|
10779 | });
|
10780 | exports.parseAd = parseAd;
|
10781 |
|
10782 | var _ad = __webpack_require__(59);
|
10783 |
|
10784 | var _ad_extension = __webpack_require__(60);
|
10785 |
|
10786 | var _ad_extension_child = __webpack_require__(61);
|
10787 |
|
10788 | var _creative_companion_parser = __webpack_require__(62);
|
10789 |
|
10790 | var _creative_linear_parser = __webpack_require__(64);
|
10791 |
|
10792 | var _creative_non_linear_parser = __webpack_require__(67);
|
10793 |
|
10794 | var _parser_utils = __webpack_require__(3);
|
10795 |
|
10796 |
|
10797 |
|
10798 |
|
10799 |
|
10800 |
|
10801 |
|
10802 |
|
10803 |
|
10804 |
|
10805 | function parseAd(adElement) {
|
10806 | var childNodes = adElement.childNodes;
|
10807 |
|
10808 | for (var adTypeElementKey in childNodes) {
|
10809 | var adTypeElement = childNodes[adTypeElementKey];
|
10810 |
|
10811 | if (['Wrapper', 'InLine'].indexOf(adTypeElement.nodeName) === -1) {
|
10812 | continue;
|
10813 | }
|
10814 |
|
10815 | _parser_utils.parserUtils.copyNodeAttribute('id', adElement, adTypeElement);
|
10816 | _parser_utils.parserUtils.copyNodeAttribute('sequence', adElement, adTypeElement);
|
10817 |
|
10818 | if (adTypeElement.nodeName === 'Wrapper') {
|
10819 | return parseWrapper(adTypeElement);
|
10820 | } else if (adTypeElement.nodeName === 'InLine') {
|
10821 | return parseInLine(adTypeElement);
|
10822 | }
|
10823 | }
|
10824 | }
|
10825 |
|
10826 |
|
10827 |
|
10828 |
|
10829 |
|
10830 |
|
10831 | function parseInLine(inLineElement) {
|
10832 | var childNodes = inLineElement.childNodes;
|
10833 | var ad = new _ad.Ad();
|
10834 | ad.id = inLineElement.getAttribute('id') || null;
|
10835 | ad.sequence = inLineElement.getAttribute('sequence') || null;
|
10836 |
|
10837 | for (var nodeKey in childNodes) {
|
10838 | var node = childNodes[nodeKey];
|
10839 |
|
10840 | switch (node.nodeName) {
|
10841 | case 'Error':
|
10842 | ad.errorURLTemplates.push(_parser_utils.parserUtils.parseNodeText(node));
|
10843 | break;
|
10844 |
|
10845 | case 'Impression':
|
10846 | ad.impressionURLTemplates.push(_parser_utils.parserUtils.parseNodeText(node));
|
10847 | break;
|
10848 |
|
10849 | case 'Creatives':
|
10850 | _parser_utils.parserUtils.childrenByName(node, 'Creative').forEach(function (creativeElement) {
|
10851 | var creativeAttributes = {
|
10852 | id: creativeElement.getAttribute('id') || null,
|
10853 | adId: parseCreativeAdIdAttribute(creativeElement),
|
10854 | sequence: creativeElement.getAttribute('sequence') || null,
|
10855 | apiFramework: creativeElement.getAttribute('apiFramework') || null
|
10856 | };
|
10857 |
|
10858 | for (var creativeTypeElementKey in creativeElement.childNodes) {
|
10859 | var creativeTypeElement = creativeElement.childNodes[creativeTypeElementKey];
|
10860 | var parsedCreative = void 0;
|
10861 |
|
10862 | switch (creativeTypeElement.nodeName) {
|
10863 | case 'Linear':
|
10864 | parsedCreative = (0, _creative_linear_parser.parseCreativeLinear)(creativeTypeElement, creativeAttributes);
|
10865 | if (parsedCreative) {
|
10866 | ad.creatives.push(parsedCreative);
|
10867 | }
|
10868 | break;
|
10869 | case 'NonLinearAds':
|
10870 | parsedCreative = (0, _creative_non_linear_parser.parseCreativeNonLinear)(creativeTypeElement, creativeAttributes);
|
10871 | if (parsedCreative) {
|
10872 | ad.creatives.push(parsedCreative);
|
10873 | }
|
10874 | break;
|
10875 | case 'CompanionAds':
|
10876 | parsedCreative = (0, _creative_companion_parser.parseCreativeCompanion)(creativeTypeElement, creativeAttributes);
|
10877 | if (parsedCreative) {
|
10878 | ad.creatives.push(parsedCreative);
|
10879 | }
|
10880 | break;
|
10881 | }
|
10882 | }
|
10883 | });
|
10884 | break;
|
10885 |
|
10886 | case 'Extensions':
|
10887 | parseExtensions(ad.extensions, _parser_utils.parserUtils.childrenByName(node, 'Extension'));
|
10888 | break;
|
10889 |
|
10890 | case 'AdSystem':
|
10891 | ad.system = {
|
10892 | value: _parser_utils.parserUtils.parseNodeText(node),
|
10893 | version: node.getAttribute('version') || null
|
10894 | };
|
10895 | break;
|
10896 |
|
10897 | case 'AdTitle':
|
10898 | ad.title = _parser_utils.parserUtils.parseNodeText(node);
|
10899 | break;
|
10900 |
|
10901 | case 'Description':
|
10902 | ad.description = _parser_utils.parserUtils.parseNodeText(node);
|
10903 | break;
|
10904 |
|
10905 | case 'Advertiser':
|
10906 | ad.advertiser = _parser_utils.parserUtils.parseNodeText(node);
|
10907 | break;
|
10908 |
|
10909 | case 'Pricing':
|
10910 | ad.pricing = {
|
10911 | value: _parser_utils.parserUtils.parseNodeText(node),
|
10912 | model: node.getAttribute('model') || null,
|
10913 | currency: node.getAttribute('currency') || null
|
10914 | };
|
10915 | break;
|
10916 |
|
10917 | case 'Survey':
|
10918 | ad.survey = _parser_utils.parserUtils.parseNodeText(node);
|
10919 | break;
|
10920 | }
|
10921 | }
|
10922 |
|
10923 | return ad;
|
10924 | }
|
10925 |
|
10926 |
|
10927 |
|
10928 |
|
10929 |
|
10930 |
|
10931 | function parseWrapper(wrapperElement) {
|
10932 | var ad = parseInLine(wrapperElement);
|
10933 | var wrapperURLElement = _parser_utils.parserUtils.childByName(wrapperElement, 'VASTAdTagURI');
|
10934 |
|
10935 | if (wrapperURLElement) {
|
10936 | ad.nextWrapperURL = _parser_utils.parserUtils.parseNodeText(wrapperURLElement);
|
10937 | } else {
|
10938 | wrapperURLElement = _parser_utils.parserUtils.childByName(wrapperElement, 'VASTAdTagURL');
|
10939 |
|
10940 | if (wrapperURLElement) {
|
10941 | ad.nextWrapperURL = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(wrapperURLElement, 'URL'));
|
10942 | }
|
10943 | }
|
10944 |
|
10945 | ad.creatives.forEach(function (wrapperCreativeElement) {
|
10946 | if (['linear', 'nonlinear'].indexOf(wrapperCreativeElement.type) !== -1) {
|
10947 |
|
10948 | if (wrapperCreativeElement.trackingEvents) {
|
10949 | if (!ad.trackingEvents) {
|
10950 | ad.trackingEvents = {};
|
10951 | }
|
10952 | if (!ad.trackingEvents[wrapperCreativeElement.type]) {
|
10953 | ad.trackingEvents[wrapperCreativeElement.type] = {};
|
10954 | }
|
10955 |
|
10956 | var _loop = function _loop(eventName) {
|
10957 | var urls = wrapperCreativeElement.trackingEvents[eventName];
|
10958 | if (!Array.isArray(ad.trackingEvents[wrapperCreativeElement.type][eventName])) {
|
10959 | ad.trackingEvents[wrapperCreativeElement.type][eventName] = [];
|
10960 | }
|
10961 | urls.forEach(function (url) {
|
10962 | ad.trackingEvents[wrapperCreativeElement.type][eventName].push(url);
|
10963 | });
|
10964 | };
|
10965 |
|
10966 | for (var eventName in wrapperCreativeElement.trackingEvents) {
|
10967 | _loop(eventName);
|
10968 | }
|
10969 | }
|
10970 |
|
10971 | if (wrapperCreativeElement.videoClickTrackingURLTemplates) {
|
10972 | if (!Array.isArray(ad.videoClickTrackingURLTemplates)) {
|
10973 | ad.videoClickTrackingURLTemplates = [];
|
10974 | }
|
10975 | wrapperCreativeElement.videoClickTrackingURLTemplates.forEach(function (item) {
|
10976 | ad.videoClickTrackingURLTemplates.push(item);
|
10977 | });
|
10978 | }
|
10979 |
|
10980 | if (wrapperCreativeElement.videoClickThroughURLTemplate) {
|
10981 | ad.videoClickThroughURLTemplate = wrapperCreativeElement.videoClickThroughURLTemplate;
|
10982 | }
|
10983 |
|
10984 | if (wrapperCreativeElement.videoCustomClickURLTemplates) {
|
10985 | if (!Array.isArray(ad.videoCustomClickURLTemplates)) {
|
10986 | ad.videoCustomClickURLTemplates = [];
|
10987 | }
|
10988 | wrapperCreativeElement.videoCustomClickURLTemplates.forEach(function (item) {
|
10989 | ad.videoCustomClickURLTemplates.push(item);
|
10990 | });
|
10991 | }
|
10992 | }
|
10993 | });
|
10994 |
|
10995 | if (ad.nextWrapperURL) {
|
10996 | return ad;
|
10997 | }
|
10998 | }
|
10999 |
|
11000 |
|
11001 |
|
11002 |
|
11003 |
|
11004 |
|
11005 | function parseExtensions(collection, extensions) {
|
11006 | extensions.forEach(function (extNode) {
|
11007 | var ext = new _ad_extension.AdExtension();
|
11008 | var extNodeAttrs = extNode.attributes;
|
11009 | var childNodes = extNode.childNodes;
|
11010 |
|
11011 | if (extNode.attributes) {
|
11012 | for (var extNodeAttrKey in extNodeAttrs) {
|
11013 | var extNodeAttr = extNodeAttrs[extNodeAttrKey];
|
11014 |
|
11015 | if (extNodeAttr.nodeName && extNodeAttr.nodeValue) {
|
11016 | ext.attributes[extNodeAttr.nodeName] = extNodeAttr.nodeValue;
|
11017 | }
|
11018 | }
|
11019 | }
|
11020 |
|
11021 | for (var childNodeKey in childNodes) {
|
11022 | var childNode = childNodes[childNodeKey];
|
11023 | var txt = _parser_utils.parserUtils.parseNodeText(childNode);
|
11024 |
|
11025 |
|
11026 | if (childNode.nodeName !== '#comment' && txt !== '') {
|
11027 | var extChild = new _ad_extension_child.AdExtensionChild();
|
11028 | extChild.name = childNode.nodeName;
|
11029 | extChild.value = txt;
|
11030 |
|
11031 | if (childNode.attributes) {
|
11032 | var childNodeAttributes = childNode.attributes;
|
11033 |
|
11034 | for (var extChildNodeAttrKey in childNodeAttributes) {
|
11035 | var extChildNodeAttr = childNodeAttributes[extChildNodeAttrKey];
|
11036 |
|
11037 | extChild.attributes[extChildNodeAttr.nodeName] = extChildNodeAttr.nodeValue;
|
11038 | }
|
11039 | }
|
11040 |
|
11041 | ext.children.push(extChild);
|
11042 | }
|
11043 | }
|
11044 |
|
11045 | collection.push(ext);
|
11046 | });
|
11047 | }
|
11048 |
|
11049 |
|
11050 |
|
11051 |
|
11052 |
|
11053 |
|
11054 | function parseCreativeAdIdAttribute(creativeElement) {
|
11055 | return creativeElement.getAttribute('AdID') ||
|
11056 | creativeElement.getAttribute('adID') ||
|
11057 | creativeElement.getAttribute('adId') ||
|
11058 | null;
|
11059 | }
|
11060 |
|
11061 | }),
|
11062 |
|
11063 | (function(module, exports, __webpack_require__) {
|
11064 |
|
11065 | "use strict";
|
11066 |
|
11067 |
|
11068 | Object.defineProperty(exports, "__esModule", {
|
11069 | value: true
|
11070 | });
|
11071 |
|
11072 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11073 |
|
11074 | var Ad = exports.Ad = function Ad() {
|
11075 | _classCallCheck(this, Ad);
|
11076 |
|
11077 | this.id = null;
|
11078 | this.sequence = null;
|
11079 | this.system = null;
|
11080 | this.title = null;
|
11081 | this.description = null;
|
11082 | this.advertiser = null;
|
11083 | this.pricing = null;
|
11084 | this.survey = null;
|
11085 | this.errorURLTemplates = [];
|
11086 | this.impressionURLTemplates = [];
|
11087 | this.creatives = [];
|
11088 | this.extensions = [];
|
11089 | };
|
11090 |
|
11091 | }),
|
11092 |
|
11093 | (function(module, exports, __webpack_require__) {
|
11094 |
|
11095 | "use strict";
|
11096 |
|
11097 |
|
11098 | Object.defineProperty(exports, "__esModule", {
|
11099 | value: true
|
11100 | });
|
11101 |
|
11102 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11103 |
|
11104 | var AdExtension = exports.AdExtension = function AdExtension() {
|
11105 | _classCallCheck(this, AdExtension);
|
11106 |
|
11107 | this.attributes = {};
|
11108 | this.children = [];
|
11109 | };
|
11110 |
|
11111 | }),
|
11112 |
|
11113 | (function(module, exports, __webpack_require__) {
|
11114 |
|
11115 | "use strict";
|
11116 |
|
11117 |
|
11118 | Object.defineProperty(exports, "__esModule", {
|
11119 | value: true
|
11120 | });
|
11121 |
|
11122 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11123 |
|
11124 | var AdExtensionChild = exports.AdExtensionChild = function AdExtensionChild() {
|
11125 | _classCallCheck(this, AdExtensionChild);
|
11126 |
|
11127 | this.name = null;
|
11128 | this.value = null;
|
11129 | this.attributes = {};
|
11130 | };
|
11131 |
|
11132 | }),
|
11133 |
|
11134 | (function(module, exports, __webpack_require__) {
|
11135 |
|
11136 | "use strict";
|
11137 |
|
11138 |
|
11139 | Object.defineProperty(exports, "__esModule", {
|
11140 | value: true
|
11141 | });
|
11142 | exports.parseCreativeCompanion = parseCreativeCompanion;
|
11143 |
|
11144 | var _companion_ad = __webpack_require__(28);
|
11145 |
|
11146 | var _creative_companion = __webpack_require__(63);
|
11147 |
|
11148 | var _parser_utils = __webpack_require__(3);
|
11149 |
|
11150 |
|
11151 |
|
11152 |
|
11153 |
|
11154 |
|
11155 |
|
11156 |
|
11157 |
|
11158 |
|
11159 |
|
11160 | function parseCreativeCompanion(creativeElement, creativeAttributes) {
|
11161 | var creative = new _creative_companion.CreativeCompanion(creativeAttributes);
|
11162 |
|
11163 | _parser_utils.parserUtils.childrenByName(creativeElement, 'Companion').forEach(function (companionResource) {
|
11164 | var companionAd = new _companion_ad.CompanionAd();
|
11165 | companionAd.id = companionResource.getAttribute('id') || null;
|
11166 | companionAd.width = companionResource.getAttribute('width');
|
11167 | companionAd.height = companionResource.getAttribute('height');
|
11168 | companionAd.companionClickTrackingURLTemplates = [];
|
11169 |
|
11170 | _parser_utils.parserUtils.childrenByName(companionResource, 'HTMLResource').forEach(function (htmlElement) {
|
11171 | companionAd.type = htmlElement.getAttribute('creativeType') || 'text/html';
|
11172 | companionAd.htmlResource = _parser_utils.parserUtils.parseNodeText(htmlElement);
|
11173 | });
|
11174 |
|
11175 | _parser_utils.parserUtils.childrenByName(companionResource, 'IFrameResource').forEach(function (iframeElement) {
|
11176 | companionAd.type = iframeElement.getAttribute('creativeType') || 0;
|
11177 | companionAd.iframeResource = _parser_utils.parserUtils.parseNodeText(iframeElement);
|
11178 | });
|
11179 |
|
11180 | _parser_utils.parserUtils.childrenByName(companionResource, 'StaticResource').forEach(function (staticElement) {
|
11181 | companionAd.type = staticElement.getAttribute('creativeType') || 0;
|
11182 |
|
11183 | _parser_utils.parserUtils.childrenByName(companionResource, 'AltText').forEach(function (child) {
|
11184 | companionAd.altText = _parser_utils.parserUtils.parseNodeText(child);
|
11185 | });
|
11186 |
|
11187 | companionAd.staticResource = _parser_utils.parserUtils.parseNodeText(staticElement);
|
11188 | });
|
11189 |
|
11190 | _parser_utils.parserUtils.childrenByName(companionResource, 'TrackingEvents').forEach(function (trackingEventsElement) {
|
11191 | _parser_utils.parserUtils.childrenByName(trackingEventsElement, 'Tracking').forEach(function (trackingElement) {
|
11192 | var eventName = trackingElement.getAttribute('event');
|
11193 | var trackingURLTemplate = _parser_utils.parserUtils.parseNodeText(trackingElement);
|
11194 | if (eventName && trackingURLTemplate) {
|
11195 | if (!Array.isArray(companionAd.trackingEvents[eventName])) {
|
11196 | companionAd.trackingEvents[eventName] = [];
|
11197 | }
|
11198 | companionAd.trackingEvents[eventName].push(trackingURLTemplate);
|
11199 | }
|
11200 | });
|
11201 | });
|
11202 |
|
11203 | _parser_utils.parserUtils.childrenByName(companionResource, 'CompanionClickTracking').forEach(function (clickTrackingElement) {
|
11204 | companionAd.companionClickTrackingURLTemplates.push(_parser_utils.parserUtils.parseNodeText(clickTrackingElement));
|
11205 | });
|
11206 |
|
11207 | companionAd.companionClickThroughURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(companionResource, 'CompanionClickThrough'));
|
11208 | companionAd.companionClickTrackingURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(companionResource, 'CompanionClickTracking'));
|
11209 | creative.variations.push(companionAd);
|
11210 | });
|
11211 |
|
11212 | return creative;
|
11213 | }
|
11214 |
|
11215 | }),
|
11216 |
|
11217 | (function(module, exports, __webpack_require__) {
|
11218 |
|
11219 | "use strict";
|
11220 |
|
11221 |
|
11222 | Object.defineProperty(exports, "__esModule", {
|
11223 | value: true
|
11224 | });
|
11225 | exports.CreativeCompanion = undefined;
|
11226 |
|
11227 | var _creative = __webpack_require__(12);
|
11228 |
|
11229 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11230 |
|
11231 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
11232 |
|
11233 | 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; }
|
11234 |
|
11235 | var CreativeCompanion = exports.CreativeCompanion = function (_Creative) {
|
11236 | _inherits(CreativeCompanion, _Creative);
|
11237 |
|
11238 | function CreativeCompanion() {
|
11239 | var creativeAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11240 |
|
11241 | _classCallCheck(this, CreativeCompanion);
|
11242 |
|
11243 | var _this = _possibleConstructorReturn(this, (CreativeCompanion.__proto__ || Object.getPrototypeOf(CreativeCompanion)).call(this, creativeAttributes));
|
11244 |
|
11245 | _this.type = 'companion';
|
11246 | _this.variations = [];
|
11247 | return _this;
|
11248 | }
|
11249 |
|
11250 | return CreativeCompanion;
|
11251 | }(_creative.Creative);
|
11252 |
|
11253 | }),
|
11254 |
|
11255 | (function(module, exports, __webpack_require__) {
|
11256 |
|
11257 | "use strict";
|
11258 |
|
11259 |
|
11260 | Object.defineProperty(exports, "__esModule", {
|
11261 | value: true
|
11262 | });
|
11263 | exports.parseCreativeLinear = parseCreativeLinear;
|
11264 |
|
11265 | var _creative_linear = __webpack_require__(29);
|
11266 |
|
11267 | var _icon = __webpack_require__(65);
|
11268 |
|
11269 | var _media_file = __webpack_require__(66);
|
11270 |
|
11271 | var _parser_utils = __webpack_require__(3);
|
11272 |
|
11273 |
|
11274 |
|
11275 |
|
11276 |
|
11277 |
|
11278 |
|
11279 |
|
11280 |
|
11281 |
|
11282 |
|
11283 | function parseCreativeLinear(creativeElement, creativeAttributes) {
|
11284 | var offset = void 0;
|
11285 | var creative = new _creative_linear.CreativeLinear(creativeAttributes);
|
11286 |
|
11287 | creative.duration = _parser_utils.parserUtils.parseDuration(_parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(creativeElement, 'Duration')));
|
11288 | var skipOffset = creativeElement.getAttribute('skipoffset');
|
11289 |
|
11290 | if (typeof skipOffset === 'undefined' || skipOffset === null) {
|
11291 | creative.skipDelay = null;
|
11292 | } else if (skipOffset.charAt(skipOffset.length - 1) === '%' && creative.duration !== -1) {
|
11293 | var percent = parseInt(skipOffset, 10);
|
11294 | creative.skipDelay = creative.duration * (percent / 100);
|
11295 | } else {
|
11296 | creative.skipDelay = _parser_utils.parserUtils.parseDuration(skipOffset);
|
11297 | }
|
11298 |
|
11299 | var videoClicksElement = _parser_utils.parserUtils.childByName(creativeElement, 'VideoClicks');
|
11300 | if (videoClicksElement) {
|
11301 | creative.videoClickThroughURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(videoClicksElement, 'ClickThrough'));
|
11302 |
|
11303 | _parser_utils.parserUtils.childrenByName(videoClicksElement, 'ClickTracking').forEach(function (clickTrackingElement) {
|
11304 | creative.videoClickTrackingURLTemplates.push(_parser_utils.parserUtils.parseNodeText(clickTrackingElement));
|
11305 | });
|
11306 |
|
11307 | _parser_utils.parserUtils.childrenByName(videoClicksElement, 'CustomClick').forEach(function (customClickElement) {
|
11308 | creative.videoCustomClickURLTemplates.push(_parser_utils.parserUtils.parseNodeText(customClickElement));
|
11309 | });
|
11310 | }
|
11311 |
|
11312 | var adParamsElement = _parser_utils.parserUtils.childByName(creativeElement, 'AdParameters');
|
11313 | if (adParamsElement) {
|
11314 | creative.adParameters = _parser_utils.parserUtils.parseNodeText(adParamsElement);
|
11315 | }
|
11316 |
|
11317 | _parser_utils.parserUtils.childrenByName(creativeElement, 'TrackingEvents').forEach(function (trackingEventsElement) {
|
11318 | _parser_utils.parserUtils.childrenByName(trackingEventsElement, 'Tracking').forEach(function (trackingElement) {
|
11319 | var eventName = trackingElement.getAttribute('event');
|
11320 | var trackingURLTemplate = _parser_utils.parserUtils.parseNodeText(trackingElement);
|
11321 | if (eventName && trackingURLTemplate) {
|
11322 | if (eventName === 'progress') {
|
11323 | offset = trackingElement.getAttribute('offset');
|
11324 | if (!offset) {
|
11325 | return;
|
11326 | }
|
11327 | if (offset.charAt(offset.length - 1) === '%') {
|
11328 | eventName = 'progress-' + offset;
|
11329 | } else {
|
11330 | eventName = 'progress-' + Math.round(_parser_utils.parserUtils.parseDuration(offset));
|
11331 | }
|
11332 | }
|
11333 |
|
11334 | if (!Array.isArray(creative.trackingEvents[eventName])) {
|
11335 | creative.trackingEvents[eventName] = [];
|
11336 | }
|
11337 | creative.trackingEvents[eventName].push(trackingURLTemplate);
|
11338 | }
|
11339 | });
|
11340 | });
|
11341 |
|
11342 | _parser_utils.parserUtils.childrenByName(creativeElement, 'MediaFiles').forEach(function (mediaFilesElement) {
|
11343 | _parser_utils.parserUtils.childrenByName(mediaFilesElement, 'MediaFile').forEach(function (mediaFileElement) {
|
11344 | var mediaFile = new _media_file.MediaFile();
|
11345 | mediaFile.id = mediaFileElement.getAttribute('id');
|
11346 | mediaFile.fileURL = _parser_utils.parserUtils.parseNodeText(mediaFileElement);
|
11347 | mediaFile.deliveryType = mediaFileElement.getAttribute('delivery');
|
11348 | mediaFile.codec = mediaFileElement.getAttribute('codec');
|
11349 | mediaFile.mimeType = mediaFileElement.getAttribute('type');
|
11350 | mediaFile.apiFramework = mediaFileElement.getAttribute('apiFramework');
|
11351 | mediaFile.bitrate = parseInt(mediaFileElement.getAttribute('bitrate') || 0);
|
11352 | mediaFile.minBitrate = parseInt(mediaFileElement.getAttribute('minBitrate') || 0);
|
11353 | mediaFile.maxBitrate = parseInt(mediaFileElement.getAttribute('maxBitrate') || 0);
|
11354 | mediaFile.width = parseInt(mediaFileElement.getAttribute('width') || 0);
|
11355 | mediaFile.height = parseInt(mediaFileElement.getAttribute('height') || 0);
|
11356 |
|
11357 | var scalable = mediaFileElement.getAttribute('scalable');
|
11358 | if (scalable && typeof scalable === 'string') {
|
11359 | scalable = scalable.toLowerCase();
|
11360 | if (scalable === 'true') {
|
11361 | mediaFile.scalable = true;
|
11362 | } else if (scalable === 'false') {
|
11363 | mediaFile.scalable = false;
|
11364 | }
|
11365 | }
|
11366 |
|
11367 | var maintainAspectRatio = mediaFileElement.getAttribute('maintainAspectRatio');
|
11368 | if (maintainAspectRatio && typeof maintainAspectRatio === 'string') {
|
11369 | maintainAspectRatio = maintainAspectRatio.toLowerCase();
|
11370 | if (maintainAspectRatio === 'true') {
|
11371 | mediaFile.maintainAspectRatio = true;
|
11372 | } else if (maintainAspectRatio === 'false') {
|
11373 | mediaFile.maintainAspectRatio = false;
|
11374 | }
|
11375 | }
|
11376 |
|
11377 | creative.mediaFiles.push(mediaFile);
|
11378 | });
|
11379 | });
|
11380 |
|
11381 | var iconsElement = _parser_utils.parserUtils.childByName(creativeElement, 'Icons');
|
11382 | if (iconsElement) {
|
11383 | _parser_utils.parserUtils.childrenByName(iconsElement, 'Icon').forEach(function (iconElement) {
|
11384 | var icon = new _icon.Icon();
|
11385 | icon.program = iconElement.getAttribute('program');
|
11386 | icon.height = parseInt(iconElement.getAttribute('height') || 0);
|
11387 | icon.width = parseInt(iconElement.getAttribute('width') || 0);
|
11388 | icon.xPosition = parseXPosition(iconElement.getAttribute('xPosition'));
|
11389 | icon.yPosition = parseYPosition(iconElement.getAttribute('yPosition'));
|
11390 | icon.apiFramework = iconElement.getAttribute('apiFramework');
|
11391 | icon.offset = _parser_utils.parserUtils.parseDuration(iconElement.getAttribute('offset'));
|
11392 | icon.duration = _parser_utils.parserUtils.parseDuration(iconElement.getAttribute('duration'));
|
11393 |
|
11394 | _parser_utils.parserUtils.childrenByName(iconElement, 'HTMLResource').forEach(function (htmlElement) {
|
11395 | icon.type = htmlElement.getAttribute('creativeType') || 'text/html';
|
11396 | icon.htmlResource = _parser_utils.parserUtils.parseNodeText(htmlElement);
|
11397 | });
|
11398 |
|
11399 | _parser_utils.parserUtils.childrenByName(iconElement, 'IFrameResource').forEach(function (iframeElement) {
|
11400 | icon.type = iframeElement.getAttribute('creativeType') || 0;
|
11401 | icon.iframeResource = _parser_utils.parserUtils.parseNodeText(iframeElement);
|
11402 | });
|
11403 |
|
11404 | _parser_utils.parserUtils.childrenByName(iconElement, 'StaticResource').forEach(function (staticElement) {
|
11405 | icon.type = staticElement.getAttribute('creativeType') || 0;
|
11406 | icon.staticResource = _parser_utils.parserUtils.parseNodeText(staticElement);
|
11407 | });
|
11408 |
|
11409 | var iconClicksElement = _parser_utils.parserUtils.childByName(iconElement, 'IconClicks');
|
11410 | if (iconClicksElement) {
|
11411 | icon.iconClickThroughURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(iconClicksElement, 'IconClickThrough'));
|
11412 | _parser_utils.parserUtils.childrenByName(iconClicksElement, 'IconClickTracking').forEach(function (iconClickTrackingElement) {
|
11413 | icon.iconClickTrackingURLTemplates.push(_parser_utils.parserUtils.parseNodeText(iconClickTrackingElement));
|
11414 | });
|
11415 | }
|
11416 |
|
11417 | icon.iconViewTrackingURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(iconElement, 'IconViewTracking'));
|
11418 |
|
11419 | creative.icons.push(icon);
|
11420 | });
|
11421 | }
|
11422 |
|
11423 | return creative;
|
11424 | }
|
11425 |
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 | function parseXPosition(xPosition) {
|
11432 | if (['left', 'right'].indexOf(xPosition) !== -1) {
|
11433 | return xPosition;
|
11434 | }
|
11435 |
|
11436 | return parseInt(xPosition || 0);
|
11437 | }
|
11438 |
|
11439 |
|
11440 |
|
11441 |
|
11442 |
|
11443 |
|
11444 | function parseYPosition(yPosition) {
|
11445 | if (['top', 'bottom'].indexOf(yPosition) !== -1) {
|
11446 | return yPosition;
|
11447 | }
|
11448 |
|
11449 | return parseInt(yPosition || 0);
|
11450 | }
|
11451 |
|
11452 | }),
|
11453 |
|
11454 | (function(module, exports, __webpack_require__) {
|
11455 |
|
11456 | "use strict";
|
11457 |
|
11458 |
|
11459 | Object.defineProperty(exports, "__esModule", {
|
11460 | value: true
|
11461 | });
|
11462 |
|
11463 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11464 |
|
11465 | var Icon = exports.Icon = function Icon() {
|
11466 | _classCallCheck(this, Icon);
|
11467 |
|
11468 | this.program = null;
|
11469 | this.height = 0;
|
11470 | this.width = 0;
|
11471 | this.xPosition = 0;
|
11472 | this.yPosition = 0;
|
11473 | this.apiFramework = null;
|
11474 | this.offset = null;
|
11475 | this.duration = 0;
|
11476 | this.type = null;
|
11477 | this.staticResource = null;
|
11478 | this.htmlResource = null;
|
11479 | this.iframeResource = null;
|
11480 | this.iconClickThroughURLTemplate = null;
|
11481 | this.iconClickTrackingURLTemplates = [];
|
11482 | this.iconViewTrackingURLTemplate = null;
|
11483 | };
|
11484 |
|
11485 | }),
|
11486 |
|
11487 | (function(module, exports, __webpack_require__) {
|
11488 |
|
11489 | "use strict";
|
11490 |
|
11491 |
|
11492 | Object.defineProperty(exports, "__esModule", {
|
11493 | value: true
|
11494 | });
|
11495 |
|
11496 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11497 |
|
11498 | var MediaFile = exports.MediaFile = function MediaFile() {
|
11499 | _classCallCheck(this, MediaFile);
|
11500 |
|
11501 | this.id = null;
|
11502 | this.fileURL = null;
|
11503 | this.deliveryType = 'progressive';
|
11504 | this.mimeType = null;
|
11505 | this.codec = null;
|
11506 | this.bitrate = 0;
|
11507 | this.minBitrate = 0;
|
11508 | this.maxBitrate = 0;
|
11509 | this.width = 0;
|
11510 | this.height = 0;
|
11511 | this.apiFramework = null;
|
11512 | this.scalable = null;
|
11513 | this.maintainAspectRatio = null;
|
11514 | };
|
11515 |
|
11516 | }),
|
11517 |
|
11518 | (function(module, exports, __webpack_require__) {
|
11519 |
|
11520 | "use strict";
|
11521 |
|
11522 |
|
11523 | Object.defineProperty(exports, "__esModule", {
|
11524 | value: true
|
11525 | });
|
11526 | exports.parseCreativeNonLinear = parseCreativeNonLinear;
|
11527 |
|
11528 | var _creative_non_linear = __webpack_require__(68);
|
11529 |
|
11530 | var _non_linear_ad = __webpack_require__(30);
|
11531 |
|
11532 | var _parser_utils = __webpack_require__(3);
|
11533 |
|
11534 |
|
11535 |
|
11536 |
|
11537 |
|
11538 |
|
11539 |
|
11540 |
|
11541 |
|
11542 |
|
11543 |
|
11544 | function parseCreativeNonLinear(creativeElement, creativeAttributes) {
|
11545 | var creative = new _creative_non_linear.CreativeNonLinear(creativeAttributes);
|
11546 |
|
11547 | _parser_utils.parserUtils.childrenByName(creativeElement, 'TrackingEvents').forEach(function (trackingEventsElement) {
|
11548 | var eventName = void 0,
|
11549 | trackingURLTemplate = void 0;
|
11550 | _parser_utils.parserUtils.childrenByName(trackingEventsElement, 'Tracking').forEach(function (trackingElement) {
|
11551 | eventName = trackingElement.getAttribute('event');
|
11552 | trackingURLTemplate = _parser_utils.parserUtils.parseNodeText(trackingElement);
|
11553 |
|
11554 | if (eventName && trackingURLTemplate) {
|
11555 | if (!Array.isArray(creative.trackingEvents[eventName])) {
|
11556 | creative.trackingEvents[eventName] = [];
|
11557 | }
|
11558 | creative.trackingEvents[eventName].push(trackingURLTemplate);
|
11559 | }
|
11560 | });
|
11561 | });
|
11562 |
|
11563 | _parser_utils.parserUtils.childrenByName(creativeElement, 'NonLinear').forEach(function (nonlinearResource) {
|
11564 | var nonlinearAd = new _non_linear_ad.NonLinearAd();
|
11565 | nonlinearAd.id = nonlinearResource.getAttribute('id') || null;
|
11566 | nonlinearAd.width = nonlinearResource.getAttribute('width');
|
11567 | nonlinearAd.height = nonlinearResource.getAttribute('height');
|
11568 | nonlinearAd.expandedWidth = nonlinearResource.getAttribute('expandedWidth');
|
11569 | nonlinearAd.expandedHeight = nonlinearResource.getAttribute('expandedHeight');
|
11570 | nonlinearAd.scalable = _parser_utils.parserUtils.parseBoolean(nonlinearResource.getAttribute('scalable'));
|
11571 | nonlinearAd.maintainAspectRatio = _parser_utils.parserUtils.parseBoolean(nonlinearResource.getAttribute('maintainAspectRatio'));
|
11572 | nonlinearAd.minSuggestedDuration = _parser_utils.parserUtils.parseDuration(nonlinearResource.getAttribute('minSuggestedDuration'));
|
11573 | nonlinearAd.apiFramework = nonlinearResource.getAttribute('apiFramework');
|
11574 |
|
11575 | _parser_utils.parserUtils.childrenByName(nonlinearResource, 'HTMLResource').forEach(function (htmlElement) {
|
11576 | nonlinearAd.type = htmlElement.getAttribute('creativeType') || 'text/html';
|
11577 | nonlinearAd.htmlResource = _parser_utils.parserUtils.parseNodeText(htmlElement);
|
11578 | });
|
11579 |
|
11580 | _parser_utils.parserUtils.childrenByName(nonlinearResource, 'IFrameResource').forEach(function (iframeElement) {
|
11581 | nonlinearAd.type = iframeElement.getAttribute('creativeType') || 0;
|
11582 | nonlinearAd.iframeResource = _parser_utils.parserUtils.parseNodeText(iframeElement);
|
11583 | });
|
11584 |
|
11585 | _parser_utils.parserUtils.childrenByName(nonlinearResource, 'StaticResource').forEach(function (staticElement) {
|
11586 | nonlinearAd.type = staticElement.getAttribute('creativeType') || 0;
|
11587 | nonlinearAd.staticResource = _parser_utils.parserUtils.parseNodeText(staticElement);
|
11588 | });
|
11589 |
|
11590 | var adParamsElement = _parser_utils.parserUtils.childByName(nonlinearResource, 'AdParameters');
|
11591 | if (adParamsElement) {
|
11592 | nonlinearAd.adParameters = _parser_utils.parserUtils.parseNodeText(adParamsElement);
|
11593 | }
|
11594 |
|
11595 | nonlinearAd.nonlinearClickThroughURLTemplate = _parser_utils.parserUtils.parseNodeText(_parser_utils.parserUtils.childByName(nonlinearResource, 'NonLinearClickThrough'));
|
11596 | _parser_utils.parserUtils.childrenByName(nonlinearResource, 'NonLinearClickTracking').forEach(function (clickTrackingElement) {
|
11597 | nonlinearAd.nonlinearClickTrackingURLTemplates.push(_parser_utils.parserUtils.parseNodeText(clickTrackingElement));
|
11598 | });
|
11599 |
|
11600 | creative.variations.push(nonlinearAd);
|
11601 | });
|
11602 |
|
11603 | return creative;
|
11604 | }
|
11605 |
|
11606 | }),
|
11607 |
|
11608 | (function(module, exports, __webpack_require__) {
|
11609 |
|
11610 | "use strict";
|
11611 |
|
11612 |
|
11613 | Object.defineProperty(exports, "__esModule", {
|
11614 | value: true
|
11615 | });
|
11616 | exports.CreativeNonLinear = undefined;
|
11617 |
|
11618 | var _creative = __webpack_require__(12);
|
11619 |
|
11620 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11621 |
|
11622 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
11623 |
|
11624 | 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; }
|
11625 |
|
11626 | var CreativeNonLinear = exports.CreativeNonLinear = function (_Creative) {
|
11627 | _inherits(CreativeNonLinear, _Creative);
|
11628 |
|
11629 | function CreativeNonLinear() {
|
11630 | var creativeAttributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11631 |
|
11632 | _classCallCheck(this, CreativeNonLinear);
|
11633 |
|
11634 | var _this = _possibleConstructorReturn(this, (CreativeNonLinear.__proto__ || Object.getPrototypeOf(CreativeNonLinear)).call(this, creativeAttributes));
|
11635 |
|
11636 | _this.type = 'nonlinear';
|
11637 | _this.variations = [];
|
11638 | return _this;
|
11639 | }
|
11640 |
|
11641 | return CreativeNonLinear;
|
11642 | }(_creative.Creative);
|
11643 |
|
11644 | }),
|
11645 |
|
11646 | (function(module, exports, __webpack_require__) {
|
11647 |
|
11648 | "use strict";
|
11649 |
|
11650 |
|
11651 | Object.defineProperty(exports, "__esModule", {
|
11652 | value: true
|
11653 | });
|
11654 | exports.urlHandler = undefined;
|
11655 |
|
11656 | var _flash_url_handler = __webpack_require__(70);
|
11657 |
|
11658 | var _mock_node_url_handler = __webpack_require__(71);
|
11659 |
|
11660 | var _xhr_url_handler = __webpack_require__(72);
|
11661 |
|
11662 | function get(url, options, cb) {
|
11663 |
|
11664 | if (!cb) {
|
11665 | if (typeof options === 'function') {
|
11666 | cb = options;
|
11667 | }
|
11668 | options = {};
|
11669 | }
|
11670 |
|
11671 | if (typeof window === 'undefined' || window === null) {
|
11672 | return _mock_node_url_handler.nodeURLHandler.get(url, options, cb);
|
11673 | } else if (_xhr_url_handler.XHRURLHandler.supported()) {
|
11674 | return _xhr_url_handler.XHRURLHandler.get(url, options, cb);
|
11675 | } else if (_flash_url_handler.flashURLHandler.supported()) {
|
11676 | return _flash_url_handler.flashURLHandler.get(url, options, cb);
|
11677 | }
|
11678 | return cb(new Error('Current context is not supported by any of the default URLHandlers. Please provide a custom URLHandler'));
|
11679 | }
|
11680 |
|
11681 | var urlHandler = exports.urlHandler = {
|
11682 | get: get
|
11683 | };
|
11684 |
|
11685 | /***/ }),
|
11686 | /* 70 */
|
11687 | /***/ (function(module, exports, __webpack_require__) {
|
11688 |
|
11689 | "use strict";
|
11690 |
|
11691 |
|
11692 | Object.defineProperty(exports, "__esModule", {
|
11693 | value: true
|
11694 | });
|
11695 | function xdr() {
|
11696 | var request = void 0;
|
11697 | if (window.XDomainRequest) {
|
11698 |
|
11699 | request = new XDomainRequest();
|
11700 | }
|
11701 | return request;
|
11702 | }
|
11703 |
|
11704 | function supported() {
|
11705 | return !!xdr();
|
11706 | }
|
11707 |
|
11708 | function get(url, options, cb) {
|
11709 | var xmlDocument = typeof window.ActiveXObject === 'function' ? new window.ActiveXObject('Microsoft.XMLDOM') : undefined;
|
11710 |
|
11711 | if (xmlDocument) {
|
11712 | xmlDocument.async = false;
|
11713 | } else {
|
11714 | return cb(new Error('FlashURLHandler: Microsoft.XMLDOM format not supported'));
|
11715 | }
|
11716 |
|
11717 | var request = xdr();
|
11718 | request.open('GET', url);
|
11719 | request.timeout = options.timeout || 0;
|
11720 | request.withCredentials = options.withCredentials || false;
|
11721 | request.send();
|
11722 | request.onprogress = function () {};
|
11723 |
|
11724 | request.onload = function () {
|
11725 | xmlDocument.loadXML(request.responseText);
|
11726 | cb(null, xmlDocument);
|
11727 | };
|
11728 | }
|
11729 |
|
11730 | var flashURLHandler = exports.flashURLHandler = {
|
11731 | get: get,
|
11732 | supported: supported
|
11733 | };
|
11734 |
|
11735 | /***/ }),
|
11736 | /* 71 */
|
11737 | /***/ (function(module, exports, __webpack_require__) {
|
11738 |
|
11739 | "use strict";
|
11740 |
|
11741 |
|
11742 | Object.defineProperty(exports, "__esModule", {
|
11743 | value: true
|
11744 | });
|
11745 |
|
11746 |
|
11747 |
|
11748 | function get(url, options, cb) {
|
11749 | cb(new Error('Please bundle the library for node to use the node urlHandler'));
|
11750 | }
|
11751 |
|
11752 | var nodeURLHandler = exports.nodeURLHandler = {
|
11753 | get: get
|
11754 | };
|
11755 |
|
11756 | /***/ }),
|
11757 | /* 72 */
|
11758 | /***/ (function(module, exports, __webpack_require__) {
|
11759 |
|
11760 | "use strict";
|
11761 |
|
11762 |
|
11763 | Object.defineProperty(exports, "__esModule", {
|
11764 | value: true
|
11765 | });
|
11766 | function xhr() {
|
11767 | try {
|
11768 | var request = new window.XMLHttpRequest();
|
11769 | if ('withCredentials' in request) {
|
11770 |
|
11771 | return request;
|
11772 | }
|
11773 | return null;
|
11774 | } catch (err) {
|
11775 | return null;
|
11776 | }
|
11777 | }
|
11778 |
|
11779 | function supported() {
|
11780 | return !!xhr();
|
11781 | }
|
11782 |
|
11783 | function get(url, options, cb) {
|
11784 | if (window.location.protocol === 'https:' && url.indexOf('http://') === 0) {
|
11785 | return cb(new Error('XHRURLHandler: Cannot go from HTTPS to HTTP.'));
|
11786 | }
|
11787 |
|
11788 | try {
|
11789 | var request = xhr();
|
11790 |
|
11791 | request.open('GET', url);
|
11792 | request.timeout = options.timeout || 0;
|
11793 | request.withCredentials = options.withCredentials || false;
|
11794 | request.overrideMimeType && request.overrideMimeType('text/xml');
|
11795 | request.onreadystatechange = function () {
|
11796 | if (request.readyState === 4) {
|
11797 | if (request.status === 200) {
|
11798 | cb(null, request.responseXML);
|
11799 | } else {
|
11800 | cb(new Error('XHRURLHandler: ' + request.statusText));
|
11801 | }
|
11802 | }
|
11803 | };
|
11804 | request.send();
|
11805 | } catch (error) {
|
11806 | cb(new Error('XHRURLHandler: Unexpected error'));
|
11807 | }
|
11808 | }
|
11809 |
|
11810 | var XHRURLHandler = exports.XHRURLHandler = {
|
11811 | get: get,
|
11812 | supported: supported
|
11813 | };
|
11814 |
|
11815 | /***/ }),
|
11816 | /* 73 */
|
11817 | /***/ (function(module, exports, __webpack_require__) {
|
11818 |
|
11819 | "use strict";
|
11820 |
|
11821 |
|
11822 | Object.defineProperty(exports, "__esModule", {
|
11823 | value: true
|
11824 | });
|
11825 |
|
11826 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11827 |
|
11828 | var VASTResponse = exports.VASTResponse = function VASTResponse() {
|
11829 | _classCallCheck(this, VASTResponse);
|
11830 |
|
11831 | this.ads = [];
|
11832 | this.errorURLTemplates = [];
|
11833 | };
|
11834 |
|
11835 | }),
|
11836 |
|
11837 | (function(module, exports, __webpack_require__) {
|
11838 |
|
11839 | "use strict";
|
11840 |
|
11841 |
|
11842 | Object.defineProperty(exports, "__esModule", {
|
11843 | value: true
|
11844 | });
|
11845 | exports.VASTClient = undefined;
|
11846 |
|
11847 | 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; }; }();
|
11848 |
|
11849 | var _storage = __webpack_require__(75);
|
11850 |
|
11851 | var _vast_parser = __webpack_require__(27);
|
11852 |
|
11853 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11854 |
|
11855 |
|
11856 |
|
11857 |
|
11858 |
|
11859 |
|
11860 |
|
11861 | var VASTClient = exports.VASTClient = function () {
|
11862 | |
11863 |
|
11864 |
|
11865 |
|
11866 |
|
11867 |
|
11868 |
|
11869 | function VASTClient(cappingFreeLunch, cappingMinimumTimeInterval, customStorage) {
|
11870 | _classCallCheck(this, VASTClient);
|
11871 |
|
11872 | this.cappingFreeLunch = cappingFreeLunch || 0;
|
11873 | this.cappingMinimumTimeInterval = cappingMinimumTimeInterval || 0;
|
11874 | this.defaultOptions = {
|
11875 | withCredentials: false,
|
11876 | timeout: 0
|
11877 | };
|
11878 | this.vastParser = new _vast_parser.VASTParser();
|
11879 | this.storage = customStorage || new _storage.Storage();
|
11880 |
|
11881 |
|
11882 | if (this.lastSuccessfulAd === undefined) {
|
11883 | this.lastSuccessfulAd = 0;
|
11884 | }
|
11885 |
|
11886 | if (this.totalCalls === undefined) {
|
11887 | this.totalCalls = 0;
|
11888 | }
|
11889 | if (this.totalCallsTimeout === undefined) {
|
11890 | this.totalCallsTimeout = 0;
|
11891 | }
|
11892 | }
|
11893 |
|
11894 | _createClass(VASTClient, [{
|
11895 | key: 'getParser',
|
11896 | value: function getParser() {
|
11897 | return this.vastParser;
|
11898 | }
|
11899 | }, {
|
11900 | key: 'hasRemainingAds',
|
11901 |
|
11902 |
|
11903 | |
11904 |
|
11905 |
|
11906 |
|
11907 | value: function hasRemainingAds() {
|
11908 | return this.vastParser.remainingAds.length > 0;
|
11909 | }
|
11910 |
|
11911 | |
11912 |
|
11913 |
|
11914 |
|
11915 |
|
11916 |
|
11917 | }, {
|
11918 | key: 'getNextAds',
|
11919 | value: function getNextAds(all) {
|
11920 | return this.vastParser.getRemainingAds(all);
|
11921 | }
|
11922 |
|
11923 | |
11924 |
|
11925 |
|
11926 |
|
11927 |
|
11928 |
|
11929 |
|
11930 |
|
11931 | }, {
|
11932 | key: 'get',
|
11933 | value: function get(url) {
|
11934 | var _this = this;
|
11935 |
|
11936 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
11937 |
|
11938 | var now = Date.now();
|
11939 | options = Object.assign(this.defaultOptions, options);
|
11940 |
|
11941 |
|
11942 | if (!options.hasOwnProperty('resolveAll')) {
|
11943 | options.resolveAll = false;
|
11944 | }
|
11945 |
|
11946 |
|
11947 |
|
11948 |
|
11949 | if (this.totalCallsTimeout < now) {
|
11950 | this.totalCalls = 1;
|
11951 | this.totalCallsTimeout = now + 60 * 60 * 1000;
|
11952 | } else {
|
11953 | this.totalCalls++;
|
11954 | }
|
11955 |
|
11956 | return new Promise(function (resolve, reject) {
|
11957 | if (_this.cappingFreeLunch >= _this.totalCalls) {
|
11958 | return reject(new Error('VAST call canceled \u2013 FreeLunch capping not reached yet ' + _this.totalCalls + '/' + _this.cappingFreeLunch));
|
11959 | }
|
11960 |
|
11961 | var timeSinceLastCall = now - _this.lastSuccessfulAd;
|
11962 |
|
11963 |
|
11964 |
|
11965 | if (timeSinceLastCall < 0) {
|
11966 | _this.lastSuccessfulAd = 0;
|
11967 | } else if (timeSinceLastCall < _this.cappingMinimumTimeInterval) {
|
11968 | return reject(new Error('VAST call canceled \u2013 (' + _this.cappingMinimumTimeInterval + ')ms minimum interval reached'));
|
11969 | }
|
11970 |
|
11971 | _this.vastParser.getAndParseVAST(url, options).then(function (response) {
|
11972 | return resolve(response);
|
11973 | }).catch(function (err) {
|
11974 | return reject(err);
|
11975 | });
|
11976 | });
|
11977 | }
|
11978 | }, {
|
11979 | key: 'lastSuccessfulAd',
|
11980 | get: function get() {
|
11981 | return this.storage.getItem('vast-client-last-successful-ad');
|
11982 | },
|
11983 | set: function set(value) {
|
11984 | this.storage.setItem('vast-client-last-successful-ad', value);
|
11985 | }
|
11986 | }, {
|
11987 | key: 'totalCalls',
|
11988 | get: function get() {
|
11989 | return this.storage.getItem('vast-client-total-calls');
|
11990 | },
|
11991 | set: function set(value) {
|
11992 | this.storage.setItem('vast-client-total-calls', value);
|
11993 | }
|
11994 | }, {
|
11995 | key: 'totalCallsTimeout',
|
11996 | get: function get() {
|
11997 | return this.storage.getItem('vast-client-total-calls-timeout');
|
11998 | },
|
11999 | set: function set(value) {
|
12000 | this.storage.setItem('vast-client-total-calls-timeout', value);
|
12001 | }
|
12002 | }]);
|
12003 |
|
12004 | return VASTClient;
|
12005 | }();
|
12006 |
|
12007 | }),
|
12008 |
|
12009 | (function(module, exports, __webpack_require__) {
|
12010 |
|
12011 | "use strict";
|
12012 |
|
12013 |
|
12014 | Object.defineProperty(exports, "__esModule", {
|
12015 | value: true
|
12016 | });
|
12017 |
|
12018 | 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; }; }();
|
12019 |
|
12020 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12021 |
|
12022 | var storage = null;
|
12023 |
|
12024 |
|
12025 |
|
12026 |
|
12027 |
|
12028 |
|
12029 | var DEFAULT_STORAGE = {
|
12030 | data: {},
|
12031 | length: 0,
|
12032 | getItem: function getItem(key) {
|
12033 | return this.data[key];
|
12034 | },
|
12035 | setItem: function setItem(key, value) {
|
12036 | this.data[key] = value;
|
12037 | this.length = Object.keys(this.data).length;
|
12038 | },
|
12039 | removeItem: function removeItem(key) {
|
12040 | delete this.data[key];
|
12041 | this.length = Object.keys(this.data).length;
|
12042 | },
|
12043 | clear: function clear() {
|
12044 | this.data = {};
|
12045 | this.length = 0;
|
12046 | }
|
12047 | };
|
12048 |
|
12049 |
|
12050 |
|
12051 |
|
12052 |
|
12053 |
|
12054 |
|
12055 |
|
12056 | var Storage = exports.Storage = function () {
|
12057 | |
12058 |
|
12059 |
|
12060 |
|
12061 | function Storage() {
|
12062 | _classCallCheck(this, Storage);
|
12063 |
|
12064 | this.storage = this.initStorage();
|
12065 | }
|
12066 |
|
12067 | |
12068 |
|
12069 |
|
12070 |
|
12071 |
|
12072 |
|
12073 | _createClass(Storage, [{
|
12074 | key: 'initStorage',
|
12075 | value: function initStorage() {
|
12076 | if (storage) {
|
12077 | return storage;
|
12078 | }
|
12079 |
|
12080 | try {
|
12081 | storage = typeof window !== 'undefined' && window !== null ? window.localStorage || window.sessionStorage : null;
|
12082 | } catch (storageError) {
|
12083 | storage = null;
|
12084 | }
|
12085 |
|
12086 | if (!storage || this.isStorageDisabled(storage)) {
|
12087 | storage = DEFAULT_STORAGE;
|
12088 | storage.clear();
|
12089 | }
|
12090 |
|
12091 | return storage;
|
12092 | }
|
12093 |
|
12094 | |
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 | }, {
|
12103 | key: 'isStorageDisabled',
|
12104 | value: function isStorageDisabled(testStorage) {
|
12105 | var testValue = '__VASTStorage__';
|
12106 |
|
12107 | try {
|
12108 | testStorage.setItem(testValue, testValue);
|
12109 | if (testStorage.getItem(testValue) !== testValue) {
|
12110 | testStorage.removeItem(testValue);
|
12111 | return true;
|
12112 | }
|
12113 | } catch (e) {
|
12114 | return true;
|
12115 | }
|
12116 |
|
12117 | testStorage.removeItem(testValue);
|
12118 | return false;
|
12119 | }
|
12120 |
|
12121 | |
12122 |
|
12123 |
|
12124 |
|
12125 |
|
12126 |
|
12127 | }, {
|
12128 | key: 'getItem',
|
12129 | value: function getItem(key) {
|
12130 | return this.storage.getItem(key);
|
12131 | }
|
12132 |
|
12133 | |
12134 |
|
12135 |
|
12136 |
|
12137 |
|
12138 |
|
12139 |
|
12140 | }, {
|
12141 | key: 'setItem',
|
12142 | value: function setItem(key, value) {
|
12143 | return this.storage.setItem(key, value);
|
12144 | }
|
12145 |
|
12146 | |
12147 |
|
12148 |
|
12149 |
|
12150 |
|
12151 |
|
12152 | }, {
|
12153 | key: 'removeItem',
|
12154 | value: function removeItem(key) {
|
12155 | return this.storage.removeItem(key);
|
12156 | }
|
12157 |
|
12158 | |
12159 |
|
12160 |
|
12161 |
|
12162 | }, {
|
12163 | key: 'clear',
|
12164 | value: function clear() {
|
12165 | return this.storage.clear();
|
12166 | }
|
12167 | }]);
|
12168 |
|
12169 | return Storage;
|
12170 | }();
|
12171 |
|
12172 | }),
|
12173 |
|
12174 | (function(module, exports, __webpack_require__) {
|
12175 |
|
12176 | "use strict";
|
12177 |
|
12178 |
|
12179 | Object.defineProperty(exports, "__esModule", {
|
12180 | value: true
|
12181 | });
|
12182 | exports.VASTTracker = undefined;
|
12183 |
|
12184 | 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; }; }();
|
12185 |
|
12186 | var _companion_ad = __webpack_require__(28);
|
12187 |
|
12188 | var _creative_linear = __webpack_require__(29);
|
12189 |
|
12190 | var _events = __webpack_require__(31);
|
12191 |
|
12192 | var _non_linear_ad = __webpack_require__(30);
|
12193 |
|
12194 | var _util = __webpack_require__(13);
|
12195 |
|
12196 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12197 |
|
12198 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
12199 |
|
12200 | 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; }
|
12201 |
|
12202 |
|
12203 |
|
12204 |
|
12205 |
|
12206 |
|
12207 | var DEFAULT_SKIP_DELAY = -1;
|
12208 |
|
12209 |
|
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 |
|
12216 |
|
12217 | var VASTTracker = exports.VASTTracker = function (_EventEmitter) {
|
12218 | _inherits(VASTTracker, _EventEmitter);
|
12219 |
|
12220 | |
12221 |
|
12222 |
|
12223 |
|
12224 |
|
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 | function VASTTracker(client, ad, creative) {
|
12230 | var variation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
12231 |
|
12232 | _classCallCheck(this, VASTTracker);
|
12233 |
|
12234 | var _this = _possibleConstructorReturn(this, (VASTTracker.__proto__ || Object.getPrototypeOf(VASTTracker)).call(this));
|
12235 |
|
12236 | _this.ad = ad;
|
12237 | _this.creative = creative;
|
12238 | _this.variation = variation;
|
12239 | _this.muted = false;
|
12240 | _this.impressed = false;
|
12241 | _this.skippable = false;
|
12242 | _this.trackingEvents = {};
|
12243 |
|
12244 | _this._alreadyTriggeredQuartiles = {};
|
12245 |
|
12246 |
|
12247 | _this.emitAlwaysEvents = ['creativeView', 'start', 'firstQuartile', 'midpoint', 'thirdQuartile', 'complete', 'resume', 'pause', 'rewind', 'skip', 'closeLinear', 'close'];
|
12248 |
|
12249 |
|
12250 | for (var eventName in _this.creative.trackingEvents) {
|
12251 | var events = _this.creative.trackingEvents[eventName];
|
12252 | _this.trackingEvents[eventName] = events.slice(0);
|
12253 | }
|
12254 |
|
12255 |
|
12256 |
|
12257 |
|
12258 | if (_this.creative instanceof _creative_linear.CreativeLinear) {
|
12259 | _this._initLinearTracking();
|
12260 | } else {
|
12261 | _this._initVariationTracking();
|
12262 | }
|
12263 |
|
12264 |
|
12265 |
|
12266 | if (client) {
|
12267 | _this.on('start', function () {
|
12268 | client.lastSuccessfulAd = Date.now();
|
12269 | });
|
12270 | }
|
12271 | return _this;
|
12272 | }
|
12273 |
|
12274 | |
12275 |
|
12276 |
|
12277 |
|
12278 |
|
12279 |
|
12280 |
|
12281 | _createClass(VASTTracker, [{
|
12282 | key: '_initLinearTracking',
|
12283 | value: function _initLinearTracking() {
|
12284 | this.linear = true;
|
12285 | this.skipDelay = this.creative.skipDelay;
|
12286 |
|
12287 | this.setDuration(this.creative.duration);
|
12288 |
|
12289 | this.clickThroughURLTemplate = this.creative.videoClickThroughURLTemplate;
|
12290 | this.clickTrackingURLTemplates = this.creative.videoClickTrackingURLTemplates;
|
12291 | }
|
12292 |
|
12293 | |
12294 |
|
12295 |
|
12296 |
|
12297 |
|
12298 |
|
12299 |
|
12300 | }, {
|
12301 | key: '_initVariationTracking',
|
12302 | value: function _initVariationTracking() {
|
12303 | this.linear = false;
|
12304 | this.skipDelay = DEFAULT_SKIP_DELAY;
|
12305 |
|
12306 |
|
12307 | if (!this.variation) {
|
12308 | return;
|
12309 | }
|
12310 |
|
12311 |
|
12312 | for (var eventName in this.variation.trackingEvents) {
|
12313 | var events = this.variation.trackingEvents[eventName];
|
12314 |
|
12315 |
|
12316 |
|
12317 | if (this.trackingEvents[eventName]) {
|
12318 | this.trackingEvents[eventName] = this.trackingEvents[eventName].concat(events.slice(0));
|
12319 | } else {
|
12320 | this.trackingEvents[eventName] = events.slice(0);
|
12321 | }
|
12322 | }
|
12323 |
|
12324 | if (this.variation instanceof _non_linear_ad.NonLinearAd) {
|
12325 | this.clickThroughURLTemplate = this.variation.nonlinearClickThroughURLTemplate;
|
12326 | this.clickTrackingURLTemplates = this.variation.nonlinearClickTrackingURLTemplates;
|
12327 | this.setDuration(this.variation.minSuggestedDuration);
|
12328 | } else if (this.variation instanceof _companion_ad.CompanionAd) {
|
12329 | this.clickThroughURLTemplate = this.variation.companionClickThroughURLTemplate;
|
12330 | this.clickTrackingURLTemplates = this.variation.companionClickTrackingURLTemplates;
|
12331 | }
|
12332 | }
|
12333 |
|
12334 | |
12335 |
|
12336 |
|
12337 |
|
12338 |
|
12339 |
|
12340 | }, {
|
12341 | key: 'setDuration',
|
12342 | value: function setDuration(duration) {
|
12343 | this.assetDuration = duration;
|
12344 |
|
12345 | this.quartiles = {
|
12346 | firstQuartile: Math.round(25 * this.assetDuration) / 100,
|
12347 | midpoint: Math.round(50 * this.assetDuration) / 100,
|
12348 | thirdQuartile: Math.round(75 * this.assetDuration) / 100
|
12349 | };
|
12350 | }
|
12351 |
|
12352 | |
12353 |
|
12354 |
|
12355 |
|
12356 |
|
12357 |
|
12358 |
|
12359 |
|
12360 |
|
12361 |
|
12362 |
|
12363 |
|
12364 |
|
12365 |
|
12366 |
|
12367 | }, {
|
12368 | key: 'setProgress',
|
12369 | value: function setProgress(progress) {
|
12370 | var _this2 = this;
|
12371 |
|
12372 | var skipDelay = this.skipDelay || DEFAULT_SKIP_DELAY;
|
12373 |
|
12374 | if (skipDelay !== -1 && !this.skippable) {
|
12375 | if (skipDelay > progress) {
|
12376 | this.emit('skip-countdown', skipDelay - progress);
|
12377 | } else {
|
12378 | this.skippable = true;
|
12379 | this.emit('skip-countdown', 0);
|
12380 | }
|
12381 | }
|
12382 |
|
12383 | if (this.assetDuration > 0) {
|
12384 | var events = [];
|
12385 |
|
12386 | if (progress > 0) {
|
12387 | var percent = Math.round(progress / this.assetDuration * 100);
|
12388 |
|
12389 | events.push('start');
|
12390 | events.push('progress-' + percent + '%');
|
12391 | events.push('progress-' + Math.round(progress));
|
12392 |
|
12393 | for (var quartile in this.quartiles) {
|
12394 | if (this.isQuartileReached(quartile, this.quartiles[quartile], progress)) {
|
12395 | events.push(quartile);
|
12396 | this._alreadyTriggeredQuartiles[quartile] = true;
|
12397 | }
|
12398 | }
|
12399 | }
|
12400 |
|
12401 | events.forEach(function (eventName) {
|
12402 | _this2.track(eventName, true);
|
12403 | });
|
12404 |
|
12405 | if (progress < this.progress) {
|
12406 | this.track('rewind');
|
12407 | }
|
12408 | }
|
12409 |
|
12410 | this.progress = progress;
|
12411 | }
|
12412 |
|
12413 | |
12414 |
|
12415 |
|
12416 |
|
12417 |
|
12418 |
|
12419 |
|
12420 |
|
12421 |
|
12422 |
|
12423 | }, {
|
12424 | key: 'isQuartileReached',
|
12425 | value: function isQuartileReached(quartile, time, progress) {
|
12426 | var quartileReached = false;
|
12427 |
|
12428 | if (time <= progress && !this._alreadyTriggeredQuartiles[quartile]) {
|
12429 | quartileReached = true;
|
12430 | }
|
12431 | return quartileReached;
|
12432 | }
|
12433 |
|
12434 | |
12435 |
|
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 |
|
12442 | }, {
|
12443 | key: 'setMuted',
|
12444 | value: function setMuted(muted) {
|
12445 | if (this.muted !== muted) {
|
12446 | this.track(muted ? 'mute' : 'unmute');
|
12447 | }
|
12448 | this.muted = muted;
|
12449 | }
|
12450 |
|
12451 | |
12452 |
|
12453 |
|
12454 |
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 | }, {
|
12460 | key: 'setPaused',
|
12461 | value: function setPaused(paused) {
|
12462 | if (this.paused !== paused) {
|
12463 | this.track(paused ? 'pause' : 'resume');
|
12464 | }
|
12465 | this.paused = paused;
|
12466 | }
|
12467 |
|
12468 | |
12469 |
|
12470 |
|
12471 |
|
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 | }, {
|
12477 | key: 'setFullscreen',
|
12478 | value: function setFullscreen(fullscreen) {
|
12479 | if (this.fullscreen !== fullscreen) {
|
12480 | this.track(fullscreen ? 'fullscreen' : 'exitFullscreen');
|
12481 | }
|
12482 | this.fullscreen = fullscreen;
|
12483 | }
|
12484 |
|
12485 | |
12486 |
|
12487 |
|
12488 |
|
12489 |
|
12490 |
|
12491 |
|
12492 |
|
12493 | }, {
|
12494 | key: 'setExpand',
|
12495 | value: function setExpand(expanded) {
|
12496 | if (this.expanded !== expanded) {
|
12497 | this.track(expanded ? 'expand' : 'collapse');
|
12498 | }
|
12499 | this.expanded = expanded;
|
12500 | }
|
12501 |
|
12502 | |
12503 |
|
12504 |
|
12505 |
|
12506 |
|
12507 |
|
12508 |
|
12509 |
|
12510 |
|
12511 | }, {
|
12512 | key: 'setSkipDelay',
|
12513 | value: function setSkipDelay(duration) {
|
12514 | if (typeof duration === 'number') {
|
12515 | this.skipDelay = duration;
|
12516 | }
|
12517 | }
|
12518 |
|
12519 | |
12520 |
|
12521 |
|
12522 |
|
12523 |
|
12524 |
|
12525 | }, {
|
12526 | key: 'trackImpression',
|
12527 | value: function trackImpression() {
|
12528 | if (!this.impressed) {
|
12529 | this.impressed = true;
|
12530 | this.trackURLs(this.ad.impressionURLTemplates);
|
12531 | this.track('creativeView');
|
12532 | }
|
12533 | }
|
12534 |
|
12535 | |
12536 |
|
12537 |
|
12538 |
|
12539 |
|
12540 |
|
12541 |
|
12542 |
|
12543 | }, {
|
12544 | key: 'errorWithCode',
|
12545 | value: function errorWithCode(errorCode) {
|
12546 | var isCustomCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
12547 |
|
12548 | this.trackURLs(this.ad.errorURLTemplates, { ERRORCODE: errorCode }, { isCustomCode: isCustomCode });
|
12549 | }
|
12550 |
|
12551 | |
12552 |
|
12553 |
|
12554 |
|
12555 |
|
12556 |
|
12557 |
|
12558 | }, {
|
12559 | key: 'complete',
|
12560 | value: function complete() {
|
12561 | this.track('complete');
|
12562 | }
|
12563 |
|
12564 | |
12565 |
|
12566 |
|
12567 |
|
12568 |
|
12569 |
|
12570 |
|
12571 |
|
12572 | }, {
|
12573 | key: 'close',
|
12574 | value: function close() {
|
12575 | this.track(this.linear ? 'closeLinear' : 'close');
|
12576 | }
|
12577 |
|
12578 | |
12579 |
|
12580 |
|
12581 |
|
12582 |
|
12583 |
|
12584 | }, {
|
12585 | key: 'skip',
|
12586 | value: function skip() {
|
12587 | this.track('skip');
|
12588 | }
|
12589 |
|
12590 | |
12591 |
|
12592 |
|
12593 |
|
12594 |
|
12595 |
|
12596 |
|
12597 |
|
12598 |
|
12599 | }, {
|
12600 | key: 'click',
|
12601 | value: function click() {
|
12602 | var fallbackClickThroughURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
12603 |
|
12604 | if (this.clickTrackingURLTemplates && this.clickTrackingURLTemplates.length) {
|
12605 | this.trackURLs(this.clickTrackingURLTemplates);
|
12606 | }
|
12607 |
|
12608 |
|
12609 | var clickThroughURLTemplate = this.clickThroughURLTemplate || fallbackClickThroughURL;
|
12610 |
|
12611 | if (clickThroughURLTemplate) {
|
12612 | var variables = this.linear ? { CONTENTPLAYHEAD: this.progressFormatted() } : {};
|
12613 | var clickThroughURL = _util.util.resolveURLTemplates([clickThroughURLTemplate], variables)[0];
|
12614 |
|
12615 | this.emit('clickthrough', clickThroughURL);
|
12616 | }
|
12617 | }
|
12618 |
|
12619 | |
12620 |
|
12621 |
|
12622 |
|
12623 |
|
12624 |
|
12625 |
|
12626 | }, {
|
12627 | key: 'track',
|
12628 | value: function track(eventName) {
|
12629 | var once = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
12630 |
|
12631 |
|
12632 |
|
12633 | if (eventName === 'closeLinear' && !this.trackingEvents[eventName] && this.trackingEvents['close']) {
|
12634 | eventName = 'close';
|
12635 | }
|
12636 |
|
12637 | var trackingURLTemplates = this.trackingEvents[eventName];
|
12638 | var isAlwaysEmitEvent = this.emitAlwaysEvents.indexOf(eventName) > -1;
|
12639 |
|
12640 | if (trackingURLTemplates) {
|
12641 | this.emit(eventName, '');
|
12642 | this.trackURLs(trackingURLTemplates);
|
12643 | } else if (isAlwaysEmitEvent) {
|
12644 | this.emit(eventName, '');
|
12645 | }
|
12646 |
|
12647 | if (once) {
|
12648 | delete this.trackingEvents[eventName];
|
12649 | if (isAlwaysEmitEvent) {
|
12650 | this.emitAlwaysEvents.splice(this.emitAlwaysEvents.indexOf(eventName), 1);
|
12651 | }
|
12652 | }
|
12653 | }
|
12654 |
|
12655 | |
12656 |
|
12657 |
|
12658 |
|
12659 |
|
12660 |
|
12661 |
|
12662 |
|
12663 | }, {
|
12664 | key: 'trackURLs',
|
12665 | value: function trackURLs(URLTemplates) {
|
12666 | var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
12667 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
12668 |
|
12669 | if (this.linear) {
|
12670 | if (this.creative && this.creative.mediaFiles && this.creative.mediaFiles[0] && this.creative.mediaFiles[0].fileURL) {
|
12671 | variables['ASSETURI'] = this.creative.mediaFiles[0].fileURL;
|
12672 | }
|
12673 | variables['CONTENTPLAYHEAD'] = this.progressFormatted();
|
12674 | }
|
12675 |
|
12676 | _util.util.track(URLTemplates, variables, options);
|
12677 | }
|
12678 |
|
12679 | |
12680 |
|
12681 |
|
12682 |
|
12683 |
|
12684 |
|
12685 | }, {
|
12686 | key: 'progressFormatted',
|
12687 | value: function progressFormatted() {
|
12688 | var seconds = parseInt(this.progress);
|
12689 | var h = seconds / (60 * 60);
|
12690 | if (h.length < 2) {
|
12691 | h = '0' + h;
|
12692 | }
|
12693 | var m = seconds / 60 % 60;
|
12694 | if (m.length < 2) {
|
12695 | m = '0' + m;
|
12696 | }
|
12697 | var s = seconds % 60;
|
12698 | if (s.length < 2) {
|
12699 | s = '0' + m;
|
12700 | }
|
12701 | var ms = parseInt((this.progress - seconds) * 100);
|
12702 | return h + ':' + m + ':' + s + '.' + ms;
|
12703 | }
|
12704 | }]);
|
12705 |
|
12706 | return VASTTracker;
|
12707 | }(_events.EventEmitter);
|
12708 |
|
12709 | }),
|
12710 |
|
12711 | (function(module, exports, __webpack_require__) {
|
12712 |
|
12713 | "use strict";
|
12714 |
|
12715 |
|
12716 | Object.defineProperty(exports, "__esModule", {
|
12717 | value: true
|
12718 | });
|
12719 |
|
12720 | var _YouTube = __webpack_require__(6);
|
12721 |
|
12722 | var _SoundCloud = __webpack_require__(8);
|
12723 |
|
12724 | var _Vimeo = __webpack_require__(9);
|
12725 |
|
12726 | var _Facebook = __webpack_require__(16);
|
12727 |
|
12728 | var _Streamable = __webpack_require__(17);
|
12729 |
|
12730 | var _FaceMask = __webpack_require__(18);
|
12731 |
|
12732 | var _Wistia = __webpack_require__(19);
|
12733 |
|
12734 | var _Twitch = __webpack_require__(20);
|
12735 |
|
12736 | var _DailyMotion = __webpack_require__(10);
|
12737 |
|
12738 | var _UstreamLive = __webpack_require__(21);
|
12739 |
|
12740 | var _UstreamVideo = __webpack_require__(22);
|
12741 |
|
12742 | var _Iframe = __webpack_require__(23);
|
12743 |
|
12744 | var _Mixcloud = __webpack_require__(24);
|
12745 |
|
12746 | var _FilePlayer = __webpack_require__(11);
|
12747 |
|
12748 | var _VAST = __webpack_require__(25);
|
12749 |
|
12750 | var _JWPlayer = __webpack_require__(32);
|
12751 |
|
12752 | var _PhenixPlayer = __webpack_require__(33);
|
12753 |
|
12754 | exports['default'] = [_PhenixPlayer.PhenixPlayer, _YouTube.YouTube, _SoundCloud.SoundCloud, _Vimeo.Vimeo, _Facebook.Facebook, _Streamable.Streamable, _FaceMask.FaceMask, _Wistia.Wistia, _Twitch.Twitch, _DailyMotion.DailyMotion, _Mixcloud.Mixcloud, _UstreamLive.UstreamLive, _UstreamVideo.UstreamVideo, _JWPlayer.JWPlayer, _VAST.VAST, _FilePlayer.FilePlayer, _Iframe.Iframe];
|
12755 |
|
12756 | }),
|
12757 |
|
12758 | (function(module, exports, __webpack_require__) {
|
12759 |
|
12760 | "use strict";
|
12761 |
|
12762 |
|
12763 | Object.defineProperty(exports, "__esModule", {
|
12764 | value: true
|
12765 | });
|
12766 |
|
12767 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
12768 |
|
12769 | 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; }; }();
|
12770 |
|
12771 | var _react = __webpack_require__(0);
|
12772 |
|
12773 | var _react2 = _interopRequireDefault(_react);
|
12774 |
|
12775 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12776 |
|
12777 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
12778 |
|
12779 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
12780 |
|
12781 | 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; }
|
12782 |
|
12783 | var ICON_SIZE = '64px';
|
12784 |
|
12785 | var Preview = function (_Component) {
|
12786 | _inherits(Preview, _Component);
|
12787 |
|
12788 | function Preview() {
|
12789 | var _ref;
|
12790 |
|
12791 | var _temp, _this, _ret;
|
12792 |
|
12793 | _classCallCheck(this, Preview);
|
12794 |
|
12795 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
12796 | args[_key] = arguments[_key];
|
12797 | }
|
12798 |
|
12799 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Preview.__proto__ || Object.getPrototypeOf(Preview)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
12800 | image: null
|
12801 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
12802 | }
|
12803 |
|
12804 | _createClass(Preview, [{
|
12805 | key: 'componentDidMount',
|
12806 | value: function componentDidMount() {
|
12807 | this.fetchImage(this.props);
|
12808 | }
|
12809 | }, {
|
12810 | key: 'componentWillReceiveProps',
|
12811 | value: function componentWillReceiveProps(nextProps) {
|
12812 | if (this.props.url !== nextProps.url) {
|
12813 | this.fetchImage(nextProps);
|
12814 | }
|
12815 | }
|
12816 | }, {
|
12817 | key: 'fetchImage',
|
12818 | value: function fetchImage(_ref2) {
|
12819 | var _this2 = this;
|
12820 |
|
12821 | var url = _ref2.url,
|
12822 | light = _ref2.light;
|
12823 |
|
12824 | if (typeof light === 'string') {
|
12825 | this.setState({ image: light });
|
12826 | return;
|
12827 | }
|
12828 | this.setState({ image: null });
|
12829 | return window.fetch('https://noembed.com/embed?url=' + url).then(function (response) {
|
12830 | return response.json();
|
12831 | }).then(function (data) {
|
12832 | if (data.thumbnail_url) {
|
12833 | var image = data.thumbnail_url.replace('height=100', 'height=480');
|
12834 | _this2.setState({ image: image });
|
12835 | }
|
12836 | });
|
12837 | }
|
12838 | }, {
|
12839 | key: 'render',
|
12840 | value: function render() {
|
12841 | var onClick = this.props.onClick;
|
12842 | var image = this.state.image;
|
12843 |
|
12844 | var flexCenter = {
|
12845 | display: 'flex',
|
12846 | alignItems: 'center',
|
12847 | justifyContent: 'center'
|
12848 | };
|
12849 | var styles = {
|
12850 | preview: _extends({
|
12851 | width: '100%',
|
12852 | height: '100%',
|
12853 | backgroundImage: image ? 'url(' + image + ')' : undefined,
|
12854 | backgroundSize: 'cover',
|
12855 | backgroundPosition: 'center',
|
12856 | cursor: 'pointer'
|
12857 | }, flexCenter),
|
12858 | shadow: _extends({
|
12859 | background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',
|
12860 | borderRadius: ICON_SIZE,
|
12861 | width: ICON_SIZE,
|
12862 | height: ICON_SIZE
|
12863 | }, flexCenter),
|
12864 | playIcon: {
|
12865 | borderStyle: 'solid',
|
12866 | borderWidth: '16px 0 16px 26px',
|
12867 | borderColor: 'transparent transparent transparent white',
|
12868 | marginLeft: '7px'
|
12869 | }
|
12870 | };
|
12871 | return _react2['default'].createElement(
|
12872 | 'div',
|
12873 | { style: styles.preview, className: 'react-player__preview', onClick: onClick },
|
12874 | _react2['default'].createElement(
|
12875 | 'div',
|
12876 | { style: styles.shadow, className: 'react-player__shadow' },
|
12877 | _react2['default'].createElement('div', { style: styles.playIcon, className: 'react-player__play-icon' })
|
12878 | )
|
12879 | );
|
12880 | }
|
12881 | }]);
|
12882 |
|
12883 | return Preview;
|
12884 | }(_react.Component);
|
12885 |
|
12886 | exports['default'] = Preview;
|
12887 |
|
12888 | }),
|
12889 |
|
12890 | (function(module, exports, __webpack_require__) {
|
12891 |
|
12892 | "use strict";
|
12893 |
|
12894 |
|
12895 | Object.defineProperty(exports, "__esModule", {
|
12896 | value: true
|
12897 | });
|
12898 | exports['default'] = renderPreloadPlayers;
|
12899 |
|
12900 | var _react = __webpack_require__(0);
|
12901 |
|
12902 | var _react2 = _interopRequireDefault(_react);
|
12903 |
|
12904 | var _Player = __webpack_require__(7);
|
12905 |
|
12906 | var _Player2 = _interopRequireDefault(_Player);
|
12907 |
|
12908 | var _YouTube = __webpack_require__(6);
|
12909 |
|
12910 | var _SoundCloud = __webpack_require__(8);
|
12911 |
|
12912 | var _Vimeo = __webpack_require__(9);
|
12913 |
|
12914 | var _DailyMotion = __webpack_require__(10);
|
12915 |
|
12916 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
12917 |
|
12918 | var PRELOAD_PLAYERS = [{
|
12919 | Player: _YouTube.YouTube,
|
12920 | configKey: 'youtube',
|
12921 | url: 'https://www.youtube.com/watch?v=GlCmAC4MHek'
|
12922 | }, {
|
12923 | Player: _SoundCloud.SoundCloud,
|
12924 | configKey: 'soundcloud',
|
12925 | url: 'https://soundcloud.com/seucheu/john-cage-433-8-bit-version'
|
12926 | }, {
|
12927 | Player: _Vimeo.Vimeo,
|
12928 | configKey: 'vimeo',
|
12929 | url: 'https://vimeo.com/300970506'
|
12930 | }, {
|
12931 | Player: _DailyMotion.DailyMotion,
|
12932 | configKey: 'dailymotion',
|
12933 | url: 'http://www.dailymotion.com/video/xqdpyk'
|
12934 | }];
|
12935 |
|
12936 | function renderPreloadPlayers(url, controls, config) {
|
12937 | var players = [];
|
12938 |
|
12939 | var _iteratorNormalCompletion = true;
|
12940 | var _didIteratorError = false;
|
12941 | var _iteratorError = undefined;
|
12942 |
|
12943 | try {
|
12944 | for (var _iterator = PRELOAD_PLAYERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
12945 | var player = _step.value;
|
12946 |
|
12947 | if (!player.Player.canPlay(url) && config[player.configKey].preload) {
|
12948 | players.push(_react2['default'].createElement(_Player2['default'], {
|
12949 | key: player.Player.displayName,
|
12950 | activePlayer: player.Player,
|
12951 | url: player.url,
|
12952 | controls: controls,
|
12953 | playing: true,
|
12954 | muted: true,
|
12955 | style: { display: 'none' }
|
12956 | }));
|
12957 | }
|
12958 | }
|
12959 | } catch (err) {
|
12960 | _didIteratorError = true;
|
12961 | _iteratorError = err;
|
12962 | } finally {
|
12963 | try {
|
12964 | if (!_iteratorNormalCompletion && _iterator['return']) {
|
12965 | _iterator['return']();
|
12966 | }
|
12967 | } finally {
|
12968 | if (_didIteratorError) {
|
12969 | throw _iteratorError;
|
12970 | }
|
12971 | }
|
12972 | }
|
12973 |
|
12974 | return players;
|
12975 | }
|
12976 |
|
12977 | })
|
12978 | ])["default"];
|
12979 |
|
\ | No newline at end of file |