Anna Kurylo
2018-10-16 99929e8c706aa7f6196ac4e02df1c04449feee7a
commit | author | age
d76f7b 1 /*
87a4ca 2 react-datetime v2.15.0
be9654 3 https://github.com/YouCanBookMe/react-datetime
SE 4 MIT: https://github.com/YouCanBookMe/react-datetime/raw/master/LICENSE
d76f7b 5 */
M 6 (function webpackUniversalModuleDefinition(root, factory) {
7     if(typeof exports === 'object' && typeof module === 'object')
be31e2 8         module.exports = factory(require("React"), require("moment"), require("ReactDOM"));
d76f7b 9     else if(typeof define === 'function' && define.amd)
be31e2 10         define(["React", "moment", "ReactDOM"], factory);
d76f7b 11     else if(typeof exports === 'object')
be31e2 12         exports["Datetime"] = factory(require("React"), require("moment"), require("ReactDOM"));
d76f7b 13     else
be31e2 14         root["Datetime"] = factory(root["React"], root["moment"], root["ReactDOM"]);
99929e 15 })(this, function(__WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_16__, __WEBPACK_EXTERNAL_MODULE_20__) {
d76f7b 16 return /******/ (function(modules) { // webpackBootstrap
M 17 /******/     // The module cache
18 /******/     var installedModules = {};
19
20 /******/     // The require function
21 /******/     function __webpack_require__(moduleId) {
22
23 /******/         // Check if module is in cache
24 /******/         if(installedModules[moduleId])
25 /******/             return installedModules[moduleId].exports;
26
27 /******/         // Create a new module (and put it into the cache)
28 /******/         var module = installedModules[moduleId] = {
29 /******/             exports: {},
30 /******/             id: moduleId,
31 /******/             loaded: false
32 /******/         };
33
34 /******/         // Execute the module function
35 /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
36
37 /******/         // Flag the module as loaded
38 /******/         module.loaded = true;
39
40 /******/         // Return the exports of the module
41 /******/         return module.exports;
42 /******/     }
43
44
45 /******/     // expose the modules object (__webpack_modules__)
46 /******/     __webpack_require__.m = modules;
47
48 /******/     // expose the module cache
49 /******/     __webpack_require__.c = installedModules;
50
51 /******/     // __webpack_public_path__
52 /******/     __webpack_require__.p = "";
53
54 /******/     // Load entry module and return exports
55 /******/     return __webpack_require__(0);
56 /******/ })
57 /************************************************************************/
58 /******/ ([
59 /* 0 */
7392ed 60 /***/ (function(module, exports, __webpack_require__) {
d76f7b 61
be9654 62     'use strict';
SE 63
64     var assign = __webpack_require__(1),
833531 65         PropTypes = __webpack_require__(2),
87a4ca 66         createClass = __webpack_require__(11),
99929e 67         moment = __webpack_require__(16),
87a4ca 68         React = __webpack_require__(12),
99929e 69         CalendarContainer = __webpack_require__(17)
8f6f33 70         ;
be9654 71
12add8 72     var viewModes = Object.freeze({
SE 73         YEARS: 'years',
74         MONTHS: 'months',
75         DAYS: 'days',
76         TIME: 'time',
77     });
78
be31e2 79     var TYPES = PropTypes;
JB 80     var Datetime = createClass({
87a4ca 81         displayName: 'DateTime',
be9654 82         propTypes: {
SE 83             // value: TYPES.object | TYPES.string,
84             // defaultValue: TYPES.object | TYPES.string,
94dde5 85             // viewDate: TYPES.object | TYPES.string,
be9654 86             onFocus: TYPES.func,
SE 87             onBlur: TYPES.func,
88             onChange: TYPES.func,
833531 89             onViewModeChange: TYPES.func,
87a4ca 90             onNavigateBack: TYPES.func,
JM 91             onNavigateForward: TYPES.func,
be9654 92             locale: TYPES.string,
SE 93             utc: TYPES.bool,
94             input: TYPES.bool,
95             // dateFormat: TYPES.string | TYPES.bool,
96             // timeFormat: TYPES.string | TYPES.bool,
97             inputProps: TYPES.object,
98             timeConstraints: TYPES.object,
12add8 99             viewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),
be9654 100             isValidDate: TYPES.func,
SE 101             open: TYPES.bool,
102             strictParsing: TYPES.bool,
103             closeOnSelect: TYPES.bool,
104             closeOnTab: TYPES.bool
105         },
106
107         getInitialState: function() {
108             var state = this.getStateFromProps( this.props );
109
110             if ( state.open === undefined )
111                 state.open = !this.props.input;
112
12add8 113             state.currentView = this.props.dateFormat ?
SE 114                 (this.props.viewMode || state.updateOn || viewModes.DAYS) : viewModes.TIME;
be9654 115
SE 116             return state;
117         },
118
94dde5 119         parseDate: function (date, formats) {
SE 120             var parsedDate;
121
122             if (date && typeof date === 'string')
123                 parsedDate = this.localMoment(date, formats.datetime);
124             else if (date)
125                 parsedDate = this.localMoment(date);
126
127             if (parsedDate && !parsedDate.isValid())
128                 parsedDate = null;
129
130             return parsedDate;
131         },
132
be9654 133         getStateFromProps: function( props ) {
SE 134             var formats = this.getFormats( props ),
135                 date = props.value || props.defaultValue,
136                 selectedDate, viewDate, updateOn, inputValue
8f6f33 137                 ;
be9654 138
94dde5 139             selectedDate = this.parseDate(date, formats);
be9654 140
94dde5 141             viewDate = this.parseDate(props.viewDate, formats);
be9654 142
SE 143             viewDate = selectedDate ?
144                 selectedDate.clone().startOf('month') :
94dde5 145                 viewDate ? viewDate.clone().startOf('month') : this.localMoment().startOf('month');
be9654 146
SE 147             updateOn = this.getUpdateOn(formats);
148
149             if ( selectedDate )
150                 inputValue = selectedDate.format(formats.datetime);
151             else if ( date.isValid && !date.isValid() )
152                 inputValue = '';
153             else
154                 inputValue = date || '';
155
156             return {
157                 updateOn: updateOn,
158                 inputFormat: formats.datetime,
159                 viewDate: viewDate,
160                 selectedDate: selectedDate,
161                 inputValue: inputValue,
162                 open: props.open
163             };
164         },
165
166         getUpdateOn: function( formats ) {
8f6f33 167             if ( formats.date.match(/[lLD]/) ) {
12add8 168                 return viewModes.DAYS;
833531 169             } else if ( formats.date.indexOf('M') !== -1 ) {
12add8 170                 return viewModes.MONTHS;
833531 171             } else if ( formats.date.indexOf('Y') !== -1 ) {
12add8 172                 return viewModes.YEARS;
be9654 173             }
SE 174
12add8 175             return viewModes.DAYS;
be9654 176         },
SE 177
178         getFormats: function( props ) {
179             var formats = {
180                     date: props.dateFormat || '',
181                     time: props.timeFormat || ''
182                 },
183                 locale = this.localMoment( props.date, null, props ).localeData()
8f6f33 184                 ;
be9654 185
SE 186             if ( formats.date === true ) {
187                 formats.date = locale.longDateFormat('L');
188             }
12add8 189             else if ( this.getUpdateOn(formats) !== viewModes.DAYS ) {
be9654 190                 formats.time = '';
SE 191             }
192
193             if ( formats.time === true ) {
194                 formats.time = locale.longDateFormat('LT');
195             }
196
197             formats.datetime = formats.date && formats.time ?
198                 formats.date + ' ' + formats.time :
199                 formats.date || formats.time
200             ;
201
202             return formats;
203         },
204
205         componentWillReceiveProps: function( nextProps ) {
206             var formats = this.getFormats( nextProps ),
207                 updatedState = {}
208             ;
209
210             if ( nextProps.value !== this.props.value ||
211                 formats.datetime !== this.getFormats( this.props ).datetime ) {
212                 updatedState = this.getStateFromProps( nextProps );
213             }
214
215             if ( updatedState.open === undefined ) {
94dde5 216                 if ( typeof nextProps.open !== 'undefined' ) {
SE 217                     updatedState.open = nextProps.open;
12add8 218                 } else if ( this.props.closeOnSelect && this.state.currentView !== viewModes.TIME ) {
a6752b 219                     updatedState.open = false;
7750ac 220                 } else {
a6752b 221                     updatedState.open = this.state.open;
SE 222                 }
be9654 223             }
SE 224
225             if ( nextProps.viewMode !== this.props.viewMode ) {
226                 updatedState.currentView = nextProps.viewMode;
227             }
228
229             if ( nextProps.locale !== this.props.locale ) {
230                 if ( this.state.viewDate ) {
231                     var updatedViewDate = this.state.viewDate.clone().locale( nextProps.locale );
232                     updatedState.viewDate = updatedViewDate;
233                 }
234                 if ( this.state.selectedDate ) {
235                     var updatedSelectedDate = this.state.selectedDate.clone().locale( nextProps.locale );
236                     updatedState.selectedDate = updatedSelectedDate;
237                     updatedState.inputValue = updatedSelectedDate.format( formats.datetime );
238                 }
239             }
240
241             if ( nextProps.utc !== this.props.utc ) {
242                 if ( nextProps.utc ) {
243                     if ( this.state.viewDate )
244                         updatedState.viewDate = this.state.viewDate.clone().utc();
245                     if ( this.state.selectedDate ) {
246                         updatedState.selectedDate = this.state.selectedDate.clone().utc();
247                         updatedState.inputValue = updatedState.selectedDate.format( formats.datetime );
248                     }
249                 } else {
250                     if ( this.state.viewDate )
251                         updatedState.viewDate = this.state.viewDate.clone().local();
252                     if ( this.state.selectedDate ) {
253                         updatedState.selectedDate = this.state.selectedDate.clone().local();
254                         updatedState.inputValue = updatedState.selectedDate.format(formats.datetime);
255                     }
256                 }
12add8 257             }
SE 258
259             if ( nextProps.viewDate !== this.props.viewDate ) {
260                 updatedState.viewDate = moment(nextProps.viewDate);
be9654 261             }
39b827 262             //we should only show a valid date if we are provided a isValidDate function. Removed in 2.10.3
LA 263             /*if (this.props.isValidDate) {
8f6f33 264                 updatedState.viewDate = updatedState.viewDate || this.state.viewDate;
LA 265                 while (!this.props.isValidDate(updatedState.viewDate)) {
266                     updatedState.viewDate = updatedState.viewDate.add(1, 'day');
267                 }
39b827 268             }*/
be9654 269             this.setState( updatedState );
SE 270         },
271
272         onInputChange: function( e ) {
273             var value = e.target === null ? e : e.target.value,
274                 localMoment = this.localMoment( value, this.state.inputFormat ),
275                 update = { inputValue: value }
8f6f33 276                 ;
be9654 277
SE 278             if ( localMoment.isValid() && !this.props.value ) {
279                 update.selectedDate = localMoment;
280                 update.viewDate = localMoment.clone().startOf('month');
833531 281             } else {
be9654 282                 update.selectedDate = null;
SE 283             }
284
285             return this.setState( update, function() {
286                 return this.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );
287             });
288         },
289
290         onInputKey: function( e ) {
291             if ( e.which === 9 && this.props.closeOnTab ) {
292                 this.closeCalendar();
293             }
294         },
295
296         showView: function( view ) {
297             var me = this;
298             return function() {
833531 299                 me.state.currentView !== view && me.props.onViewModeChange( view );
be9654 300                 me.setState({ currentView: view });
SE 301             };
302         },
303
304         setDate: function( type ) {
305             var me = this,
306                 nextViews = {
12add8 307                     month: viewModes.DAYS,
SE 308                     year: viewModes.MONTHS,
be9654 309                 }
SE 310             ;
311             return function( e ) {
312                 me.setState({
313                     viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value'), 10) ).startOf( type ),
314                     currentView: nextViews[ type ]
315                 });
833531 316                 me.props.onViewModeChange( nextViews[ type ] );
be9654 317             };
SE 318         },
319
87a4ca 320         subtractTime: function( amount, type, toSelected ) {
JM 321             var me = this;
322             return function() {
323                 me.props.onNavigateBack( amount, type );
324                 me.updateTime( 'subtract', amount, type, toSelected );
325             };
be9654 326         },
SE 327
87a4ca 328         addTime: function( amount, type, toSelected ) {
JM 329             var me = this;
330             return function() {
331                 me.props.onNavigateForward( amount, type );
332                 me.updateTime( 'add', amount, type, toSelected );
333             };
be9654 334         },
SE 335
336         updateTime: function( op, amount, type, toSelected ) {
87a4ca 337             var update = {},
JM 338                 date = toSelected ? 'selectedDate' : 'viewDate';
be9654 339
87a4ca 340             update[ date ] = this.state[ date ].clone()[ op ]( amount, type );
be9654 341
87a4ca 342             this.setState( update );
be9654 343         },
SE 344
345         allowedSetTime: ['hours', 'minutes', 'seconds', 'milliseconds'],
346         setTime: function( type, value ) {
347             var index = this.allowedSetTime.indexOf( type ) + 1,
348                 state = this.state,
349                 date = (state.selectedDate || state.viewDate).clone(),
350                 nextType
8f6f33 351                 ;
be9654 352
SE 353             // It is needed to set all the time properties
354             // to not to reset the time
355             date[ type ]( value );
356             for (; index < this.allowedSetTime.length; index++) {
357                 nextType = this.allowedSetTime[index];
358                 date[ nextType ]( date[nextType]() );
359             }
360
361             if ( !this.props.value ) {
362                 this.setState({
363                     selectedDate: date,
364                     inputValue: date.format( state.inputFormat )
365                 });
366             }
367             this.props.onChange( date );
368         },
369
370         updateSelectedDate: function( e, close ) {
371             var target = e.target,
372                 modifier = 0,
373                 viewDate = this.state.viewDate,
374                 currentDate = this.state.selectedDate || viewDate,
375                 date
8f6f33 376                 ;
be9654 377
SE 378             if (target.className.indexOf('rdtDay') !== -1) {
379                 if (target.className.indexOf('rdtNew') !== -1)
380                     modifier = 1;
381                 else if (target.className.indexOf('rdtOld') !== -1)
382                     modifier = -1;
383
384                 date = viewDate.clone()
385                     .month( viewDate.month() + modifier )
386                     .date( parseInt( target.getAttribute('data-value'), 10 ) );
387             } else if (target.className.indexOf('rdtMonth') !== -1) {
388                 date = viewDate.clone()
389                     .month( parseInt( target.getAttribute('data-value'), 10 ) )
390                     .date( currentDate.date() );
391             } else if (target.className.indexOf('rdtYear') !== -1) {
392                 date = viewDate.clone()
393                     .month( currentDate.month() )
394                     .date( currentDate.date() )
395                     .year( parseInt( target.getAttribute('data-value'), 10 ) );
396             }
397
398             date.hours( currentDate.hours() )
399                 .minutes( currentDate.minutes() )
400                 .seconds( currentDate.seconds() )
401                 .milliseconds( currentDate.milliseconds() );
402
403             if ( !this.props.value ) {
7750ac 404                 var open = !( this.props.closeOnSelect && close );
JM 405                 if ( !open ) {
406                     this.props.onBlur( date );
407                 }
408
be9654 409                 this.setState({
SE 410                     selectedDate: date,
411                     viewDate: date.clone().startOf('month'),
412                     inputValue: date.format( this.state.inputFormat ),
7750ac 413                     open: open
be9654 414                 });
SE 415             } else {
7750ac 416                 if ( this.props.closeOnSelect && close ) {
be9654 417                     this.closeCalendar();
SE 418                 }
419             }
420
421             this.props.onChange( date );
422         },
423
c1a952 424         openCalendar: function( e ) {
SE 425             if ( !this.state.open ) {
be9654 426                 this.setState({ open: true }, function() {
c1a952 427                     this.props.onFocus( e );
be9654 428                 });
SE 429             }
430         },
431
432         closeCalendar: function() {
433             this.setState({ open: false }, function () {
434                 this.props.onBlur( this.state.selectedDate || this.state.inputValue );
435             });
436         },
437
438         handleClickOutside: function() {
94dde5 439             if ( this.props.input && this.state.open && !this.props.open && !this.props.disableOnClickOutside ) {
be9654 440                 this.setState({ open: false }, function() {
SE 441                     this.props.onBlur( this.state.selectedDate || this.state.inputValue );
442                 });
443             }
444         },
445
446         localMoment: function( date, format, props ) {
447             props = props || this.props;
448             var momentFn = props.utc ? moment.utc : moment;
449             var m = momentFn( date, format, props.strictParsing );
450             if ( props.locale )
451                 m.locale( props.locale );
452             return m;
453         },
454
455         componentProps: {
456             fromProps: ['value', 'isValidDate', 'renderDay', 'renderMonth', 'renderYear', 'timeConstraints'],
457             fromState: ['viewDate', 'selectedDate', 'updateOn'],
11612b 458             fromThis: ['setDate', 'setTime', 'showView', 'addTime', 'subtractTime', 'updateSelectedDate', 'localMoment', 'handleClickOutside']
be9654 459         },
SE 460
461         getComponentProps: function() {
462             var me = this,
463                 formats = this.getFormats( this.props ),
464                 props = {dateFormat: formats.date, timeFormat: formats.time}
8f6f33 465                 ;
be9654 466
SE 467             this.componentProps.fromProps.forEach( function( name ) {
468                 props[ name ] = me.props[ name ];
469             });
470             this.componentProps.fromState.forEach( function( name ) {
471                 props[ name ] = me.state[ name ];
472             });
473             this.componentProps.fromThis.forEach( function( name ) {
474                 props[ name ] = me[ name ];
475             });
476
477             return props;
478         },
479
480         render: function() {
8f6f33 481             // TODO: Make a function or clean up this code,
LA 482             // logic right now is really hard to follow
a50b2e 483             var className = 'rdt' + (this.props.className ?
be9654 484                       ( Array.isArray( this.props.className ) ?
SE 485                       ' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''),
8f6f33 486                 children = [];
be9654 487
SE 488             if ( this.props.input ) {
c1a952 489                 var finalInputProps = assign({
be9654 490                     type: 'text',
SE 491                     className: 'form-control',
c1a952 492                     onClick: this.openCalendar,
be9654 493                     onFocus: this.openCalendar,
SE 494                     onChange: this.onInputChange,
495                     onKeyDown: this.onInputKey,
c1a952 496                     value: this.state.inputValue,
SE 497                 }, this.props.inputProps);
498                 if ( this.props.renderInput ) {
94dde5 499                     children = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar, this.closeCalendar )) ];
c1a952 500                 } else {
SE 501                     children = [ React.createElement('input', assign({ key: 'i' }, finalInputProps ))];
502                 }
be9654 503             } else {
SE 504                 className += ' rdtStatic';
505             }
506
507             if ( this.state.open )
508                 className += ' rdtOpen';
509
c1a952 510             return React.createElement( 'div', { className: className }, children.concat(
SE 511                 React.createElement( 'div',
be9654 512                     { key: 'dt', className: 'rdtPicker' },
c1a952 513                     React.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps(), onClickOutside: this.handleClickOutside })
be9654 514                 )
SE 515             ));
516         }
517     });
94dde5 518
SE 519     Datetime.defaultProps = {
520         className: '',
521         defaultValue: '',
522         inputProps: {},
523         input: true,
524         onFocus: function() {},
525         onBlur: function() {},
526         onChange: function() {},
527         onViewModeChange: function() {},
87a4ca 528         onNavigateBack: function() {},
JM 529         onNavigateForward: function() {},
94dde5 530         timeFormat: true,
SE 531         timeConstraints: {},
532         dateFormat: true,
533         strictParsing: true,
534         closeOnSelect: false,
535         closeOnTab: true,
536         utc: false
537     };
be9654 538
SE 539     // Make moment accessible through the Datetime class
540     Datetime.moment = moment;
541
542     module.exports = Datetime;
543
d76f7b 544
7392ed 545 /***/ }),
d76f7b 546 /* 1 */
7392ed 547 /***/ (function(module, exports) {
d76f7b 548
be9654 549     'use strict';
SE 550     var propIsEnumerable = Object.prototype.propertyIsEnumerable;
551
552     function ToObject(val) {
553         if (val == null) {
554             throw new TypeError('Object.assign cannot be called with null or undefined');
555         }
556
557         return Object(val);
558     }
559
560     function ownEnumerableKeys(obj) {
561         var keys = Object.getOwnPropertyNames(obj);
562
563         if (Object.getOwnPropertySymbols) {
564             keys = keys.concat(Object.getOwnPropertySymbols(obj));
565         }
566
567         return keys.filter(function (key) {
568             return propIsEnumerable.call(obj, key);
569         });
570     }
571
572     module.exports = Object.assign || function (target, source) {
573         var from;
574         var keys;
575         var to = ToObject(target);
576
577         for (var s = 1; s < arguments.length; s++) {
578             from = arguments[s];
579             keys = ownEnumerableKeys(Object(from));
580
581             for (var i = 0; i < keys.length; i++) {
582                 to[keys[i]] = from[keys[i]];
583             }
584         }
585
586         return to;
587     };
588
d76f7b 589
7392ed 590 /***/ }),
d76f7b 591 /* 2 */
7392ed 592 /***/ (function(module, exports, __webpack_require__) {
d76f7b 593
be31e2 594     /* WEBPACK VAR INJECTION */(function(process) {/**
87a4ca 595      * Copyright 2013-present, Facebook, Inc.
JM 596      * All rights reserved.
be31e2 597      *
87a4ca 598      * This source code is licensed under the BSD-style license found in the
JM 599      * LICENSE file in the root directory of this source tree. An additional grant
600      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 601      */
JB 602
603     if (process.env.NODE_ENV !== 'production') {
604       var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
605         Symbol.for &&
606         Symbol.for('react.element')) ||
607         0xeac7;
608
609       var isValidElement = function(object) {
610         return typeof object === 'object' &&
611           object !== null &&
612           object.$$typeof === REACT_ELEMENT_TYPE;
613       };
614
615       // By explicitly using `prop-types` you are opting into new development behavior.
616       // http://fb.me/prop-types-in-prod
617       var throwOnDirectAccess = true;
618       module.exports = __webpack_require__(4)(isValidElement, throwOnDirectAccess);
619     } else {
620       // By explicitly using `prop-types` you are opting into new production behavior.
621       // http://fb.me/prop-types-in-prod
87a4ca 622       module.exports = __webpack_require__(10)();
be31e2 623     }
JB 624
625     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
d76f7b 626
7392ed 627 /***/ }),
d76f7b 628 /* 3 */
7392ed 629 /***/ (function(module, exports) {
d76f7b 630
be31e2 631     // shim for using process in browser
JB 632     var process = module.exports = {};
633
634     // cached from whatever global is present so that test runners that stub it
635     // don't break things.  But we need to wrap it in a try catch in case it is
636     // wrapped in strict mode code which doesn't define any globals.  It's inside a
637     // function because try/catches deoptimize in certain engines.
638
639     var cachedSetTimeout;
640     var cachedClearTimeout;
641
642     function defaultSetTimout() {
643         throw new Error('setTimeout has not been defined');
644     }
645     function defaultClearTimeout () {
646         throw new Error('clearTimeout has not been defined');
647     }
648     (function () {
649         try {
650             if (typeof setTimeout === 'function') {
651                 cachedSetTimeout = setTimeout;
652             } else {
653                 cachedSetTimeout = defaultSetTimout;
654             }
655         } catch (e) {
656             cachedSetTimeout = defaultSetTimout;
657         }
658         try {
659             if (typeof clearTimeout === 'function') {
660                 cachedClearTimeout = clearTimeout;
661             } else {
662                 cachedClearTimeout = defaultClearTimeout;
663             }
664         } catch (e) {
665             cachedClearTimeout = defaultClearTimeout;
666         }
667     } ())
668     function runTimeout(fun) {
669         if (cachedSetTimeout === setTimeout) {
670             //normal enviroments in sane situations
671             return setTimeout(fun, 0);
672         }
673         // if setTimeout wasn't available but was latter defined
674         if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
675             cachedSetTimeout = setTimeout;
676             return setTimeout(fun, 0);
677         }
678         try {
679             // when when somebody has screwed with setTimeout but no I.E. maddness
680             return cachedSetTimeout(fun, 0);
681         } catch(e){
682             try {
683                 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
684                 return cachedSetTimeout.call(null, fun, 0);
685             } catch(e){
686                 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
687                 return cachedSetTimeout.call(this, fun, 0);
688             }
689         }
690
691
692     }
693     function runClearTimeout(marker) {
694         if (cachedClearTimeout === clearTimeout) {
695             //normal enviroments in sane situations
696             return clearTimeout(marker);
697         }
698         // if clearTimeout wasn't available but was latter defined
699         if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
700             cachedClearTimeout = clearTimeout;
701             return clearTimeout(marker);
702         }
703         try {
704             // when when somebody has screwed with setTimeout but no I.E. maddness
705             return cachedClearTimeout(marker);
706         } catch (e){
707             try {
708                 // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
709                 return cachedClearTimeout.call(null, marker);
710             } catch (e){
711                 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
712                 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
713                 return cachedClearTimeout.call(this, marker);
714             }
715         }
716
717
718
719     }
720     var queue = [];
721     var draining = false;
722     var currentQueue;
723     var queueIndex = -1;
724
725     function cleanUpNextTick() {
726         if (!draining || !currentQueue) {
727             return;
728         }
729         draining = false;
730         if (currentQueue.length) {
731             queue = currentQueue.concat(queue);
732         } else {
733             queueIndex = -1;
734         }
735         if (queue.length) {
736             drainQueue();
737         }
738     }
739
740     function drainQueue() {
741         if (draining) {
742             return;
743         }
744         var timeout = runTimeout(cleanUpNextTick);
745         draining = true;
746
747         var len = queue.length;
748         while(len) {
749             currentQueue = queue;
750             queue = [];
751             while (++queueIndex < len) {
752                 if (currentQueue) {
753                     currentQueue[queueIndex].run();
754                 }
755             }
756             queueIndex = -1;
757             len = queue.length;
758         }
759         currentQueue = null;
760         draining = false;
761         runClearTimeout(timeout);
762     }
763
764     process.nextTick = function (fun) {
765         var args = new Array(arguments.length - 1);
766         if (arguments.length > 1) {
767             for (var i = 1; i < arguments.length; i++) {
768                 args[i - 1] = arguments[i];
769             }
770         }
771         queue.push(new Item(fun, args));
772         if (queue.length === 1 && !draining) {
773             runTimeout(drainQueue);
774         }
775     };
776
777     // v8 likes predictible objects
778     function Item(fun, array) {
779         this.fun = fun;
780         this.array = array;
781     }
782     Item.prototype.run = function () {
783         this.fun.apply(null, this.array);
784     };
785     process.title = 'browser';
786     process.browser = true;
787     process.env = {};
788     process.argv = [];
789     process.version = ''; // empty string to avoid regexp issues
790     process.versions = {};
791
792     function noop() {}
793
794     process.on = noop;
795     process.addListener = noop;
796     process.once = noop;
797     process.off = noop;
798     process.removeListener = noop;
799     process.removeAllListeners = noop;
800     process.emit = noop;
a50b2e 801     process.prependListener = noop;
GL 802     process.prependOnceListener = noop;
803
804     process.listeners = function (name) { return [] }
be31e2 805
JB 806     process.binding = function (name) {
807         throw new Error('process.binding is not supported');
808     };
809
810     process.cwd = function () { return '/' };
811     process.chdir = function (dir) {
812         throw new Error('process.chdir is not supported');
813     };
814     process.umask = function() { return 0; };
815
d76f7b 816
7392ed 817 /***/ }),
d76f7b 818 /* 4 */
7392ed 819 /***/ (function(module, exports, __webpack_require__) {
7750ac 820
be31e2 821     /* WEBPACK VAR INJECTION */(function(process) {/**
87a4ca 822      * Copyright 2013-present, Facebook, Inc.
JM 823      * All rights reserved.
be31e2 824      *
87a4ca 825      * This source code is licensed under the BSD-style license found in the
JM 826      * LICENSE file in the root directory of this source tree. An additional grant
827      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 828      */
JB 829
830     'use strict';
831
832     var emptyFunction = __webpack_require__(5);
833     var invariant = __webpack_require__(6);
834     var warning = __webpack_require__(7);
835
87a4ca 836     var ReactPropTypesSecret = __webpack_require__(8);
JM 837     var checkPropTypes = __webpack_require__(9);
be31e2 838
JB 839     module.exports = function(isValidElement, throwOnDirectAccess) {
840       /* global Symbol */
841       var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
842       var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
843
844       /**
845        * Returns the iterator method function contained on the iterable object.
846        *
847        * Be sure to invoke the function with the iterable as context:
848        *
849        *     var iteratorFn = getIteratorFn(myIterable);
850        *     if (iteratorFn) {
851        *       var iterator = iteratorFn.call(myIterable);
852        *       ...
853        *     }
854        *
855        * @param {?object} maybeIterable
856        * @return {?function}
857        */
858       function getIteratorFn(maybeIterable) {
859         var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
860         if (typeof iteratorFn === 'function') {
861           return iteratorFn;
862         }
863       }
864
865       /**
866        * Collection of methods that allow declaration and validation of props that are
867        * supplied to React components. Example usage:
868        *
869        *   var Props = require('ReactPropTypes');
870        *   var MyArticle = React.createClass({
871        *     propTypes: {
872        *       // An optional string prop named "description".
873        *       description: Props.string,
874        *
875        *       // A required enum prop named "category".
876        *       category: Props.oneOf(['News','Photos']).isRequired,
877        *
878        *       // A prop named "dialog" that requires an instance of Dialog.
879        *       dialog: Props.instanceOf(Dialog).isRequired
880        *     },
881        *     render: function() { ... }
882        *   });
883        *
884        * A more formal specification of how these methods are used:
885        *
886        *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
887        *   decl := ReactPropTypes.{type}(.isRequired)?
888        *
889        * Each and every declaration produces a function with the same signature. This
890        * allows the creation of custom validation functions. For example:
891        *
892        *  var MyLink = React.createClass({
893        *    propTypes: {
894        *      // An optional string or URI prop named "href".
895        *      href: function(props, propName, componentName) {
896        *        var propValue = props[propName];
897        *        if (propValue != null && typeof propValue !== 'string' &&
898        *            !(propValue instanceof URI)) {
899        *          return new Error(
900        *            'Expected a string or an URI for ' + propName + ' in ' +
901        *            componentName
902        *          );
903        *        }
904        *      }
905        *    },
906        *    render: function() {...}
907        *  });
908        *
909        * @internal
910        */
911
912       var ANONYMOUS = '<<anonymous>>';
913
914       // Important!
915       // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
916       var ReactPropTypes = {
917         array: createPrimitiveTypeChecker('array'),
918         bool: createPrimitiveTypeChecker('boolean'),
919         func: createPrimitiveTypeChecker('function'),
920         number: createPrimitiveTypeChecker('number'),
921         object: createPrimitiveTypeChecker('object'),
922         string: createPrimitiveTypeChecker('string'),
923         symbol: createPrimitiveTypeChecker('symbol'),
924
925         any: createAnyTypeChecker(),
926         arrayOf: createArrayOfTypeChecker,
927         element: createElementTypeChecker(),
928         instanceOf: createInstanceTypeChecker,
929         node: createNodeChecker(),
930         objectOf: createObjectOfTypeChecker,
931         oneOf: createEnumTypeChecker,
932         oneOfType: createUnionTypeChecker,
87a4ca 933         shape: createShapeTypeChecker
be31e2 934       };
JB 935
936       /**
937        * inlined Object.is polyfill to avoid requiring consumers ship their own
938        * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
939        */
940       /*eslint-disable no-self-compare*/
941       function is(x, y) {
942         // SameValue algorithm
943         if (x === y) {
944           // Steps 1-5, 7-10
945           // Steps 6.b-6.e: +0 != -0
946           return x !== 0 || 1 / x === 1 / y;
947         } else {
948           // Step 6.a: NaN == NaN
949           return x !== x && y !== y;
950         }
951       }
952       /*eslint-enable no-self-compare*/
953
954       /**
955        * We use an Error-like object for backward compatibility as people may call
956        * PropTypes directly and inspect their output. However, we don't use real
957        * Errors anymore. We don't inspect their stack anyway, and creating them
958        * is prohibitively expensive if they are created too often, such as what
959        * happens in oneOfType() for any type before the one that matched.
960        */
961       function PropTypeError(message) {
962         this.message = message;
963         this.stack = '';
964       }
965       // Make `instanceof Error` still work for returned errors.
966       PropTypeError.prototype = Error.prototype;
967
968       function createChainableTypeChecker(validate) {
969         if (process.env.NODE_ENV !== 'production') {
970           var manualPropTypeCallCache = {};
7392ed 971           var manualPropTypeWarningCount = 0;
be31e2 972         }
JB 973         function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
974           componentName = componentName || ANONYMOUS;
975           propFullName = propFullName || propName;
976
977           if (secret !== ReactPropTypesSecret) {
978             if (throwOnDirectAccess) {
979               // New behavior only for users of `prop-types` package
980               invariant(
981                 false,
982                 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
983                 'Use `PropTypes.checkPropTypes()` to call them. ' +
984                 'Read more at http://fb.me/use-check-prop-types'
985               );
986             } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
987               // Old behavior for people using React.PropTypes
988               var cacheKey = componentName + ':' + propName;
7392ed 989               if (
SE 990                 !manualPropTypeCallCache[cacheKey] &&
991                 // Avoid spamming the console because they are often not actionable except for lib authors
992                 manualPropTypeWarningCount < 3
993               ) {
be31e2 994                 warning(
JB 995                   false,
996                   'You are manually calling a React.PropTypes validation ' +
997                   'function for the `%s` prop on `%s`. This is deprecated ' +
998                   'and will throw in the standalone `prop-types` package. ' +
999                   'You may be seeing this warning due to a third-party PropTypes ' +
1000                   'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
1001                   propFullName,
1002                   componentName
1003                 );
1004                 manualPropTypeCallCache[cacheKey] = true;
7392ed 1005                 manualPropTypeWarningCount++;
be31e2 1006               }
JB 1007             }
1008           }
1009           if (props[propName] == null) {
1010             if (isRequired) {
1011               if (props[propName] === null) {
1012                 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1013               }
1014               return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1015             }
1016             return null;
1017           } else {
1018             return validate(props, propName, componentName, location, propFullName);
1019           }
1020         }
1021
1022         var chainedCheckType = checkType.bind(null, false);
1023         chainedCheckType.isRequired = checkType.bind(null, true);
1024
1025         return chainedCheckType;
1026       }
1027
1028       function createPrimitiveTypeChecker(expectedType) {
1029         function validate(props, propName, componentName, location, propFullName, secret) {
1030           var propValue = props[propName];
1031           var propType = getPropType(propValue);
1032           if (propType !== expectedType) {
1033             // `propValue` being instance of, say, date/regexp, pass the 'object'
1034             // check, but we can offer a more precise error message here rather than
1035             // 'of type `object`'.
1036             var preciseType = getPreciseType(propValue);
1037
1038             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
1039           }
1040           return null;
1041         }
1042         return createChainableTypeChecker(validate);
1043       }
1044
1045       function createAnyTypeChecker() {
1046         return createChainableTypeChecker(emptyFunction.thatReturnsNull);
1047       }
1048
1049       function createArrayOfTypeChecker(typeChecker) {
1050         function validate(props, propName, componentName, location, propFullName) {
1051           if (typeof typeChecker !== 'function') {
1052             return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1053           }
1054           var propValue = props[propName];
1055           if (!Array.isArray(propValue)) {
1056             var propType = getPropType(propValue);
1057             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1058           }
1059           for (var i = 0; i < propValue.length; i++) {
1060             var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1061             if (error instanceof Error) {
1062               return error;
1063             }
1064           }
1065           return null;
1066         }
1067         return createChainableTypeChecker(validate);
1068       }
1069
1070       function createElementTypeChecker() {
1071         function validate(props, propName, componentName, location, propFullName) {
1072           var propValue = props[propName];
1073           if (!isValidElement(propValue)) {
1074             var propType = getPropType(propValue);
1075             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1076           }
1077           return null;
1078         }
1079         return createChainableTypeChecker(validate);
1080       }
1081
1082       function createInstanceTypeChecker(expectedClass) {
1083         function validate(props, propName, componentName, location, propFullName) {
1084           if (!(props[propName] instanceof expectedClass)) {
1085             var expectedClassName = expectedClass.name || ANONYMOUS;
1086             var actualClassName = getClassName(props[propName]);
1087             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1088           }
1089           return null;
1090         }
1091         return createChainableTypeChecker(validate);
1092       }
1093
1094       function createEnumTypeChecker(expectedValues) {
1095         if (!Array.isArray(expectedValues)) {
1096           process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
1097           return emptyFunction.thatReturnsNull;
1098         }
1099
1100         function validate(props, propName, componentName, location, propFullName) {
1101           var propValue = props[propName];
1102           for (var i = 0; i < expectedValues.length; i++) {
1103             if (is(propValue, expectedValues[i])) {
1104               return null;
1105             }
1106           }
1107
1108           var valuesString = JSON.stringify(expectedValues);
1109           return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1110         }
1111         return createChainableTypeChecker(validate);
1112       }
1113
1114       function createObjectOfTypeChecker(typeChecker) {
1115         function validate(props, propName, componentName, location, propFullName) {
1116           if (typeof typeChecker !== 'function') {
1117             return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1118           }
1119           var propValue = props[propName];
1120           var propType = getPropType(propValue);
1121           if (propType !== 'object') {
1122             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1123           }
1124           for (var key in propValue) {
1125             if (propValue.hasOwnProperty(key)) {
1126               var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1127               if (error instanceof Error) {
1128                 return error;
1129               }
1130             }
1131           }
1132           return null;
1133         }
1134         return createChainableTypeChecker(validate);
1135       }
1136
1137       function createUnionTypeChecker(arrayOfTypeCheckers) {
1138         if (!Array.isArray(arrayOfTypeCheckers)) {
1139           process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1140           return emptyFunction.thatReturnsNull;
1141         }
1142
a50b2e 1143         for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
GL 1144           var checker = arrayOfTypeCheckers[i];
1145           if (typeof checker !== 'function') {
1146             warning(
1147               false,
87a4ca 1148               'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
a50b2e 1149               'received %s at index %s.',
GL 1150               getPostfixForTypeWarning(checker),
1151               i
1152             );
1153             return emptyFunction.thatReturnsNull;
1154           }
1155         }
1156
be31e2 1157         function validate(props, propName, componentName, location, propFullName) {
JB 1158           for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1159             var checker = arrayOfTypeCheckers[i];
1160             if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
1161               return null;
1162             }
1163           }
1164
1165           return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1166         }
1167         return createChainableTypeChecker(validate);
1168       }
1169
1170       function createNodeChecker() {
1171         function validate(props, propName, componentName, location, propFullName) {
1172           if (!isNode(props[propName])) {
1173             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1174           }
1175           return null;
1176         }
1177         return createChainableTypeChecker(validate);
1178       }
1179
1180       function createShapeTypeChecker(shapeTypes) {
1181         function validate(props, propName, componentName, location, propFullName) {
1182           var propValue = props[propName];
1183           var propType = getPropType(propValue);
1184           if (propType !== 'object') {
1185             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1186           }
1187           for (var key in shapeTypes) {
1188             var checker = shapeTypes[key];
1189             if (!checker) {
1190               continue;
1191             }
1192             var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1193             if (error) {
1194               return error;
1195             }
1196           }
1197           return null;
1198         }
1199         return createChainableTypeChecker(validate);
1200       }
1201
1202       function isNode(propValue) {
1203         switch (typeof propValue) {
1204           case 'number':
1205           case 'string':
1206           case 'undefined':
1207             return true;
1208           case 'boolean':
1209             return !propValue;
1210           case 'object':
1211             if (Array.isArray(propValue)) {
1212               return propValue.every(isNode);
1213             }
1214             if (propValue === null || isValidElement(propValue)) {
1215               return true;
1216             }
1217
1218             var iteratorFn = getIteratorFn(propValue);
1219             if (iteratorFn) {
1220               var iterator = iteratorFn.call(propValue);
1221               var step;
1222               if (iteratorFn !== propValue.entries) {
1223                 while (!(step = iterator.next()).done) {
1224                   if (!isNode(step.value)) {
1225                     return false;
1226                   }
1227                 }
1228               } else {
1229                 // Iterator will provide entry [k,v] tuples rather than values.
1230                 while (!(step = iterator.next()).done) {
1231                   var entry = step.value;
1232                   if (entry) {
1233                     if (!isNode(entry[1])) {
1234                       return false;
1235                     }
1236                   }
1237                 }
1238               }
1239             } else {
1240               return false;
1241             }
1242
1243             return true;
1244           default:
1245             return false;
1246         }
1247       }
1248
1249       function isSymbol(propType, propValue) {
1250         // Native Symbol.
1251         if (propType === 'symbol') {
1252           return true;
1253         }
1254
1255         // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1256         if (propValue['@@toStringTag'] === 'Symbol') {
1257           return true;
1258         }
1259
1260         // Fallback for non-spec compliant Symbols which are polyfilled.
1261         if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1262           return true;
1263         }
1264
1265         return false;
1266       }
1267
1268       // Equivalent of `typeof` but with special handling for array and regexp.
1269       function getPropType(propValue) {
1270         var propType = typeof propValue;
1271         if (Array.isArray(propValue)) {
1272           return 'array';
1273         }
1274         if (propValue instanceof RegExp) {
1275           // Old webkits (at least until Android 4.0) return 'function' rather than
1276           // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1277           // passes PropTypes.object.
1278           return 'object';
1279         }
1280         if (isSymbol(propType, propValue)) {
1281           return 'symbol';
1282         }
1283         return propType;
1284       }
1285
1286       // This handles more types than `getPropType`. Only used for error messages.
1287       // See `createPrimitiveTypeChecker`.
1288       function getPreciseType(propValue) {
a50b2e 1289         if (typeof propValue === 'undefined' || propValue === null) {
GL 1290           return '' + propValue;
1291         }
be31e2 1292         var propType = getPropType(propValue);
JB 1293         if (propType === 'object') {
1294           if (propValue instanceof Date) {
1295             return 'date';
1296           } else if (propValue instanceof RegExp) {
1297             return 'regexp';
1298           }
1299         }
1300         return propType;
a50b2e 1301       }
GL 1302
1303       // Returns a string that is postfixed to a warning about an invalid type.
1304       // For example, "undefined" or "of type array"
1305       function getPostfixForTypeWarning(value) {
1306         var type = getPreciseType(value);
1307         switch (type) {
1308           case 'array':
1309           case 'object':
1310             return 'an ' + type;
1311           case 'boolean':
1312           case 'date':
1313           case 'regexp':
1314             return 'a ' + type;
1315           default:
1316             return type;
1317         }
be31e2 1318       }
JB 1319
1320       // Returns class name of the object, if any.
1321       function getClassName(propValue) {
1322         if (!propValue.constructor || !propValue.constructor.name) {
1323           return ANONYMOUS;
1324         }
1325         return propValue.constructor.name;
1326       }
1327
1328       ReactPropTypes.checkPropTypes = checkPropTypes;
1329       ReactPropTypes.PropTypes = ReactPropTypes;
1330
1331       return ReactPropTypes;
1332     };
1333
1334     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1335
7392ed 1336 /***/ }),
be31e2 1337 /* 5 */
7392ed 1338 /***/ (function(module, exports) {
be31e2 1339
JB 1340     "use strict";
1341
1342     /**
1343      * Copyright (c) 2013-present, Facebook, Inc.
87a4ca 1344      * All rights reserved.
be31e2 1345      *
87a4ca 1346      * This source code is licensed under the BSD-style license found in the
JM 1347      * LICENSE file in the root directory of this source tree. An additional grant
1348      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1349      *
JB 1350      * 
1351      */
1352
1353     function makeEmptyFunction(arg) {
1354       return function () {
1355         return arg;
1356       };
1357     }
1358
1359     /**
1360      * This function accepts and discards inputs; it has no side effects. This is
1361      * primarily useful idiomatically for overridable function endpoints which
1362      * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1363      */
1364     var emptyFunction = function emptyFunction() {};
1365
1366     emptyFunction.thatReturns = makeEmptyFunction;
1367     emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
1368     emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
1369     emptyFunction.thatReturnsNull = makeEmptyFunction(null);
1370     emptyFunction.thatReturnsThis = function () {
1371       return this;
1372     };
1373     emptyFunction.thatReturnsArgument = function (arg) {
1374       return arg;
1375     };
1376
1377     module.exports = emptyFunction;
1378
7392ed 1379 /***/ }),
be31e2 1380 /* 6 */
7392ed 1381 /***/ (function(module, exports, __webpack_require__) {
be31e2 1382
JB 1383     /* WEBPACK VAR INJECTION */(function(process) {/**
1384      * Copyright (c) 2013-present, Facebook, Inc.
87a4ca 1385      * All rights reserved.
be31e2 1386      *
87a4ca 1387      * This source code is licensed under the BSD-style license found in the
JM 1388      * LICENSE file in the root directory of this source tree. An additional grant
1389      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1390      *
JB 1391      */
1392
1393     'use strict';
1394
1395     /**
1396      * Use invariant() to assert state which your program assumes to be true.
1397      *
1398      * Provide sprintf-style format (only %s is supported) and arguments
1399      * to provide information about what broke and what you were
1400      * expecting.
1401      *
1402      * The invariant message will be stripped in production, but the invariant
1403      * will remain to ensure logic does not differ in production.
1404      */
1405
1406     var validateFormat = function validateFormat(format) {};
1407
1408     if (process.env.NODE_ENV !== 'production') {
1409       validateFormat = function validateFormat(format) {
1410         if (format === undefined) {
1411           throw new Error('invariant requires an error message argument');
1412         }
1413       };
1414     }
1415
1416     function invariant(condition, format, a, b, c, d, e, f) {
1417       validateFormat(format);
1418
1419       if (!condition) {
1420         var error;
1421         if (format === undefined) {
1422           error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
1423         } else {
1424           var args = [a, b, c, d, e, f];
1425           var argIndex = 0;
1426           error = new Error(format.replace(/%s/g, function () {
1427             return args[argIndex++];
1428           }));
1429           error.name = 'Invariant Violation';
1430         }
1431
1432         error.framesToPop = 1; // we don't care about invariant's own frame
1433         throw error;
1434       }
1435     }
1436
1437     module.exports = invariant;
1438     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1439
7392ed 1440 /***/ }),
be31e2 1441 /* 7 */
7392ed 1442 /***/ (function(module, exports, __webpack_require__) {
be31e2 1443
JB 1444     /* WEBPACK VAR INJECTION */(function(process) {/**
87a4ca 1445      * Copyright 2014-2015, Facebook, Inc.
JM 1446      * All rights reserved.
be31e2 1447      *
87a4ca 1448      * This source code is licensed under the BSD-style license found in the
JM 1449      * LICENSE file in the root directory of this source tree. An additional grant
1450      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1451      *
JB 1452      */
1453
1454     'use strict';
1455
1456     var emptyFunction = __webpack_require__(5);
1457
1458     /**
1459      * Similar to invariant but only logs a warning if the condition is not met.
1460      * This can be used to log issues in development environments in critical
1461      * paths. Removing the logging code for production environments will keep the
1462      * same logic and follow the same code paths.
1463      */
1464
1465     var warning = emptyFunction;
1466
1467     if (process.env.NODE_ENV !== 'production') {
87a4ca 1468       (function () {
JM 1469         var printWarning = function printWarning(format) {
1470           for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1471             args[_key - 1] = arguments[_key];
be31e2 1472           }
JB 1473
87a4ca 1474           var argIndex = 0;
JM 1475           var message = 'Warning: ' + format.replace(/%s/g, function () {
1476             return args[argIndex++];
1477           });
1478           if (typeof console !== 'undefined') {
1479             console.error(message);
1480           }
1481           try {
1482             // --- Welcome to debugging React ---
1483             // This error was thrown as a convenience so that you can use this stack
1484             // to find the callsite that caused this warning to fire.
1485             throw new Error(message);
1486           } catch (x) {}
1487         };
1488
1489         warning = function warning(condition, format) {
1490           if (format === undefined) {
1491             throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1492           }
1493
1494           if (format.indexOf('Failed Composite propType: ') === 0) {
1495             return; // Ignore CompositeComponent proptype check.
1496           }
1497
1498           if (!condition) {
1499             for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1500               args[_key2 - 2] = arguments[_key2];
1501             }
1502
1503             printWarning.apply(undefined, [format].concat(args));
1504           }
1505         };
1506       })();
be31e2 1507     }
JB 1508
1509     module.exports = warning;
1510     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1511
7392ed 1512 /***/ }),
be31e2 1513 /* 8 */
7392ed 1514 /***/ (function(module, exports) {
be31e2 1515
JB 1516     /**
87a4ca 1517      * Copyright 2013-present, Facebook, Inc.
JM 1518      * All rights reserved.
be31e2 1519      *
87a4ca 1520      * This source code is licensed under the BSD-style license found in the
JM 1521      * LICENSE file in the root directory of this source tree. An additional grant
1522      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1523      */
JB 1524
1525     'use strict';
1526
1527     var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1528
1529     module.exports = ReactPropTypesSecret;
1530
1531
7392ed 1532 /***/ }),
87a4ca 1533 /* 9 */
7392ed 1534 /***/ (function(module, exports, __webpack_require__) {
be31e2 1535
JB 1536     /* WEBPACK VAR INJECTION */(function(process) {/**
87a4ca 1537      * Copyright 2013-present, Facebook, Inc.
JM 1538      * All rights reserved.
be31e2 1539      *
87a4ca 1540      * This source code is licensed under the BSD-style license found in the
JM 1541      * LICENSE file in the root directory of this source tree. An additional grant
1542      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1543      */
JB 1544
1545     'use strict';
1546
1547     if (process.env.NODE_ENV !== 'production') {
1548       var invariant = __webpack_require__(6);
1549       var warning = __webpack_require__(7);
87a4ca 1550       var ReactPropTypesSecret = __webpack_require__(8);
be31e2 1551       var loggedTypeFailures = {};
JB 1552     }
1553
1554     /**
1555      * Assert that the values match with the type specs.
1556      * Error messages are memorized and will only be shown once.
1557      *
1558      * @param {object} typeSpecs Map of name to a ReactPropType
1559      * @param {object} values Runtime values that need to be type-checked
1560      * @param {string} location e.g. "prop", "context", "child context"
1561      * @param {string} componentName Name of the component for error messages.
1562      * @param {?Function} getStack Returns the component stack.
1563      * @private
1564      */
1565     function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1566       if (process.env.NODE_ENV !== 'production') {
1567         for (var typeSpecName in typeSpecs) {
1568           if (typeSpecs.hasOwnProperty(typeSpecName)) {
1569             var error;
1570             // Prop type validation may throw. In case they do, we don't want to
1571             // fail the render phase where it didn't fail before. So we log it.
1572             // After these have been cleaned up, we'll let them throw.
1573             try {
1574               // This is intentionally an invariant that gets caught. It's the same
1575               // behavior as without this statement except with a better message.
87a4ca 1576               invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
be31e2 1577               error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
JB 1578             } catch (ex) {
1579               error = ex;
1580             }
1581             warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
1582             if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1583               // Only monitor this failure once because there tends to be a lot of the
1584               // same error.
1585               loggedTypeFailures[error.message] = true;
1586
1587               var stack = getStack ? getStack() : '';
1588
1589               warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1590             }
1591           }
1592         }
1593       }
1594     }
1595
1596     module.exports = checkPropTypes;
1597
1598     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1599
7392ed 1600 /***/ }),
87a4ca 1601 /* 10 */
7392ed 1602 /***/ (function(module, exports, __webpack_require__) {
be31e2 1603
JB 1604     /**
87a4ca 1605      * Copyright 2013-present, Facebook, Inc.
JM 1606      * All rights reserved.
be31e2 1607      *
87a4ca 1608      * This source code is licensed under the BSD-style license found in the
JM 1609      * LICENSE file in the root directory of this source tree. An additional grant
1610      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1611      */
JB 1612
1613     'use strict';
1614
1615     var emptyFunction = __webpack_require__(5);
1616     var invariant = __webpack_require__(6);
87a4ca 1617     var ReactPropTypesSecret = __webpack_require__(8);
be31e2 1618
JB 1619     module.exports = function() {
a50b2e 1620       function shim(props, propName, componentName, location, propFullName, secret) {
GL 1621         if (secret === ReactPropTypesSecret) {
1622           // It is still safe when called from React.
1623           return;
1624         }
be31e2 1625         invariant(
JB 1626           false,
1627           'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1628           'Use PropTypes.checkPropTypes() to call them. ' +
1629           'Read more at http://fb.me/use-check-prop-types'
1630         );
1631       };
1632       shim.isRequired = shim;
1633       function getShim() {
1634         return shim;
1635       };
a50b2e 1636       // Important!
GL 1637       // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
be31e2 1638       var ReactPropTypes = {
JB 1639         array: shim,
1640         bool: shim,
1641         func: shim,
1642         number: shim,
1643         object: shim,
1644         string: shim,
1645         symbol: shim,
1646
1647         any: shim,
1648         arrayOf: getShim,
1649         element: shim,
1650         instanceOf: getShim,
1651         node: shim,
1652         objectOf: getShim,
1653         oneOf: getShim,
1654         oneOfType: getShim,
87a4ca 1655         shape: getShim
be31e2 1656       };
JB 1657
1658       ReactPropTypes.checkPropTypes = emptyFunction;
1659       ReactPropTypes.PropTypes = ReactPropTypes;
1660
1661       return ReactPropTypes;
1662     };
1663
1664
7392ed 1665 /***/ }),
87a4ca 1666 /* 11 */
7392ed 1667 /***/ (function(module, exports, __webpack_require__) {
be31e2 1668
JB 1669     /**
87a4ca 1670      * Copyright 2013-present, Facebook, Inc.
JM 1671      * All rights reserved.
be31e2 1672      *
87a4ca 1673      * This source code is licensed under the BSD-style license found in the
JM 1674      * LICENSE file in the root directory of this source tree. An additional grant
1675      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1676      *
JB 1677      */
1678
1679     'use strict';
1680
87a4ca 1681     var React = __webpack_require__(12);
JM 1682     var factory = __webpack_require__(13);
a50b2e 1683
GL 1684     if (typeof React === 'undefined') {
1685       throw Error(
1686         'create-react-class could not find the React object. If you are using script tags, ' +
1687           'make sure that React is being loaded before create-react-class.'
1688       );
1689     }
be31e2 1690
JB 1691     // Hack to grab NoopUpdateQueue from isomorphic React
1692     var ReactNoopUpdateQueue = new React.Component().updater;
1693
1694     module.exports = factory(
1695       React.Component,
1696       React.isValidElement,
1697       ReactNoopUpdateQueue
1698     );
1699
1700
7392ed 1701 /***/ }),
87a4ca 1702 /* 12 */
7392ed 1703 /***/ (function(module, exports) {
be31e2 1704
87a4ca 1705     module.exports = __WEBPACK_EXTERNAL_MODULE_12__;
be31e2 1706
7392ed 1707 /***/ }),
87a4ca 1708 /* 13 */
7392ed 1709 /***/ (function(module, exports, __webpack_require__) {
be31e2 1710
JB 1711     /* WEBPACK VAR INJECTION */(function(process) {/**
87a4ca 1712      * Copyright 2013-present, Facebook, Inc.
JM 1713      * All rights reserved.
be31e2 1714      *
87a4ca 1715      * This source code is licensed under the BSD-style license found in the
JM 1716      * LICENSE file in the root directory of this source tree. An additional grant
1717      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 1718      *
JB 1719      */
1720
1721     'use strict';
1722
99929e 1723     var _assign = __webpack_require__(14);
be31e2 1724
99929e 1725     var emptyObject = __webpack_require__(15);
be31e2 1726     var _invariant = __webpack_require__(6);
JB 1727
1728     if (process.env.NODE_ENV !== 'production') {
1729       var warning = __webpack_require__(7);
1730     }
1731
1732     var MIXINS_KEY = 'mixins';
1733
1734     // Helper function to allow the creation of anonymous functions which do not
1735     // have .name set to the name of the variable being assigned to.
1736     function identity(fn) {
1737       return fn;
1738     }
1739
1740     var ReactPropTypeLocationNames;
1741     if (process.env.NODE_ENV !== 'production') {
1742       ReactPropTypeLocationNames = {
1743         prop: 'prop',
1744         context: 'context',
a50b2e 1745         childContext: 'child context'
be31e2 1746       };
JB 1747     } else {
1748       ReactPropTypeLocationNames = {};
1749     }
1750
1751     function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
1752       /**
1753        * Policies that describe methods in `ReactClassInterface`.
1754        */
1755
1756       var injectedMixins = [];
1757
1758       /**
1759        * Composite components are higher-level components that compose other composite
1760        * or host components.
1761        *
1762        * To create a new type of `ReactClass`, pass a specification of
1763        * your new class to `React.createClass`. The only requirement of your class
1764        * specification is that you implement a `render` method.
1765        *
1766        *   var MyComponent = React.createClass({
1767        *     render: function() {
1768        *       return <div>Hello World</div>;
1769        *     }
1770        *   });
1771        *
1772        * The class specification supports a specific protocol of methods that have
1773        * special meaning (e.g. `render`). See `ReactClassInterface` for
1774        * more the comprehensive protocol. Any other properties and methods in the
1775        * class specification will be available on the prototype.
1776        *
1777        * @interface ReactClassInterface
1778        * @internal
1779        */
1780       var ReactClassInterface = {
1781         /**
1782          * An array of Mixin objects to include when defining your component.
1783          *
1784          * @type {array}
1785          * @optional
1786          */
1787         mixins: 'DEFINE_MANY',
1788
1789         /**
1790          * An object containing properties and methods that should be defined on
1791          * the component's constructor instead of its prototype (static methods).
1792          *
1793          * @type {object}
1794          * @optional
1795          */
1796         statics: 'DEFINE_MANY',
1797
1798         /**
1799          * Definition of prop types for this component.
1800          *
1801          * @type {object}
1802          * @optional
1803          */
1804         propTypes: 'DEFINE_MANY',
1805
1806         /**
1807          * Definition of context types for this component.
1808          *
1809          * @type {object}
1810          * @optional
1811          */
1812         contextTypes: 'DEFINE_MANY',
1813
1814         /**
1815          * Definition of context types this component sets for its children.
1816          *
1817          * @type {object}
1818          * @optional
1819          */
1820         childContextTypes: 'DEFINE_MANY',
1821
1822         // ==== Definition methods ====
1823
1824         /**
1825          * Invoked when the component is mounted. Values in the mapping will be set on
1826          * `this.props` if that prop is not specified (i.e. using an `in` check).
1827          *
1828          * This method is invoked before `getInitialState` and therefore cannot rely
1829          * on `this.state` or use `this.setState`.
1830          *
1831          * @return {object}
1832          * @optional
1833          */
1834         getDefaultProps: 'DEFINE_MANY_MERGED',
1835
1836         /**
1837          * Invoked once before the component is mounted. The return value will be used
1838          * as the initial value of `this.state`.
1839          *
1840          *   getInitialState: function() {
1841          *     return {
1842          *       isOn: false,
1843          *       fooBaz: new BazFoo()
1844          *     }
1845          *   }
1846          *
1847          * @return {object}
1848          * @optional
1849          */
1850         getInitialState: 'DEFINE_MANY_MERGED',
1851
1852         /**
1853          * @return {object}
1854          * @optional
1855          */
1856         getChildContext: 'DEFINE_MANY_MERGED',
1857
1858         /**
1859          * Uses props from `this.props` and state from `this.state` to render the
1860          * structure of the component.
1861          *
1862          * No guarantees are made about when or how often this method is invoked, so
1863          * it must not have side effects.
1864          *
1865          *   render: function() {
1866          *     var name = this.props.name;
1867          *     return <div>Hello, {name}!</div>;
1868          *   }
1869          *
1870          * @return {ReactComponent}
1871          * @required
1872          */
1873         render: 'DEFINE_ONCE',
1874
1875         // ==== Delegate methods ====
1876
1877         /**
1878          * Invoked when the component is initially created and about to be mounted.
1879          * This may have side effects, but any external subscriptions or data created
1880          * by this method must be cleaned up in `componentWillUnmount`.
1881          *
1882          * @optional
1883          */
1884         componentWillMount: 'DEFINE_MANY',
1885
1886         /**
1887          * Invoked when the component has been mounted and has a DOM representation.
1888          * However, there is no guarantee that the DOM node is in the document.
1889          *
1890          * Use this as an opportunity to operate on the DOM when the component has
1891          * been mounted (initialized and rendered) for the first time.
1892          *
1893          * @param {DOMElement} rootNode DOM element representing the component.
1894          * @optional
1895          */
1896         componentDidMount: 'DEFINE_MANY',
1897
1898         /**
1899          * Invoked before the component receives new props.
1900          *
1901          * Use this as an opportunity to react to a prop transition by updating the
1902          * state using `this.setState`. Current props are accessed via `this.props`.
1903          *
1904          *   componentWillReceiveProps: function(nextProps, nextContext) {
1905          *     this.setState({
1906          *       likesIncreasing: nextProps.likeCount > this.props.likeCount
1907          *     });
1908          *   }
1909          *
1910          * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
1911          * transition may cause a state change, but the opposite is not true. If you
1912          * need it, you are probably looking for `componentWillUpdate`.
1913          *
1914          * @param {object} nextProps
1915          * @optional
1916          */
1917         componentWillReceiveProps: 'DEFINE_MANY',
1918
1919         /**
1920          * Invoked while deciding if the component should be updated as a result of
1921          * receiving new props, state and/or context.
1922          *
1923          * Use this as an opportunity to `return false` when you're certain that the
1924          * transition to the new props/state/context will not require a component
1925          * update.
1926          *
1927          *   shouldComponentUpdate: function(nextProps, nextState, nextContext) {
1928          *     return !equal(nextProps, this.props) ||
1929          *       !equal(nextState, this.state) ||
1930          *       !equal(nextContext, this.context);
1931          *   }
1932          *
1933          * @param {object} nextProps
1934          * @param {?object} nextState
1935          * @param {?object} nextContext
1936          * @return {boolean} True if the component should update.
1937          * @optional
1938          */
1939         shouldComponentUpdate: 'DEFINE_ONCE',
1940
1941         /**
1942          * Invoked when the component is about to update due to a transition from
1943          * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
1944          * and `nextContext`.
1945          *
1946          * Use this as an opportunity to perform preparation before an update occurs.
1947          *
1948          * NOTE: You **cannot** use `this.setState()` in this method.
1949          *
1950          * @param {object} nextProps
1951          * @param {?object} nextState
1952          * @param {?object} nextContext
1953          * @param {ReactReconcileTransaction} transaction
1954          * @optional
1955          */
1956         componentWillUpdate: 'DEFINE_MANY',
1957
1958         /**
1959          * Invoked when the component's DOM representation has been updated.
1960          *
1961          * Use this as an opportunity to operate on the DOM when the component has
1962          * been updated.
1963          *
1964          * @param {object} prevProps
1965          * @param {?object} prevState
1966          * @param {?object} prevContext
1967          * @param {DOMElement} rootNode DOM element representing the component.
1968          * @optional
1969          */
1970         componentDidUpdate: 'DEFINE_MANY',
1971
1972         /**
1973          * Invoked when the component is about to be removed from its parent and have
1974          * its DOM representation destroyed.
1975          *
1976          * Use this as an opportunity to deallocate any external resources.
1977          *
1978          * NOTE: There is no `componentDidUnmount` since your component will have been
1979          * destroyed by that point.
1980          *
1981          * @optional
1982          */
1983         componentWillUnmount: 'DEFINE_MANY',
1984
1985         // ==== Advanced methods ====
1986
1987         /**
1988          * Updates the component's currently mounted DOM representation.
1989          *
1990          * By default, this implements React's rendering and reconciliation algorithm.
1991          * Sophisticated clients may wish to override this.
1992          *
1993          * @param {ReactReconcileTransaction} transaction
1994          * @internal
1995          * @overridable
1996          */
1997         updateComponent: 'OVERRIDE_BASE'
1998       };
1999
2000       /**
2001        * Mapping from class specification keys to special processing functions.
2002        *
2003        * Although these are declared like instance properties in the specification
2004        * when defining classes using `React.createClass`, they are actually static
2005        * and are accessible on the constructor instead of the prototype. Despite
2006        * being static, they must be defined outside of the "statics" key under
2007        * which all other static methods are defined.
2008        */
2009       var RESERVED_SPEC_KEYS = {
a50b2e 2010         displayName: function(Constructor, displayName) {
be31e2 2011           Constructor.displayName = displayName;
JB 2012         },
a50b2e 2013         mixins: function(Constructor, mixins) {
be31e2 2014           if (mixins) {
JB 2015             for (var i = 0; i < mixins.length; i++) {
2016               mixSpecIntoComponent(Constructor, mixins[i]);
2017             }
2018           }
2019         },
a50b2e 2020         childContextTypes: function(Constructor, childContextTypes) {
be31e2 2021           if (process.env.NODE_ENV !== 'production') {
JB 2022             validateTypeDef(Constructor, childContextTypes, 'childContext');
2023           }
a50b2e 2024           Constructor.childContextTypes = _assign(
GL 2025             {},
2026             Constructor.childContextTypes,
2027             childContextTypes
2028           );
be31e2 2029         },
a50b2e 2030         contextTypes: function(Constructor, contextTypes) {
be31e2 2031           if (process.env.NODE_ENV !== 'production') {
JB 2032             validateTypeDef(Constructor, contextTypes, 'context');
2033           }
a50b2e 2034           Constructor.contextTypes = _assign(
GL 2035             {},
2036             Constructor.contextTypes,
2037             contextTypes
2038           );
be31e2 2039         },
JB 2040         /**
2041          * Special case getDefaultProps which should move into statics but requires
2042          * automatic merging.
2043          */
a50b2e 2044         getDefaultProps: function(Constructor, getDefaultProps) {
be31e2 2045           if (Constructor.getDefaultProps) {
a50b2e 2046             Constructor.getDefaultProps = createMergedResultFunction(
GL 2047               Constructor.getDefaultProps,
2048               getDefaultProps
2049             );
be31e2 2050           } else {
JB 2051             Constructor.getDefaultProps = getDefaultProps;
2052           }
2053         },
a50b2e 2054         propTypes: function(Constructor, propTypes) {
be31e2 2055           if (process.env.NODE_ENV !== 'production') {
JB 2056             validateTypeDef(Constructor, propTypes, 'prop');
2057           }
2058           Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
2059         },
a50b2e 2060         statics: function(Constructor, statics) {
be31e2 2061           mixStaticSpecIntoComponent(Constructor, statics);
JB 2062         },
a50b2e 2063         autobind: function() {}
GL 2064       };
be31e2 2065
JB 2066       function validateTypeDef(Constructor, typeDef, location) {
2067         for (var propName in typeDef) {
2068           if (typeDef.hasOwnProperty(propName)) {
2069             // use a warning instead of an _invariant so components
2070             // don't show up in prod but only in __DEV__
a50b2e 2071             if (process.env.NODE_ENV !== 'production') {
GL 2072               warning(
2073                 typeof typeDef[propName] === 'function',
2074                 '%s: %s type `%s` is invalid; it must be a function, usually from ' +
2075                   'React.PropTypes.',
2076                 Constructor.displayName || 'ReactClass',
2077                 ReactPropTypeLocationNames[location],
2078                 propName
2079               );
2080             }
be31e2 2081           }
JB 2082         }
2083       }
2084
2085       function validateMethodOverride(isAlreadyDefined, name) {
a50b2e 2086         var specPolicy = ReactClassInterface.hasOwnProperty(name)
GL 2087           ? ReactClassInterface[name]
2088           : null;
be31e2 2089
JB 2090         // Disallow overriding of base class methods unless explicitly allowed.
2091         if (ReactClassMixin.hasOwnProperty(name)) {
a50b2e 2092           _invariant(
GL 2093             specPolicy === 'OVERRIDE_BASE',
2094             'ReactClassInterface: You are attempting to override ' +
2095               '`%s` from your class specification. Ensure that your method names ' +
2096               'do not overlap with React methods.',
2097             name
2098           );
be31e2 2099         }
JB 2100
2101         // Disallow defining methods more than once unless explicitly allowed.
2102         if (isAlreadyDefined) {
a50b2e 2103           _invariant(
GL 2104             specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
2105             'ReactClassInterface: You are attempting to define ' +
2106               '`%s` on your component more than once. This conflict may be due ' +
2107               'to a mixin.',
2108             name
2109           );
be31e2 2110         }
JB 2111       }
2112
2113       /**
2114        * Mixin helper which handles policy validation and reserved
2115        * specification keys when building React classes.
2116        */
2117       function mixSpecIntoComponent(Constructor, spec) {
2118         if (!spec) {
2119           if (process.env.NODE_ENV !== 'production') {
2120             var typeofSpec = typeof spec;
2121             var isMixinValid = typeofSpec === 'object' && spec !== null;
2122
a50b2e 2123             if (process.env.NODE_ENV !== 'production') {
GL 2124               warning(
2125                 isMixinValid,
2126                 "%s: You're attempting to include a mixin that is either null " +
2127                   'or not an object. Check the mixins included by the component, ' +
2128                   'as well as any mixins they include themselves. ' +
2129                   'Expected object but got %s.',
2130                 Constructor.displayName || 'ReactClass',
2131                 spec === null ? null : typeofSpec
2132               );
2133             }
be31e2 2134           }
JB 2135
2136           return;
2137         }
2138
a50b2e 2139         _invariant(
GL 2140           typeof spec !== 'function',
2141           "ReactClass: You're attempting to " +
2142             'use a component class or function as a mixin. Instead, just use a ' +
2143             'regular object.'
2144         );
2145         _invariant(
2146           !isValidElement(spec),
2147           "ReactClass: You're attempting to " +
2148             'use a component as a mixin. Instead, just use a regular object.'
2149         );
be31e2 2150
JB 2151         var proto = Constructor.prototype;
2152         var autoBindPairs = proto.__reactAutoBindPairs;
2153
2154         // By handling mixins before any other properties, we ensure the same
2155         // chaining order is applied to methods with DEFINE_MANY policy, whether
2156         // mixins are listed before or after these methods in the spec.
2157         if (spec.hasOwnProperty(MIXINS_KEY)) {
2158           RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
2159         }
2160
2161         for (var name in spec) {
2162           if (!spec.hasOwnProperty(name)) {
2163             continue;
2164           }
2165
2166           if (name === MIXINS_KEY) {
2167             // We have already handled mixins in a special case above.
2168             continue;
2169           }
2170
2171           var property = spec[name];
2172           var isAlreadyDefined = proto.hasOwnProperty(name);
2173           validateMethodOverride(isAlreadyDefined, name);
2174
2175           if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
2176             RESERVED_SPEC_KEYS[name](Constructor, property);
2177           } else {
2178             // Setup methods on prototype:
2179             // The following member methods should not be automatically bound:
2180             // 1. Expected ReactClass methods (in the "interface").
2181             // 2. Overridden methods (that were mixed in).
2182             var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
2183             var isFunction = typeof property === 'function';
a50b2e 2184             var shouldAutoBind =
GL 2185               isFunction &&
2186               !isReactClassMethod &&
2187               !isAlreadyDefined &&
2188               spec.autobind !== false;
be31e2 2189
JB 2190             if (shouldAutoBind) {
2191               autoBindPairs.push(name, property);
2192               proto[name] = property;
2193             } else {
2194               if (isAlreadyDefined) {
2195                 var specPolicy = ReactClassInterface[name];
2196
2197                 // These cases should already be caught by validateMethodOverride.
a50b2e 2198                 _invariant(
GL 2199                   isReactClassMethod &&
2200                     (specPolicy === 'DEFINE_MANY_MERGED' ||
2201                       specPolicy === 'DEFINE_MANY'),
2202                   'ReactClass: Unexpected spec policy %s for key %s ' +
2203                     'when mixing in component specs.',
2204                   specPolicy,
2205                   name
2206                 );
be31e2 2207
JB 2208                 // For methods which are defined more than once, call the existing
2209                 // methods before calling the new property, merging if appropriate.
2210                 if (specPolicy === 'DEFINE_MANY_MERGED') {
2211                   proto[name] = createMergedResultFunction(proto[name], property);
2212                 } else if (specPolicy === 'DEFINE_MANY') {
2213                   proto[name] = createChainedFunction(proto[name], property);
2214                 }
2215               } else {
2216                 proto[name] = property;
2217                 if (process.env.NODE_ENV !== 'production') {
2218                   // Add verbose displayName to the function, which helps when looking
2219                   // at profiling tools.
2220                   if (typeof property === 'function' && spec.displayName) {
2221                     proto[name].displayName = spec.displayName + '_' + name;
2222                   }
2223                 }
2224               }
2225             }
2226           }
2227         }
2228       }
2229
2230       function mixStaticSpecIntoComponent(Constructor, statics) {
2231         if (!statics) {
2232           return;
2233         }
2234         for (var name in statics) {
2235           var property = statics[name];
2236           if (!statics.hasOwnProperty(name)) {
2237             continue;
2238           }
2239
2240           var isReserved = name in RESERVED_SPEC_KEYS;
a50b2e 2241           _invariant(
GL 2242             !isReserved,
2243             'ReactClass: You are attempting to define a reserved ' +
2244               'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
2245               'as an instance property instead; it will still be accessible on the ' +
2246               'constructor.',
2247             name
2248           );
be31e2 2249
87a4ca 2250           var isInherited = name in Constructor;
JM 2251           _invariant(
2252             !isInherited,
2253             'ReactClass: You are attempting to define ' +
2254               '`%s` on your component more than once. This conflict may be ' +
2255               'due to a mixin.',
2256             name
2257           );
be31e2 2258           Constructor[name] = property;
JB 2259         }
2260       }
2261
2262       /**
2263        * Merge two objects, but throw if both contain the same key.
2264        *
2265        * @param {object} one The first object, which is mutated.
2266        * @param {object} two The second object
2267        * @return {object} one after it has been mutated to contain everything in two.
2268        */
2269       function mergeIntoWithNoDuplicateKeys(one, two) {
a50b2e 2270         _invariant(
GL 2271           one && two && typeof one === 'object' && typeof two === 'object',
2272           'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
2273         );
be31e2 2274
JB 2275         for (var key in two) {
2276           if (two.hasOwnProperty(key)) {
a50b2e 2277             _invariant(
GL 2278               one[key] === undefined,
2279               'mergeIntoWithNoDuplicateKeys(): ' +
2280                 'Tried to merge two objects with the same key: `%s`. This conflict ' +
2281                 'may be due to a mixin; in particular, this may be caused by two ' +
2282                 'getInitialState() or getDefaultProps() methods returning objects ' +
2283                 'with clashing keys.',
2284               key
2285             );
be31e2 2286             one[key] = two[key];
JB 2287           }
2288         }
2289         return one;
2290       }
2291
2292       /**
2293        * Creates a function that invokes two functions and merges their return values.
2294        *
2295        * @param {function} one Function to invoke first.
2296        * @param {function} two Function to invoke second.
2297        * @return {function} Function that invokes the two argument functions.
2298        * @private
2299        */
2300       function createMergedResultFunction(one, two) {
2301         return function mergedResult() {
2302           var a = one.apply(this, arguments);
2303           var b = two.apply(this, arguments);
2304           if (a == null) {
2305             return b;
2306           } else if (b == null) {
2307             return a;
2308           }
2309           var c = {};
2310           mergeIntoWithNoDuplicateKeys(c, a);
2311           mergeIntoWithNoDuplicateKeys(c, b);
2312           return c;
2313         };
2314       }
2315
2316       /**
2317        * Creates a function that invokes two functions and ignores their return vales.
2318        *
2319        * @param {function} one Function to invoke first.
2320        * @param {function} two Function to invoke second.
2321        * @return {function} Function that invokes the two argument functions.
2322        * @private
2323        */
2324       function createChainedFunction(one, two) {
2325         return function chainedFunction() {
2326           one.apply(this, arguments);
2327           two.apply(this, arguments);
2328         };
2329       }
2330
2331       /**
2332        * Binds a method to the component.
2333        *
2334        * @param {object} component Component whose method is going to be bound.
2335        * @param {function} method Method to be bound.
2336        * @return {function} The bound method.
2337        */
2338       function bindAutoBindMethod(component, method) {
2339         var boundMethod = method.bind(component);
2340         if (process.env.NODE_ENV !== 'production') {
2341           boundMethod.__reactBoundContext = component;
2342           boundMethod.__reactBoundMethod = method;
2343           boundMethod.__reactBoundArguments = null;
2344           var componentName = component.constructor.displayName;
2345           var _bind = boundMethod.bind;
a50b2e 2346           boundMethod.bind = function(newThis) {
GL 2347             for (
2348               var _len = arguments.length,
2349                 args = Array(_len > 1 ? _len - 1 : 0),
2350                 _key = 1;
2351               _key < _len;
2352               _key++
2353             ) {
be31e2 2354               args[_key - 1] = arguments[_key];
JB 2355             }
2356
2357             // User is trying to bind() an autobound method; we effectively will
2358             // ignore the value of "this" that the user is trying to use, so
2359             // let's warn.
2360             if (newThis !== component && newThis !== null) {
a50b2e 2361               if (process.env.NODE_ENV !== 'production') {
GL 2362                 warning(
2363                   false,
2364                   'bind(): React component methods may only be bound to the ' +
2365                     'component instance. See %s',
2366                   componentName
2367                 );
2368               }
be31e2 2369             } else if (!args.length) {
a50b2e 2370               if (process.env.NODE_ENV !== 'production') {
GL 2371                 warning(
2372                   false,
2373                   'bind(): You are binding a component method to the component. ' +
2374                     'React does this for you automatically in a high-performance ' +
2375                     'way, so you can safely remove this call. See %s',
2376                   componentName
2377                 );
2378               }
be31e2 2379               return boundMethod;
JB 2380             }
2381             var reboundMethod = _bind.apply(boundMethod, arguments);
2382             reboundMethod.__reactBoundContext = component;
2383             reboundMethod.__reactBoundMethod = method;
2384             reboundMethod.__reactBoundArguments = args;
2385             return reboundMethod;
2386           };
2387         }
2388         return boundMethod;
2389       }
2390
2391       /**
2392        * Binds all auto-bound methods in a component.
2393        *
2394        * @param {object} component Component whose method is going to be bound.
2395        */
2396       function bindAutoBindMethods(component) {
2397         var pairs = component.__reactAutoBindPairs;
2398         for (var i = 0; i < pairs.length; i += 2) {
2399           var autoBindKey = pairs[i];
2400           var method = pairs[i + 1];
2401           component[autoBindKey] = bindAutoBindMethod(component, method);
2402         }
2403       }
2404
a50b2e 2405       var IsMountedPreMixin = {
GL 2406         componentDidMount: function() {
be31e2 2407           this.__isMounted = true;
a50b2e 2408         }
GL 2409       };
2410
2411       var IsMountedPostMixin = {
2412         componentWillUnmount: function() {
be31e2 2413           this.__isMounted = false;
JB 2414         }
2415       };
2416
2417       /**
2418        * Add more to the ReactClass base class. These are all legacy features and
2419        * therefore not already part of the modern ReactComponent.
2420        */
2421       var ReactClassMixin = {
2422         /**
2423          * TODO: This will be deprecated because state should always keep a consistent
2424          * type signature and the only use case for this, is to avoid that.
2425          */
a50b2e 2426         replaceState: function(newState, callback) {
be31e2 2427           this.updater.enqueueReplaceState(this, newState, callback);
JB 2428         },
2429
2430         /**
2431          * Checks whether or not this composite component is mounted.
2432          * @return {boolean} True if mounted, false otherwise.
2433          * @protected
2434          * @final
2435          */
a50b2e 2436         isMounted: function() {
be31e2 2437           if (process.env.NODE_ENV !== 'production') {
a50b2e 2438             warning(
GL 2439               this.__didWarnIsMounted,
2440               '%s: isMounted is deprecated. Instead, make sure to clean up ' +
2441                 'subscriptions and pending requests in componentWillUnmount to ' +
2442                 'prevent memory leaks.',
2443               (this.constructor && this.constructor.displayName) ||
2444                 this.name ||
2445                 'Component'
2446             );
be31e2 2447             this.__didWarnIsMounted = true;
JB 2448           }
2449           return !!this.__isMounted;
2450         }
2451       };
2452
a50b2e 2453       var ReactClassComponent = function() {};
GL 2454       _assign(
2455         ReactClassComponent.prototype,
2456         ReactComponent.prototype,
2457         ReactClassMixin
2458       );
be31e2 2459
JB 2460       /**
2461        * Creates a composite component class given a class specification.
2462        * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
2463        *
2464        * @param {object} spec Class specification (which must define `render`).
2465        * @return {function} Component constructor function.
2466        * @public
2467        */
2468       function createClass(spec) {
2469         // To keep our warnings more understandable, we'll use a little hack here to
2470         // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
2471         // unnecessarily identify a class without displayName as 'Constructor'.
a50b2e 2472         var Constructor = identity(function(props, context, updater) {
be31e2 2473           // This constructor gets overridden by mocks. The argument is used
JB 2474           // by mocks to assert on what gets mounted.
2475
2476           if (process.env.NODE_ENV !== 'production') {
a50b2e 2477             warning(
GL 2478               this instanceof Constructor,
2479               'Something is calling a React component directly. Use a factory or ' +
2480                 'JSX instead. See: https://fb.me/react-legacyfactory'
2481             );
be31e2 2482           }
JB 2483
2484           // Wire up auto-binding
2485           if (this.__reactAutoBindPairs.length) {
2486             bindAutoBindMethods(this);
2487           }
2488
2489           this.props = props;
2490           this.context = context;
2491           this.refs = emptyObject;
2492           this.updater = updater || ReactNoopUpdateQueue;
2493
2494           this.state = null;
2495
2496           // ReactClasses doesn't have constructors. Instead, they use the
2497           // getInitialState and componentWillMount methods for initialization.
2498
2499           var initialState = this.getInitialState ? this.getInitialState() : null;
2500           if (process.env.NODE_ENV !== 'production') {
2501             // We allow auto-mocks to proceed as if they're returning null.
a50b2e 2502             if (
GL 2503               initialState === undefined &&
2504               this.getInitialState._isMockFunction
2505             ) {
be31e2 2506               // This is probably bad practice. Consider warning here and
JB 2507               // deprecating this convenience.
2508               initialState = null;
2509             }
2510           }
a50b2e 2511           _invariant(
GL 2512             typeof initialState === 'object' && !Array.isArray(initialState),
2513             '%s.getInitialState(): must return an object or null',
2514             Constructor.displayName || 'ReactCompositeComponent'
2515           );
be31e2 2516
JB 2517           this.state = initialState;
2518         });
2519         Constructor.prototype = new ReactClassComponent();
2520         Constructor.prototype.constructor = Constructor;
2521         Constructor.prototype.__reactAutoBindPairs = [];
2522
2523         injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
2524
a50b2e 2525         mixSpecIntoComponent(Constructor, IsMountedPreMixin);
be31e2 2526         mixSpecIntoComponent(Constructor, spec);
a50b2e 2527         mixSpecIntoComponent(Constructor, IsMountedPostMixin);
be31e2 2528
JB 2529         // Initialize the defaultProps property after all mixins have been merged.
2530         if (Constructor.getDefaultProps) {
2531           Constructor.defaultProps = Constructor.getDefaultProps();
2532         }
2533
2534         if (process.env.NODE_ENV !== 'production') {
2535           // This is a tag to indicate that the use of these method names is ok,
2536           // since it's used with createClass. If it's not, then it's likely a
2537           // mistake so we'll warn you to use the static property, property
2538           // initializer or constructor respectively.
2539           if (Constructor.getDefaultProps) {
2540             Constructor.getDefaultProps.isReactClassApproved = {};
2541           }
2542           if (Constructor.prototype.getInitialState) {
2543             Constructor.prototype.getInitialState.isReactClassApproved = {};
2544           }
2545         }
2546
a50b2e 2547         _invariant(
GL 2548           Constructor.prototype.render,
2549           'createClass(...): Class specification must implement a `render` method.'
2550         );
be31e2 2551
JB 2552         if (process.env.NODE_ENV !== 'production') {
a50b2e 2553           warning(
GL 2554             !Constructor.prototype.componentShouldUpdate,
2555             '%s has a method called ' +
2556               'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
2557               'The name is phrased as a question because the function is ' +
2558               'expected to return a value.',
2559             spec.displayName || 'A component'
2560           );
2561           warning(
2562             !Constructor.prototype.componentWillRecieveProps,
2563             '%s has a method called ' +
2564               'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
2565             spec.displayName || 'A component'
2566           );
be31e2 2567         }
JB 2568
2569         // Reduce time spent doing lookups by setting these on the prototype.
2570         for (var methodName in ReactClassInterface) {
2571           if (!Constructor.prototype[methodName]) {
2572             Constructor.prototype[methodName] = null;
2573           }
2574         }
2575
2576         return Constructor;
2577       }
2578
2579       return createClass;
2580     }
2581
2582     module.exports = factory;
2583
2584     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
2585
7392ed 2586 /***/ }),
87a4ca 2587 /* 14 */
99929e 2588 /***/ (function(module, exports) {
AK 2589
2590     /*
2591     object-assign
2592     (c) Sindre Sorhus
2593     @license MIT
2594     */
2595
2596     'use strict';
2597     /* eslint-disable no-unused-vars */
2598     var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2599     var hasOwnProperty = Object.prototype.hasOwnProperty;
2600     var propIsEnumerable = Object.prototype.propertyIsEnumerable;
2601
2602     function toObject(val) {
2603         if (val === null || val === undefined) {
2604             throw new TypeError('Object.assign cannot be called with null or undefined');
2605         }
2606
2607         return Object(val);
2608     }
2609
2610     function shouldUseNative() {
2611         try {
2612             if (!Object.assign) {
2613                 return false;
2614             }
2615
2616             // Detect buggy property enumeration order in older V8 versions.
2617
2618             // https://bugs.chromium.org/p/v8/issues/detail?id=4118
2619             var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
2620             test1[5] = 'de';
2621             if (Object.getOwnPropertyNames(test1)[0] === '5') {
2622                 return false;
2623             }
2624
2625             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2626             var test2 = {};
2627             for (var i = 0; i < 10; i++) {
2628                 test2['_' + String.fromCharCode(i)] = i;
2629             }
2630             var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
2631                 return test2[n];
2632             });
2633             if (order2.join('') !== '0123456789') {
2634                 return false;
2635             }
2636
2637             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2638             var test3 = {};
2639             'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
2640                 test3[letter] = letter;
2641             });
2642             if (Object.keys(Object.assign({}, test3)).join('') !==
2643                     'abcdefghijklmnopqrst') {
2644                 return false;
2645             }
2646
2647             return true;
2648         } catch (err) {
2649             // We don't expect any of the above to throw, but better to be safe.
2650             return false;
2651         }
2652     }
2653
2654     module.exports = shouldUseNative() ? Object.assign : function (target, source) {
2655         var from;
2656         var to = toObject(target);
2657         var symbols;
2658
2659         for (var s = 1; s < arguments.length; s++) {
2660             from = Object(arguments[s]);
2661
2662             for (var key in from) {
2663                 if (hasOwnProperty.call(from, key)) {
2664                     to[key] = from[key];
2665                 }
2666             }
2667
2668             if (getOwnPropertySymbols) {
2669                 symbols = getOwnPropertySymbols(from);
2670                 for (var i = 0; i < symbols.length; i++) {
2671                     if (propIsEnumerable.call(from, symbols[i])) {
2672                         to[symbols[i]] = from[symbols[i]];
2673                     }
2674                 }
2675             }
2676         }
2677
2678         return to;
2679     };
2680
2681
2682 /***/ }),
2683 /* 15 */
7392ed 2684 /***/ (function(module, exports, __webpack_require__) {
be31e2 2685
JB 2686     /* WEBPACK VAR INJECTION */(function(process) {/**
2687      * Copyright (c) 2013-present, Facebook, Inc.
87a4ca 2688      * All rights reserved.
be31e2 2689      *
87a4ca 2690      * This source code is licensed under the BSD-style license found in the
JM 2691      * LICENSE file in the root directory of this source tree. An additional grant
2692      * of patent rights can be found in the PATENTS file in the same directory.
be31e2 2693      *
JB 2694      */
2695
2696     'use strict';
2697
2698     var emptyObject = {};
2699
2700     if (process.env.NODE_ENV !== 'production') {
2701       Object.freeze(emptyObject);
2702     }
2703
2704     module.exports = emptyObject;
2705     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
2706
7392ed 2707 /***/ }),
99929e 2708 /* 16 */
7392ed 2709 /***/ (function(module, exports) {
be31e2 2710
99929e 2711     module.exports = __WEBPACK_EXTERNAL_MODULE_16__;
be31e2 2712
7392ed 2713 /***/ }),
99929e 2714 /* 17 */
7392ed 2715 /***/ (function(module, exports, __webpack_require__) {
be31e2 2716
833531 2717     'use strict';
SE 2718
87a4ca 2719     var React = __webpack_require__(12),
JM 2720         createClass = __webpack_require__(11),
99929e 2721         DaysView = __webpack_require__(18),
AK 2722         MonthsView = __webpack_require__(22),
2723         YearsView = __webpack_require__(23),
2724         TimeView = __webpack_require__(24)
8f6f33 2725         ;
7750ac 2726
be31e2 2727     var CalendarContainer = createClass({
7750ac 2728         viewComponents: {
JM 2729             days: DaysView,
2730             months: MonthsView,
2731             years: YearsView,
2732             time: TimeView
2733         },
2734
8f6f33 2735         render: function() {
LA 2736             return React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps );
2737         }
11612b 2738     });
7750ac 2739
JM 2740     module.exports = CalendarContainer;
2741
2742
7392ed 2743 /***/ }),
99929e 2744 /* 18 */
7392ed 2745 /***/ (function(module, exports, __webpack_require__) {
d76f7b 2746
be9654 2747     'use strict';
SE 2748
87a4ca 2749     var React = __webpack_require__(12),
JM 2750         createClass = __webpack_require__(11),
99929e 2751         moment = __webpack_require__(16),
AK 2752         onClickOutside = __webpack_require__(19).default
8f6f33 2753         ;
be9654 2754
be31e2 2755     var DateTimePickerDays = onClickOutside( createClass({
be9654 2756         render: function() {
SE 2757             var footer = this.renderFooter(),
2758                 date = this.props.viewDate,
2759                 locale = date.localeData(),
2760                 tableChildren
8f6f33 2761                 ;
be9654 2762
SE 2763             tableChildren = [
a50b2e 2764                 React.createElement('thead', { key: 'th' }, [
GL 2765                     React.createElement('tr', { key: 'h' }, [
2766                         React.createElement('th', { key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, React.createElement('span', {}, '‹' )),
99929e 2767                         React.createElement('th', { key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colspan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),
a50b2e 2768                         React.createElement('th', { key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, React.createElement('span', {}, '›' ))
be9654 2769                     ]),
a50b2e 2770                     React.createElement('tr', { key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return React.createElement('th', { key: day + index, className: 'dow'}, day ); }) )
be9654 2771                 ]),
a50b2e 2772                 React.createElement('tbody', { key: 'tb' }, this.renderDays())
be9654 2773             ];
SE 2774
2775             if ( footer )
2776                 tableChildren.push( footer );
2777
a50b2e 2778             return React.createElement('div', { className: 'rdtDays' },
GL 2779                 React.createElement('table', {}, tableChildren )
be9654 2780             );
SE 2781         },
2782
2783         /**
2784          * Get a list of the days of the week
2785          * depending on the current locale
2786          * @return {array} A list with the shortname of the days
2787          */
2788         getDaysOfWeek: function( locale ) {
2789             var days = locale._weekdaysMin,
2790                 first = locale.firstDayOfWeek(),
2791                 dow = [],
2792                 i = 0
8f6f33 2793                 ;
be9654 2794
SE 2795             days.forEach( function( day ) {
2796                 dow[ (7 + ( i++ ) - first) % 7 ] = day;
2797             });
2798
2799             return dow;
2800         },
2801
2802         renderDays: function() {
2803             var date = this.props.viewDate,
2804                 selected = this.props.selectedDate && this.props.selectedDate.clone(),
2805                 prevMonth = date.clone().subtract( 1, 'months' ),
2806                 currentYear = date.year(),
2807                 currentMonth = date.month(),
2808                 weeks = [],
2809                 days = [],
2810                 renderer = this.props.renderDay || this.renderDay,
2811                 isValid = this.props.isValidDate || this.alwaysValidDate,
2812                 classes, isDisabled, dayProps, currentDate
8f6f33 2813                 ;
be9654 2814
SE 2815             // Go to the last week of the previous month
2816             prevMonth.date( prevMonth.daysInMonth() ).startOf( 'week' );
2817             var lastDay = prevMonth.clone().add( 42, 'd' );
2818
2819             while ( prevMonth.isBefore( lastDay ) ) {
2820                 classes = 'rdtDay';
2821                 currentDate = prevMonth.clone();
2822
2823                 if ( ( prevMonth.year() === currentYear && prevMonth.month() < currentMonth ) || ( prevMonth.year() < currentYear ) )
2824                     classes += ' rdtOld';
2825                 else if ( ( prevMonth.year() === currentYear && prevMonth.month() > currentMonth ) || ( prevMonth.year() > currentYear ) )
2826                     classes += ' rdtNew';
2827
2828                 if ( selected && prevMonth.isSame( selected, 'day' ) )
2829                     classes += ' rdtActive';
2830
7750ac 2831                 if ( prevMonth.isSame( moment(), 'day' ) )
be9654 2832                     classes += ' rdtToday';
SE 2833
2834                 isDisabled = !isValid( currentDate, selected );
2835                 if ( isDisabled )
2836                     classes += ' rdtDisabled';
2837
2838                 dayProps = {
2839                     key: prevMonth.format( 'M_D' ),
2840                     'data-value': prevMonth.date(),
2841                     className: classes
2842                 };
2843
2844                 if ( !isDisabled )
2845                     dayProps.onClick = this.updateSelectedDate;
2846
2847                 days.push( renderer( dayProps, currentDate, selected ) );
2848
2849                 if ( days.length === 7 ) {
a50b2e 2850                     weeks.push( React.createElement('tr', { key: prevMonth.format( 'M_D' )}, days ) );
be9654 2851                     days = [];
SE 2852                 }
2853
2854                 prevMonth.add( 1, 'd' );
2855             }
2856
2857             return weeks;
2858         },
2859
2860         updateSelectedDate: function( event ) {
2861             this.props.updateSelectedDate( event, true );
2862         },
2863
2864         renderDay: function( props, currentDate ) {
a50b2e 2865             return React.createElement('td',  props, currentDate.date() );
be9654 2866         },
SE 2867
2868         renderFooter: function() {
2869             if ( !this.props.timeFormat )
2870                 return '';
2871
2872             var date = this.props.selectedDate || this.props.viewDate;
2873
a50b2e 2874             return React.createElement('tfoot', { key: 'tf'},
GL 2875                 React.createElement('tr', {},
99929e 2876                     React.createElement('td', { onClick: this.props.showView( 'time' ), colspan: 7, className: 'rdtTimeToggle' }, date.format( this.props.timeFormat ))
be9654 2877                 )
SE 2878             );
2879         },
2880
2881         alwaysValidDate: function() {
2882             return 1;
11612b 2883         },
JM 2884
8f6f33 2885         handleClickOutside: function() {
LA 2886             this.props.handleClickOutside();
2887         }
11612b 2888     }));
be9654 2889
SE 2890     module.exports = DateTimePickerDays;
2891
d76f7b 2892
7392ed 2893 /***/ }),
99929e 2894 /* 19 */
7392ed 2895 /***/ (function(module, exports, __webpack_require__) {
d76f7b 2896
39b827 2897     'use strict';
LA 2898
87a4ca 2899     exports.__esModule = true;
JM 2900     exports.IGNORE_CLASS_NAME = undefined;
2901     exports.default = onClickOutsideHOC;
39b827 2902
87a4ca 2903     var _react = __webpack_require__(12);
39b827 2904
99929e 2905     var _reactDom = __webpack_require__(20);
39b827 2906
99929e 2907     var _generateOutsideCheck = __webpack_require__(21);
39b827 2908
87a4ca 2909     var _generateOutsideCheck2 = _interopRequireDefault(_generateOutsideCheck);
39b827 2910
87a4ca 2911     function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39b827 2912
87a4ca 2913     function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
39b827 2914
87a4ca 2915     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; }
JM 2916
2917     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; }
39b827 2918
LA 2919     /**
87a4ca 2920      * A higher-order-component for handling onClickOutside for React components.
7750ac 2921      */
87a4ca 2922     var registeredComponents = [];
JM 2923     var handlers = [];
be9654 2924
39b827 2925     var touchEvents = ['touchstart', 'touchmove'];
87a4ca 2926     var IGNORE_CLASS_NAME = exports.IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';
be9654 2927
39b827 2928     /**
LA 2929      * This function generates the HOC function that you'll use
2930      * in order to impart onOutsideClick listening to an
2931      * arbitrary component. It gets called at the end of the
2932      * bootstrapping code to yield an instance of the
2933      * onClickOutsideHOC function defined inside setupHOC().
2934      */
2935     function onClickOutsideHOC(WrappedComponent, config) {
87a4ca 2936       var _class, _temp2;
be9654 2937
87a4ca 2938       return _temp2 = _class = function (_Component) {
JM 2939         _inherits(onClickOutside, _Component);
be9654 2940
87a4ca 2941         function onClickOutside() {
JM 2942           var _temp, _this, _ret;
39b827 2943
87a4ca 2944           _classCallCheck(this, onClickOutside);
39b827 2945
87a4ca 2946           for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
JM 2947             args[_key] = arguments[_key];
2948           }
39b827 2949
87a4ca 2950           return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.__outsideClickHandler = null, _this.enableOnClickOutside = function () {
JM 2951             var fn = _this.__outsideClickHandler;
39b827 2952             if (fn && typeof document !== 'undefined') {
LA 2953               var events = _this.props.eventTypes;
2954               if (!events.forEach) {
2955                 events = [events];
2956               }
2957
2958               events.forEach(function (eventName) {
87a4ca 2959                 var handlerOptions = null;
JM 2960                 var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
2961
2962                 if (isTouchEvent) {
2963                   handlerOptions = { passive: !_this.props.preventDefault };
2964                 }
2965
2966                 document.addEventListener(eventName, fn, handlerOptions);
39b827 2967               });
LA 2968             }
87a4ca 2969           }, _this.disableOnClickOutside = function () {
JM 2970             var fn = _this.__outsideClickHandler;
2971             if (fn && typeof document !== 'undefined') {
2972               var events = _this.props.eventTypes;
2973               if (!events.forEach) {
2974                 events = [events];
2975               }
2976               events.forEach(function (eventName) {
2977                 return document.removeEventListener(eventName, fn);
2978               });
2979             }
2980           }, _this.getRef = function (ref) {
39b827 2981             return _this.instanceRef = ref;
87a4ca 2982           }, _temp), _possibleConstructorReturn(_this, _ret);
94dde5 2983         }
87a4ca 2984
39b827 2985         /**
LA 2986          * Access the WrappedComponent's instance.
2987          */
87a4ca 2988         onClickOutside.prototype.getInstance = function getInstance() {
39b827 2989           if (!WrappedComponent.prototype.isReactComponent) {
LA 2990             return this;
2991           }
2992           var ref = this.instanceRef;
2993           return ref.getInstance ? ref.getInstance() : ref;
2994         };
87a4ca 2995
JM 2996         // this is given meaning in componentDidMount/componentDidUpdate
2997
39b827 2998
LA 2999         /**
3000          * Add click listeners to the current document,
3001          * linked to this component's state.
3002          */
87a4ca 3003         onClickOutside.prototype.componentDidMount = function componentDidMount() {
39b827 3004           // If we are in an environment without a DOM such
LA 3005           // as shallow rendering or snapshots then we exit
3006           // early to prevent any unhandled errors being thrown.
3007           if (typeof document === 'undefined' || !document.createElement) {
7750ac 3008             return;
JM 3009           }
be9654 3010
39b827 3011           var instance = this.getInstance();
be9654 3012
39b827 3013           if (config && typeof config.handleClickOutside === 'function') {
LA 3014             this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
3015             if (typeof this.__clickOutsideHandlerProp !== 'function') {
3016               throw new Error('WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.');
7750ac 3017             }
87a4ca 3018           } else if (typeof instance.handleClickOutside === 'function') {
JM 3019             if (_react.Component.prototype.isPrototypeOf(instance)) {
3020               this.__clickOutsideHandlerProp = instance.handleClickOutside.bind(instance);
3021             } else {
3022               this.__clickOutsideHandlerProp = instance.handleClickOutside;
3023             }
3024           } else if (typeof instance.props.handleClickOutside === 'function') {
3025             this.__clickOutsideHandlerProp = instance.props.handleClickOutside;
3026           } else {
3027             throw new Error('WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.');
39b827 3028           }
7750ac 3029
87a4ca 3030           // TODO: try to get rid of this, could be done with function ref, might be problematic for SFC though, they do not expose refs
JM 3031           if ((0, _reactDom.findDOMNode)(instance) === null) {
3032             return;
3033           }
3034
3035           this.addOutsideClickHandler();
7750ac 3036         };
JM 3037
87a4ca 3038         /**
JM 3039         * Track for disableOnClickOutside props changes and enable/disable click outside
3040         */
3041
3042
3043         onClickOutside.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
3044           if (this.props.disableOnClickOutside && !nextProps.disableOnClickOutside) {
3045             this.enableOnClickOutside();
3046           } else if (!this.props.disableOnClickOutside && nextProps.disableOnClickOutside) {
3047             this.disableOnClickOutside();
3048           }
39b827 3049         };
87a4ca 3050
JM 3051         onClickOutside.prototype.componentDidUpdate = function componentDidUpdate() {
3052           var componentNode = (0, _reactDom.findDOMNode)(this.getInstance());
3053
3054           if (componentNode === null && this.__outsideClickHandler) {
3055             this.removeOutsideClickHandler();
3056             return;
3057           }
3058
3059           if (componentNode !== null && !this.__outsideClickHandler) {
3060             this.addOutsideClickHandler();
3061             return;
3062           }
3063         };
3064
39b827 3065         /**
LA 3066          * Remove all document's event listeners for this component
3067          */
3068
3069
87a4ca 3070         onClickOutside.prototype.componentWillUnmount = function componentWillUnmount() {
JM 3071           this.removeOutsideClickHandler();
39b827 3072         };
87a4ca 3073
39b827 3074         /**
LA 3075          * Can be called to explicitly enable event listening
3076          * for clicks and touches outside of this element.
3077          */
3078
3079
3080         /**
87a4ca 3081          * Can be called to explicitly disable event listening
JM 3082          * for clicks and touches outside of this element.
3083          */
3084
3085
3086         onClickOutside.prototype.addOutsideClickHandler = function addOutsideClickHandler() {
3087           var fn = this.__outsideClickHandler = (0, _generateOutsideCheck2.default)((0, _reactDom.findDOMNode)(this.getInstance()), this.__clickOutsideHandlerProp, this.props.outsideClickIgnoreClass, this.props.excludeScrollbar, this.props.preventDefault, this.props.stopPropagation);
3088
3089           var pos = registeredComponents.length;
3090           registeredComponents.push(this);
3091           handlers[pos] = fn;
3092
3093           // If there is a truthy disableOnClickOutside property for this
3094           // component, don't immediately start listening for outside events.
3095           if (!this.props.disableOnClickOutside) {
3096             this.enableOnClickOutside();
3097           }
3098         };
3099
3100         onClickOutside.prototype.removeOutsideClickHandler = function removeOutsideClickHandler() {
3101           this.disableOnClickOutside();
3102           this.__outsideClickHandler = false;
3103
3104           var pos = registeredComponents.indexOf(this);
3105
3106           if (pos > -1) {
3107             // clean up so we don't leak memory
3108             if (handlers[pos]) {
3109               handlers.splice(pos, 1);
3110             }
3111             registeredComponents.splice(pos, 1);
3112           }
3113         };
3114
3115         /**
39b827 3116          * Pass-through render
LA 3117          */
87a4ca 3118         onClickOutside.prototype.render = function render() {
JM 3119           var _this2 = this;
3120
3121           var props = Object.keys(this.props).filter(function (prop) {
3122             return prop !== 'excludeScrollbar';
3123           }).reduce(function (props, prop) {
3124             props[prop] = _this2.props[prop];
3125             return props;
3126           }, {});
39b827 3127
LA 3128           if (WrappedComponent.prototype.isReactComponent) {
3129             props.ref = this.getRef;
3130           } else {
3131             props.wrappedRef = this.getRef;
3132           }
3133
3134           props.disableOnClickOutside = this.disableOnClickOutside;
3135           props.enableOnClickOutside = this.enableOnClickOutside;
87a4ca 3136
JM 3137           return (0, _react.createElement)(WrappedComponent, props);
39b827 3138         };
LA 3139
3140         return onClickOutside;
87a4ca 3141       }(_react.Component), _class.displayName = 'OnClickOutside(' + (WrappedComponent.displayName || WrappedComponent.name || 'Component') + ')', _class.defaultProps = {
39b827 3142         eventTypes: ['mousedown', 'touchstart'],
LA 3143         excludeScrollbar: config && config.excludeScrollbar || false,
3144         outsideClickIgnoreClass: IGNORE_CLASS_NAME,
3145         preventDefault: false,
3146         stopPropagation: false
3147       }, _class.getClass = function () {
3148         return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
87a4ca 3149       }, _temp2;
39b827 3150     }
d359eb 3151
87a4ca 3152 /***/ }),
99929e 3153 /* 20 */
87a4ca 3154 /***/ (function(module, exports) {
d359eb 3155
99929e 3156     module.exports = __WEBPACK_EXTERNAL_MODULE_20__;
87a4ca 3157
JM 3158 /***/ }),
99929e 3159 /* 21 */
87a4ca 3160 /***/ (function(module, exports) {
JM 3161
3162     "use strict";
3163
3164     exports.__esModule = true;
3165     exports.default = generateOutsideCheck;
3166     /**
3167      * Check whether some DOM node is our Component's node.
3168      */
3169     function isNodeFound(current, componentNode, ignoreClass) {
3170       if (current === componentNode) {
3171         return true;
3172       }
3173       // SVG <use/> elements do not technically reside in the rendered DOM, so
3174       // they do not have classList directly, but they offer a link to their
3175       // corresponding element, which can have classList. This extra check is for
3176       // that case.
3177       // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement
3178       // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17
3179       if (current.correspondingElement) {
3180         return current.correspondingElement.classList.contains(ignoreClass);
3181       }
3182       return current.classList.contains(ignoreClass);
3183     }
3184
3185     /**
3186      * Try to find our node in a hierarchy of nodes, returning the document
3187      * node as highest node if our node is not found in the path up.
3188      */
3189     function findHighest(current, componentNode, ignoreClass) {
3190       if (current === componentNode) {
3191         return true;
3192       }
3193
3194       // If source=local then this event came from 'somewhere'
3195       // inside and should be ignored. We could handle this with
3196       // a layered approach, too, but that requires going back to
3197       // thinking in terms of Dom node nesting, running counter
3198       // to React's 'you shouldn't care about the DOM' philosophy.
3199       while (current.parentNode) {
3200         if (isNodeFound(current, componentNode, ignoreClass)) {
3201           return true;
3202         }
3203         current = current.parentNode;
3204       }
3205       return current;
3206     }
3207
3208     /**
3209      * Check if the browser scrollbar was clicked
3210      */
3211     function clickedScrollbar(evt) {
3212       return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
3213     }
3214
3215     /**
3216      * Generate the event handler that checks whether a clicked DOM node
3217      * is inside of, or lives outside of, our Component's node tree.
3218      */
3219     function generateOutsideCheck(componentNode, eventHandler, ignoreClass, excludeScrollbar, preventDefault, stopPropagation) {
3220       return function (evt) {
3221         if (preventDefault) {
3222           evt.preventDefault();
3223         }
3224         if (stopPropagation) {
3225           evt.stopPropagation();
3226         }
3227         var current = evt.target;
3228         if (excludeScrollbar && clickedScrollbar(evt) || findHighest(current, componentNode, ignoreClass) !== document) {
3229           return;
3230         }
3231         eventHandler(evt);
3232       };
3233     }
11612b 3234
7392ed 3235 /***/ }),
99929e 3236 /* 22 */
7392ed 3237 /***/ (function(module, exports, __webpack_require__) {
11612b 3238
JM 3239     'use strict';
3240
87a4ca 3241     var React = __webpack_require__(12),
JM 3242         createClass = __webpack_require__(11),
99929e 3243         onClickOutside = __webpack_require__(19).default
8f6f33 3244         ;
11612b 3245
be31e2 3246     var DateTimePickerMonths = onClickOutside( createClass({
11612b 3247         render: function() {
a50b2e 3248             return React.createElement('div', { className: 'rdtMonths' }, [
GL 3249                 React.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [
3250                     React.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, React.createElement('span', {}, '‹' )),
99929e 3251                     React.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colspan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ),
a50b2e 3252                     React.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, React.createElement('span', {}, '›' ))
11612b 3253                 ]))),
a50b2e 3254                 React.createElement('table', { key: 'months' }, React.createElement('tbody', { key: 'b' }, this.renderMonths()))
11612b 3255             ]);
JM 3256         },
3257
3258         renderMonths: function() {
3259             var date = this.props.selectedDate,
3260                 month = this.props.viewDate.month(),
3261                 year = this.props.viewDate.year(),
3262                 rows = [],
3263                 i = 0,
3264                 months = [],
3265                 renderer = this.props.renderMonth || this.renderMonth,
3266                 isValid = this.props.isValidDate || this.alwaysValidDate,
3267                 classes, props, currentMonth, isDisabled, noOfDaysInMonth, daysInMonth, validDay,
3268                 // Date is irrelevant because we're only interested in month
3269                 irrelevantDate = 1
8f6f33 3270                 ;
11612b 3271
JM 3272             while (i < 12) {
3273                 classes = 'rdtMonth';
3274                 currentMonth =
3275                     this.props.viewDate.clone().set({ year: year, month: i, date: irrelevantDate });
3276
3277                 noOfDaysInMonth = currentMonth.endOf( 'month' ).format( 'D' );
3278                 daysInMonth = Array.from({ length: noOfDaysInMonth }, function( e, i ) {
3279                     return i + 1;
3280                 });
3281
3282                 validDay = daysInMonth.find(function( d ) {
3283                     var day = currentMonth.clone().set( 'date', d );
3284                     return isValid( day );
3285                 });
3286
3287                 isDisabled = ( validDay === undefined );
3288
3289                 if ( isDisabled )
3290                     classes += ' rdtDisabled';
3291
7d7b99 3292                 if ( date && i === date.month() && year === date.year() )
11612b 3293                     classes += ' rdtActive';
JM 3294
3295                 props = {
3296                     key: i,
3297                     'data-value': i,
3298                     className: classes
3299                 };
3300
3301                 if ( !isDisabled )
3302                     props.onClick = ( this.props.updateOn === 'months' ?
3303                         this.updateSelectedMonth : this.props.setDate( 'month' ) );
3304
3305                 months.push( renderer( props, i, year, date && date.clone() ) );
3306
3307                 if ( months.length === 4 ) {
a50b2e 3308                     rows.push( React.createElement('tr', { key: month + '_' + rows.length }, months ) );
11612b 3309                     months = [];
JM 3310                 }
3311
3312                 i++;
3313             }
3314
3315             return rows;
3316         },
3317
3318         updateSelectedMonth: function( event ) {
3319             this.props.updateSelectedDate( event );
3320         },
3321
3322         renderMonth: function( props, month ) {
3323             var localMoment = this.props.viewDate;
3324             var monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );
3325             var strLength = 3;
3326             // Because some months are up to 5 characters long, we want to
3327             // use a fixed string length for consistency
3328             var monthStrFixedLength = monthStr.substring( 0, strLength );
a50b2e 3329             return React.createElement('td', props, capitalize( monthStrFixedLength ) );
11612b 3330         },
JM 3331
3332         alwaysValidDate: function() {
3333             return 1;
3334         },
3335
8f6f33 3336         handleClickOutside: function() {
LA 3337             this.props.handleClickOutside();
3338         }
11612b 3339     }));
JM 3340
3341     function capitalize( str ) {
3342         return str.charAt( 0 ).toUpperCase() + str.slice( 1 );
3343     }
3344
3345     module.exports = DateTimePickerMonths;
3346
3347
7392ed 3348 /***/ }),
99929e 3349 /* 23 */
7392ed 3350 /***/ (function(module, exports, __webpack_require__) {
11612b 3351
JM 3352     'use strict';
3353
87a4ca 3354     var React = __webpack_require__(12),
JM 3355         createClass = __webpack_require__(11),
99929e 3356         onClickOutside = __webpack_require__(19).default
8f6f33 3357         ;
a50b2e 3358
be31e2 3359     var DateTimePickerYears = onClickOutside( createClass({
11612b 3360         render: function() {
JM 3361             var year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;
3362
a50b2e 3363             return React.createElement('div', { className: 'rdtYears' }, [
GL 3364                 React.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [
3365                     React.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, React.createElement('span', {}, '‹' )),
99929e 3366                     React.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colspan: 2 }, year + '-' + ( year + 9 ) ),
a50b2e 3367                     React.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, React.createElement('span', {}, '›' ))
8f6f33 3368                 ]))),
a50b2e 3369                 React.createElement('table', { key: 'years' }, React.createElement('tbody',  {}, this.renderYears( year )))
11612b 3370             ]);
JM 3371         },
3372
3373         renderYears: function( year ) {
3374             var years = [],
3375                 i = -1,
3376                 rows = [],
3377                 renderer = this.props.renderYear || this.renderYear,
3378                 selectedDate = this.props.selectedDate,
3379                 isValid = this.props.isValidDate || this.alwaysValidDate,
3380                 classes, props, currentYear, isDisabled, noOfDaysInYear, daysInYear, validDay,
3381                 // Month and date are irrelevant here because
3382                 // we're only interested in the year
3383                 irrelevantMonth = 0,
3384                 irrelevantDate = 1
8f6f33 3385                 ;
11612b 3386
JM 3387             year--;
3388             while (i < 11) {
3389                 classes = 'rdtYear';
3390                 currentYear = this.props.viewDate.clone().set(
3391                     { year: year, month: irrelevantMonth, date: irrelevantDate } );
3392
3393                 // Not sure what 'rdtOld' is for, commenting out for now as it's not working properly
3394                 // if ( i === -1 | i === 10 )
3395                     // classes += ' rdtOld';
3396
3397                 noOfDaysInYear = currentYear.endOf( 'year' ).format( 'DDD' );
3398                 daysInYear = Array.from({ length: noOfDaysInYear }, function( e, i ) {
3399                     return i + 1;
3400                 });
3401
3402                 validDay = daysInYear.find(function( d ) {
3403                     var day = currentYear.clone().dayOfYear( d );
3404                     return isValid( day );
3405                 });
3406
3407                 isDisabled = ( validDay === undefined );
3408
3409                 if ( isDisabled )
3410                     classes += ' rdtDisabled';
3411
3412                 if ( selectedDate && selectedDate.year() === year )
3413                     classes += ' rdtActive';
3414
3415                 props = {
3416                     key: year,
3417                     'data-value': year,
3418                     className: classes
3419                 };
3420
3421                 if ( !isDisabled )
3422                     props.onClick = ( this.props.updateOn === 'years' ?
3423                         this.updateSelectedYear : this.props.setDate('year') );
3424
3425                 years.push( renderer( props, year, selectedDate && selectedDate.clone() ));
3426
3427                 if ( years.length === 4 ) {
a50b2e 3428                     rows.push( React.createElement('tr', { key: i }, years ) );
11612b 3429                     years = [];
JM 3430                 }
3431
3432                 year++;
3433                 i++;
3434             }
3435
3436             return rows;
3437         },
3438
3439         updateSelectedYear: function( event ) {
3440             this.props.updateSelectedDate( event );
3441         },
3442
3443         renderYear: function( props, year ) {
a50b2e 3444             return React.createElement('td',  props, year );
11612b 3445         },
JM 3446
3447         alwaysValidDate: function() {
3448             return 1;
3449         },
3450
8f6f33 3451         handleClickOutside: function() {
LA 3452             this.props.handleClickOutside();
3453         }
11612b 3454     }));
JM 3455
3456     module.exports = DateTimePickerYears;
3457
3458
7392ed 3459 /***/ }),
99929e 3460 /* 24 */
7392ed 3461 /***/ (function(module, exports, __webpack_require__) {
11612b 3462
JM 3463     'use strict';
3464
87a4ca 3465     var React = __webpack_require__(12),
JM 3466         createClass = __webpack_require__(11),
11612b 3467         assign = __webpack_require__(1),
99929e 3468         onClickOutside = __webpack_require__(19).default
8f6f33 3469         ;
11612b 3470
be31e2 3471     var DateTimePickerTime = onClickOutside( createClass({
11612b 3472         getInitialState: function() {
JM 3473             return this.calculateState( this.props );
3474         },
3475
3476         calculateState: function( props ) {
3477             var date = props.selectedDate || props.viewDate,
3478                 format = props.timeFormat,
3479                 counters = []
8f6f33 3480                 ;
11612b 3481
JM 3482             if ( format.toLowerCase().indexOf('h') !== -1 ) {
3483                 counters.push('hours');
3484                 if ( format.indexOf('m') !== -1 ) {
3485                     counters.push('minutes');
3486                     if ( format.indexOf('s') !== -1 ) {
3487                         counters.push('seconds');
3488                     }
3489                 }
3490             }
3491
c1a952 3492             var hours = date.format( 'H' );
99929e 3493
11612b 3494             var daypart = false;
JM 3495             if ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {
3496                 if ( this.props.timeFormat.indexOf( ' A' ) !== -1 ) {
c1a952 3497                     daypart = ( hours >= 12 ) ? 'PM' : 'AM';
11612b 3498                 } else {
c1a952 3499                     daypart = ( hours >= 12 ) ? 'pm' : 'am';
11612b 3500                 }
JM 3501             }
3502
3503             return {
c1a952 3504                 hours: hours,
11612b 3505                 minutes: date.format( 'mm' ),
JM 3506                 seconds: date.format( 'ss' ),
3507                 milliseconds: date.format( 'SSS' ),
3508                 daypart: daypart,
3509                 counters: counters
3510             };
3511         },
3512
3513         renderCounter: function( type ) {
3514             if ( type !== 'daypart' ) {
3515                 var value = this.state[ type ];
3516                 if ( type === 'hours' && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {
3517                     value = ( value - 1 ) % 12 + 1;
3518
3519                     if ( value === 0 ) {
3520                         value = 12;
3521                     }
3522                 }
a50b2e 3523                 return React.createElement('div', { key: type, className: 'rdtCounter' }, [
87a4ca 3524                     React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),
a50b2e 3525                     React.createElement('div', { key: 'c', className: 'rdtCount' }, value ),
87a4ca 3526                     React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )
11612b 3527                 ]);
JM 3528             }
3529             return '';
3530         },
3531
3532         renderDayPart: function() {
a50b2e 3533             return React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [
87a4ca 3534                 React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),
a50b2e 3535                 React.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ),
87a4ca 3536                 React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )
11612b 3537             ]);
JM 3538         },
3539
3540         render: function() {
3541             var me = this,
3542                 counters = []
3543             ;
3544
3545             this.state.counters.forEach( function( c ) {
3546                 if ( counters.length )
a50b2e 3547                     counters.push( React.createElement('div', { key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ) );
11612b 3548                 counters.push( me.renderCounter( c ) );
JM 3549             });
3550
3551             if ( this.state.daypart !== false ) {
3552                 counters.push( me.renderDayPart() );
3553             }
3554
3555             if ( this.state.counters.length === 3 && this.props.timeFormat.indexOf( 'S' ) !== -1 ) {
a50b2e 3556                 counters.push( React.createElement('div', { className: 'rdtCounterSeparator', key: 'sep5' }, ':' ) );
11612b 3557                 counters.push(
a50b2e 3558                     React.createElement('div', { className: 'rdtCounter rdtMilli', key: 'm' },
GL 3559                         React.createElement('input', { value: this.state.milliseconds, type: 'text', onChange: this.updateMilli } )
11612b 3560                         )
JM 3561                     );
3562             }
3563
a50b2e 3564             return React.createElement('div', { className: 'rdtTime' },
GL 3565                 React.createElement('table', {}, [
11612b 3566                     this.renderHeader(),
a50b2e 3567                     React.createElement('tbody', { key: 'b'}, React.createElement('tr', {}, React.createElement('td', {},
GL 3568                         React.createElement('div', { className: 'rdtCounters' }, counters )
11612b 3569                     )))
JM 3570                 ])
3571             );
3572         },
3573
3574         componentWillMount: function() {
3575             var me = this;
3576             me.timeConstraints = {
3577                 hours: {
3578                     min: 0,
3579                     max: 23,
3580                     step: 1
3581                 },
3582                 minutes: {
3583                     min: 0,
3584                     max: 59,
3585                     step: 1
3586                 },
3587                 seconds: {
3588                     min: 0,
3589                     max: 59,
3590                     step: 1
3591                 },
3592                 milliseconds: {
3593                     min: 0,
3594                     max: 999,
3595                     step: 1
3596                 }
3597             };
3598             ['hours', 'minutes', 'seconds', 'milliseconds'].forEach( function( type ) {
3599                 assign(me.timeConstraints[ type ], me.props.timeConstraints[ type ]);
3600             });
3601             this.setState( this.calculateState( this.props ) );
3602         },
3603
3604         componentWillReceiveProps: function( nextProps ) {
3605             this.setState( this.calculateState( nextProps ) );
3606         },
3607
3608         updateMilli: function( e ) {
3609             var milli = parseInt( e.target.value, 10 );
3610             if ( milli === e.target.value && milli >= 0 && milli < 1000 ) {
3611                 this.props.setTime( 'milliseconds', milli );
3612                 this.setState( { milliseconds: milli } );
3613             }
3614         },
3615
3616         renderHeader: function() {
3617             if ( !this.props.dateFormat )
3618                 return null;
3619
3620             var date = this.props.selectedDate || this.props.viewDate;
a50b2e 3621             return React.createElement('thead', { key: 'h' }, React.createElement('tr', {},
99929e 3622                 React.createElement('th', { className: 'rdtSwitch', colspan: 4, onClick: this.props.showView( 'days' ) }, date.format( this.props.dateFormat ) )
11612b 3623             ));
JM 3624         },
3625
3626         onStartClicking: function( action, type ) {
3627             var me = this;
3628
3629             return function() {
3630                 var update = {};
3631                 update[ type ] = me[ action ]( type );
3632                 me.setState( update );
3633
3634                 me.timer = setTimeout( function() {
3635                     me.increaseTimer = setInterval( function() {
3636                         update[ type ] = me[ action ]( type );
3637                         me.setState( update );
3638                     }, 70);
3639                 }, 500);
3640
3641                 me.mouseUpListener = function() {
3642                     clearTimeout( me.timer );
3643                     clearInterval( me.increaseTimer );
3644                     me.props.setTime( type, me.state[ type ] );
3645                     document.body.removeEventListener( 'mouseup', me.mouseUpListener );
94dde5 3646                     document.body.removeEventListener( 'touchend', me.mouseUpListener );
11612b 3647                 };
JM 3648
3649                 document.body.addEventListener( 'mouseup', me.mouseUpListener );
94dde5 3650                 document.body.addEventListener( 'touchend', me.mouseUpListener );
11612b 3651             };
JM 3652         },
3653
c1a952 3654         disableContextMenu: function( event ) {
SE 3655             event.preventDefault();
3656             return false;
3657         },
3658
11612b 3659         padValues: {
JM 3660             hours: 1,
3661             minutes: 2,
3662             seconds: 2,
3663             milliseconds: 3
3664         },
3665
3666         toggleDayPart: function( type ) { // type is always 'hours'
3667             var value = parseInt( this.state[ type ], 10) + 12;
3668             if ( value > this.timeConstraints[ type ].max )
3669                 value = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );
3670             return this.pad( type, value );
3671         },
3672
3673         increase: function( type ) {
3674             var value = parseInt( this.state[ type ], 10) + this.timeConstraints[ type ].step;
3675             if ( value > this.timeConstraints[ type ].max )
3676                 value = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );
3677             return this.pad( type, value );
3678         },
3679
3680         decrease: function( type ) {
3681             var value = parseInt( this.state[ type ], 10) - this.timeConstraints[ type ].step;
3682             if ( value < this.timeConstraints[ type ].min )
3683                 value = this.timeConstraints[ type ].max + 1 - ( this.timeConstraints[ type ].min - value );
3684             return this.pad( type, value );
3685         },
3686
3687         pad: function( type, value ) {
3688             var str = value + '';
3689             while ( str.length < this.padValues[ type ] )
3690                 str = '0' + str;
3691             return str;
3692         },
3693
8f6f33 3694         handleClickOutside: function() {
LA 3695             this.props.handleClickOutside();
3696         }
11612b 3697     }));
JM 3698
3699     module.exports = DateTimePickerTime;
3700
d76f7b 3701
7392ed 3702 /***/ })
d76f7b 3703 /******/ ])
M 3704 });
be9654 3705 ;