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